caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Stupid question
@ 2004-01-15  0:03 Brian Hurt
  2004-01-15  3:57 ` skaller
  0 siblings, 1 reply; 10+ messages in thread
From: Brian Hurt @ 2004-01-15  0:03 UTC (permalink / raw)
  To: Ocaml Mailing List


I was poking around in the produced assembly code of some ocaml code of 
mine, and I noticed something.  The construct:
	if (x < m) <> (y < m) then
		...

when the compiler knows that x, y, and m are all ints, it calls an 
external C routine to compare the two booleans.  But the construct:

	if (x < m) != (y < m) then
		...

does not.  Now, this isn't a big deal- I just replaced <> with != and no 
problem.  But I was kind of interested in why the compiler didn't catch 
and optimize this.  Is there some sort of subtle semantic difference I'm 
too dense to see?

-- 
"Usenet is like a herd of performing elephants with diarrhea -- massive,
difficult to redirect, awe-inspiring, entertaining, and a source of
mind-boggling amounts of excrement when you least expect it."
                                - Gene Spafford 
Brian


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-01-16 12:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-15  0:03 [Caml-list] Stupid question Brian Hurt
2004-01-15  3:57 ` skaller
2004-01-15  6:13   ` Brian Hurt
2004-01-15  8:37     ` Christophe Raffalli
2004-01-16  0:43   ` Jacques Garrigue
2004-01-16  2:35     ` Brian Hurt
2004-01-16  8:40       ` Hendrik Tews
2004-01-16 10:25         ` Frederic van der Plancke
2004-01-16 12:07           ` Alex Baretta
2004-01-16  5:41     ` Nicolas Cannasse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).