aboutsummaryrefslogtreecommitdiff
path: root/src/libmpg123/testcpu.c
diff options
context:
space:
mode:
authorLucas Eckels <eckels@google.com>2012-08-06 15:17:56 -0700
committerLucas Eckels <eckels@google.com>2012-08-08 09:29:17 -0700
commit3d540f5de5b3a28ce6ad855cef7d9d9a44242c07 (patch)
tree56367e03b9d9fe3cce806508c4d7553647945b91 /src/libmpg123/testcpu.c
parent9e51f014ada352e89237a6981093860291c8150d (diff)
downloadmpg123-3d540f5de5b3a28ce6ad855cef7d9d9a44242c07.tar.gz
Add mpg123 1.8.1 source
Change-Id: I602e744b1e24d95e203c05b0e93d15d373a45639
Diffstat (limited to 'src/libmpg123/testcpu.c')
-rw-r--r--src/libmpg123/testcpu.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/libmpg123/testcpu.c b/src/libmpg123/testcpu.c
new file mode 100644
index 0000000..bacd6c1
--- /dev/null
+++ b/src/libmpg123/testcpu.c
@@ -0,0 +1,35 @@
+/*
+ testcpu: standalone CPU flags tester
+
+ copyright 2007 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Thomas Orgis
+*/
+
+#include <stdio.h>
+#include "getcpuflags.h"
+
+int main()
+{
+ int family;
+ struct cpuflags flags;
+ if(!getcpuflags(&flags)){ printf("CPU won't do cpuid (some old i386 or i486)\n"); return 0; }
+ family = (flags.id & 0xf00)>>8;
+ printf("family: %i\n", family);
+ printf("stdcpuflags: 0x%08x\n", flags.std);
+ printf("std2cpuflags: 0x%08x\n", flags.std2);
+ printf("extcpuflags: 0x%08x\n", flags.ext);
+ if(cpu_i586(flags))
+ {
+ printf("A i586 or better cpu with:");
+ if(cpu_mmx(flags)) printf(" mmx");
+ if(cpu_3dnow(flags)) printf(" 3dnow");
+ if(cpu_3dnowext(flags)) printf(" 3dnowext");
+ if(cpu_sse(flags)) printf(" sse");
+ if(cpu_sse2(flags)) printf(" sse2");
+ if(cpu_sse3(flags)) printf(" sse3");
+ printf("\n");
+ }
+ else printf("I guess you have some i486\n");
+ return 0;
+}