From owner-freebsd-numerics@FreeBSD.ORG  Sun Aug 12 22:58:35 2012
Return-Path: <owner-freebsd-numerics@FreeBSD.ORG>
Delivered-To: freebsd-numerics@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 09727106564A
	for <freebsd-numerics@freebsd.org>;
	Sun, 12 Aug 2012 22:58:35 +0000 (UTC)
	(envelope-from peter@rulingia.com)
Received: from vps.rulingia.com (host-122-100-2-194.octopus.com.au
	[122.100.2.194])
	by mx1.freebsd.org (Postfix) with ESMTP id 96B518FC14
	for <freebsd-numerics@freebsd.org>;
	Sun, 12 Aug 2012 22:58:34 +0000 (UTC)
Received: from server.rulingia.com
	(c220-239-249-137.belrs5.nsw.optusnet.com.au [220.239.249.137])
	by vps.rulingia.com (8.14.5/8.14.5) with ESMTP id q7CMwY8W075534
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <freebsd-numerics@freebsd.org>;
	Mon, 13 Aug 2012 08:58:34 +1000 (EST)
	(envelope-from peter@rulingia.com)
X-Bogosity: Ham, spamicity=0.000000
Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1])
	by server.rulingia.com (8.14.5/8.14.5) with ESMTP id q7CMwSDk020953
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <freebsd-numerics@freebsd.org>;
	Mon, 13 Aug 2012 08:58:28 +1000 (EST)
	(envelope-from peter@server.rulingia.com)
Received: (from peter@localhost)
	by server.rulingia.com (8.14.5/8.14.5/Submit) id q7CMwS4j020952
	for freebsd-numerics@freebsd.org; Mon, 13 Aug 2012 08:58:28 +1000 (EST)
	(envelope-from peter)
Resent-From: Peter Jeremy <peter@rulingia.com>
Resent-Date: Mon, 13 Aug 2012 08:58:28 +1000
Resent-Message-ID: <20120812225828.GO20453@server.rulingia.com>
Resent-To: freebsd-numerics@freebsd.org
Received: from vps.rulingia.com (host-122-100-2-194.octopus.com.au
	[122.100.2.194])
	by server.rulingia.com (8.14.5/8.14.5) with ESMTP id q6K4U9Tk025066
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <peter@home.rulingia.com>; Fri, 20 Jul 2012 14:30:10 +1000 (EST)
	(envelope-from sgk@troutmask.apl.washington.edu)
Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu
	[128.95.76.21])
	by vps.rulingia.com (8.14.5/8.14.5) with ESMTP id q6K4U6Lg085380
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <peter@rulingia.com>; Fri, 20 Jul 2012 14:30:08 +1000 (EST)
	(envelope-from sgk@troutmask.apl.washington.edu)
Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu
	[127.0.0.1])
	by troutmask.apl.washington.edu (8.14.5/8.14.5) with ESMTP id
	q6K4U5gK007441; Thu, 19 Jul 2012 21:30:05 -0700 (PDT)
	(envelope-from sgk@troutmask.apl.washington.edu)
Received: (from sgk@localhost)
	by troutmask.apl.washington.edu (8.14.5/8.14.5/Submit) id
	q6K4U4B9007440; Thu, 19 Jul 2012 21:30:04 -0700 (PDT)
	(envelope-from sgk)
From: Steve Kargl <sgk@troutmask.apl.washington.edu>
Mail-Followup-To: freebsd-numerics@freebsd.org
To: Bruce Evans <brde@optusnet.com.au>
Message-ID: <20120720043004.GA7404@troutmask.apl.washington.edu>
References: <20120717040118.GA86840@troutmask.apl.washington.edu>
	<20120717042125.GF66913@server.rulingia.com>
	<20120717043848.GB87001@troutmask.apl.washington.edu>
	<20120717225328.GA86902@server.rulingia.com>
	<20120717232740.GA95026@troutmask.apl.washington.edu>
	<20120718001337.GA87817@server.rulingia.com>
	<20120718123627.D1575@besplex.bde.org>
	<20120719213944.GA21199@server.rulingia.com>
	<20120719234425.GA6280@troutmask.apl.washington.edu>
	<20120720130309.P814@besplex.bde.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20120720130309.P814@besplex.bde.org>
User-Agent: Mutt/1.4.2.3i
Cc: Diane Bruce <db@db.net>, John Baldwin <jhb@freebsd.org>,
	David Chisnall <theraven@freebsd.org>,
	Stephen Montgomery-Smith <stephen@missouri.edu>,
	Bruce Evans <bde@freebsd.org>, David Schultz <das@freebsd.org>,
	Peter Jeremy <peter@rulingia.com>, Warner Losh <imp@bsdimp.com>
Subject: Re: Use of C99 extra long double math functions after r236148
X-BeenThere: freebsd-numerics@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "Discussions of high quality implementation of libm functions."
	<freebsd-numerics.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-numerics>, 
	<mailto:freebsd-numerics-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-numerics>
List-Post: <mailto:freebsd-numerics@freebsd.org>
List-Help: <mailto:freebsd-numerics-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-numerics>, 
	<mailto:freebsd-numerics-request@freebsd.org?subject=subscribe>
Date: Sun, 12 Aug 2012 22:58:35 -0000
X-Original-Date: Thu, 19 Jul 2012 21:30:04 -0700
X-List-Received-Date: Sun, 12 Aug 2012 22:58:35 -0000

On Fri, Jul 20, 2012 at 02:12:20PM +1000, Bruce Evans wrote:
> On Thu, 19 Jul 2012, Steve Kargl wrote:
> 
> >I collected some of the float and double into a cheat sheet.
> >
> >Idioms used in libm with float type:
> >
> > int32_t xsb;
> > u_int32_t hx;
> >
> > GET_FLOAT_WORD(hx, x);
> >
> > /* Get the sign bit of x */
> > xsb = (hx >> 31) & 1;
> 
> Getting it without shifting it (hx & 0x8000) is more efficient and common.
> You don't need to shift it in this example.

I collected these from msun/src, when I was trying to understand
the magic numbers.  I suppose someone should audit the code for
consistency. :-)

laptop:kargl[219] grep " (hx>>31)&1" *c
e_exp.c:        xsb = (hx>>31)&1;               /* sign bit of x */
e_expf.c:       xsb = (hx>>31)&1;               /* sign bit of x */

-- 
Steve