Subject: Re: Checking for CPU feature from userland
To: None <port-i386@netbsd.org, tron@zhadum.de>
From: Ross Harvey <ross@ghs.com>
List: port-i386
Date: 04/22/2001 00:57:37
>
> 	Hello,
>
> during system startup the kernel reports detailed information about
> the CPU and its features:
>
> cpu0: Intel Pentium III (Coppermine) (686-class), 701.63 MHz
> cpu0: I-cache 16K 32b/line 4-way, D-cache 16K 32b/line 2/4-way
> cpu0: L2 cache 256K 32b/line 8-way
> cpu0: features 383f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR>
> cpu0: features 383f9ff<PGE,MCA,CMOV,FGPAT,PSE36,MMX,FXSR,XMM>
>
> How can I query this information from an userland program to check if
> it can use MMX?

You use the `cpuid' instruction.  There is free pdf documentation for
x86 on the intel web site.

// ross