summaryrefslogtreecommitdiff
path: root/volk/gen/make_cpuid_c.py
diff options
context:
space:
mode:
Diffstat (limited to 'volk/gen/make_cpuid_c.py')
-rw-r--r--volk/gen/make_cpuid_c.py36
1 files changed, 18 insertions, 18 deletions
diff --git a/volk/gen/make_cpuid_c.py b/volk/gen/make_cpuid_c.py
index 49b216677..005fc2b19 100644
--- a/volk/gen/make_cpuid_c.py
+++ b/volk/gen/make_cpuid_c.py
@@ -1,24 +1,24 @@
#!/usr/bin/env python
#
# Copyright 2011 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
from xml.dom import minidom
@@ -107,7 +107,7 @@ static inline unsigned int xgetbv(void) {
def make_cpuid_c(dom) :
tempstring = HEADER_TEMPL;
-
+
for domarch in dom:
if str(domarch.attributes["type"].value) == "x86":
if "no_test" in domarch.attributes.keys():
@@ -147,9 +147,9 @@ int i_can_has_%s () {
return 0;
#endif
}
-
+
""" % (arch)
-
+
elif op == "1":
tempstring = tempstring + """\
int i_can_has_%s () {
@@ -188,7 +188,7 @@ int i_can_has_%s () {
}
""" % (arch, val, reg, op, shift, val)
-
+
elif str(domarch.attributes["type"].value) == "powerpc":
arch = str(domarch.attributes["name"].value);
tempstring = tempstring + """\
@@ -222,7 +222,7 @@ int i_can_has_%s () {
unsigned int found_neon = 0;
auxvec_f = fopen("/proc/self/auxv", "rb");
if(!auxvec_f) return 0;
-
+
//so auxv is basically 32b of ID and 32b of value
//so it goes like this
while(!found_neon && auxvec_f) {
@@ -230,7 +230,7 @@ int i_can_has_%s () {
if((auxvec[0] == AT_HWCAP) && (auxvec[1] & HWCAP_NEON))
found_neon = 1;
}
-
+
fclose(auxvec_f);
return found_neon;
@@ -240,7 +240,7 @@ int i_can_has_%s () {
}
""" % (arch)
-
+
elif str(domarch.attributes["type"].value) == "all":
arch = str(domarch.attributes["name"].value);
tempstring = tempstring + """\
@@ -257,7 +257,7 @@ int i_can_has_%s () {
}
""" % (arch)
-
+
tempstring = tempstring + "void volk_cpu_init() {\n";
for domarch in dom:
arch = str(domarch.attributes["name"].value);
@@ -275,9 +275,9 @@ int i_can_has_%s () {
return tempstring;
-
-
-
-
-
+
+
+
+
+