I have a C++ program that is doing a lot of math (mostly calls to sin(), sqrt() and so regular operations). I know that in theory enabling -msse, -msse2, and -mfpmath=sse should expose more registers for GCC/G++ to use therefor potentially making my program run faster, in practice will it always do so? In the worst case could it make my code run slower?
Share
When worried about performance, you should always profile.
SSE instructions use different CPU resources, so they could cause a decrease in performance (e.g. because those resources are not available for Hyperthreading), but in real life this should be very rare indeed.