ReactOS  0.4.15-dev-1207-g698a8e6
testcpu.c
Go to the documentation of this file.
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 }
#define cpu_3dnow(s)
Definition: getcpuflags.h:50
int main()
Definition: testcpu.c:12
#define cpu_sse3(s)
Definition: getcpuflags.h:54
unsigned int getcpuflags(struct cpuflags *cf)
#define cpu_mmx(s)
Definition: getcpuflags.h:49
#define cpu_i586(s)
Definition: getcpuflags.h:46
#define cpu_sse2(s)
Definition: getcpuflags.h:53
#define cpu_3dnowext(s)
Definition: getcpuflags.h:51
#define cpu_sse(s)
Definition: getcpuflags.h:52
GLbitfield flags
Definition: glext.h:7161
#define printf
Definition: config.h:203