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/1eca4fcd5916
branches: netbsd-1-4
changeset: 468810:1eca4fcd5916
user: perry <perry%NetBSD.org@localhost>
date: Mon Jun 21 15:21:09 1999 +0000
description:
pullup 1.1->1.2 (briggs): fix FPE
diffstat:
sys/arch/m68k/fpe/fpu_sqrt.c | 51 ++++++-------------------------------------
1 files changed, 8 insertions(+), 43 deletions(-)
diffs (101 lines):
diff -r 5f40d9d904de -r 1eca4fcd5916 sys/arch/m68k/fpe/fpu_sqrt.c
--- a/sys/arch/m68k/fpe/fpu_sqrt.c Mon Jun 21 15:20:52 1999 +0000
+++ b/sys/arch/m68k/fpe/fpu_sqrt.c Mon Jun 21 15:21:09 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fpu_sqrt.c,v 1.1 1995/11/03 04:47:18 briggs Exp $ */
+/* $NetBSD: fpu_sqrt.c,v 1.1.24.1 1999/06/21 15:21:09 perry Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -192,9 +192,9 @@
{
register struct fpn *x = &fe->fe_f2;
register u_int bit, q, tt;
- register u_int x0, x1, x2, x3;
- register u_int y0, y1, y2, y3;
- register u_int d0, d1, d2, d3;
+ register u_int x0, x1, x2;
+ register u_int y0, y1, y2;
+ register u_int d0, d1, d2;
register int e;
FPU_DECL_CARRY
@@ -224,13 +224,13 @@
*/
#ifdef FPU_SHL1_BY_ADD
#define DOUBLE_X { \
- FPU_ADDS(x3, x3, x3); FPU_ADDCS(x2, x2, x2); \
+ FPU_ADDS(x2, x2, x2); \
FPU_ADDCS(x1, x1, x1); FPU_ADDC(x0, x0, x0); \
}
#else
#define DOUBLE_X { \
x0 = (x0 << 1) | (x1 >> 31); x1 = (x1 << 1) | (x2 >> 31); \
- x2 = (x2 << 1) | (x3 >> 31); x3 <<= 1; \
+ x2 <<= 1; \
}
#endif
#if (FP_NMANT & 1) != 0
@@ -243,7 +243,6 @@
x0 = x->fp_mant[0];
x1 = x->fp_mant[1];
x2 = x->fp_mant[2];
- x3 = x->fp_mant[3];
e = x->fp_exp;
if (e & 1) /* exponent is odd; use sqrt(2mant) */
DOUBLE_X;
@@ -262,7 +261,7 @@
* outside of each per-word loop.
*
* The calculation `t = y + bit' breaks down into `t0 = y0, ...,
- * t3 = y3, t? |= bit' for the appropriate word. Since the bit
+ * t2 = y2, t? |= bit' for the appropriate word. Since the bit
* is always a `new' one, this means that three of the `t?'s are
* just the corresponding `y?'; we use `#define's here for this.
* The variable `tt' holds the actual `t?' variable.
@@ -355,44 +354,10 @@
x->fp_mant[2] = q;
#undef t2
- /* calculate q3. y0, t0, y1, t1 all fixed; y2, t2, almost done. */
-#define t2 y2
-#define t3 tt
- q = 0;
- y3 = 0;
- bit = 1 << 31;
- EVEN_DOUBLE;
- t3 = bit;
- FPU_SUBS(d3, x3, t3);
- FPU_SUBCS(d2, x2, t2);
- FPU_SUBCS(d1, x1, t1);
- FPU_SUBC(d0, x0, t0);
- ODD_DOUBLE;
- if ((int)d0 >= 0) {
- x0 = d0, x1 = d1, x2 = d2;
- q |= bit;
- y2 |= 1;
- }
- while ((bit >>= 1) != 0) {
- EVEN_DOUBLE;
- t3 = y3 | bit;
- FPU_SUBS(d3, x3, t3);
- FPU_SUBCS(d2, x2, t2);
- FPU_SUBCS(d1, x1, t1);
- FPU_SUBC(d0, x0, t0);
- if ((int)d0 >= 0) {
- x0 = d0, x1 = d1, x2 = d2;
- q |= bit;
- y3 |= bit << 1;
- }
- ODD_DOUBLE;
- }
- x->fp_mant[3] = q;
-
/*
* The result, which includes guard and round bits, is exact iff
* x is now zero; any nonzero bits in x represent sticky bits.
*/
- x->fp_sticky = x0 | x1 | x2 | x3;
+ x->fp_sticky = x0 | x1 | x2;
return (x);
}
Home |
Main Index |
Thread Index |
Old Index