From 81c3086bee1752c94a89ab2d20b7de048fdd1be7 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Fri, 14 Jan 2011 19:58:11 -0500 Subject: Cleans up the Makefiles for the various platforms. This should also make it easier to add new architectures. Thanks to Josh for the inspiration. --- volk/include/volk/Makefile.am | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) (limited to 'volk/include') diff --git a/volk/include/volk/Makefile.am b/volk/include/volk/Makefile.am index 04a43bd34..658974d3a 100644 --- a/volk/include/volk/Makefile.am +++ b/volk/include/volk/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2010 Free Software Foundation, Inc. +# Copyright 2010,2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -130,33 +130,11 @@ volkinclude_HEADERS = \ volk_8s_convert_32f_unaligned16.h VOLK_MKTABLES_SOURCES = \ + $(platform_CODE) \ $(top_srcdir)/lib/volk_rank_archs.c \ $(top_srcdir)/lib/volk_mktables.c -# FIXME: Not very extensible to supporting more processors easily -if MYSUBCPU_X86_64 - VOLK_MKTABLES_SOURCES += \ - $(top_srcdir)/lib/volk_cpu_x86.c \ - $(top_srcdir)/lib/cpuid_x86_64.S -endif - -if MYSUBCPU_X86 - VOLK_MKTABLES_SOURCES += \ - $(top_srcdir)/lib/volk_cpu_x86.c \ - $(top_srcdir)/lib/cpuid_x86.S -endif - -if MYSUBCPU_POWERPC - VOLK_MKTABLES_SOURCES += \ - $(top_srcdir)/lib/volk_cpu_powerpc.c -endif - -if MYSUBCPU_GENERIC - VOLK_MKTABLES_SOURCES += \ - $(top_srcdir)/lib/volk_cpu_generic.c -endif - volk_mktables$(EXEEXT): $(VOLK_MKTABLES_SOURCES) $(CC) -o $@ $^ $(AM_CPPFLAGS) -I$(top_builddir)/include -- cgit From 74e9f2b0bce026b7b68a2d0a3558687386fdaab5 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Fri, 14 Jan 2011 23:18:07 -0500 Subject: Creates volk_cpu in a .cc file and externs it in the header. --- volk/include/volk/make_cpuid_h.py | 25 ++++++++++++++++++++++++- volk/include/volk/make_proccpu_sim.py | 23 +++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) (limited to 'volk/include') diff --git a/volk/include/volk/make_cpuid_h.py b/volk/include/volk/make_cpuid_h.py index 823e3b2c0..cd3da2455 100644 --- a/volk/include/volk/make_cpuid_h.py +++ b/volk/include/volk/make_cpuid_h.py @@ -1,3 +1,25 @@ +#!/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 from emit_omnilog import * @@ -13,7 +35,8 @@ def make_cpuid_h(dom) : for domarch in dom: arch = str(domarch.attributes["name"].value); tempstring = tempstring + " int (*has_" + arch + ") ();\n"; - tempstring = tempstring + "}volk_cpu;\n\n"; + tempstring = tempstring + "};\n\n"; + tempstring = tempstring + "extern struct VOLK_CPU volk_cpu;\n\n"; tempstring = tempstring + "void volk_cpu_init ();\n" tempstring = tempstring + "unsigned int volk_get_lvarch ();\n" diff --git a/volk/include/volk/make_proccpu_sim.py b/volk/include/volk/make_proccpu_sim.py index c75a4d5fb..e8463f5be 100644 --- a/volk/include/volk/make_proccpu_sim.py +++ b/volk/include/volk/make_proccpu_sim.py @@ -1,3 +1,25 @@ +#!/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 def make_proccpu_sim(dom) : @@ -6,6 +28,7 @@ def make_proccpu_sim(dom) : tempstring = tempstring + "#include \n" tempstring = tempstring + "#include \n" tempstring = tempstring + "\n\n" + tempstring = tempstring + "struct VOLK_CPU volk_cpu;\n\n" tempstring = tempstring + "void test_append(char* buf, int val, char* newkey){\n"; tempstring = tempstring + " if(val==1){\n"; -- cgit From 568d0cafb8423f34530c94963654abea4c62801b Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Fri, 14 Jan 2011 23:18:07 -0500 Subject: A fix for volk_cpu being a duplicate variable. Declared as extern in the header file volk_cpu.h and actually created in the C files. Note that this could be a problem if multiple architectures are ever (can ever?) be built at the same time. If that happens, we can move this variable declaration to another C file that is made common to all builds. --- volk/include/volk/make_cpuid_generic_c.py | 26 ++++++++++++++++++++++++-- volk/include/volk/make_cpuid_h.py | 25 ++++++++++++++++++++++++- volk/include/volk/make_cpuid_powerpc_c.py | 26 ++++++++++++++++++++++++-- volk/include/volk/make_cpuid_x86_c.py | 27 +++++++++++++++++++++++++-- 4 files changed, 97 insertions(+), 7 deletions(-) (limited to 'volk/include') diff --git a/volk/include/volk/make_cpuid_generic_c.py b/volk/include/volk/make_cpuid_generic_c.py index 3ba225fca..c682d4138 100644 --- a/volk/include/volk/make_cpuid_generic_c.py +++ b/volk/include/volk/make_cpuid_generic_c.py @@ -1,11 +1,33 @@ +#!/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 def make_cpuid_generic_c(dom) : tempstring = ""; tempstring = tempstring + "/*this file is auto_generated by volk_register.py*/\n\n"; tempstring = tempstring + "#include \n" - tempstring = tempstring + "#include \n" - tempstring = tempstring + "\n\n" + tempstring = tempstring + "#include \n\n" + tempstring = tempstring + "struct VOLK_CPU volk_cpu;\n\n" for domarch in dom: if str(domarch.attributes["type"].value) == "all": diff --git a/volk/include/volk/make_cpuid_h.py b/volk/include/volk/make_cpuid_h.py index 823e3b2c0..cd3da2455 100644 --- a/volk/include/volk/make_cpuid_h.py +++ b/volk/include/volk/make_cpuid_h.py @@ -1,3 +1,25 @@ +#!/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 from emit_omnilog import * @@ -13,7 +35,8 @@ def make_cpuid_h(dom) : for domarch in dom: arch = str(domarch.attributes["name"].value); tempstring = tempstring + " int (*has_" + arch + ") ();\n"; - tempstring = tempstring + "}volk_cpu;\n\n"; + tempstring = tempstring + "};\n\n"; + tempstring = tempstring + "extern struct VOLK_CPU volk_cpu;\n\n"; tempstring = tempstring + "void volk_cpu_init ();\n" tempstring = tempstring + "unsigned int volk_get_lvarch ();\n" diff --git a/volk/include/volk/make_cpuid_powerpc_c.py b/volk/include/volk/make_cpuid_powerpc_c.py index 443a58488..0b0ea84e7 100644 --- a/volk/include/volk/make_cpuid_powerpc_c.py +++ b/volk/include/volk/make_cpuid_powerpc_c.py @@ -1,11 +1,33 @@ +#!/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 def make_cpuid_powerpc_c(dom) : tempstring = ""; tempstring = tempstring + "/*this file is auto_generated by volk_register.py*/\n\n"; tempstring = tempstring + "#include \n" - tempstring = tempstring + "#include \n" - tempstring = tempstring + "\n\n" + tempstring = tempstring + "#include \n\n" + tempstring = tempstring + "struct VOLK_CPU volk_cpu;\n\n" #just assume it has them for powerpc for domarch in dom: diff --git a/volk/include/volk/make_cpuid_x86_c.py b/volk/include/volk/make_cpuid_x86_c.py index 8ebe243e5..48a406fa4 100644 --- a/volk/include/volk/make_cpuid_x86_c.py +++ b/volk/include/volk/make_cpuid_x86_c.py @@ -1,11 +1,34 @@ +#!/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 def make_cpuid_x86_c(dom) : tempstring = ""; tempstring = tempstring + "/*this file is auto_generated by volk_register.py*/\n\n"; tempstring = tempstring + "#include \n" - tempstring = tempstring + "#include \n" - tempstring = tempstring + "\n\n" + tempstring = tempstring + "#include \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 + "static inline unsigned int cpuid_eax(unsigned int op) {\n"; tempstring = tempstring + " unsigned int regs[4];\n" -- cgit From 2e8610450bc467400f8de2976cc6c1743025aff1 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sat, 15 Jan 2011 10:53:54 -0500 Subject: This should not have been put here. --- volk/include/volk/make_proccpu_sim.py | 1 - 1 file changed, 1 deletion(-) (limited to 'volk/include') diff --git a/volk/include/volk/make_proccpu_sim.py b/volk/include/volk/make_proccpu_sim.py index e8463f5be..029dacfcc 100644 --- a/volk/include/volk/make_proccpu_sim.py +++ b/volk/include/volk/make_proccpu_sim.py @@ -28,7 +28,6 @@ def make_proccpu_sim(dom) : tempstring = tempstring + "#include \n" tempstring = tempstring + "#include \n" tempstring = tempstring + "\n\n" - tempstring = tempstring + "struct VOLK_CPU volk_cpu;\n\n" tempstring = tempstring + "void test_append(char* buf, int val, char* newkey){\n"; tempstring = tempstring + " if(val==1){\n"; -- cgit