aboutsummaryrefslogtreecommitdiff
path: root/core/sys/info
diff options
context:
space:
mode:
authorBarinzaya <barinzaya@gmail.com>2024-10-14 09:09:14 -0400
committerBarinzaya <barinzaya@gmail.com>2024-10-14 09:13:27 -0400
commitff35a59548d12df4c0a51e991b70c85063ead639 (patch)
tree03ff2c9806a8076b5ed3a727eacde41e99850aa0 /core/sys/info
parentc93923c9f7609529304dcebab5005ea172cac4ae (diff)
Fixed a theoretical edge case in AVX512VL support detection.
Diffstat (limited to 'core/sys/info')
-rw-r--r--core/sys/info/cpu_intel.odin6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/sys/info/cpu_intel.odin b/core/sys/info/cpu_intel.odin
index d8ef21473..44272d93b 100644
--- a/core/sys/info/cpu_intel.odin
+++ b/core/sys/info/cpu_intel.odin
@@ -128,7 +128,11 @@ init_cpu_features :: proc "c" () {
try_set(&set, .avx512_er, 27, ebx7)
try_set(&set, .avx512_cd, 28, ebx7)
try_set(&set, .avx512_bw, 30, ebx7)
- try_set(&set, .avx512_vl, 31, ebx7)
+
+ // XMM/YMM are also required for 128/256-bit instructions
+ if os_supports_avx {
+ try_set(&set, .avx512_vl, 31, ebx7)
+ }
try_set(&set, .avx512_vbmi, 1, ecx7)
try_set(&set, .avx512_vbmi2, 6, ecx7)