(j3.2006) BEQ, BNE?
Malcolm Cohen
malcolm
Wed Jan 30 01:07:31 EST 2013
Van Snyder wrote:
>We did BLT, BLE, etc., but why not BEQ and BNE?
Good question.
>One might be tempted to use == and /=, but these are required to fail
>for +/- zero on ones-complement and sign-magnitude machines because
>Fortran doesn't distinguish +0 from -0 for integers.
It could be worse than that - I seem to recall that some such hardware rather
tended to force negative zero to positive zero at the drop of a hat... which
might well result in DIGITS(0) being 1 less than the actual number of bits
stored, so as to satisfy all the requirements of the bit model.
>Should we add BEQ and BNE, or suggest that users write something like
For now users have little choice, they have to write something...
Bob Corbett wrote:
>Any optimizing compiler worth being called an optimizing compiler can recognize
>idioms and produce good code for them.
Well yes, but they have to become idioms first... Van's suggestion looks more
obvious as to the intent!
Cheers,
--
................................Malcolm Cohen, Nihon NAG, Tokyo.
More information about the J3
mailing list