comparison cpudetect.c @ 16662:77e35d3153b4

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
author gpoirier
date Tue, 04 Oct 2005 21:06:07 +0000
parents 3758536dcef3
children fab832f37083
comparison
equal deleted inserted replaced
16661:adb581352e63 16662:77e35d3153b4
118 unsigned cl_size; 118 unsigned cl_size;
119 119
120 do_cpuid(0x00000001, regs2); 120 do_cpuid(0x00000001, regs2);
121 121
122 caps->cpuType=(regs2[0] >> 8)&0xf; 122 caps->cpuType=(regs2[0] >> 8)&0xf;
123
124 // see AMD64 Architecture Programmer's Manual, Volume 3: General-purpose and
125 // System Instructions, Table 3-2: Effective family computation, page 120.
123 if(caps->cpuType==0xf){ 126 if(caps->cpuType==0xf){
124 // use extended family (P4, IA64) 127 // use extended family (P4, IA64, K8)
125 caps->cpuType=8+((regs2[0]>>20)&255); 128 caps->cpuType=0xf+((regs2[0]>>20)&255);
126 } 129 }
127 caps->cpuStepping=regs2[0] & 0xf; 130 caps->cpuStepping=regs2[0] & 0xf;
128 131
129 // general feature flags: 132 // general feature flags:
130 caps->hasTSC = (regs2[3] & (1 << 8 )) >> 8; // 0x0000010 133 caps->hasTSC = (regs2[3] & (1 << 8 )) >> 8; // 0x0000010