summaryrefslogtreecommitdiffstats
path: root/cpudetect.c
diff options
context:
space:
mode:
authorgpoirier <gpoirier@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-10-04 21:06:07 +0000
committergpoirier <gpoirier@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-10-04 21:06:07 +0000
commitac9e6666a3a977c5d2aaeaf624a976ee0f5e7f3b (patch)
tree2de6e899f2ba3b88cdb089d9c7db777f54b3a4ac /cpudetect.c
parent9cae258a42501d074b48a270e16d2bf615c54f20 (diff)
downloadmpv-ac9e6666a3a977c5d2aaeaf624a976ee0f5e7f3b.tar.bz2
mpv-ac9e6666a3a977c5d2aaeaf624a976ee0f5e7f3b.tar.xz
according to Intel/AMD official documentations, CPU family should be displayed as
the sum of CPUID's family field and extended family field when a CPU has a CPUID family 0xF. Patch by Zuxy <zuxy POIS meng AH gmail POIS com> Original thread: Date: Oct 2, 2005 11:08 AM Subject: [MPlayer-dev-eng] [Patch] Correction of P4 family CPUs detection in cputable.h git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16663 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'cpudetect.c')
-rw-r--r--cpudetect.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/cpudetect.c b/cpudetect.c
index af85c7fdab..09fe43d323 100644
--- a/cpudetect.c
+++ b/cpudetect.c
@@ -120,9 +120,12 @@ void GetCpuCaps( CpuCaps *caps)
do_cpuid(0x00000001, regs2);
caps->cpuType=(regs2[0] >> 8)&0xf;
+
+// see AMD64 Architecture Programmer's Manual, Volume 3: General-purpose and
+// System Instructions, Table 3-2: Effective family computation, page 120.
if(caps->cpuType==0xf){
- // use extended family (P4, IA64)
- caps->cpuType=8+((regs2[0]>>20)&255);
+ // use extended family (P4, IA64, K8)
+ caps->cpuType=0xf+((regs2[0]>>20)&255);
}
caps->cpuStepping=regs2[0] & 0xf;