[comp.lang.c] numeric comparison

kym@bingvaxu.cc.binghamton.edu (R. Kym Horsell) (10/03/90)

In article <34469@cup.portal.com> Don_A_Corbitt@cup.portal.com writes:
>roy@phri.nyu.edu writes:
[equality comparison faster than greater]
>I haven't seen this in print, but I assume it is because there is extra 
>delay waiting for carry propagation to set the condition code.  XOR can
>test all the bits in parallel.

I think there is still O(log n) delays for all the bit XOR's to get
together into a final result. However, AND-ing together 32 XOR's is a 
much easier proposition than handling carry lookahead for the same number of
bits (assuming greater/less is done using effectively an ALU subtract).

The more efficient means of generating less/greater, comparable to
the the speed of XOR's for equality, are typically uneconomic to
implement in dedicated h/w.

-Kym Horsell