Developer Center and Site Navigational Bars



Back to Developers Home
 
CPUID Instruction

The CPUID instruction (opcode 0FA2) allows software to inquire about the CPU vendor, family, model, stepping, features, and cache information.

The presence of the CPUID instruction is indicated by the ability to change the value of the ID Flag (bit 21) in the EFLAGS register.

The CPUID level is determined by the value placed in the EAX register before the instruction is executed. Each CPUID level returns different information in EAX, EBX, ECX, and EDX registers.

Standard Levels

CPUID Instruction with EAX = 0000 0000h
Standard level 0h (EAX = 0) of the CPUID instruction returns the maximum standard CPUID levels supported as well as the processor vendor string.

After the instruction is executed, the EAX register contains the maximum standard CPUID levels supported. The maximum standard CPUID level is the highest acceptable value for the EAX register input. This does not include the extended CPUID levels. The EBX through EDX registers contain the vendor string of the processor. Note that the registers are placed out of order.

Register Description
EAXMaximum Standard Levels
EBX-EDX-ECXVendor String - "CyrixInstead"

Description 6x86(L) 6x86MX MediaGX MediaGX
MMX Enhanced
Max Std Levels1112

CPUID Instruction with EAX = 0000 0001h
Standard function 01h (EAX = 1) of the CPUID instruction returns the Processor Type, Family, Model, and Stepping information of the current processor in EAX. The EBX and ECX registers are reserved.

Register Description
EAX[3:0] Stepping ID
EAX[7:4] Model
EAX[11:8] Family
EAX[15:12] Type
EAX[31:16] Reserved

Description 6x86(L) 6x86MX MediaGX MediaGX
MMX Enhanced
Stepping ID xxxxxxxx
Model 2044
Family 5645
Type 0000

The Standard Feature Flags supported are returned in the EDX register. Each flag refers to a specific feature and indicates if that feature is present on the processor. Some of these features have protection control in CR4. Before using any of these features on the processor, the software should check the corresponding feature flag. Attempting to execute an unavailable feature can cause exceptions and unexpected behavior. For example, software must check bit 4 before attempting to use the Time Stamp Counter instruction.

Feature Flag EDX Bit CR4 Bit 6x86 6x86(L) 6x86MX MediaGX MediaGX
MMX Enhanced
FPU On-chip0-xxxxx
Virtual Mode Extension10,1-----
Debugging Extension23-xx--
Page Size Extension34--x--
Time Stamp Counter42--x-x
RDMSR / WRMSR Instructions58--x-x
Physical Address Extension65-----
Machine Check Exception76-----
CMPXCHG8B Instruction8--xx-x
On-chip APIC Hardware9------
Undefined10------
SYSENTER / SYSEXIT Instructions11- -----
Memory Type Range Registers12------
Page Global Enable137--x--
Machine Check Architecture14------
Conditional Move Instruction15---x-x
Page Attribute Table16------
Undefined17-22------
MMX Instructions23---x-x
Fast FPU Save and Restore24------
Undefined25-31------

CPUID Instruction with EAX = 0000 0002h
Standard function 02h (EAX = 02h) of the CPUID instruction returns information that is specific to the Cyrix family of processors. Information about the TLB is returned in EAX. Information about the L1 Cache is returned in EDX. The EBX and ECX registers are reserved.

Register Description
EAX TLB Information
EBX Reserved
ECX Reserved
EDX L1 Cache Information

Value Description
xxxx70xxhTLB is 32 Entry, 4-way Set Associative, and has 4K Pages
xxxxxx01hThe CPUID instruction needs to be executed only once with an input value of 02h to retrieve complete information about the cache and TLB
xxxxxx80hL1 Cache is 16K, 4-way Set Associative, and has 16 Bytes per Line

Description MediaGX MMX Enhanced
EAX (TLB Info) 00007001h
EDX (L1 Cache Info) 00000080h

Extended Levels

