microsoft / DirectXMath

DirectXMath is an all inline SIMD C++ linear algebra library for use in games and graphics apps

Home Page:https://walbourn.github.io/introducing-directxmath/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Optimise 'XMVectorSin/Cos/SinEst/CosEst/SinCos/SinCosEst' with FMA

john-h-k opened this issue · comments

None of them currently use it for the polynomial approximation (appears tan does), but with slight rearrangement of the constant FMA can be used to accelerate the x64 pathway. I saw a speedup of roughly 6.5ns->4.8ns when using FMA with Sin

Thanks. I'll take a look at this for AVX2 improvements in a future release.

XMVectorTan is implemented in terms of other DirectXMath functions which is why it ends up using FMA3 with /arch:AVX2. The Sin/Cos are implemented directly in platform intrinsics so I need to review those.