First off, is anyone working on providing GCC or libm with a (complete) set of C99 math functions with SSE/SSE2 calling conventions? If not, I will start with something like the following plan:
1. There is already support for switching the ABI function-wise in the backend for local static functions. As a first step I'd like to expose this functionality as a function attribute. 2. In the -mfpmath=sse case I'd like to attach this attribute to GCCs builtin math functions, either dependent on availability of such function in libgcc(?) or glibc libm (detected by some configure magic). 3. Emit calls to alternate the functions during RTL expansion, possibly following the naming scheme from the Intel compiler (to be able to use their libm replacement for testing). 4. Provide either libgcc or libm with SSE/SSE2 implementations for the math functions, possibly with both ABIs as entry point. 5. Eventually provide GCC with RTL inline intrinsics for commonly used math functions in the -ffast-math case. Does this sound reasonable and profitable? As far as I see glibc libm currently has no SSE/SSE2 implementations, neither for amd64 nor for ia32. Thanks, Richard.