Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-4]: src/sys/arch/m68k/fpe pullup 1.1->1.2 (briggs): fix FPE



details:   https://anonhg.NetBSD.org/src/rev/e861d8a05087
branches:  netbsd-1-4
changeset: 468806:e861d8a05087
user:      perry <perry%NetBSD.org@localhost>
date:      Mon Jun 21 15:20:08 1999 +0000

description:
pullup 1.1->1.2 (briggs): fix FPE

diffstat:

 sys/arch/m68k/fpe/fpu_int.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (59 lines):

diff -r ca7b1b7c5bdb -r e861d8a05087 sys/arch/m68k/fpe/fpu_int.c
--- a/sys/arch/m68k/fpe/fpu_int.c       Mon Jun 21 15:19:57 1999 +0000
+++ b/sys/arch/m68k/fpe/fpu_int.c       Mon Jun 21 15:20:08 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fpu_int.c,v 1.1 1995/11/03 04:47:14 briggs Exp $       */
+/*     $NetBSD: fpu_int.c,v 1.1.24.1 1999/06/21 15:20:08 perry Exp $   */
 
 /*
  * Copyright (c) 1995 Ken Nakata
@@ -50,7 +50,7 @@
   /* when |x| < 1.0 */
   if (x->fp_exp < 0) {
     x->fp_class = FPC_ZERO;
-    x->fp_mant[0] = x->fp_mant[1] = x->fp_mant[2] = x->fp_mant[3] = 0;
+    x->fp_mant[0] = x->fp_mant[1] = x->fp_mant[2] = 0;
     return x;
   }
 
@@ -63,7 +63,7 @@
   clr = 3 - sh / 32;
   mask = (0xffffffff << (sh % 32));
 
-  for (i = 3; i > clr; i--) {
+  for (i = 2; i > clr; i--) {
     x->fp_mant[i] = 0;
   }
   x->fp_mant[i] &= mask;
@@ -87,7 +87,7 @@
      that the result >= 1.0 when mantissa ~= 1.0 and rounded up */
   if (x->fp_exp < -1) {
     x->fp_class = FPC_ZERO;
-    x->fp_mant[0] = x->fp_mant[1] = x->fp_mant[2] = x->fp_mant[3] = 0;
+    x->fp_mant[0] = x->fp_mant[1] = x->fp_mant[2] = 0;
     return x;
   }
 
@@ -100,7 +100,7 @@
   fpu_shr(x, rsh - FP_NG);     /* shift to the right */
 
   if (round(fe, x) == 1 /* rounded up */ &&
-      x->fp_mant[3 - (FP_NMANT-rsh)/32] & (1 << ((FP_NMANT-rsh)%32))
+      x->fp_mant[2 - (FP_NMANT-rsh)/32] & (1 << ((FP_NMANT-rsh)%32))
       /* x >= 2.0 */) {
     rsh--;                     /* reduce shift count by 1 */
     x->fp_exp++;               /* adjust exponent */
@@ -110,11 +110,11 @@
   wsh = rsh / 32;
   lsh = rsh % 32;
   rsh = 32 - lsh;
-  for (i = 0; i + wsh < 3; i++) {
+  for (i = 0; i + wsh < 2; i++) {
     x->fp_mant[i] = (x->fp_mant[i+wsh] << lsh) | (x->fp_mant[i+wsh+1] >> rsh);
   }
   x->fp_mant[i++] = (x->fp_mant[i+wsh] << lsh);
-  for (; i < 4; i++) {
+  for (; i < 3; i++) {
     x->fp_mant[i] = 0;
   }
 



Home | Main Index | Thread Index | Old Index