From owner-svn-src-all@FreeBSD.ORG Sat Sep 29 16:40:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14B91106564A; Sat, 29 Sep 2012 16:40:13 +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 DB7A88FC0A; Sat, 29 Sep 2012 16:40:12 +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 q8TGeCGZ057791; Sat, 29 Sep 2012 16:40:12 GMT (envelope-from kargl@svn.freebsd.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8TGeCVS057788; Sat, 29 Sep 2012 16:40:12 GMT (envelope-from kargl@svn.freebsd.org) Message-Id: <201209291640.q8TGeCVS057788@svn.freebsd.org> From: Steve Kargl Date: Sat, 29 Sep 2012 16:40:12 +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: r241051 - in head/lib/msun: ld80 src 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: Sat, 29 Sep 2012 16:40:13 -0000 Author: kargl Date: Sat Sep 29 16:40:12 2012 New Revision: 241051 URL: http://svn.freebsd.org/changeset/base/241051 Log: * src/math_private.h: . Change the API for the LD80C by removing the explicit passing of the sign bit. The sign can be determined from the last parameter of the macro. . On i386, load long double by bit manipulations to work around at least a gcc compiler issue. On non-i386 ld80 architectures, use a simple assignment. * ld80/s_expl.c: . Update the only consumer of LD80C. Submitted by: bde Approved by: das (mentor) Modified: head/lib/msun/ld80/s_expl.c head/lib/msun/src/math_private.h Modified: head/lib/msun/ld80/s_expl.c ============================================================================== --- head/lib/msun/ld80/s_expl.c Sat Sep 29 16:27:13 2012 (r241050) +++ head/lib/msun/ld80/s_expl.c Sat Sep 29 16:40:12 2012 (r241051) @@ -60,9 +60,9 @@ static volatile const long double tiny = static const union IEEEl2bits /* log(2**16384 - 0.5) rounded towards zero: */ -o_threshold = LD80C(0xb17217f7d1cf79ab, 13, 0, 11356.5234062941439488L), +o_threshold = LD80C(0xb17217f7d1cf79ab, 13, 11356.5234062941439488L), /* log(2**(-16381-64-1)) rounded towards zero: */ -u_threshold = LD80C(0xb21dfe7f09e2baa9, 13, 1, -11399.4985314888605581L); +u_threshold = LD80C(0xb21dfe7f09e2baa9, 13, -11399.4985314888605581L); static const double __aligned(64) /* Modified: head/lib/msun/src/math_private.h ============================================================================== --- head/lib/msun/src/math_private.h Sat Sep 29 16:27:13 2012 (r241050) +++ head/lib/msun/src/math_private.h Sat Sep 29 16:40:12 2012 (r241051) @@ -207,12 +207,16 @@ do { \ (d) = se_u.e; \ } while (0) -/* Long double constants are broken on i386. This workaround is OK always. */ -#define LD80C(m, ex, s, v) { \ - /* .e = v, */ /* overwritten */ \ - .xbits.man = __CONCAT(m, ULL), \ - .xbits.expsign = (0x3fff + (ex)) | ((s) ? 0x8000 : 0), \ +#ifdef __i386__ +/* Long double constants are broken on i386. */ +#define LD80C(m, ex, v) { \ + .xbits.man = __CONCAT(m, ULL), \ + .xbits.expsign = (0x3fff + (ex)) | ((v) < 0 ? 0x8000 : 0), \ } +#else +/* The above works on non-i386 too, but we use this to check v. */ +#define LD80C(m, ex, v) { .e = (v), } +#endif #ifdef FLT_EVAL_METHOD /*