Re: Release: Linux 2.0.34pre11

Richard Henderson (rth@dot.cygnus.com)
Sun, 26 Apr 1998 22:41:01 -0700


The following patch for Alpha fp software completion should be
included, if at all possible, in the final 2.0.34.

r~

--- fp-emul.c.orig Sun Aug 3 10:58:38 1997
+++ fp-emul.c Sun Apr 26 22:33:43 1998
@@ -13,9 +13,9 @@
#define OPC_INTL 0x11
#define OPC_INTS 0x12
#define OPC_INTM 0x13
-#define OPC_FLTV 0x14
-#define OPC_FLTI 0x15
-#define OPC_FLTL 0x16
+#define OPC_FLTV 0x15
+#define OPC_FLTI 0x16
+#define OPC_FLTL 0x17

#define OPC_MISC 0x18

--- ieee-math.c.orig Sun Apr 26 22:26:04 1998
+++ ieee-math.c Sun Apr 26 22:33:43 1998
@@ -733,19 +733,23 @@ ieee_CVTQT (int f, unsigned long a, unsi
* FPCR_INV if invalid operation occurred, etc.
*/
unsigned long
-ieee_CVTTQ (int f, unsigned long a, unsigned long *b)
+ieee_CVTTQ (int f, unsigned long a, unsigned long *pb)
{
unsigned int midway;
- unsigned long ov, uv, res = 0;
+ unsigned long ov, uv, res, b;
fpclass_t a_type;
EXTENDED temp;

- *b = 0;
a_type = extend_ieee(a, &temp, DOUBLE);
+
+ b = 0x7fffffffffffffff;
+ res = FPCR_INV;
if (a_type == NaN || a_type == INFTY)
- return FPCR_INV;
+ goto out;
+
+ res = 0;
if (a_type == QNaN)
- return 0;
+ goto out;

if (temp.e > 0) {
ov = 0;
@@ -757,7 +761,7 @@ ieee_CVTTQ (int f, unsigned long a, unsi
if (ov || (temp.f[1] & 0xffc0000000000000))
res |= FPCR_IOV | FPCR_INE;
}
- if (temp.e < 0) {
+ else if (temp.e < 0) {
while (temp.e < 0) {
++temp.e;
uv = temp.f[0] & 1; /* save sticky bit */
@@ -765,7 +769,8 @@ ieee_CVTTQ (int f, unsigned long a, unsi
temp.f[0] |= uv;
}
}
- *b = ((temp.f[1] << 9) | (temp.f[0] >> 55)) & 0x7fffffffffffffff;
+ b = (temp.f[1] << 9) | (temp.f[0] >> 55);
+
/*
* Notice: the fraction is only 52 bits long. Thus, rounding
* cannot possibly result in an integer overflow.
@@ -781,12 +786,12 @@ ieee_CVTTQ (int f, unsigned long a, unsi
break;

case ROUND_PINF:
- if ((temp.f[0] & 0x003fffffffffffff) != 0)
+ if ((temp.f[0] & 0x007fffffffffffff) != 0)
++b;
break;

case ROUND_NINF:
- if ((temp.f[0] & 0x003fffffffffffff) != 0)
+ if ((temp.f[0] & 0x007fffffffffffff) != 0)
--b;
break;

@@ -794,12 +799,15 @@ ieee_CVTTQ (int f, unsigned long a, unsi
/* no action needed */
break;
}
- if ((temp.f[0] & 0x003fffffffffffff) != 0)
+ if ((temp.f[0] & 0x007fffffffffffff) != 0)
res |= FPCR_INE;

if (temp.s) {
- *b = -*b;
+ b = -b;
}
+
+out:
+ *pb = b;
return res;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu