From 8670366ae2d1399491e5a7b73d6cb2269d46ac45 Mon Sep 17 00:00:00 2001 From: David Heidelberg Date: Sun, 28 Dec 2014 17:52:25 +0100 Subject: [PATCH] util: add check for bit_FXSAVE This prevent segfault on CPUs without FXSAVE as Mobile Intel(R) Pentium(R) 4 - M. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=87658 Signed-off-by: David Heidelberg --- src/gallium/auxiliary/util/u_cpu_detect.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/util/u_cpu_detect.c b/src/gallium/auxiliary/util/u_cpu_detect.c index 5d9db59..fd98997 100644 --- a/src/gallium/auxiliary/util/u_cpu_detect.c +++ b/src/gallium/auxiliary/util/u_cpu_detect.c @@ -375,7 +375,8 @@ util_cpu_detect(void) util_cpu_caps.has_daz = 1; #else util_cpu_caps.has_daz = util_cpu_caps.has_sse3 || - (util_cpu_caps.has_sse2 && sse2_has_daz()); + (util_cpu_caps.has_sse2 && + ((regs2[3] >> 24) & 1 /* bit_FXSAVE */ ) && sse2_has_daz()); #endif cacheline = ((regs2[1] >> 8) & 0xFF) * 8; -- 2.2.1