GCC -msse2 does not generate SIMD code

前端 未结 1 1230
灰色年华
灰色年华 2021-01-24 04:49

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         


        
相关标签:
1条回答
  • 2021-01-24 05:35

    -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.

    0 讨论(0)
提交回复
热议问题