(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
i386/
avx-os-support.h
       1  /* Check if the OS supports executing AVX instructions.  */
       2  
       3  #define XCR_XFEATURE_ENABLED_MASK	0x0
       4  
       5  #define XSTATE_FP	0x1
       6  #define XSTATE_SSE	0x2
       7  #define XSTATE_YMM	0x4
       8  
       9  static int
      10  avx_os_support (void)
      11  {
      12    unsigned int eax, edx;
      13    unsigned int ecx = XCR_XFEATURE_ENABLED_MASK;
      14  
      15    __asm__ ("xgetbv" : "=a" (eax), "=d" (edx) : "c" (ecx));
      16  
      17    return (eax & (XSTATE_SSE | XSTATE_YMM)) == (XSTATE_SSE | XSTATE_YMM);
      18  }