This is the mail archive of the gcc-bugs@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]

[Bug middle-end/51446] -fno-trapping-math generates NaN constant with different sign


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51446

--- Comment #5 from lucier at math dot purdue.edu 2011-12-08 14:30:00 UTC ---
Re:

Do the architecture manuals say anything about the sign of the qnan?

Amazingly enough, they do!

I downloaded the combined x86-64 manuals from

http://www.intel.com/content/www/us/en/architecture-and-technology/64-ia-32-architectures-software-developer-manual-325462-rmver.html

and found the following:

Table 4-3: Floating-point number and NaN encodings:

QNaN Floating-point indefinite: sign is 1

Section 4.8.3.7:

Description of QNaN for floating-point indefinite

Section 8.5.1.2:

0/0, 0*Inf, Inf-Inf, etc., return this QNaN floating-point indefinite.

So at least for Intel x87 processors, the sign bit of the canonical QNaN for
floating-point indefinite should be 1.


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