Commit 493155af authored by Henrik Gramner's avatar Henrik Gramner Committed by Henrik Gramner

x86: Check for BMI1 and BMI2 flags in addition to AVX2

All known AVX2-capable CPU:s has BMI1 and BMI2, but apparently some
x86 emulators can be configured to emulate esoteric combinations of
instruction sets that doesn't correspond to any existing hardware.
parent d7c3420b
Pipeline #5194 passed with stages
in 5 minutes and 39 seconds
......@@ -57,7 +57,8 @@ unsigned dav1d_get_cpu_flags_x86(void) {
if (info[2] & (1 << 28)) flags |= DAV1D_X86_CPU_FLAG_AVX;
if (n_ids >= 7) {
dav1d_cpu_cpuid(info, 7);
if (info[1] & (1 << 5)) flags |= DAV1D_X86_CPU_FLAG_AVX2;
if ((info[1] & 0x00000128) == 0x00000128)
flags |= DAV1D_X86_CPU_FLAG_AVX2;
if ((xcr & 0x000000e0) == 0x000000e0) /* ZMM/OPMASK */ {
if ((info[1] & 0xd0030000) == 0xd0030000)
flags |= DAV1D_X86_CPU_FLAG_AVX512;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment