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]

Re: iso c9x unordered fp cmp builtins


>>>>> 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


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