All of lore.kernel.org
 help / color / mirror / Atom feed
* math emulator patch
@ 2001-11-30  1:38 Mark Salter
  2001-11-30 23:36   ` Kjeld Borch Egevang
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Salter @ 2001-11-30  1:38 UTC (permalink / raw)
  To: linux-mips


The following patch fixes the emulation of cvt.w.s and cvt.w.d for
values of -2147483648.

--Mark


Index: sp_tint.c
===================================================================
RCS file: /cvs/linux/arch/mips/math-emu/sp_tint.c,v
retrieving revision 1.4
diff -u -p -5 -c -r1.4 sp_tint.c
cvs server: conflicting specifications of output style
*** sp_tint.c	2001/10/09 23:56:19	1.4
--- sp_tint.c	2001/11/29 19:14:58
*************** int ieee754sp_tint(ieee754sp x)
*** 48,57 ****
--- 48,60 ----
  	case IEEE754_CLASS_DNORM:
  	case IEEE754_CLASS_NORM:
  		break;
  	}
  	if (xe >= 31) {
+ 		/* look for valid corner case */
+ 		if (xe == 31 && xs && xm == SP_HIDDEN_BIT)
+ 			return -2147483648;
  		/* Set invalid. We will only use overflow for floating
  		   point overflow */
  		SETCX(IEEE754_INVALID_OPERATION);
  		return ieee754si_xcpt(ieee754si_indef(), "sp_tint", x);
  	}
Index: dp_tint.c
===================================================================
RCS file: /cvs/linux/arch/mips/math-emu/dp_tint.c,v
retrieving revision 1.4
diff -u -p -5 -c -r1.4 dp_tint.c
cvs server: conflicting specifications of output style
*** dp_tint.c	2001/10/09 23:56:18	1.4
--- dp_tint.c	2001/11/29 19:18:02
*************** int ieee754dp_tint(ieee754dp x)
*** 48,57 ****
--- 48,60 ----
  	case IEEE754_CLASS_DNORM:
  	case IEEE754_CLASS_NORM:
  		break;
  	}
  	if (xe >= 31) {
+ 		/* look for valid corner case */
+ 		if (xe == 31 && xs && xm == DP_HIDDEN_BIT)
+ 			return -2147483648;
  		/* Set invalid. We will only use overflow for floating
  		   point overflow */
  		SETCX(IEEE754_INVALID_OPERATION);
  		return ieee754si_xcpt(ieee754si_indef(), "dp_tint", x);
  	}

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-05-17 14:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-11-30  1:38 math emulator patch Mark Salter
2001-11-30 23:36 ` Kjeld Borch Egevang
2001-11-30 23:36   ` Kjeld Borch Egevang
2001-12-02 13:12   ` Ralf Baechle
2001-12-02 13:22     ` Geert Uytterhoeven
2001-12-02 13:40       ` Ralf Baechle
2002-05-17 14:04   ` Kjeld Borch Egevang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.