From owner-svn-src-all@FreeBSD.ORG Sun Oct 16 05:36:39 2011 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 E90031065670; Sun, 16 Oct 2011 05:36:39 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BFF688FC08; Sun, 16 Oct 2011 05:36:39 +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 p9G5adXF047130; Sun, 16 Oct 2011 05:36:39 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9G5adOW047127; Sun, 16 Oct 2011 05:36:39 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201110160536.p9G5adOW047127@svn.freebsd.org> From: David Schultz Date: Sun, 16 Oct 2011 05:36:39 +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: r226412 - head/lib/msun/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: Sun, 16 Oct 2011 05:36:40 -0000 Author: das Date: Sun Oct 16 05:36:39 2011 New Revision: 226412 URL: http://svn.freebsd.org/changeset/base/226412 Log: Move the macros GET_LDBL_EXPSIGN() and SET_LDBL_EXPSIGN() into math_private.h, so they can be used elsewhere in the math library. Modified: head/lib/msun/src/e_hypotl.c head/lib/msun/src/math_private.h Modified: head/lib/msun/src/e_hypotl.c ============================================================================== --- head/lib/msun/src/e_hypotl.c Sun Oct 16 05:36:23 2011 (r226411) +++ head/lib/msun/src/e_hypotl.c Sun Oct 16 05:36:39 2011 (r226412) @@ -21,13 +21,6 @@ __FBSDID("$FreeBSD$"); #include "math.h" #include "math_private.h" -#define GET_LDBL_EXPSIGN(i, v) do { \ - union IEEEl2bits uv; \ - \ - uv.e = v; \ - i = uv.xbits.expsign; \ -} while (0) - #define GET_LDBL_MAN(h, l, v) do { \ union IEEEl2bits uv; \ \ @@ -36,14 +29,6 @@ __FBSDID("$FreeBSD$"); l = uv.bits.manl; \ } while (0) -#define SET_LDBL_EXPSIGN(v, i) do { \ - union IEEEl2bits uv; \ - \ - uv.e = v; \ - uv.xbits.expsign = i; \ - v = uv.e; \ -} while (0) - #undef GET_HIGH_WORD #define GET_HIGH_WORD(i, v) GET_LDBL_EXPSIGN(i, v) #undef SET_HIGH_WORD Modified: head/lib/msun/src/math_private.h ============================================================================== --- head/lib/msun/src/math_private.h Sun Oct 16 05:36:23 2011 (r226411) +++ head/lib/msun/src/math_private.h Sun Oct 16 05:36:39 2011 (r226412) @@ -188,6 +188,25 @@ do { \ (d) = sf_u.value; \ } while (0) +/* Get expsign as a 16 bit int from a long double. */ + +#define GET_LDBL_EXPSIGN(i,d) \ +do { \ + union IEEEl2bits ge_u; \ + ge_u.e = (d); \ + (i) = ge_u.xbits.expsign; \ +} while (0) + +/* Set expsign of a long double from a 16 bit int. */ + +#define SET_LDBL_EXPSIGN(d,v) \ +do { \ + union IEEEl2bits se_u; \ + se_u.e = (d); \ + se_u.xbits.expsign = (v); \ + (d) = se_u.e; \ +} while (0) + #ifdef FLT_EVAL_METHOD /* * Attempt to get strict C99 semantics for assignment with non-C99 compilers.