This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: alternative to -ffloat-store on x86?


Interesting info from http://math.nist.gov/javanumerics/jgfnwg-01.html:

... x86 processors most naturally operate on 80-bit double extended
floating-point values. A precision control word can be set to make the
processor round to single or double precision. However, even when rounding
to a reduced precision, the floating-point registers still use the full 15
exponent bits of the double extended format (instead of the 11 exponent
bits for true double and 8 bits for true float). A store to memory is
required to narrow the exponent as well ...

Recently, a refinement of the store-reload technique that eliminates the
double rounding problem has been developed [Gol98]. To avoid double
rounding during multiplication, the new technique scales down one of the
operands by 2^(Emax (double extended) - Emax (double)) where Emax is the
largest exponent for a given floating point format. After this scaling, all
operations that would result in subnormals in true double also result in
subnormals in double with extended exponent range. This result is then
rescaled back up by the same quantity; normal results are unaffected and
subnormals are properly rounded once. A store of the product after being
scaled enforces the overflow threshold.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]