From owner-svn-src-all@FreeBSD.ORG Sun Sep 23 18:32:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B2F5F106564A; Sun, 23 Sep 2012 18:32:04 +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 8504D8FC15; Sun, 23 Sep 2012 18:32:04 +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 q8NIW4h9052387; Sun, 23 Sep 2012 18:32:04 GMT (envelope-from kargl@svn.freebsd.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8NIW4jD052384; Sun, 23 Sep 2012 18:32:04 GMT (envelope-from kargl@svn.freebsd.org) Message-Id: <201209231832.q8NIW4jD052384@svn.freebsd.org> From: Steve Kargl Date: Sun, 23 Sep 2012 18:32:04 +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: r240866 - in head/lib/msun: ld128 ld80 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Sep 2012 18:32:04 -0000 Author: kargl Date: Sun Sep 23 18:32:03 2012 New Revision: 240866 URL: http://svn.freebsd.org/changeset/base/240866 Log: * ld80/s_expl.c: . Fix the threshold for expl(x) where |x| is small. . Also update the previously incorrect comment to match the new threshold. * ld128/s_expl.c: . Re-order logic in exceptional cases to match the logic used in other long double functions. . Fix the threshold for expl(x) where is |x| is small. . Also update the previously incorrect comment to match the new threshold. Submitted by: bde Approved by: das (mentor) 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 Sun Sep 23 18:13:46 2012 (r240865) +++ head/lib/msun/ld128/s_expl.c Sun Sep 23 18:32:03 2012 (r240866) @@ -211,19 +211,16 @@ expl(long double x) ix = hx & 0x7fff; if (ix >= BIAS + 13) { /* |x| >= 8192 or x is NaN */ if (ix == BIAS + LDBL_MAX_EXP) { - if (u.xbits.manh != 0 - || u.xbits.manl != 0 - || (hx & 0x8000) == 0) - return (x + x); /* x is NaN or +Inf */ - else - return (0.0); /* x is -Inf */ + if (hx & 0x8000 && u.xbits.manh == 0 && + u.xbits.manl == 0) + return (0.0L); /* x is -Inf */ + return (x + x); /* x is +Inf or NaN */ } if (x > o_threshold) return (huge * huge); if (x < u_threshold) return (tiny * tiny); - } else if (ix <= BIAS - 115) { /* |x| < 0x1p-33 */ - /* includes pseudo-denormals */ + } else if (ix < BIAS - 115) { /* |x| < 0x1p-115 */ if (huge + x > 1.0L) /* trigger inexact iff x != 0 */ return (1.0L + x); } Modified: head/lib/msun/ld80/s_expl.c ============================================================================== --- head/lib/msun/ld80/s_expl.c Sun Sep 23 18:13:46 2012 (r240865) +++ head/lib/msun/ld80/s_expl.c Sun Sep 23 18:32:03 2012 (r240866) @@ -249,7 +249,7 @@ expl(long double x) return (huge * huge); if (x < u_threshold.e) return (tiny * tiny); - } else if (ix <= BIAS - 34) { /* |x| < 0x1p-33 */ + } else if (ix < BIAS - 66) { /* |x| < 0x1p-66 */ /* includes pseudo-denormals */ if (huge + x > 1.0L) /* trigger inexact iff x != 0 */ return (1.0L + x);