From owner-freebsd-standards Mon Feb 17 22:10:58 2003 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7D75937B401; Mon, 17 Feb 2003 22:10:56 -0800 (PST) Received: from HAL9000.homeunix.com (12-233-57-224.client.attbi.com [12.233.57.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id AC28B43F3F; Mon, 17 Feb 2003 22:10:55 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.6/8.12.5) with ESMTP id h1I6AsQb011365; Mon, 17 Feb 2003 22:10:54 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.6/8.12.5/Submit) id h1I6Areb011364; Mon, 17 Feb 2003 22:10:53 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Date: Mon, 17 Feb 2003 22:10:53 -0800 From: David Schultz To: Mike Barcroft Cc: Dag-Erling Smorgrav , Kris Kennaway , standards@FreeBSD.ORG Subject: Re: -fno-builtin world breaks in gperf Message-ID: <20030218061053.GB10838@HAL9000.homeunix.com> Mail-Followup-To: Mike Barcroft , Dag-Erling Smorgrav , Kris Kennaway , standards@FreeBSD.ORG References: <20030217213405.GB71679@rot13.obsecurity.org> <20030217193655.I74149@espresso.bsdmike.org> <20030217224840.L74149@espresso.bsdmike.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030217224840.L74149@espresso.bsdmike.org> Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Thus spake Mike Barcroft : > Mike Barcroft writes: > > Dag-Erling Smorgrav writes: > > > Kris Kennaway writes: > > > > On Mon, Feb 17, 2003 at 03:46:15PM +0100, Dag-Erling Smorgrav wrote: > > > > > Our libm doesn't seem to support long double at all, yet our libstdc++ > > > > > requires long double support. > > > > I pointed this out a while ago..looks like no-one did anything about > > > > it yet. > > > > > > I've looked at it, and it looks Hard[tm]. The four architectures I > > > tested (alpha, ia32, ia64, sparc64) had four different representations > > > for long double: > > [...] > > > > You might want to take a look at the fpclassify() implementation. It > > doesn't look like your findings are correct. Specifically, see the > > bitfield layouts in _fpmath.h. > > > > IIRC, long doubles are as follows: > [...] > > - ia64 IEEE quad (128-bit) format > > Oops, this is actually just a double-extended 80-bit, but aligned to > 16-bytes. I'm in the progress of testing a fix for _fpmath.h. BTW, float.h for ia64 is wrong about long doubles, too. In fact, I'll bet *most* archtectures have it wrong, since they all copied from i386, and even i386 had it wrong until a few months ago. Here's the (unverified) output of 'enquire -f' on an ia64 Linux box. DECIMAL_DIG will probably need to be updated according to the formula in the standard as well. /* Number of base-FLT_RADIX digits in the significand of a long double */ #undef LDBL_MANT_DIG #define LDBL_MANT_DIG 64 /* Number of decimal digits of precision in a long double */ #undef LDBL_DIG #define LDBL_DIG 18 /* Difference between 1.0 and the minimum long double greater than 1.0 */ #undef LDBL_EPSILON #define LDBL_EPSILON 1.08420217248550443401e-19L /* Minimum int x such that FLT_RADIX**(x-1) is a normalised long double */ #undef LDBL_MIN_EXP #define LDBL_MIN_EXP (-16381) /* Minimum normalised long double */ #undef LDBL_MIN #define LDBL_MIN 3.36210314311209350626e-4932L /* Minimum int x such that 10**x is a normalised long double */ #undef LDBL_MIN_10_EXP #define LDBL_MIN_10_EXP (-4931) /* Maximum int x such that FLT_RADIX**(x-1) is a representable long double */ #undef LDBL_MAX_EXP #define LDBL_MAX_EXP 16384 /* Maximum long double */ #undef LDBL_MAX #define LDBL_MAX 1.18973149535723176502e+4932L /* Maximum int x such that 10**x is a representable long double */ #undef LDBL_MAX_10_EXP #define LDBL_MAX_10_EXP 4932 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message