Skip to content

Commit

Permalink
lib/x86: fix XCR0 check for AVX-512VL
Browse files Browse the repository at this point in the history
According to the Intel manual, the ZMM_Hi256 bit needs to be checked for
all AVX-512 instructions, even if 512-bit vectors aren't being used.
  • Loading branch information
ebiggers committed Feb 24, 2024
1 parent ea028f1 commit 5b217a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/x86/cpu_features.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void libdeflate_init_x86_cpu_features(void)
features |= X86_CPU_FEATURE_ZMM;
if ((b & (1 << 16)) && ((xcr0 & 0xe6) == 0xe6))
features |= X86_CPU_FEATURE_AVX512F;
if ((b & (1U << 31)) && ((xcr0 & 0xa6) == 0xa6))
if ((b & (1U << 31)) && ((xcr0 & 0xe6) == 0xe6))
features |= X86_CPU_FEATURE_AVX512VL;
if ((c & (1 << 10)) && ((xcr0 & 0x6) == 0x6))
features |= X86_CPU_FEATURE_VPCLMULQDQ;
Expand Down

0 comments on commit 5b217a1

Please sign in to comment.