There's something I've noticed when profiling a VS2013 program with VTune that I haven't been able to find a proper explanation for.
Essentially, one of the non-negligible hotspots for the program are the mathematical functions. cos
, sin
, sqrt
, etc. We do a lot of math calculations.
However, in the win32 build, the functions that are called are libm_sse2_cosprecise
, libm_sse2_sqrtprecise
, etc. In x64, cos
, sin
, etc. are called. It turns out that performance is slower in x64 than in win32 for all the mathematical functions.
Compiler settings are near identical between 32 and 64-bit builds, the only differences should have no impact on math functions. We use double-precision most of the time.
So why are the 64-bit math functions slower? Why isn't this documented somewhere? Did I miss anything? Am I not understanding something properly?
The only information I could really find on intrinsics for math functions in Microsoft's documentation (which is rather lacking on this topic, I feel), is this page
Since we use the default floating-point accuracy (which should be fp-precise
), this wouldn't apply in our case, even with /O2
enabled, if I understood correctly. (Enabling intrinsic functions is off in our latest tests, btw). Besides, it wouldn't explain why 32 and 64-bit outputs differ...
Any information or pointers would be appreciated.