[llvm-commits] [llvm] r107852 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp lib/Target/ARM/ARMISelLowering.h test/CodeGen/ARM/fpcmp-opt.ll

John McCall rjmccall at apple.com
Thu Jul 8 00:04:58 PDT 2010


On Jul 7, 2010, at 11:21 PM, Evan Cheng wrote:
> On Jul 7, 2010, at 11:03 PM, Kevin Enderby wrote:
> 
>> Also what about NaN's compared to anything being required to return unordered (that is the way I recall the IEEE standard)?
> 
> I did check for those. :-)

Kevin is right, this is just never correct with NaNs.  Suppose A and B are QNaNs with different bit-patterns.

For oeq, A == A should be false, bitwise comparison has it true.
For ueq, A == B should be true, bitwise comparison has it false.
For one, A != B should be false, bitwise comparison has it true.
For une, A != A should be true, bitwise comparison has it false.

It's also wrong with SNaNs, but I don't know if we care about that.

Anyway, I think -ffinite-math-only is sufficient.

John.



More information about the llvm-commits mailing list