Replace code that toggles between 53 and 64 bits on i386

class hardware with the ENTERI and RETURNI macros, which
are now available in math_private.h.

Suggested by:	bde
Approved by: das (mentor)
This commit is contained in:
Steve Kargl 2012-07-26 03:50:24 +00:00
parent b3f18e536a
commit 3458a81e65
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=238782

View File

@ -51,23 +51,12 @@ cbrtl(long double x)
if (k == BIAS + LDBL_MAX_EXP)
return (x + x);
#ifdef __i386__
fp_prec_t oprec;
oprec = fpgetprec();
if (oprec != FP_PE)
fpsetprec(FP_PE);
#endif
ENTERI();
if (k == 0) {
/* If x = +-0, then cbrt(x) = +-0. */
if ((u.bits.manh | u.bits.manl) == 0) {
#ifdef __i386__
if (oprec != FP_PE)
fpsetprec(oprec);
#endif
return (x);
}
if ((u.bits.manh | u.bits.manl) == 0)
RETURNI(x);
/* Adjust subnormal numbers. */
u.e *= 0x1.0p514;
k = u.bits.exp;
@ -149,9 +138,5 @@ cbrtl(long double x)
t=t+t*r; /* error <= 0.5 + 0.5/3 + epsilon */
t *= v.e;
#ifdef __i386__
if (oprec != FP_PE)
fpsetprec(oprec);
#endif
return (t);
RETURNI(t);
}