linux-mips
[Top] [All Lists]

Re: math emulator patch

To: Kjeld Borch Egevang <kjelde@mips.com>
Subject: Re: math emulator patch
From: Ralf Baechle <ralf@oss.sgi.com>
Date: Mon, 3 Dec 2001 00:12:33 +1100
Cc: Mark Salter <msalter@redhat.com>, linux-mips@oss.sgi.com
In-reply-to: <Pine.LNX.4.33.0112010033480.29161-100000@coplin19.mips.com>; from kjelde@mips.com on Sat, Dec 01, 2001 at 12:36:44AM +0100
References: <200111300138.fAU1cOA31059@deneb.localdomain> <Pine.LNX.4.33.0112010033480.29161-100000@coplin19.mips.com>
Sender: owner-linux-mips@oss.sgi.com
User-agent: Mutt/1.2.5i
On Sat, Dec 01, 2001 at 12:36:44AM +0100, Kjeld Borch Egevang wrote:

> Great. The same problem exists for sp_tlong.c and dp_tlong.c.

Ok, this is what I'm going to checkin for both 2.4 and 2.5.  Tell me if
that's ok.

Btw, we've got so many almost identical sourcefiles in the fp emulation
code, something should be done about that ...

  Ralf

Index: arch/mips/math-emu/dp_tint.c
===================================================================
RCS file: /home/pub/cvs/linux/arch/mips/math-emu/dp_tint.c,v
retrieving revision 1.4
diff -u -r1.4 dp_tint.c
--- arch/mips/math-emu/dp_tint.c        2001/10/09 23:56:18     1.4
+++ arch/mips/math-emu/dp_tint.c        2001/12/02 13:10:44
@@ -50,6 +50,9 @@
                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);
Index: arch/mips/math-emu/dp_tlong.c
===================================================================
RCS file: /home/pub/cvs/linux/arch/mips/math-emu/dp_tlong.c,v
retrieving revision 1.5
diff -u -r1.5 dp_tlong.c
--- arch/mips/math-emu/dp_tlong.c       2001/11/21 15:53:51     1.5
+++ arch/mips/math-emu/dp_tlong.c       2001/12/02 13:10:44
@@ -49,6 +49,9 @@
                break;
        }
        if (xe >= 63) {
+               /* look for valid corner case */ 
+               if (xe == 63 && xs && xm == DP_HIDDEN_BIT)
+                       return -9223372036854775808LL;
                /* Set invalid. We will only use overflow for floating
                   point overflow */
                SETCX(IEEE754_INVALID_OPERATION);
Index: arch/mips/math-emu/sp_tint.c
===================================================================
RCS file: /home/pub/cvs/linux/arch/mips/math-emu/sp_tint.c,v
retrieving revision 1.4
diff -u -r1.4 sp_tint.c
--- arch/mips/math-emu/sp_tint.c        2001/10/09 23:56:19     1.4
+++ arch/mips/math-emu/sp_tint.c        2001/12/02 13:10:44
@@ -50,6 +50,9 @@
                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);
Index: arch/mips/math-emu/sp_tlong.c
===================================================================
RCS file: /home/pub/cvs/linux/arch/mips/math-emu/sp_tlong.c,v
retrieving revision 1.4
diff -u -r1.4 sp_tlong.c
--- arch/mips/math-emu/sp_tlong.c       2001/10/09 23:56:19     1.4
+++ arch/mips/math-emu/sp_tlong.c       2001/12/02 13:10:44
@@ -49,6 +49,9 @@
                break;
        }
        if (xe >= 63) {
+               /* look for valid corner case */
+               if (xe == 63 && xs && xm == SP_HIDDEN_BIT)
+                       return -9223372036854775808LL;
                /* Set invalid. We will only use overflow for floating
                   point overflow */
                SETCX(IEEE754_INVALID_OPERATION);

<Prev in Thread] Current Thread [Next in Thread>