On Mon, 28 Oct 2002, M. Warner Losh wrote: > In message: <[EMAIL PROTECTED]> > Loren James Rittle <[EMAIL PROTECTED]> 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. <float.h> 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 <float.h>: > : > : #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 [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message