How to test if your Linux Support SSE2

后端 未结 5 872
迷失自我
迷失自我 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

    use asm to check the existence of sse2

    enter code here
    static
    bool HaveSSE2()
    {
        return false;
        __asm mov EAX,1              ;
        __asm cpuid                  ;
        __asm test EDX, 4000000h     ;test whether bit 26 is set
        __asm jnz yes                ;yes
        return false;
    yes:
        return true;
    }
    

提交回复
热议问题