diff options
author | Marat Dukhan <marat@fb.com> | 2017-10-13 07:10:25 -0700 |
---|---|---|
committer | Marat Dukhan <marat@fb.com> | 2017-10-13 07:10:25 -0700 |
commit | 861d21a1cedc0ee7c7263aca1ead7ee356d55a22 (patch) | |
tree | e940a1a30abae7f9cedc938ffee99250a1ebc1e2 /include | |
parent | ca67e696a5164ea6fe77c7510c55665197e64915 (diff) | |
download | cpuinfo-861d21a1cedc0ee7c7263aca1ead7ee356d55a22.tar.gz |
Detect new x86 ISA extensions: VAES, VPCLMULQDQ, GFNI, AVX512VBMI2, AVX512BITALG, AVX512VNNI
Diffstat (limited to 'include')
-rw-r--r-- | include/cpuinfo.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/include/cpuinfo.h b/include/cpuinfo.h index 2b1c60a..10470cd 100644 --- a/include/cpuinfo.h +++ b/include/cpuinfo.h @@ -546,7 +546,10 @@ void CPUINFO_ABI cpuinfo_deinitialize(void); bool avx512vl; bool avx512ifma; bool avx512vbmi; + bool avx512vbmi2; + bool avx512bitalg; bool avx512vpopcntdq; + bool avx512vnni; bool avx512_4vnniw; bool avx512_4fmaps; bool hle; @@ -571,7 +574,10 @@ void CPUINFO_ABI cpuinfo_deinitialize(void); bool bmi2; bool adx; bool aes; + bool vaes; bool pclmulqdq; + bool vpclmulqdq; + bool gfni; bool rdrand; bool rdseed; bool sha; @@ -982,6 +988,22 @@ static inline bool cpuinfo_has_x86_avx512vbmi(void) { #endif } +static inline bool cpuinfo_has_x86_avx512vbmi2(void) { + #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64 + return cpuinfo_isa.avx512vbmi2; + #else + return false; + #endif +} + +static inline bool cpuinfo_has_x86_avx512bitalg(void) { + #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64 + return cpuinfo_isa.avx512bitalg; + #else + return false; + #endif +} + static inline bool cpuinfo_has_x86_avx512vpopcntdq(void) { #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64 return cpuinfo_isa.avx512vpopcntdq; @@ -990,6 +1012,14 @@ static inline bool cpuinfo_has_x86_avx512vpopcntdq(void) { #endif } +static inline bool cpuinfo_has_x86_avx512vnni(void) { + #if CPUINFO_ARCH_ARM || CPUINFO_ARCH_X86_64 + return cpuinfo_isa.avx512vnni; + #else + return false; + #endif +} + static inline bool cpuinfo_has_x86_avx512_4vnniw(void) { #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64 return cpuinfo_isa.avx512_4vnniw; @@ -1154,6 +1184,14 @@ static inline bool cpuinfo_has_x86_aes(void) { #endif } +static inline bool cpuinfo_has_x86_vaes(void) { + #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64 + return cpuinfo_isa.vaes; + #else + return false; + #endif +} + static inline bool cpuinfo_has_x86_pclmulqdq(void) { #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64 return cpuinfo_isa.pclmulqdq; @@ -1162,6 +1200,22 @@ static inline bool cpuinfo_has_x86_pclmulqdq(void) { #endif } +static inline bool cpuinfo_has_x86_vpclmulqdq(void) { + #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64 + return cpuinfo_isa.vpclmulqdq; + #else + return false; + #endif +} + +static inline bool cpuinfo_has_x86_gfni(void) { + #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64 + return cpuinfo_isa.gfni; + #else + return false; + #endif +} + static inline bool cpuinfo_has_x86_rdrand(void) { #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64 return cpuinfo_isa.rdrand; |