summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Rowley <[email protected]>2017-07-19 14:18:49 -0500
committerEmil Velikov <[email protected]>2017-08-03 00:19:06 +0100
commit57bf8e1cd808e7333ca47289621b993bf199ddd6 (patch)
treeff517d6431fa356395e1f1ddea516f197973cba9
parente0951c67f4401a206db5e94d77dc67dfccf88010 (diff)
gallium/util: fix nondeterministic avx512 detection
cpuid.7 requires cx=0 to select the extended feature leaf. avx512 detection was using the non-indexed cpuid resulting in random non-detection of avx512. Cc: [email protected] Reviewed-by: Roland Scheidegger <[email protected]> (cherry picked from commit 131b9f644cbe70728ba02878483e22459400bcb4)
-rw-r--r--src/gallium/auxiliary/util/u_cpu_detect.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/util/u_cpu_detect.c b/src/gallium/auxiliary/util/u_cpu_detect.c
index 845fc6b34d5..e6c41b4d4ce 100644
--- a/src/gallium/auxiliary/util/u_cpu_detect.c
+++ b/src/gallium/auxiliary/util/u_cpu_detect.c
@@ -393,7 +393,7 @@ util_cpu_detect(void)
(xgetbv() & (0x7 << 5)) && // OPMASK: upper-256 enabled by OS
((xgetbv() & 6) == 6)) { // XMM/YMM enabled by OS
uint32_t regs3[4];
- cpuid(0x00000007, regs3);
+ cpuid_count(0x00000007, 0x00000000, regs3);
util_cpu_caps.has_avx512f = (regs3[1] >> 16) & 1;
util_cpu_caps.has_avx512dq = (regs3[1] >> 17) & 1;
util_cpu_caps.has_avx512ifma = (regs3[1] >> 21) & 1;