From 8e0c605992437bff5488864b54673cb4218fa00b Mon Sep 17 00:00:00 2001 From: Jason Wright Date: Sun, 9 Sep 2001 00:35:49 +0000 Subject: in fpu_ftox() make sure the high bits are the return value and res[1] gets the low bits. --- sys/arch/sparc64/fpu/fpu_implode.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'sys') diff --git a/sys/arch/sparc64/fpu/fpu_implode.c b/sys/arch/sparc64/fpu/fpu_implode.c index 1b7522b0637..dc52cd2ef68 100644 --- a/sys/arch/sparc64/fpu/fpu_implode.c +++ b/sys/arch/sparc64/fpu/fpu_implode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fpu_implode.c,v 1.1 2001/09/08 22:33:51 jason Exp $ */ +/* $OpenBSD: fpu_implode.c,v 1.2 2001/09/09 00:35:48 jason Exp $ */ /* $NetBSD: fpu_implode.c,v 1.7 2000/08/03 18:32:08 eeh Exp $ */ /* @@ -254,8 +254,8 @@ fpu_ftox(fe, fp, res) switch (fp->fp_class) { case FPC_ZERO: - res[1] = 0; - return (0); + i = 0; + goto out; case FPC_NUM: /* @@ -276,14 +276,19 @@ fpu_ftox(fe, fp, res) i = ((u_int64_t)fp->fp_mant[2]<<32)|fp->fp_mant[3]; if (i >= ((u_int64_t)0x8000000000000000LL + sign)) break; - return (sign ? -i : i); + if (sign) + i = -i; + goto out; default: /* Inf, qNaN, sNaN */ break; } /* overflow: replace any inexact exception with invalid */ fe->fe_cx = (fe->fe_cx & ~FSR_NX) | FSR_NV; - return (0x7fffffffffffffffLL + sign); + i = 0x7fffffffffffffffLL + sign; +out: + res[1] = i & 0xffffffff; + return (i >> 32); } #endif /* SUN4U */ -- cgit v1.2.3