This is the mail archive of the
mailing list for the GCC project.
Re: FP comparisons, C, X86, and NaN's
- From: Chris Lattner <sabre at nondot dot org>
- To: Gabriel Dos Reis <gdr at cs dot tamu dot edu>
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 20 Jun 2004 15:59:44 -0500 (CDT)
- Subject: 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
> Sorry not having been precise enough.
Not at all, I should be more careful how I word my questions. :)