[LLVMdev] SIMD trigonometry/logarithms?

Peter Newman peter at uformia.com
Sun Jan 27 22:06:32 PST 2013

On 28/01/2013 12:49 AM, Hal Finkel wrote:
> Ralf Karrenberg had implemented some of these as part of his
> whole-function vectorization project:
> https://github.com/karrenberg/wfv/blob/master/src/utils/nativeSSEMathFunctions.hpp
> https://github.com/karrenberg/wfv/blob/master/src/utils/nativeAVXMathFunctions.hpp
> Opinions on pulling these into the X86 backend? -Hal

I've actually been considering doing the same as these for our project
(using the same reference implementation by Julien Pommier). We use math
functions a lot in our code so any performance gain would be useful.

However, accuracy is quite important in our case, so we would want any
implementation to at least match the accuracy of the current
implementation. On X86 (at least in LLVM 2.8 which we currently use),
the sin/cos intrinsics end up using the X87 fpsin instruction. On Win32,
the system provided sin function also ends up using the same assembly

Peter N

More information about the llvm-dev mailing list