1 /* 2 testcpu: standalone CPU flags tester 3 4 copyright 2007 by the mpg123 project - free software under the terms of the LGPL 2.1 5 see COPYING and AUTHORS files in distribution or http://mpg123.org 6 initially written by Thomas Orgis 7 */ 8 9 #include <stdio.h> 10 #include "getcpuflags.h" 11 12 int main() 13 { 14 int family; 15 struct cpuflags flags; 16 if(!getcpuflags(&flags)){ printf("CPU won't do cpuid (some old i386 or i486)\n"); return 0; } 17 family = (flags.id & 0xf00)>>8; 18 printf("family: %i\n", family); 19 printf("stdcpuflags: 0x%08x\n", flags.std); 20 printf("std2cpuflags: 0x%08x\n", flags.std2); 21 printf("extcpuflags: 0x%08x\n", flags.ext); 22 if(cpu_i586(flags)) 23 { 24 printf("A i586 or better cpu with:"); 25 if(cpu_mmx(flags)) printf(" mmx"); 26 if(cpu_3dnow(flags)) printf(" 3dnow"); 27 if(cpu_3dnowext(flags)) printf(" 3dnowext"); 28 if(cpu_sse(flags)) printf(" sse"); 29 if(cpu_sse2(flags)) printf(" sse2"); 30 if(cpu_sse3(flags)) printf(" sse3"); 31 printf("\n"); 32 } 33 else printf("I guess you have some i486\n"); 34 return 0; 35 } 36