Reputation: 12963
I'm under the impression that conversions back and forth between these two representations are not expensive operations on modern hardware, is this true?
Upvotes: 2
Views: 139
Reputation: 52679
Intel says that it can be rather expensive (on a Pentium 4 with Visual C++ 6), but using Intels' VTune performance analyser, you can turn the heavy, slow, _ftol call with a single FISTP FPU instruction for a 5x performance gain.
Then they say that enabling SSE2 instructions will give you an 11x performance gain, but I hear that has a high latency penatly. There's further speed up for using SSE3.
So, I'm not sure what the performance is like nowadays, although I think SSE2 is enabled by default in VC++, I'm pretty sure it is in GCC.
Upvotes: 1