diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2015-11-15 22:41:44 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2015-11-15 22:41:44 +0000 |
commit | d885aa53c76f4b068b821d6f868572306c160807 (patch) | |
tree | b32d3d6e718850d1af73d62b35b4fb8f3f197e9a | |
parent | 309eb4f37f80a876bab8c4c635624c3bed208c50 (diff) |
Tweak previous: rename it to fpround() to match FreeBSD
requested by kettenis@
-rw-r--r-- | lib/libc/arch/sparc64/fpu/fpu_implode.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/libc/arch/sparc64/fpu/fpu_implode.c b/lib/libc/arch/sparc64/fpu/fpu_implode.c index 691d309a7f7..ce57a84e954 100644 --- a/lib/libc/arch/sparc64/fpu/fpu_implode.c +++ b/lib/libc/arch/sparc64/fpu/fpu_implode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fpu_implode.c,v 1.4 2015/11/15 03:54:08 guenther Exp $ */ +/* $OpenBSD: fpu_implode.c,v 1.5 2015/11/15 22:41:43 guenther Exp $ */ /* * Copyright (c) 1992, 1993 @@ -65,7 +65,7 @@ __FBSDID("$FreeBSD: src/lib/libc/sparc64/fpu/fpu_implode.c,v 1.5 2002/04/27 21:5 #include "fpu_emu.h" #include "fpu_extern.h" -static int roundit(struct fpemu *, struct fpn *); +static int fpround(struct fpemu *, struct fpn *); static int toinf(struct fpemu *, int); #define FSR_GET_RD(fsr) (((fsr) >> FSR_RD_SHIFT) & FSR_RD_MASK) @@ -83,7 +83,7 @@ static int toinf(struct fpemu *, int); * responsibility to fix this if necessary. */ static int -roundit(struct fpemu *fe, struct fpn *fp) +fpround(struct fpemu *fe, struct fpn *fp) { u_int m0, m1, m2, m3; int gr, s; @@ -215,7 +215,7 @@ __fpu_ftoi(fe, fp) * into last mantissa word (this will not exceed 0xffffffff), * shifting any guard and round bits out into the sticky * bit. Then ``round'' towards zero, i.e., just set an - * inexact exception if sticky is set (see roundit()). + * inexact exception if sticky is set (see fpround()). * If the result is > 0x80000000, or is positive and equals * 0x80000000, overflow; otherwise the last fraction word * is the result. @@ -267,7 +267,7 @@ __fpu_ftox(fe, fp, res) * 0xffffffffffffffff), shifting any guard and round bits out * into the sticky bit. Then ``round'' towards zero, i.e., * just set an inexact exception if sticky is set (see - * roundit()). If the result is > 0x8000000000000000, or is + * fpround()). If the result is > 0x8000000000000000, or is * positive and equals 0x8000000000000000, overflow; * otherwise the last fraction word is the result. */ @@ -347,7 +347,7 @@ __fpu_ftos(fe, fp) if ((exp = fp->fp_exp + SNG_EXP_BIAS) <= 0) { /* subnormal */ /* -NG for g,r; -SNG_FRACBITS-exp for fraction */ (void) __fpu_shr(fp, FP_NMANT - FP_NG - SNG_FRACBITS - exp); - if (roundit(fe, fp) && fp->fp_mant[3] == SNG_EXP(1)) + if (fpround(fe, fp) && fp->fp_mant[3] == SNG_EXP(1)) return (sign | SNG_EXP(1) | 0); if ((fe->fe_cx & FSR_NX) || (fe->fe_fsr & (FSR_UF << FSR_TEM_SHIFT))) @@ -360,7 +360,7 @@ __fpu_ftos(fe, fp) if ((fp->fp_mant[3] & SNG_EXP(1 << FP_NG)) == 0) __utrap_panic("fpu_ftos"); #endif - if (roundit(fe, fp) && fp->fp_mant[3] == SNG_EXP(2)) + if (fpround(fe, fp) && fp->fp_mant[3] == SNG_EXP(2)) exp++; if (exp >= SNG_EXP_INFNAN) { /* overflow to inf or to max single */ @@ -408,7 +408,7 @@ zero: res[1] = 0; if ((exp = fp->fp_exp + DBL_EXP_BIAS) <= 0) { (void) __fpu_shr(fp, FP_NMANT - FP_NG - DBL_FRACBITS - exp); - if (roundit(fe, fp) && fp->fp_mant[2] == DBL_EXP(1)) { + if (fpround(fe, fp) && fp->fp_mant[2] == DBL_EXP(1)) { res[1] = 0; return (sign | DBL_EXP(1) | 0); } @@ -419,7 +419,7 @@ zero: res[1] = 0; goto done; } (void) __fpu_shr(fp, FP_NMANT - FP_NG - 1 - DBL_FRACBITS); - if (roundit(fe, fp) && fp->fp_mant[2] == DBL_EXP(2)) + if (fpround(fe, fp) && fp->fp_mant[2] == DBL_EXP(2)) exp++; if (exp >= DBL_EXP_INFNAN) { fe->fe_cx |= FSR_OF | FSR_NX; @@ -469,7 +469,7 @@ zero: res[1] = res[2] = res[3] = 0; if ((exp = fp->fp_exp + EXT_EXP_BIAS) <= 0) { (void) __fpu_shr(fp, FP_NMANT - FP_NG - EXT_FRACBITS - exp); - if (roundit(fe, fp) && fp->fp_mant[0] == EXT_EXP(1)) { + if (fpround(fe, fp) && fp->fp_mant[0] == EXT_EXP(1)) { res[1] = res[2] = res[3] = 0; return (sign | EXT_EXP(1) | 0); } @@ -480,7 +480,7 @@ zero: res[1] = res[2] = res[3] = 0; goto done; } /* Since internal == extended, no need to shift here. */ - if (roundit(fe, fp) && fp->fp_mant[0] == EXT_EXP(2)) + if (fpround(fe, fp) && fp->fp_mant[0] == EXT_EXP(2)) exp++; if (exp >= EXT_EXP_INFNAN) { fe->fe_cx |= FSR_OF | FSR_NX; |