Re: Handling NaNs in FP comparisons

2010-09-29 Thread Richard Henderson
On 09/29/2010 04:31 PM, Michael Eager wrote: > float a = 1.0, b = 2.0, x = NaN; > (a < b) generates the same condition flags as (a < x). ... > Are there other processors which do this? How do they > handle generating IEEE std compliant code? It looks like there is a bunch of code under config tha

Handling NaNs in FP comparisons

2010-09-29 Thread Michael Eager
Hi -- I'm working with a processor which sets the condition bits when a NaN is used as an operand in a compare in a way which is the same as a valid ordered compare. There is a flag bit which is set for a NaN compare, but it may also be set in a non-NaN compare. float a = 1.0, b = 2.0, x = NaN;