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

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

diff -urN linux-2.4.18/arch/mips/math-emu/dp_cmp.c linux-2.4.19/arch/mips/math-emu/dp_cmp.c
@@ -29,9 +29,18 @@
 
 int ieee754dp_cmp(ieee754dp x, ieee754dp y, int cmp)
 {
-	CLEARCX;
+	COMPXDP;
+	COMPYDP;
+
+	EXPLODEXDP;
+	EXPLODEYDP;
+	FLUSHXDP;
+	FLUSHYDP;
+	CLEARCX;	/* Even clear inexact flag here */
 
 	if (ieee754dp_isnan(x) || ieee754dp_isnan(y)) {
+		if (xc == IEEE754_CLASS_SNAN || yc == IEEE754_CLASS_SNAN)
+			SETCX(IEEE754_INVALID_OPERATION);
 		if (cmp & IEEE754_CUN)
 			return 1;
 		if (cmp & (IEEE754_CLT | IEEE754_CGT)) {

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