FLT_ROUNDS not always 1?
Joseph S. Myers
jsm28@cam.ac.uk
Tue Feb 26 03:06:00 GMT 2002
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?
>
> Correct.
>
> 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
jsm28@cam.ac.uk
More information about the Gcc
mailing list