This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: iso c9x unordered fp cmp builtins
- To: Richard Henderson <rth at cygnus dot com>
- Subject: Re: iso c9x unordered fp cmp builtins
- From: David Edelsohn <dje at watson dot ibm dot com>
- Date: Mon, 02 Mar 1998 00:34:26 -0500
- Cc: egcs at cygnus dot com
>>>>> Richard Henderson writes:
Richard> How do these compare with the signalling and quiet NaNs described in
Richard> the IEEE standard? Are they the same thing with different names?
These are the signalling and quiet NANs. I do not have my PowerPC
architecture documents handy to get the terminology exact.
Richard> My understanding is that
Richard> quiet_nan = 0.0 / 0.0;
Richard> isunordered(quiet_nan, 0.0);
Richard> should return true without killing the program with SIGFPE.
Richard> The way I have it implemented on the Sparc, is this: there are two
Richard> fp comparision instructions, one (fcmp) signals if either operand is
Richard> a signalling NaN, the other (fcmpe) signals if either operand is
Richard> a signalling or quiet NaN.
Richard> The normal fp comparision operators (<, >, etc) use fcmpe, while
Richard> the ISO routines (isless, isgreater, etc) use fcmp. Of course they
Richard> also use the unordered fbcc insns as well.
POWER/PowerPC calls them fcmpu and fcmpo. The POWER/PowerPC port
of GCC currently follows XLC which only seems to use fcmpu -- quiet NANs
never are signalled.
Did your SPARC implementation *change* the use of those two FP
compare instructions?
David