Mesa (master): gallium/util: fix nondeterministic avx512 detection

Tim Rowley torowley at kemper.freedesktop.org
Wed Jul 19 20:17:42 UTC 2017


Module: Mesa
Branch: master
Commit: 131b9f644cbe70728ba02878483e22459400bcb4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=131b9f644cbe70728ba02878483e22459400bcb4

Author: Tim Rowley <timothy.o.rowley at intel.com>
Date:   Wed Jul 19 14:18:49 2017 -0500

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: mesa-stable at lists.freedesktop.org
Reviewed-by: Roland Scheidegger <sroland at vmware.com>

---

 src/gallium/auxiliary/util/u_cpu_detect.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/util/u_cpu_detect.c b/src/gallium/auxiliary/util/u_cpu_detect.c
index 3d6ccb5822..4e71041bc9 100644
--- a/src/gallium/auxiliary/util/u_cpu_detect.c
+++ b/src/gallium/auxiliary/util/u_cpu_detect.c
@@ -438,7 +438,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;




More information about the mesa-commit mailing list