How to test if your Linux Support SSE2

后端 未结 5 877
迷失自我
迷失自我 2021-02-04 06:17

Actually I have 2 questions:

  1. Is SSE2 Compatibility a CPU issue or Compiler issue?
  2. How to check if your CPU or Compiler support SSE2?

I am u

5条回答
  •  余生分开走
    2021-02-04 06:42

    Another trick not yet mentioned is do:

    gcc -march=native -dM -E - 

    and get:

    #define __SSE2_MATH__ 1
    #define __SSE2__ 1
    

    With -march=native you are checking both your compiler and your CPU. If you give a different -march for a specific CPU, like -march=bonnell you can check for that CPU.

    Consult your gcc docs for the correct version of gcc:

    https://gcc.gnu.org/onlinedocs/gcc-4.9.0/gcc/Submodel-Options.html

提交回复
热议问题