aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-09-05 20:11:34 -0400
committerMarek Olšák <[email protected]>2018-09-07 15:48:31 -0400
commitce432e259d0e73299b7a86b0732efd27340d995f (patch)
tree526308a7197e9fe9a238d17482bc4e07775ac249
parenta84fd58f48fa332b1c5a545d9b7e2440b8784656 (diff)
gallium/u_cpu_detect: fix parsing the CPU family
According to: https://support.amd.com/TechDocs/54945_PPR_Family_17h_Models_00h-0Fh.pdf Also Intel: https://www.microbe.cz/docs/CPUID.pdf Reviewed-by: Brian Paul <[email protected]>
-rw-r--r--src/gallium/auxiliary/util/u_cpu_detect.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/util/u_cpu_detect.c b/src/gallium/auxiliary/util/u_cpu_detect.c
index 93cf58011db..29f4ce98203 100644
--- a/src/gallium/auxiliary/util/u_cpu_detect.c
+++ b/src/gallium/auxiliary/util/u_cpu_detect.c
@@ -420,8 +420,9 @@ util_cpu_detect_once(void)
cpuid (0x00000001, regs2);
util_cpu_caps.x86_cpu_type = (regs2[0] >> 8) & 0xf;
+ /* Add "extended family". */
if (util_cpu_caps.x86_cpu_type == 0xf)
- util_cpu_caps.x86_cpu_type = 8 + ((regs2[0] >> 20) & 255); /* use extended family (P4, IA64) */
+ util_cpu_caps.x86_cpu_type += ((regs2[0] >> 20) & 0xff);
/* general feature flags */
util_cpu_caps.has_tsc = (regs2[3] >> 4) & 1; /* 0x0000010 */