Extended CPUID Level support testing consists of executing a CPUID instruction with the EAX register initialized to 8000 0000h and testing the return value in EAX. If a value greater than or equal to 8000 0000h is returned to the EAX register by the CPUID instruction, the processor supports extended CPUID Levels.

CPUID Instruction with EAX = 8000 0000h
Extended function 8000 0000h (EAX = 80000000h) of the CPUID instruction returns the maximum extended CPUID levels supported by the current processor in EAX. The other registers are reserved.

Register Description
EAXMaximum Standard Levels
EBX-ECX-EDXReserved

Description MediaGX
MMX Enhanced
Max Extended Levels80000005h

CPUID Instruction with EAX = 8000 0001h
Extended function 8000 0001h (EAX = 80000001h) of the CPUID instruction returns the Processor Type, Family, Model, and Stepping information of the current processor in EAX. The EBX and ECX registers are reserved.

Register Description
EAX[3:0] Stepping ID
EAX[7:4] Model
EAX[11:8] Family
EAX[15:12] Type
EAX[31:16] Reserved

Description MediaGX
MMX Enhanced
Stepping ID xx
Model 4
Family 5
Type 0

The Extended Feature Flags supported are returned in the EDX register. Each flag refers to a specific feature and indicates if that feature is present on the processor. Some of these features have protection control in CR4. Before using any of these features on the processor, the software should check the corresponding feature flag.

Feature Flag EDX Bit CR4 Bit MediaGX
MMX Enhanced
FPU On-chip0-x
Virtual Mode Extension10,1-
Debugging Extension23-
Page Size Extension34-
Time Stamp Counter42x
Cyrix Model-Specific Registers58x
Undefined6--
Machine Check Exception76-
CMPXCHG8B Instruction8-x
Undefined9--
Undefined10--
SYSCALL / SYSRET Instructions11--
Undefined12--
Page Global Enable137-
Undefined14--
Integer Cond. Move Instruction15-x
FPU Cond. Move Instruction16--
Undefined17-22--
MMX Instructions23-x
6x86MX Multimedia Extensions24--
Undefined25-31--

CPUID Instruction with EAX = 8000 0002h - 8000 0004h
Extended function 8000 0002h through 8000 0004 (EAX = 80000002h, 80000003h, 80000004h) of the CPUID instruction returns an ASCII string containing the name of the current processor. These functions eliminate the need to look up the processor name in a lookup table. Software can simply call these functions to obtain the name of the processor. The string may be 48 ASCII characters long, and is returned in little endian format. If the name is shorter than 48 characters long, the remaining bytes will be filled with ASCII NULL character (00h).

8000 0002h 8000 0003h 8000 0004h
EAXCPU Name 1EAXCPU Name 5EAXCPU Name 9
EBXCPU Name 2EBXCPU Name 6EBXCPU Name 10
ECXCPU Name 3ECXCPU Name 7ECXCPU Name 11
EDXCPU Name 4EDXCPU Name 8EDXCPU Name 12

CPUID Instruction with EAX = 8000 0005h
Extended function 8000 0005h (EAX = 80000005h) of the CPUID instruction returns information about the TLB and L1 Cache to be looked up in a lookup table.

Register Description
EAX Reserved
EBX TLB Information
ECX L1 Cache Information
EDX Reserved

Value Description
xxxx70xxhTLB is 32 Entry, 4-way Set Associative, and has 4K Pages
xxxxxx01hThe CPUID instruction needs to be executed only once with an input value of 02h to retrieve complete information about the cache and TLB
xxxxxx80hL1 Cache is 16K, 4-way Set Associative, and has 16 Bytes per Line

Description MediaGX MMX Enhanced
EBX (TLB Info) 00007001h
ECX (L1 Cache Info) 00000080h


Products | Buy Cyrix | Channel | Developers | About Cyrix | Off the Page | Top

Copyright & Legal Info © 1998 by Cyrix Corporation, U.S.A.