diff options
author | Frank Barchard <fbarchard@google.com> | 2017-11-06 12:29:30 -0800 |
---|---|---|
committer | Frank Barchard <fbarchard@google.com> | 2017-11-07 00:56:37 +0000 |
commit | 522fd699e6753edb810bccb3e75d620237e2da45 (patch) | |
tree | 5f595e37ac35a92b35c24ae42821d50708d18989 /source/cpu_id.cc | |
parent | afa98e1f0870af15fb4125eb5beda6727df35ad6 (diff) | |
download | libyuv-522fd699e6753edb810bccb3e75d620237e2da45.tar.gz |
AVX512 feature detects for cnl and icl
Key instruction sets added for each microarchitecture:
AVX512BW, AVX512VL, AVX512DQ - skylake server or later
AVX512_VBMI, AVX512_IFMA - cannon lake or later
AVX512_BITALG, AVX512_VBMI2, AVX512_VPOPCNTDQ, AVX512_VNNI, GFNI, VAES, VPCLMULQDQ - ice lake or later
Bug: libyuv:752
Test: ~/intelsde/sde -icl -- out/Release/libyuv_unittest --gtest_filter=*Cpu*
Change-Id: I9ee28904c90009d66721b9f805a440c5fc2da122
Reviewed-on: https://chromium-review.googlesource.com/755617
Reviewed-by: Frank Barchard <fbarchard@google.com>
Reviewed-by: richard winterton <rrwinterton@gmail.com>
Diffstat (limited to 'source/cpu_id.cc')
-rw-r--r-- | source/cpu_id.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/source/cpu_id.cc b/source/cpu_id.cc index d9bb9ec3..7b979703 100644 --- a/source/cpu_id.cc +++ b/source/cpu_id.cc @@ -242,10 +242,17 @@ static SAFEBUFFERS int GetCpuFlags(void) { // Detect AVX512bw if ((GetXCR0() & 0xe0) == 0xe0) { - cpu_info |= (cpu_info7[1] & 0x40000000) ? kCpuHasAVX3 : 0; + cpu_info |= (cpu_info7[1] & 0x40000000) ? kCpuHasAVX512BW : 0; + cpu_info |= (cpu_info7[1] & 0x80000000) ? kCpuHasAVX512VL : 0; + cpu_info |= (cpu_info7[2] & 0x00000002) ? kCpuHasAVX512VBMI: 0; + cpu_info |= (cpu_info7[2] & 0x00000040) ? kCpuHasAVX512VBMI2: 0; + cpu_info |= (cpu_info7[2] & 0x00001000) ? kCpuHasAVX512VBITALG: 0; + cpu_info |= (cpu_info7[2] & 0x00004000) ? kCpuHasAVX512VPOPCNTDQ: 0; + cpu_info |= (cpu_info7[2] & 0x00000100) ? kCpuHasGFNI: 0; } } + // TODO(fbarchard): Consider moving these to gtest // Environment variable overrides for testing. if (TestEnv("LIBYUV_DISABLE_X86")) { cpu_info &= ~kCpuHasX86; @@ -274,12 +281,12 @@ static SAFEBUFFERS int GetCpuFlags(void) { if (TestEnv("LIBYUV_DISABLE_FMA3")) { cpu_info &= ~kCpuHasFMA3; } - if (TestEnv("LIBYUV_DISABLE_AVX3")) { - cpu_info &= ~kCpuHasAVX3; - } if (TestEnv("LIBYUV_DISABLE_F16C")) { cpu_info &= ~kCpuHasF16C; } + if (TestEnv("LIBYUV_DISABLE_AVX512BW")) { + cpu_info &= ~kCpuHasAVX512BW; + } #endif #if defined(__mips__) && defined(__linux__) |