This is the mail archive of the
mailing list for the GCC project.
Re: FLT_ROUNDS not always 1?
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Stan Shebs <shebs at apple dot com>, <gcc at gcc dot gnu dot org>
- Date: Tue, 26 Feb 2002 09:31:58 +0000 (GMT)
- Subject: Re: FLT_ROUNDS not always 1?
On Mon, 25 Feb 2002, Richard Henderson wrote:
> > Or is it just that systems that implement fesetround need to have
> > their own config/float-foo.h that defines FLT_ROUNDS in a non-constant
> > way, and no one has done this correctly yet?
> Actually, it would be trivial to add one that uses fegetround,
> which will work everywhere that actually has fesetround.
fegetround is in the application namespace, for C90.
To avoid a proliferation of float.h headers, I think we could use two
predefined preprocessor macros, __FLT_ROUNDS (which is the value of
FLT_ROUNDS, e.g. a function call) and __FLT_ROUNDS_DECL (which declares
any functions - in the implementation namespace - called by __FLT_ROUNDS -
unless they are __builtin functions). Appropriate definitions might allow
us to get rid of some of the cases where we currently use the system
float.h (which doesn't support C99) rather than ours.
Joseph S. Myers