diff options
author | Nick Foster | 2011-04-16 10:05:43 -0700 |
---|---|---|
committer | Nick Foster | 2011-04-16 10:05:43 -0700 |
commit | 8b04d29221719239b52a300a338513f05746ed7f (patch) | |
tree | 87437367864f0124a1bb4058e008231a4a814f95 /volk/include | |
parent | 7ae3c05f4ab5e694608c9146aa842ea185a0417a (diff) | |
download | gnuradio-8b04d29221719239b52a300a338513f05746ed7f.tar.gz gnuradio-8b04d29221719239b52a300a338513f05746ed7f.tar.bz2 gnuradio-8b04d29221719239b52a300a338513f05746ed7f.zip |
Volk: split n_archs out of arch_defs[0], began to add _manual support
Diffstat (limited to 'volk/include')
-rw-r--r-- | volk/include/volk/make_c.py | 9 | ||||
-rw-r--r-- | volk/include/volk/make_each_machine_c.py | 2 | ||||
-rw-r--r-- | volk/include/volk/make_registry.py | 33 | ||||
-rw-r--r-- | volk/include/volk/volk_common.h | 1 |
4 files changed, 28 insertions, 17 deletions
diff --git a/volk/include/volk/make_c.py b/volk/include/volk/make_c.py index 7cb0616c8..1129285bb 100644 --- a/volk/include/volk/make_c.py +++ b/volk/include/volk/make_c.py @@ -68,11 +68,18 @@ struct volk_machine *get_machine(void) { } } +static unsigned int get_index(const char **indices, char *arch_name) { + + + + +} + """ for i in range(len(functions)): tempstring += "void get_" + functions[i] + replace_arch.sub("", arched_arglist[i]) + "\n" - tempstring += " %s = get_machine()->%s_archs[volk_rank_archs(get_machine()->%s_desc.arch_defs, volk_get_lvarch())];\n" % (functions[i], functions[i], functions[i]) + tempstring += " %s = get_machine()->%s_archs[volk_rank_archs(get_machine()->%s_desc.arch_defs, get_machine()->%s_desc.n_archs, volk_get_lvarch())];\n" % (functions[i], functions[i], functions[i], functions[i]) tempstring += " %s(%s);\n}\n\n" % (functions[i], my_arglist[i]) tempstring += replace_volk.sub("p", functions[i]) + " " + functions[i] + " = &get_" + functions[i] + ";\n\n" diff --git a/volk/include/volk/make_each_machine_c.py b/volk/include/volk/make_each_machine_c.py index 866e18bc3..11f669566 100644 --- a/volk/include/volk/make_each_machine_c.py +++ b/volk/include/volk/make_each_machine_c.py @@ -71,7 +71,7 @@ def make_each_machine_c(machine_name, archs, functions, fcountlist, taglist): tempstring += " name,\n" for i in range(len(functions)): - tempstring += " { " + functions[i] + "_indices, " + functions[i] + "_arch_defs },\n" + tempstring += " { " + functions[i] + "_indices, " + functions[i] + "_arch_defs, " + functions[i] + "_n_archs },\n" tempstring += " " + functions[i] + "_archs,\n" tempstring = strip_trailing(tempstring, ",") diff --git a/volk/include/volk/make_registry.py b/volk/include/volk/make_registry.py index 7fbe9a8b0..de1f46aa6 100644 --- a/volk/include/volk/make_registry.py +++ b/volk/include/volk/make_registry.py @@ -1,5 +1,6 @@ from xml.dom import minidom from emit_omnilog import * +from volk_regexp import * import string def make_registry(dom, funclist, fcountlist, taglist) : @@ -39,24 +40,13 @@ def make_registry(dom, funclist, fcountlist, taglist) : tempstring = tempstring + "\n \"" + str(taglist[i][tags_counter]) + "\",\n#endif\n"; tags_counter = tags_counter + 1; - lindex = tempstring.rfind(","); - tempstring = tempstring[0:lindex] + string.replace(tempstring[lindex:len(tempstring)], ",", ""); + tempstring = strip_trailing(tempstring, ",") tempstring = tempstring + "};\n\n"; for fcount in fcountlist: tempstring = tempstring + "static const int " + funclist[counter] + "_arch_defs[] = {\n"; - counter = counter + 1; - for arch_list in fcount: - tempstring = tempstring + " (LV_" - for ind in range(len(arch_list)): - tempstring = tempstring + arch_list[ind] + "_CNT"; - if ind < len(arch_list) - 1: - tempstring = tempstring + " * LV_"; - tempstring = tempstring + ") + "; - lindex = tempstring.rfind(" + "); - tempstring = tempstring[0:lindex] + string.replace(tempstring[lindex:len(tempstring)], " + ", ""); - tempstring = tempstring + ",\n" + counter += 1; for arch_list in fcount: tempstring = tempstring + "#if defined(LV_HAVE_" for ind in range(len(arch_list)): @@ -70,9 +60,22 @@ def make_registry(dom, funclist, fcountlist, taglist) : if ind < len(arch_list) - 1: tempstring = tempstring + ") + (1 << LV_" tempstring = tempstring + "),\n#endif\n" - lindex = tempstring.rfind(","); - tempstring = tempstring[0:lindex] + string.replace(tempstring[lindex:len(tempstring)], ",", ""); + tempstring = strip_trailing(tempstring, ",") tempstring = tempstring + "};\n\n" + + counter = 0; + for fcount in fcountlist: + tempstring += "static const int " + funclist[counter] + "_n_archs = " + counter += 1; + for arch_list in fcount: + tempstring = tempstring + " (LV_" + for ind in range(len(arch_list)): + tempstring = tempstring + arch_list[ind] + "_CNT"; + if ind < len(arch_list) - 1: + tempstring = tempstring + " * LV_"; + tempstring = tempstring + ") + "; + tempstring = strip_trailing(tempstring, " + "); + tempstring = tempstring + ";\n" tempstring = tempstring + emit_epilog(); diff --git a/volk/include/volk/volk_common.h b/volk/include/volk/volk_common.h index e050600f0..0a47ff864 100644 --- a/volk/include/volk/volk_common.h +++ b/volk/include/volk/volk_common.h @@ -18,6 +18,7 @@ union bit128{ struct volk_func_desc { const char **indices; const int *arch_defs; + const int n_archs; }; #endif /*INCLUDED_LIBVOLK_COMMON_H*/ |