This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [PATCH] x87 constants for doubles with -ffast-math



On Sunday, Jun 29, 2003, at 13:52 US/Eastern, Roger Sayle wrote:



The following patch extends GCC's use of the x87's instructions to load special floating point constants, for example "fldpi". These instructions load the long double (XFmode) precision representation of these constants, and so can't normally be used when working with floats or doubles.

For this reason, GCC currently will generate a "fldpi" instruction
to implement "4*atanl(1)", but won't use it to implement the double
form, i.e. "4*atan(1)", with or without -ffast-math.

The following potentially controversial patch to the i386 backend,
allows the float and double rounded forms of these constants to be
approximated with extra precision when flag_unsafe_math_optimizations
is specified.  I hope this interpretation is reasonable.

The only other tweak in this patch is to use these short instructions
when optimizing for size, even on CPUs where loading the constant from
a constant pool may be faster.


The following patch has been tested on i686-pc-linux-gnu with a full "make bootstrap", all languages except treelang, and regression tested with a top-level "make -k check" with no new failures.

Ok for mainline?


Does this fix the ICE in PR10979 which is for atan2?

Thanks,
Andrew Pinski


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