equal
deleted
inserted
replaced
332 #define CPU_AVX512VL ((uint64_t)UCONST64(0x200000000)) // EVEX instructions with smaller vector length |
332 #define CPU_AVX512VL ((uint64_t)UCONST64(0x200000000)) // EVEX instructions with smaller vector length |
333 #define CPU_SHA ((uint64_t)UCONST64(0x400000000)) // SHA instructions |
333 #define CPU_SHA ((uint64_t)UCONST64(0x400000000)) // SHA instructions |
334 #define CPU_FMA ((uint64_t)UCONST64(0x800000000)) // FMA instructions |
334 #define CPU_FMA ((uint64_t)UCONST64(0x800000000)) // FMA instructions |
335 #define CPU_VZEROUPPER ((uint64_t)UCONST64(0x1000000000)) // Vzeroupper instruction |
335 #define CPU_VZEROUPPER ((uint64_t)UCONST64(0x1000000000)) // Vzeroupper instruction |
336 #define CPU_AVX512_VPOPCNTDQ ((uint64_t)UCONST64(0x2000000000)) // Vector popcount |
336 #define CPU_AVX512_VPOPCNTDQ ((uint64_t)UCONST64(0x2000000000)) // Vector popcount |
|
337 #define CPU_VPCLMULQDQ ((uint64_t)UCONST64(0x4000000000)) //Vector carryless multiplication |
337 |
338 |
338 enum Extended_Family { |
339 enum Extended_Family { |
339 // AMD |
340 // AMD |
340 CPU_FAMILY_AMD_11H = 0x11, |
341 CPU_FAMILY_AMD_11H = 0x11, |
341 // ZX |
342 // ZX |
540 result |= CPU_AVX512BW; |
541 result |= CPU_AVX512BW; |
541 if (_cpuid_info.sef_cpuid7_ebx.bits.avx512vl != 0) |
542 if (_cpuid_info.sef_cpuid7_ebx.bits.avx512vl != 0) |
542 result |= CPU_AVX512VL; |
543 result |= CPU_AVX512VL; |
543 if (_cpuid_info.sef_cpuid7_ecx.bits.avx512_vpopcntdq != 0) |
544 if (_cpuid_info.sef_cpuid7_ecx.bits.avx512_vpopcntdq != 0) |
544 result |= CPU_AVX512_VPOPCNTDQ; |
545 result |= CPU_AVX512_VPOPCNTDQ; |
|
546 if (_cpuid_info.sef_cpuid7_ecx.bits.vpclmulqdq != 0) |
|
547 result |= CPU_VPCLMULQDQ; |
545 } |
548 } |
546 } |
549 } |
547 if(_cpuid_info.sef_cpuid7_ebx.bits.bmi1 != 0) |
550 if(_cpuid_info.sef_cpuid7_ebx.bits.bmi1 != 0) |
548 result |= CPU_BMI1; |
551 result |= CPU_BMI1; |
549 if (_cpuid_info.std_cpuid1_edx.bits.tsc != 0) |
552 if (_cpuid_info.std_cpuid1_edx.bits.tsc != 0) |
817 static bool supports_avxonly() { return ((supports_avx2() || supports_avx()) && !supports_evex()); } |
820 static bool supports_avxonly() { return ((supports_avx2() || supports_avx()) && !supports_evex()); } |
818 static bool supports_sha() { return (_features & CPU_SHA) != 0; } |
821 static bool supports_sha() { return (_features & CPU_SHA) != 0; } |
819 static bool supports_fma() { return (_features & CPU_FMA) != 0 && supports_avx(); } |
822 static bool supports_fma() { return (_features & CPU_FMA) != 0 && supports_avx(); } |
820 static bool supports_vzeroupper() { return (_features & CPU_VZEROUPPER) != 0; } |
823 static bool supports_vzeroupper() { return (_features & CPU_VZEROUPPER) != 0; } |
821 static bool supports_vpopcntdq() { return (_features & CPU_AVX512_VPOPCNTDQ) != 0; } |
824 static bool supports_vpopcntdq() { return (_features & CPU_AVX512_VPOPCNTDQ) != 0; } |
|
825 static bool supports_vpclmulqdq() { return (_features & CPU_VPCLMULQDQ) != 0; } |
822 |
826 |
823 // Intel features |
827 // Intel features |
824 static bool is_intel_family_core() { return is_intel() && |
828 static bool is_intel_family_core() { return is_intel() && |
825 extended_cpu_family() == CPU_FAMILY_INTEL_CORE; } |
829 extended_cpu_family() == CPU_FAMILY_INTEL_CORE; } |
826 |
830 |