summaryrefslogtreecommitdiff
path: root/volk/include
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-01-15 17:29:15 -0800
committerJosh Blum <josh@joshknows.com>2011-01-17 20:02:39 -0800
commit9edf280fb25bee071c166123ac1aee41d4a4949e (patch)
tree767c4dcfe0c0d4ab72450c47e4c48d272682b80d /volk/include
parent31bbbec88b19230eb37b197d7623c3671e57837e (diff)
volk: replace assembly and separate cases with gcc cpuid for all x86
Diffstat (limited to 'volk/include')
-rw-r--r--volk/include/volk/make_cpuid_x86_c.py3
-rw-r--r--volk/include/volk/make_set_simd.py33
2 files changed, 11 insertions, 25 deletions
diff --git a/volk/include/volk/make_cpuid_x86_c.py b/volk/include/volk/make_cpuid_x86_c.py
index 48a406fa40..2b2bd7c912 100644
--- a/volk/include/volk/make_cpuid_x86_c.py
+++ b/volk/include/volk/make_cpuid_x86_c.py
@@ -27,9 +27,10 @@ def make_cpuid_x86_c(dom) :
tempstring = tempstring + "/*this file is auto_generated by volk_register.py*/\n\n";
tempstring = tempstring + "#include <volk/volk_cpu.h>\n"
tempstring = tempstring + "#include <volk/volk_config_fixed.h>\n\n"
+ tempstring = tempstring + "#include <gcc_x86_cpuid.h>\n\n"
tempstring = tempstring + "struct VOLK_CPU volk_cpu;\n\n"
- tempstring = tempstring + "extern void cpuid_x86 (unsigned int op, unsigned int result[4]);\n\n"
+ tempstring = tempstring + "#define cpuid_x86(op, r) __get_cpuid(op, r+0, r+1, r+2, r+3)\n\n"
tempstring = tempstring + "static inline unsigned int cpuid_eax(unsigned int op) {\n";
tempstring = tempstring + " unsigned int regs[4];\n"
tempstring = tempstring + " cpuid_x86 (op, regs);\n"
diff --git a/volk/include/volk/make_set_simd.py b/volk/include/volk/make_set_simd.py
index 842366b181..275d3869f3 100644
--- a/volk/include/volk/make_set_simd.py
+++ b/volk/include/volk/make_set_simd.py
@@ -27,30 +27,15 @@ def make_set_simd(dom) :
tempstring = tempstring + " AC_MSG_CHECKING([proccpu])\n";
tempstring = tempstring + " case \"$MD_CPU\" in\n";
tempstring = tempstring + " (x86)\n";
- tempstring = tempstring + " case \"$MD_SUBCPU\" in\n";
- tempstring = tempstring + " (x86)\n";
- tempstring = tempstring + " if test -z \"`${CC} -o proccpu -I $srcdir/include/ -I$srcdir/lib $srcdir/lib/volk_proccpu_sim.c $srcdir/lib/volk_cpu_x86.c $srcdir/lib/cpuid_x86.S`\"\n";
- tempstring = tempstring + " then\n";
- tempstring = tempstring + " AC_MSG_RESULT(yes)\n";
- tempstring = tempstring + " lv_PROCCPU=\"`./proccpu`\"\n";
- tempstring = tempstring + " rm -f proccpu\n";
- tempstring = tempstring + " else\n";
- tempstring = tempstring + " AC_MSG_RESULT(no)\n";
- tempstring = tempstring + " lv_PROCCPU=no\n";
- tempstring = tempstring + " fi\n"
- tempstring = tempstring + " ;;\n"
- tempstring = tempstring + " (*)\n"
- tempstring = tempstring + " if test -z \"`${CC} -o proccpu -I$srcdir/include/ -I$srcdir/lib $srcdir/lib/volk_proccpu_sim.c $srcdir/lib/volk_cpu_x86.c $srcdir/lib/cpuid_x86_64.S`\"\n";
- tempstring = tempstring + " then\n";
- tempstring = tempstring + " AC_MSG_RESULT(yes)\n";
- tempstring = tempstring + " lv_PROCCPU=\"`./proccpu`\"\n";
- tempstring = tempstring + " rm -f proccpu\n";
- tempstring = tempstring + " else\n";
- tempstring = tempstring + " AC_MSG_RESULT(no)\n";
- tempstring = tempstring + " lv_PROCCPU=no\n";
- tempstring = tempstring + " fi\n"
- tempstring = tempstring + " ;;\n"
- tempstring = tempstring + " esac\n"
+ tempstring = tempstring + " if test -z \"`${CC} -o proccpu -I$srcdir/include/ -I$srcdir/lib $srcdir/lib/volk_proccpu_sim.c $srcdir/lib/volk_cpu_x86.c 2>&1`\"\n";
+ tempstring = tempstring + " then\n";
+ tempstring = tempstring + " AC_MSG_RESULT(yes)\n";
+ tempstring = tempstring + " lv_PROCCPU=\"`./proccpu`\"\n";
+ tempstring = tempstring + " rm -f proccpu\n";
+ tempstring = tempstring + " else\n";
+ tempstring = tempstring + " AC_MSG_RESULT(no)\n";
+ tempstring = tempstring + " lv_PROCCPU=no\n";
+ tempstring = tempstring + " fi\n"
tempstring = tempstring + " ;;\n";
tempstring = tempstring + " (powerpc)\n";
tempstring = tempstring + " if test -z \"`${CC} -o proccpu -I$srcdir/include/ $srcdir/lib/volk_proccpu_sim.c $srcdir/lib/volk_cpu_powerpc.c 2>&1`\"\n";