This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/51446] -fno-trapping-math generates NaN constant with different sign
- From: "lucier at math dot purdue.edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 08 Dec 2011 14:30:00 +0000
- Subject: [Bug middle-end/51446] -fno-trapping-math generates NaN constant with different sign
- Auto-submitted: auto-generated
- References: <bug-51446-4@http.gcc.gnu.org/bugzilla/>
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.