This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: FP comparisons, C, X86, and NaN's


On Sun, 20 Jun 2004, Gabriel Dos Reis wrote:
> | > Said differently, you've discovered a bug in the code GCC generates.
> |
> | From this, I take it to mean that < is defined to trap if either operand
> | is a QNaN or SNaN.  Is this what you mean?
>
> Yes, that is what I meant -- provided you set FENV_ACCESS on.
>
> Unfortunately, the C99 standard leaves implementation-defined what the
> default state should be.

Okay, this makes a lot of sense, thanks for the help!

> What is the default state for the intel compiler?

It defaults to generating fcom* instructions on X86, which would trap on
nans.

> Sorry not having been precise enough.

Not at all, I should be more careful how I word my questions.  :)

-Chris

-- 
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]