4 ms·
Actually, if you tell the compiler to use SSE and above, it will use them extensively and even for floating point instead of x87
by rep_movsd 4y ago
Actually, if you tell the compiler to use SSE and above, it will use them extensively and even for floating point instead of x87
- josefx 4y agoYes, it will do fun things like turn 1.0f + 1.0f into (1.0f,0,0,0) + (1.0f,0,0,0), that is better than having to deal with the old floating point stack, but doesn't really exploit the full potential of SSE instructions.
- SotCodeLaureate 4y agoSSE has scalar instructions - like "addss", "subss" etc. These will be used by default (at O2 without vectorization enabled) for single-precision floating point math on x86-64 (where stack-based FPU is deprecated). Vector instructions you're referring to end with "ps", they're very unlikely to be emitted for typical fp operations.