Embedded AMD Processor Recognition
65
23913A/0—November 2000
Embedded AMD-K6™ Processors BIOS Design Guide
Preliminary Information
Detection Algorithm for Determining Instruction Set Support
To simplify the detection of the new instructions and the
original 3DNow! and MMX instructions, use the following
algorithm. A code sample using the CPUID instruction to
identify the processor and its features is available from AMD’s
website at http://www.amd.com/products/cpg/bin. There are
other ways to implement detection besides the way shown in
the sample.
CPUID Test
1. Establish that the processor has support for CPUID. See
“Testing for the CPUID Instruction” on page 58.
Standard Function
Test
2. Execute CPUID function 0, which returns the processor
vendor string and the highest standard function supported.
Save the vendor string for a later comparison. (See step 9.)
3. If step 2 indicates that the highest standard function is at
least 1, execute CPUID function 1, which returns the
standard feature flags in the EDX register.
MMX™ Test
4. If bit 23 of the standard feature flags is set to 1, MMX
technology is supported. MMX instruction support is the
basic minimum processor feature required to support other
instruction extensions.
Optional SSE Test
5. Optionally, if bit 25 of the standard feature flags is set, the
processor has streaming single instruction multiple data
(SIMD) extensions (SSE) capabilities. Further qualification
of SSE is done by checking for OS support. SSE support
might be present in the processor, but not usable due to a
lack of OS support for the additional architected registers.
Extended Functions
Test
6. Execute CPUID extended function 8000_0000h. This
function returns the highest extended function supported in
EAX. If EAX=0, there is no support for extended functions.
7. If the highest extended function supported is at least
8000_0001h, execute CPUID function 8000_0001h. This
function returns the extended feature flags in EDX.
3DNow!™ Test
8. If bit 31 of the extended feature flags is set to 1, the 3DNow!
instructions are supported.
Vendor Check
9. If the previously saved vendor string (see step 2) contains
“AuthenticAMD”, continue on to the next step.