fenv.h fixes for softfloat
freebsd at damnhippie.dyndns.org
Fri Jan 20 15:05:41 UTC 2012
On Tue, 2012-01-17 at 15:15 -0500, David Schultz wrote:
> If declaring the flags variable volatile is enough to get things
> working, more or less, then perhaps we ought to do that until we
> have a real 21st-century compiler.
I've been pondering this for a couple days, and I think it's probably a
good idea. The problem seems to be that the compiler and optimizer are
unaware of the fact that the fenv stuff can change across certain
operations, and 'volatile' tells the compiler exactly "this value can
change in ways you are unaware of." I can't think of any downside other
than trying to figure out/remember 5 years from now why the variable is
volatile, and that can be fixed with a little comment nearby.
Oh, another thing I've been meaning to mention... Doesn't the mips
platform also use software floating point? If so, then I think
libc/mips/gen/flt_rounds.c needs to be modified to look more like the
one I did for arm, with separate software and hardware implementations.
More information about the freebsd-arm