Some math functions of the C library checks what kind of CPU is running.
First there is a dispatch routine from a file called "
disp_pentium4.inc". It checks if the variable ___use_sse2_mathfcns has been set; if so, calls __sin_pentium4, otherwise calls __sin_default.
__sin_pentium4 (in "sin_pentium4.asm") starts by transferring the argument from the x87 fpu to the xmm0 register, performs the calculation using SSE2 instructions, and loads the result back in the fpu.
__sin_default (in "sin.asm") keeps the variable on the x87 stack and simply calls fsin.
Take a look:
http://stackoverflow.com/questions/15314390/how-to-determine-whether-c-math-uses-sse2#comment21619787_15314390[
^]
The following functions have SSE2 implementations that can be enabled by using _set_SSE2_enable(
[
^]):
atan
ceil
exp
floor
log
log10
modf
pow