I am writing a program which uses sqrt() a lot. A historically very slow
function but I read on CPUs with SSE support this is actually fast. Problem:
C's sqrt() (unlike C++ sqrt()) is defined to work on doubles only, and early
versions of SSE did not support double precision. The CPU requirement
"something with at least first generation SEE support" (everything from
P3/Athlon XP and up) is acceptable for me. However, requiring a CPU which
supports double precision SSE is too much.
Is there any work around for this problem? (except for switching to C++)
For those who will certainly complain that discussing the use of CPU
specific instructions is OT here - I say this question is on topic here
because my problem is caused by the C standard which only features double
precision sqrt() and thus does not allow me to exploit the capabilities of
the target CPUs.
function but I read on CPUs with SSE support this is actually fast. Problem:
C's sqrt() (unlike C++ sqrt()) is defined to work on doubles only, and early
versions of SSE did not support double precision. The CPU requirement
"something with at least first generation SEE support" (everything from
P3/Athlon XP and up) is acceptable for me. However, requiring a CPU which
supports double precision SSE is too much.
Is there any work around for this problem? (except for switching to C++)
For those who will certainly complain that discussing the use of CPU
specific instructions is OT here - I say this question is on topic here
because my problem is caused by the C standard which only features double
precision sqrt() and thus does not allow me to exploit the capabilities of
the target CPUs.
Comment