diff options
Diffstat (limited to 'volk/include')
-rw-r--r-- | volk/include/volk/archs.xml | 10 | ||||
-rw-r--r-- | volk/include/volk/make_cpuid_x86_c.py | 26 | ||||
-rw-r--r-- | volk/include/volk/make_set_simd.py | 25 |
3 files changed, 47 insertions, 14 deletions
diff --git a/volk/include/volk/archs.xml b/volk/include/volk/archs.xml index c9c441008..b7c98500f 100644 --- a/volk/include/volk/archs.xml +++ b/volk/include/volk/archs.xml @@ -9,12 +9,10 @@ <flag>maltivec</flag> </arch> -<arch name="32" type="x86"> - <op>0x80000001</op> +<arch name="32" type="x86" no_test="true" > <flag>m32</flag> - <reg>d</reg> - <shift>29</shift> - <val>0</val> + <overrule>MD_SUBCPU</overrule> + <overrule_val>x86_64</overrule_val> </arch> <arch name="64" type="x86"> @@ -23,6 +21,8 @@ <shift>29</shift> <flag>m64</flag> <val>1</val> + <overrule>MD_SUBCPU</overrule> + <overrule_val>x86</overrule_val> </arch> <arch name="3dnow" type="x86"> diff --git a/volk/include/volk/make_cpuid_x86_c.py b/volk/include/volk/make_cpuid_x86_c.py index fd83e5e5c..8ebe243e5 100644 --- a/volk/include/volk/make_cpuid_x86_c.py +++ b/volk/include/volk/make_cpuid_x86_c.py @@ -33,17 +33,33 @@ def make_cpuid_x86_c(dom) : for domarch in dom: if str(domarch.attributes["type"].value) == "x86": + if "no_test" in domarch.attributes.keys(): + no_test = str(domarch.attributes["no_test"].value); + if no_test == "true": + no_test = True; + else: + no_test = False; + else: + no_test = False; arch = str(domarch.attributes["name"].value); op = domarch.getElementsByTagName("op"); - op = str(op[0].firstChild.data); + if op: + op = str(op[0].firstChild.data); reg = domarch.getElementsByTagName("reg"); - reg = str(reg[0].firstChild.data); + if reg: + reg = str(reg[0].firstChild.data); shift = domarch.getElementsByTagName("shift"); - shift = str(shift[0].firstChild.data); + if shift: + shift = str(shift[0].firstChild.data); val = domarch.getElementsByTagName("val"); - val = str(val[0].firstChild.data); + if val: + val = str(val[0].firstChild.data); - if op == "1": + if no_test: + tempstring = tempstring + "int i_can_has_" + arch + " () {\n" + tempstring = tempstring + " return 1;\n" + tempstring = tempstring + "}\n\n" + elif op == "1": tempstring = tempstring + "int i_can_has_" + arch + " () {\n" tempstring = tempstring + " unsigned int e" + reg + "x = cpuid_e" + reg + "x (" + op + ");\n" tempstring = tempstring + " return ((e" + reg + "x >> " + shift + ") & 1) == " + val + ";\n" diff --git a/volk/include/volk/make_set_simd.py b/volk/include/volk/make_set_simd.py index 279ce06e2..842366b18 100644 --- a/volk/include/volk/make_set_simd.py +++ b/volk/include/volk/make_set_simd.py @@ -112,9 +112,11 @@ def make_set_simd(dom) : tempstring = tempstring + " ADDONS=\"\"\n"; tempstring = tempstring + " BUILT_ARCHS=\"generic\"\n"; tempstring = tempstring + " _MAKE_FAKE_PROCCPU\n"; + tempstring = tempstring + " OVERRULE_FLAG=\"no\"\n"; tempstring = tempstring + " if test -z \"$cf_with_lv_arch\"; then\n"; tempstring = tempstring + " cf_with_lv_arch=$lv_PROCCPU\n"; - + tempstring = tempstring + " OVERRULE_FLAG=\"yes\"\n"; + tempstring = tempstring + " fi\n"; for domarch in dom: if str(domarch.attributes["type"].value) != "all": @@ -132,6 +134,16 @@ def make_set_simd(dom) : for domarch in dom: arch = str(domarch.attributes["name"].value); atype = str(domarch.attributes["type"].value); + overrule = domarch.getElementsByTagName("overrule"); + if overrule: + overrule = str(overrule[0].firstChild.data); + else: + overrule = ""; + overrule_val = domarch.getElementsByTagName("overrule_val"); + if overrule_val: + overrule_val = str(overrule_val[0].firstChild.data); + else: + overrule_val = ""; flag = domarch.getElementsByTagName("flag"); flag = str(flag[0].firstChild.data); if atype == "x86": @@ -153,10 +165,15 @@ def make_set_simd(dom) : tempstring = tempstring + " indLV_ARCH=yes\n" tempstring = tempstring + " fi\n" tempstring = tempstring + " done\n" - tempstring = tempstring + " if test \"$indCC\" == \"yes\" && test \"$indCXX\" == \"yes\" && test \"$indLV_ARCH\" == \"yes\"; then\n" + tempstring = tempstring + " if test -n \"" + overrule + "\" && test \"$" + overrule + "\" == \"" + overrule_val + "\" && test \"$OVERRULE_FLAG\" == \"yes\" && test \"$indLV_ARCH\" == \"yes\"; then\n" + tempstring = tempstring + " indLV_ARCH=no\n" + tempstring = tempstring + " fi\n" + + tempstring = tempstring + " if test \"$indCC\" == \"yes\" && test \"$indCXX\" == \"yes\" && test \"$indLV_ARCH\" == \"yes\"; then\n" + tempstring = tempstring + " AC_DEFINE(LV_HAVE_" + arch.swapcase() + ", 1, [" + arch + " flag set])\n"; tempstring = tempstring + " ADDONS=\"${ADDONS} -" + flag + "\"\n"; - tempstring = tempstring + " BUILT_ARCHS=\"${BUILT_ARCHS} " + arch + "\""; + tempstring = tempstring + " BUILT_ARCHS=\"${BUILT_ARCHS} " + arch + "\"\n"; tempstring = tempstring + " LV_HAVE_" + arch.swapcase() + "=yes\n"; tempstring = tempstring + " fi\n" tempstring = tempstring + " indCC=no\n" @@ -201,7 +218,7 @@ def make_set_simd(dom) : tempstring = tempstring + " if test \"$indCC\" = yes && test \"indCXX\" = yes && \"indLV_ARCH\" = yes; then\n" tempstring = tempstring + " AC_DEFINE(LV_HAVE_" + arch.swapcase() + ", 1, [" + arch + " flag set])\n"; tempstring = tempstring + " ADDONS=\"${ADDONS} -" + flag + "\"\n"; - tempstring = tempstring + " BUILT_ARCHS=\"${BUILT_ARCHS} " + arch + "\""; + tempstring = tempstring + " BUILT_ARCHS=\"${BUILT_ARCHS} " + arch + "\"\n"; tempstring = tempstring + " LV_HAVE_" + arch.swapcase() + "=yes\n"; tempstring = tempstring + " fi\n" tempstring = tempstring + " indCC=no\n" |