patch-2.4.19 linux-2.4.19/arch/mips/math-emu/dp_simple.c

Next file: linux-2.4.19/arch/mips/math-emu/dp_sqrt.c
Previous file: linux-2.4.19/arch/mips/math-emu/dp_mul.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.18/arch/mips/math-emu/dp_simple.c linux-2.4.19/arch/mips/math-emu/dp_simple.c
@@ -42,7 +42,16 @@
 
 ieee754dp ieee754dp_neg(ieee754dp x)
 {
+	COMPXDP;
+
+	EXPLODEXDP;
 	CLEARCX;
+	FLUSHXDP;
+
+	if (xc == IEEE754_CLASS_SNAN) {
+		SETCX(IEEE754_INVALID_OPERATION);
+		return ieee754dp_nanxcpt(ieee754dp_indef(), "neg");
+	}
 
 	if (ieee754dp_isnan(x))	/* but not infinity */
 		return ieee754dp_nanxcpt(x, "neg", x);
@@ -55,7 +64,16 @@
 
 ieee754dp ieee754dp_abs(ieee754dp x)
 {
+	COMPXDP;
+
+	EXPLODEXDP;
 	CLEARCX;
+	FLUSHXDP;
+
+	if (xc == IEEE754_CLASS_SNAN) {
+		SETCX(IEEE754_INVALID_OPERATION);
+		return ieee754dp_nanxcpt(ieee754dp_indef(), "neg");
+	}
 
 	if (ieee754dp_isnan(x))	/* but not infinity */
 		return ieee754dp_nanxcpt(x, "abs", x);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)