[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Almost OT, < and <=

This page is part of the web mail archives of SRFI 32 from before July 7th, 2015. The new archives for SRFI 32 contain all messages, not just those from before July 7th, 2015.



> MIPS is different, not using condition codes.  The only pure-comparison
> MIPS operation is <.  (Not <=, not >.)  Anything else you'd have to
> synthesize with a subtraction.
> 
> Beyond cycle counting, I see op< as more primitive than op<=: one
> establishes order, while the other allows for equivalence.  I would
> prefer a SORT which lets me use the most primitive predicate possible.
> On many platforms it won't matter; but on some, it may.
> 
> Enough from me, already.  Let's hear from some other voices.
> 
> Ben
> 
> (P.S. I lied.  One more from me.  Wouldn't using op<= instead of op<
> complicate the implementation of STABLE-SORT? )

But wait a second, isn't

  (< a b) = (not (>= a b)) = (not (<= b a))

at least on integers?

So both < and <= are the **same** machine instruction, except you have
to flip the arguments, and change the destination label, but this has no
run time "cost"...

Marc