Excuse me for too late comment. On Mon, 12 Oct 2009 14:57:18 -0700, Chris Dearman <chris@xxxxxxxx> wrote: > From: Nigel Stephens <nigel@xxxxxxxx> > > This patch ensures that the sign bit is always updated > for NaN operands. ... > @@ -76,15 +74,12 @@ ieee754dp ieee754dp_abs(ieee754dp x) > CLEARCX; > FLUSHXDP; > > + /* Clear sign ALWAYS, irrespective of NaN */ > + DPSIGN(x) = 0; > + > if (xc == IEEE754_CLASS_SNAN) { > - SETCX(IEEE754_INVALID_OPERATION); > - return ieee754dp_nanxcpt(ieee754dp_indef(), "neg"); > + return ieee754dp_nanxcpt(ieee754dp_indef(), "abs"); > } > > - if (ieee754dp_isnan(x)) /* but not infinity */ > - return ieee754dp_nanxcpt(x, "abs", x); > - > - /* quick fix up */ > - DPSIGN(x) = 0; > return x; > } Is there any reason for removal of SETCX(IEEE754_INVALID_OPERATION) line here? The older version of this fix ("Fix absd emulation" by Raghu Gandham) did not remove the line. Without this line, a signaling NaN will not raise a signal. It seems not expected behaviour. --- Atsushi Nemoto