aboutsummaryrefslogtreecommitdiff
path: root/lib/msun/src/s_cbrtl.c
diff options
context:
space:
mode:
authorSteve Kargl <kargl@FreeBSD.org>2012-07-26 03:50:24 +0000
committerSteve Kargl <kargl@FreeBSD.org>2012-07-26 03:50:24 +0000
commit3458a81e65fcfc58610c724872afb3513840e65e (patch)
treeba544cf6b065baaa83156cb035a4e08daff30391 /lib/msun/src/s_cbrtl.c
parentb3f18e536a9344151a0fe6e8db1bb5d34d34c891 (diff)
downloadsrc-3458a81e65fcfc58610c724872afb3513840e65e.tar.gz
src-3458a81e65fcfc58610c724872afb3513840e65e.zip
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)
Notes
Notes: svn path=/head/; revision=238782
Diffstat (limited to 'lib/msun/src/s_cbrtl.c')
-rw-r--r--lib/msun/src/s_cbrtl.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/lib/msun/src/s_cbrtl.c b/lib/msun/src/s_cbrtl.c
index 23c9184ae18b..95ab9564bc16 100644
--- a/lib/msun/src/s_cbrtl.c
+++ b/lib/msun/src/s_cbrtl.c
@@ -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);
}