From owner-svn-src-head@FreeBSD.ORG Mon Jun 3 19:13:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A340841B; Mon, 3 Jun 2013 19:13:45 +0000 (UTC) (envelope-from kargl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7B99E10E4; Mon, 3 Jun 2013 19:13:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r53JDj2w030842; Mon, 3 Jun 2013 19:13:45 GMT (envelope-from kargl@svn.freebsd.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r53JDjc5030838; Mon, 3 Jun 2013 19:13:45 GMT (envelope-from kargl@svn.freebsd.org) Message-Id: <201306031913.r53JDjc5030838@svn.freebsd.org> From: Steve Kargl Date: Mon, 3 Jun 2013 19:13:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251339 - in head/lib/msun: ld128 ld80 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 03 Jun 2013 19:13:45 -0000 Author: kargl Date: Mon Jun 3 19:13:44 2013 New Revision: 251339 URL: http://svnweb.freebsd.org/changeset/base/251339 Log: ld80/s_expl.c: * Use integral numerical constants, and let the compiler do the conversion to long double. ld128/s_expl.c: * Use integral numerical constants, and let the compiler do the conversion to long double. * Use the ENTERI/RETURNI macros, which are no-ops on ld128. This however makes the ld80 and ld128 identical. Reviewed by: bde (as part of larger diff) Modified: head/lib/msun/ld128/s_expl.c head/lib/msun/ld80/s_expl.c Modified: head/lib/msun/ld128/s_expl.c ============================================================================== --- head/lib/msun/ld128/s_expl.c Mon Jun 3 18:57:35 2013 (r251338) +++ head/lib/msun/ld128/s_expl.c Mon Jun 3 19:13:44 2013 (r251339) @@ -228,7 +228,7 @@ expl(long double x) double dr, fn, r2; int k, n, n2; - uint32_t hx, ix; + uint16_t hx, ix; /* Filter out exceptional cases. */ u.e = x; @@ -248,6 +248,8 @@ expl(long double x) return (1 + x); /* 1 with inexact iff x != 0 */ } + ENTERI(); + /* Reduce x to (k*ln2 + endpoint[n2] + r1 + r2). */ /* Use a specialized rint() to get fn. Assume round-to-nearest. */ /* XXX assume no extra precision for the additions, as for trig fns. */ @@ -262,10 +264,11 @@ expl(long double x) k = n >> LOG2_INTERVALS; r1 = x - fn * L1; r2 = fn * -L2; + r = r1 + r2; /* Prepare scale factors. */ - v.xbits.manh = 0; - v.xbits.manl = 0; + /* XXX sparc64 multiplication is so slow that scalbnl() is faster. */ + v.e = 1; if (k >= LDBL_MIN_EXP) { v.xbits.expsign = BIAS + k; twopk = v.e; @@ -284,9 +287,9 @@ expl(long double x) /* Scale by 2**k. */ if (k >= LDBL_MIN_EXP) { if (k == LDBL_MAX_EXP) - return (t * 2.0L * 0x1p16383L); - return (t * twopk); + RETURNI(t * 2 * 0x1p16383L); + RETURNI(t * twopk); } else { - return (t * twopkp10000 * twom10000); + RETURNI(t * twopkp10000 * twom10000); } } Modified: head/lib/msun/ld80/s_expl.c ============================================================================== --- head/lib/msun/ld80/s_expl.c Mon Jun 3 18:57:35 2013 (r251338) +++ head/lib/msun/ld80/s_expl.c Mon Jun 3 19:13:44 2013 (r251339) @@ -278,7 +278,7 @@ expl(long double x) r2 = fn * -L2; /* Prepare scale factors. */ - v.e = 1ULL << 63; + v.e = 1; if (k >= LDBL_MIN_EXP) { v.xbits.expsign = BIAS + k; twopk = v.e; @@ -296,7 +296,7 @@ expl(long double x) /* Scale by 2**k. */ if (k >= LDBL_MIN_EXP) { if (k == LDBL_MAX_EXP) - RETURNI(t * 2.0L * 0x1p16383L); + RETURNI(t * 2 * 0x1p16383L); RETURNI(t * twopk); } else { RETURNI(t * twopkp10000 * twom10000);