From owner-svn-src-head@FreeBSD.ORG Thu Jul 26 03:50:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E58C106564A; Thu, 26 Jul 2012 03:50:25 +0000 (UTC) (envelope-from kargl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18AEB8FC08; Thu, 26 Jul 2012 03:50:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6Q3oOF8031903; Thu, 26 Jul 2012 03:50:24 GMT (envelope-from kargl@svn.freebsd.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6Q3oOgO031901; Thu, 26 Jul 2012 03:50:24 GMT (envelope-from kargl@svn.freebsd.org) Message-Id: <201207260350.q6Q3oOgO031901@svn.freebsd.org> From: Steve Kargl Date: Thu, 26 Jul 2012 03:50:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238782 - head/lib/msun/src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 03:50:25 -0000 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); }