svn commit: r238782 - head/lib/msun/src

Steve Kargl kargl at FreeBSD.org
Thu Jul 26 03:50:25 UTC 2012


Author: kargl
Date: Thu Jul 26 03:50:24 2012
New Revision: 238782
URL: http://svn.freebsd.org/changeset/base/238782

Log:
  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)

Modified:
  head/lib/msun/src/s_cbrtl.c

Modified: head/lib/msun/src/s_cbrtl.c
==============================================================================
--- head/lib/msun/src/s_cbrtl.c	Wed Jul 25 22:17:44 2012	(r238781)
+++ head/lib/msun/src/s_cbrtl.c	Thu Jul 26 03:50:24 2012	(r238782)
@@ -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);
 }


More information about the svn-src-all mailing list