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]
Other format: [Raw text]

Define __NO_MATH_INLINES for x86 -ffast-math?


Hello!

I have tripped over a problem, where #defines from libc
(bits/mathinline.h) interfere badly with gcc's intrinsics.

The problem (note the #include):

--cut here--
#include <math.h>

double test (double x)
{
  return ceil(x);
}
--cut here--

when compiled with -O2 -ffast-math -msse2 -mfpmath=sse, compiles to
asm that involves x87 insns from mathinline.h. Adding
-D__NO_MATH_INLINES compiles to expected SSE code.

As recent gcc implements all libc math intrinsics as its own builtin
intrinsics, and due to the above interference, I'd like to propose
that gcc defines __NO_MATH_INLINES on x86_32 target for -ffast-math,
for both -mfpmath=sse and -mfpmath=x87.

Uros.


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