diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2006-01-16 22:08:27 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2006-01-16 22:08:27 +0000 |
commit | 5a03dbfd496439c4eeacc5061987a981987b0656 (patch) | |
tree | 01b03ec79e32af4a823dd7e2c18aa4145552c6bd /sys/arch/m68k/fpe/fpu_rem.c | |
parent | 2ba959ebfb0a978f05a318f952130166b96c7c4d (diff) |
Sync m68k fpe code with NetBSD; but remove unimplemented opcodes stubs, so
that we trigger SIGILL instead of propagating false results.
Tested by martin@ on Macintosh LCIII.
Diffstat (limited to 'sys/arch/m68k/fpe/fpu_rem.c')
-rw-r--r-- | sys/arch/m68k/fpe/fpu_rem.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/sys/arch/m68k/fpe/fpu_rem.c b/sys/arch/m68k/fpe/fpu_rem.c index 40714ea126a..4390b2f302c 100644 --- a/sys/arch/m68k/fpe/fpu_rem.c +++ b/sys/arch/m68k/fpe/fpu_rem.c @@ -1,5 +1,5 @@ -/* $OpenBSD: fpu_rem.c,v 1.3 2002/03/14 01:26:34 millert Exp $ */ -/* $NetBSD: fpu_rem.c,v 1.3 1996/04/30 12:02:54 briggs Exp $ */ +/* $OpenBSD: fpu_rem.c,v 1.4 2006/01/16 22:08:26 miod Exp $ */ +/* $NetBSD: fpu_rem.c,v 1.5 2003/07/15 02:43:10 lukem Exp $ */ /* * Copyright (c) 1995 Ken Nakata @@ -83,9 +83,9 @@ * R := 0. Return signQ, last 7 bits of Q, and R. */ -static struct fpn * __fpu_modrem(struct fpemu *fe, int modrem); +struct fpn *__fpu_modrem(struct fpemu *fe, int modrem); -static struct fpn * +struct fpn * __fpu_modrem(fe, modrem) struct fpemu *fe; int modrem; @@ -126,14 +126,12 @@ __fpu_modrem(fe, modrem) */ while (y->fp_exp != r->fp_exp || y->fp_mant[0] != r->fp_mant[0] || y->fp_mant[1] != r->fp_mant[1] || - y->fp_mant[2] != r->fp_mant[2] || - y->fp_mant[3] != r->fp_mant[3]) { + y->fp_mant[2] != r->fp_mant[2]) { /* Step 3.2 */ if (y->fp_exp < r->fp_exp || y->fp_mant[0] < r->fp_mant[0] || y->fp_mant[1] < r->fp_mant[1] || - y->fp_mant[2] < r->fp_mant[2] || - y->fp_mant[3] < r->fp_mant[3]) { + y->fp_mant[2] < r->fp_mant[2]) { CPYFPN(&fe->fe_f1, r); CPYFPN(&fe->fe_f2, y); fe->fe_f2.fp_sign = 1; @@ -166,13 +164,13 @@ __fpu_modrem(fe, modrem) if (r->fp_exp + 1 < y->fp_exp || (r->fp_exp + 1 == y->fp_exp && (r->fp_mant[0] < y->fp_mant[0] || r->fp_mant[1] < y->fp_mant[1] || - r->fp_mant[2] < y->fp_mant[3] || r->fp_mant[4] < y->fp_mant[4]))) + r->fp_mant[2] < y->fp_mant[2]))) /* if r < y/2 */ goto Step6; /* Step 5.2 */ if (r->fp_exp + 1 != y->fp_exp || r->fp_mant[0] != y->fp_mant[0] || r->fp_mant[1] != y->fp_mant[1] || - r->fp_mant[2] != y->fp_mant[2] || r->fp_mant[3] != y->fp_mant[3]) { + r->fp_mant[2] != y->fp_mant[2]) { /* if (!(r < y/2) && !(r == y/2)) */ Last_Subtract = 1; q++; |