From owner-freebsd-current Tue Oct 29 3:46:31 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 38DC937B401 for ; Tue, 29 Oct 2002 03:46:29 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 19F9E43E4A for ; Tue, 29 Oct 2002 03:46:28 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id WAA24271; Tue, 29 Oct 2002 22:40:35 +1100 Date: Tue, 29 Oct 2002 22:51:58 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: "M. Warner Losh" Cc: rittle@labs.mot.com, , , Subject: Re: Lack of real long double support In-Reply-To: <20021028.214057.108404482.imp@bsdimp.com> Message-ID: <20021029222447.L1273-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, 28 Oct 2002, M. Warner Losh wrote: > In message: <200210290211.g9T2BBcP010112@latour.rsch.comm.mot.com> > Loren James Rittle writes: > This works. I'm not sure why this isn't the default. It looks like > we have hacks in the local tree to do this, which is why I thought > that it worked great by default.... Better change FreeBSD to match the unhacked version :-). > : gcc 3.3 will support a framework in which such changes would be easy > : to convey at compile-time but, to my knowledge, there is no support > : yet to obtain e.g. the precision setting at run-time. I.e. FreeBSD (on i386's) has fpgetprec() to get it and fpsetprec() to set it, but these are nonstandard and won't become standard. They don't exist on most or all non-i386's now, unlike fpget/setround() which will become the standard feget/setround(). > : is now completely dynamically created at compile-time based on the > : exact knowledge within gcc of the FP hardware; but it is static > : w.r.t. eventual run-time. It does not know how to effectively export > : a function ala FreeBSD/alpha's : > : > : #define FLT_ROUNDS __flt_rounds() I hope an alpha person will explain the details of this. Where is the default configured? > : One issue, the standard says that various macros related to float > : limits are constant expressions (as may be used to influence the > : preprocessor?). The above construct doesn't conform but I understand > : the intent. The standard has a special exception for FLT_ROUNDS. > Yes. The standard didn't anticipate the fp hardware that intel made. Actually, it didn't support the hardware. The hardware was implemented long before the (C) standard. > One could do something like: > > #define LDBL_EPSILON (fpgetprec() == FP_PE ? _LDBL_EPSILON : DBL_EPSILON) > > But as you said, this isn't a compile time constant. I'm not sure The standard doesn't have a special exception for anything in float.h except FLT_ROUNDS :-. > that it would matter in any real context. I don't think that you can > do floating point in the preprocessor... Not in non-broken preprocessors. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message