Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Feb 2003 22:10:53 -0800
From:      David Schultz <dschultz@uclink.Berkeley.EDU>
To:        Mike Barcroft <mike@FreeBSD.ORG>
Cc:        Dag-Erling Smorgrav <des@ofug.org>, Kris Kennaway <kris@obsecurity.org>, standards@FreeBSD.ORG
Subject:   Re: -fno-builtin world breaks in gperf
Message-ID:  <20030218061053.GB10838@HAL9000.homeunix.com>
In-Reply-To: <20030217224840.L74149@espresso.bsdmike.org>
References:  <xzp1y2755jc.fsf@flood.ping.uio.no> <20030217213405.GB71679@rot13.obsecurity.org> <xzp8ywezc7z.fsf@flood.ping.uio.no> <20030217193655.I74149@espresso.bsdmike.org> <20030217224840.L74149@espresso.bsdmike.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Thus spake Mike Barcroft <mike@FreeBSD.ORG>:
> Mike Barcroft <mike@FreeBSD.org> writes:
> > Dag-Erling Smorgrav <des@ofug.org> writes:
> > > Kris Kennaway <kris@obsecurity.org> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030218061053.GB10838>