I am trying to figure out why g++ does not generate a SIMD code.
Info GCC / OS / CPU:
$ gcc -v
gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
$ cat /proc/c
-march=core2
means that gcc can assume (along with 64 bit ISA) up to SSSE3 (e.g., MMX, SSE, SSE2, SSE3) is available.
-mfpmath=sse
can then force the use of SSE for floating-point arithmetic (the default in 64-bit mode), rather than 387 (the default in 32-bit -m32
mode).
See: "Intel 386 and AMD x86-64 Options" section in the man page.
Unfortunately, you still have the limitations of 32-bit mode and a 32-bit ABI. e.g., only registers XMM0 .. XMM7
are available; XMM8 .. XMM15
are only available in 64 bit mode.