summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README13
-rw-r--r--config/gr_pwin32.m413
-rw-r--r--config/grc_grc.m45
-rw-r--r--config/lf_cxx.m417
-rw-r--r--config/mkstemp.m411
-rw-r--r--configure.ac6
-rw-r--r--gcell/apps/test_all.cc7
-rw-r--r--gnuradio-core/src/lib/Makefile.am5
-rw-r--r--gnuradio-core/src/lib/filter/Makefile.am7
-rw-r--r--gnuradio-core/src/lib/filter/ccomplex_dotprod_generic.cc1
-rw-r--r--gnuradio-core/src/lib/filter/complex_dotprod_generic.cc1
-rw-r--r--gnuradio-core/src/lib/filter/cpuid_x86.S60
-rw-r--r--gnuradio-core/src/lib/filter/cpuid_x86_64.S54
-rw-r--r--gnuradio-core/src/lib/filter/gcc_x86_cpuid.h178
-rw-r--r--gnuradio-core/src/lib/filter/gr_cpu_x86.cc13
-rw-r--r--gnuradio-core/src/lib/filter/gri_fft_filter_ccc_generic.cc2
-rw-r--r--gnuradio-core/src/lib/filter/gri_fft_filter_fff_generic.cc2
-rw-r--r--gnuradio-core/src/lib/general/Makefile.am1
-rw-r--r--gnuradio-core/src/lib/general/gr_decode_ccsds_27_fb.cc2
-rw-r--r--gnuradio-core/src/lib/general/gr_firdes.cc2
-rw-r--r--gnuradio-core/src/lib/general/gr_fxpt.cc5
-rw-r--r--gnuradio-core/src/lib/general/gr_fxpt.h4
-rw-r--r--gnuradio-core/src/lib/general/gr_math.cc102
-rw-r--r--gnuradio-core/src/lib/general/gr_math.h13
-rw-r--r--gnuradio-core/src/lib/general/gr_ofdm_frame_sink.cc2
-rw-r--r--gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.cc2
-rw-r--r--gnuradio-core/src/lib/general/gri_fft.cc28
-rw-r--r--gnuradio-core/src/lib/general/qa_gr_fxpt_vco.cc4
-rw-r--r--gnuradio-core/src/lib/missing/Makefile.am4
-rw-r--r--gnuradio-core/src/lib/runtime/Makefile.am6
-rw-r--r--gnuradio-core/src/lib/runtime/gr_buffer.cc3
-rw-r--r--gnuradio-core/src/lib/runtime/gr_preferences.cc34
-rw-r--r--gnuradio-core/src/lib/runtime/gr_sys_paths.cc55
-rw-r--r--gnuradio-core/src/lib/runtime/gr_sys_paths.h (renamed from gnuradio-core/src/lib/runtime/gr_tmp_path.h)18
-rw-r--r--gnuradio-core/src/lib/runtime/gr_tmp_path.cc52
-rw-r--r--gnuradio-core/src/lib/runtime/gr_unittests.h40
-rw-r--r--gnuradio-core/src/lib/runtime/gr_vmcircbuf_createfilemapping.cc3
-rw-r--r--gnuradio-core/src/lib/runtime/gr_vmcircbuf_mmap_shm_open.cc4
-rw-r--r--gnuradio-core/src/lib/runtime/gr_vmcircbuf_mmap_tmpfile.cc4
-rw-r--r--gnuradio-core/src/tests/Makefile.am2
-rw-r--r--gnuradio-core/src/tests/benchmark_vco.cc2
-rw-r--r--gnuradio-core/src/tests/test_all.cc7
-rw-r--r--gnuradio-core/src/tests/test_atsc.cc7
-rw-r--r--gnuradio-core/src/tests/test_filter.cc7
-rw-r--r--gnuradio-core/src/tests/test_general.cc7
-rw-r--r--gnuradio-core/src/tests/test_runtime.cc7
-rw-r--r--gr-atsc/src/lib/atsci_equalizer_lms2.cc5
-rw-r--r--gr-atsc/src/lib/atsci_sssr.cc3
-rw-r--r--gr-atsc/src/lib/test_atsci.cc7
-rw-r--r--gr-howto-write-a-block/config/gr_pwin32.m413
-rw-r--r--gr-howto-write-a-block/config/lf_cxx.m417
-rw-r--r--gr-howto-write-a-block/config/mkstemp.m411
-rw-r--r--gr-howto-write-a-block/lib/test_all.cc7
-rw-r--r--gr-qtgui/src/lib/FrequencyDisplayPlot.h1
-rw-r--r--gr-qtgui/src/lib/Makefile.am6
-rw-r--r--gr-qtgui/src/lib/SpectrumGUIClass.cc4
-rw-r--r--gr-qtgui/src/lib/SpectrumGUIClass.h4
-rw-r--r--gr-qtgui/src/lib/TimeDomainDisplayPlot.h1
-rw-r--r--gr-qtgui/src/lib/WaterfallDisplayPlot.cc40
-rw-r--r--gr-qtgui/src/lib/WaterfallDisplayPlot.h13
-rw-r--r--gr-qtgui/src/lib/plot_waterfall.h2
-rwxr-xr-xgr-uhd/grc/gen_uhd_multi_usrp_blocks_xml.py2
-rw-r--r--gruel/src/lib/Makefile.am4
-rw-r--r--gruel/src/lib/test_gruel.cc53
-rw-r--r--volk/Makefile.common13
-rw-r--r--volk/config/gr_pwin32.m413
-rw-r--r--volk/config/lf_cxx.m417
-rw-r--r--volk/config/mkstemp.m411
-rw-r--r--volk/include/volk/make_cpuid_x86_c.py3
-rw-r--r--volk/include/volk/make_set_simd.py33
-rw-r--r--volk/include/volk/volk_32fc_conjugate_dot_prod_unaligned.h144
-rw-r--r--volk/lib/assembly.h67
-rw-r--r--volk/lib/cpuid_x86.S60
-rw-r--r--volk/lib/cpuid_x86_64.S54
-rw-r--r--volk/lib/gcc_x86_cpuid.h178
-rw-r--r--volk/lib/qa_32fc_conjugate_dot_prod_unaligned.cc138
-rw-r--r--volk/lib/qa_32fc_conjugate_dot_prod_unaligned.h18
-rw-r--r--volk/lib/qa_volk.cc213
78 files changed, 1105 insertions, 872 deletions
diff --git a/README b/README
index 4656af2c9..069d32024 100644
--- a/README
+++ b/README
@@ -262,3 +262,16 @@ locations:
LDFLAGS="-L/usr/pkg/lib -R/usr/pkg/lib" CPPFLAGS="-I/usr/pkg/include" ./configure --prefix=/usr/gnuradio
+
+-------------------------------------------------------------------------------
+
+ Legal Matters
+
+-------------------------------------------------------------------------------
+
+Some files have been changed many times throughout the
+years. Copyright notices at the tops of these files list which years
+changes have been made. For some files, changes have occurred in many
+consecutive years. These files may often have the format of a year
+range (e.g., "2006 - 2011"), which indicates that these files have had
+copyrightable changes made during each year in the range, inclusive.
diff --git a/config/gr_pwin32.m4 b/config/gr_pwin32.m4
index 495e9dd4d..6b27b439f 100644
--- a/config/gr_pwin32.m4
+++ b/config/gr_pwin32.m4
@@ -1,6 +1,6 @@
# Check for (mingw)win32 POSIX replacements. -*- Autoconf -*-
-# Copyright 2003,2004,2005 Free Software Foundation, Inc.
+# Copyright 2003,2004,2005,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -61,17 +61,6 @@ AC_TRY_LINK([ #include <windows.h>
AC_MSG_RESULT(no)
)
-dnl Under Win32, mkdir prototype in io.h has only one arg
-AC_MSG_CHECKING(whether mkdir accepts only one arg)
-AC_TRY_COMPILE([#include <sys/types.h>
- #include <sys/stat.h>
- #include <fcntl.h>], [
- mkdir("")
- ], [ AC_MSG_RESULT(yes)
- AC_DEFINE(MKDIR_TAKES_ONE_ARG,[],[Define if mkdir accepts only one arg]) ],
- [ AC_MSG_RESULT(no)
- ])
-
AH_BOTTOM(
[
/* Define missing prototypes, implemented in replacement lib */
diff --git a/config/grc_grc.m4 b/config/grc_grc.m4
index 446bba3c5..c21acccff 100644
--- a/config/grc_grc.m4
+++ b/config/grc_grc.m4
@@ -1,4 +1,4 @@
-dnl Copyright 2008, 2009 Free Software Foundation, Inc.
+dnl Copyright 2008, 2009, 2011 Free Software Foundation, Inc.
dnl
dnl This file is part of GNU Radio
dnl
@@ -20,8 +20,6 @@ dnl Boston, MA 02110-1301, USA.
AC_DEFUN([GRC_GRC],[
GRC_ENABLE(grc)
-dnl GRC_CHECK_DEPENDENCY(grc, gr-wxgui)
-
AC_CHECK_PROG(XDG_UTILS, xdg-mime, true, false)
AM_CONDITIONAL(XDG_UTILS, $XDG_UTILS)
@@ -33,6 +31,7 @@ dnl GRC_CHECK_DEPENDENCY(grc, gr-wxgui)
PYTHON_CHECK_MODULE([Cheetah],[Python Cheetah templates >= 2.0.0],[],[passed=no],[Cheetah.Version >= "2.0.0"])
PYTHON_CHECK_MODULE([lxml.etree],[Python lxml wrappers >= 1.3.6],[],[passed=no],[lxml.etree.LXML_VERSION >= (1, 3, 6, 0)])
PYTHON_CHECK_MODULE([gtk],[Python gtk wrappers >= 2.10.0],[],[passed=no],[gtk.pygtk_version >= (2, 10, 0)])
+ PYTHON_CHECK_MODULE([numpy],[NumPy],[],[passed=no],[True])
fi
dnl ########################################
diff --git a/config/lf_cxx.m4 b/config/lf_cxx.m4
index dfc6bfbfe..7cce5f8a4 100644
--- a/config/lf_cxx.m4
+++ b/config/lf_cxx.m4
@@ -46,22 +46,5 @@ AC_DEFUN([LF_CXX_PORTABILITY],[
dnl Check for common C++ portability problems
dnl
- dnl AC_LANG_PUSH
- dnl AC_LANG_CPLUSPLUS
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
-
-
- dnl Test whether C++ has std::isnan
- AC_MSG_CHECKING(whether C++ has std::isnan)
- AC_TRY_COMPILE([#include <cmath>], [
- std::isnan(0);
-], [ AC_MSG_RESULT(yes)
- AC_DEFINE(CXX_HAS_STD_ISNAN,[],[Define if has std::isnan]) ],
- [ AC_MSG_RESULT(no) ])
-
- dnl Done with the portability checks
- dnl AC_LANG_POP([C++])
- AC_LANG_RESTORE
])
diff --git a/config/mkstemp.m4 b/config/mkstemp.m4
index 4af0f0a9b..2d1fbee9b 100644
--- a/config/mkstemp.m4
+++ b/config/mkstemp.m4
@@ -75,15 +75,4 @@ AC_DEFUN([jm_PREREQ_TEMPNAME],
AC_CHECK_FUNCS(__secure_getenv gettimeofday lstat)
AC_CHECK_DECLS_ONCE(getenv)
# AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
-
- dnl Under Win32, mkdir prototype in io.h has only one arg
- AC_MSG_CHECKING(whether mkdir accepts only one arg)
- AC_TRY_COMPILE([#include <sys/types.h>
- #include <sys/stat.h>
- #include <fcntl.h>], [
- mkdir("")
- ], [ AC_MSG_RESULT(yes)
- AC_DEFINE(MKDIR_TAKES_ONE_ARG,[],[Define if mkdir accepts only one arg]) ],
- [ AC_MSG_RESULT(no)
- ])
])
diff --git a/configure.ac b/configure.ac
index 3de2b069e..ff969c27f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-dnl Copyright 2001,2002,2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
+dnl Copyright 2001-2011 Free Software Foundation, Inc.
dnl
dnl This file is part of GNU Radio
dnl
@@ -304,13 +304,13 @@ dnl
dnl all the rest of these call AC_SUBST(BOOST_<foo>_LIB) and define HAVE_BOOST_<foo>
dnl
AX_BOOST_DATE_TIME
-dnl AX_BOOST_FILESYSTEM
+AX_BOOST_FILESYSTEM
dnl AX_BOOST_IOSTREAMS
AX_BOOST_PROGRAM_OPTIONS
dnl AX_BOOST_REGEX
dnl AX_BOOST_SERIALIZATION
dnl AX_BOOST_SIGNALS
-dnl AX_BOOST_SYSTEM
+AX_BOOST_SYSTEM
dnl AX_BOOST_TEST_EXEC_MONITOR
dnl AX_BOOST_UNIT_TEST_FRAMEWORK
dnl AX_BOOST_WSERIALIZATION
diff --git a/gcell/apps/test_all.cc b/gcell/apps/test_all.cc
index 0b608e13b..fc3afd8ca 100644
--- a/gcell/apps/test_all.cc
+++ b/gcell/apps/test_all.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2007,2010 Free Software Foundation, Inc.
+ * Copyright 2007,2010,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -29,11 +29,8 @@
int
main(int argc, char **argv)
{
- char path[200];
- get_unittest_path ("gcell_all.xml", path, 200);
-
CppUnit::TextTestRunner runner;
- std::ofstream xmlfile(path);
+ std::ofstream xmlfile(get_unittest_path("gcell_all.xml").c_str());
CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile);
runner.addTest(qa_gcell_runtime::suite());
diff --git a/gnuradio-core/src/lib/Makefile.am b/gnuradio-core/src/lib/Makefile.am
index 1281b4aa6..4db2ff167 100644
--- a/gnuradio-core/src/lib/Makefile.am
+++ b/gnuradio-core/src/lib/Makefile.am
@@ -66,4 +66,7 @@ libgnuradio_core_qa_la_LIBADD = \
bin_PROGRAMS = gnuradio-config-info
gnuradio_config_info_SOURCES = gnuradio-config-info.cc
-gnuradio_config_info_LDADD = libgnuradio-core.la $(BOOST_LDFLAGS) $(BOOST_PROGRAM_OPTIONS_LIB)
+gnuradio_config_info_LDADD = libgnuradio-core.la \
+ $(BOOST_LDFLAGS) \
+ $(BOOST_PROGRAM_OPTIONS_LIB) \
+ $(BOOST_FILESYSTEM_LIB)
diff --git a/gnuradio-core/src/lib/filter/Makefile.am b/gnuradio-core/src/lib/filter/Makefile.am
index ebc7ad203..dee13e239 100644
--- a/gnuradio-core/src/lib/filter/Makefile.am
+++ b/gnuradio-core/src/lib/filter/Makefile.am
@@ -120,8 +120,7 @@ x86_SUBCODE = \
ccomplex_dotprod_sse.S \
fcomplex_dotprod_3dnow.S \
fcomplex_dotprod_sse.S \
- short_dotprod_mmx.S \
- cpuid_x86.S
+ short_dotprod_mmx.S
x86_64_SUBCODE = \
float_dotprod_sse64.S \
@@ -134,8 +133,7 @@ x86_64_SUBCODE = \
ccomplex_dotprod_sse64.S \
fcomplex_dotprod_3dnow64.S \
fcomplex_dotprod_sse64.S \
- short_dotprod_mmx64.S \
- cpuid_x86_64.S
+ short_dotprod_mmx64.S
x86_qa_CODE = \
qa_dotprod_x86.cc \
@@ -312,6 +310,7 @@ grinclude_HEADERS = \
noinst_HEADERS = \
assembly.h \
+ gcc_x86_cpuid.h \
dotprod_fff_altivec.h \
dotprod_fff_armv7_a.h \
dotprod_ccf_armv7_a.h \
diff --git a/gnuradio-core/src/lib/filter/ccomplex_dotprod_generic.cc b/gnuradio-core/src/lib/filter/ccomplex_dotprod_generic.cc
index 5fc04271a..0dc0c38b7 100644
--- a/gnuradio-core/src/lib/filter/ccomplex_dotprod_generic.cc
+++ b/gnuradio-core/src/lib/filter/ccomplex_dotprod_generic.cc
@@ -24,7 +24,6 @@
#include <config.h>
#endif
#include <gr_complex.h>
-#include "gr_fir_ccc_simd.h"
#include "ccomplex_dotprod_generic.h"
#include <iostream>
diff --git a/gnuradio-core/src/lib/filter/complex_dotprod_generic.cc b/gnuradio-core/src/lib/filter/complex_dotprod_generic.cc
index 89eb6db87..8cbc4aa70 100644
--- a/gnuradio-core/src/lib/filter/complex_dotprod_generic.cc
+++ b/gnuradio-core/src/lib/filter/complex_dotprod_generic.cc
@@ -24,7 +24,6 @@
#include <config.h>
#endif
#include <gr_complex.h>
-#include "gr_fir_scc_simd.h"
#include "complex_dotprod_generic.h"
diff --git a/gnuradio-core/src/lib/filter/cpuid_x86.S b/gnuradio-core/src/lib/filter/cpuid_x86.S
deleted file mode 100644
index 4e1a9404f..000000000
--- a/gnuradio-core/src/lib/filter/cpuid_x86.S
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# Copyright 2003 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.
-#
-
-#
-# execute CPUID instruction, return EAX, EBX, ECX and EDX values in result
-#
-# void cpuid_x86 (unsigned int op, unsigned int result[4]);
-#
-
-#include "assembly.h"
-
-.file "cpuid_x86.S"
- .version "01.01"
-.text
-.globl GLOB_SYMB(cpuid_x86)
- DEF_FUNC_HEAD(cpuid_x86)
-GLOB_SYMB(cpuid_x86):
- pushl %ebp
- movl %esp, %ebp
- pushl %ebx # must save in PIC mode, holds GOT pointer
- pushl %esi
-
- movl 8(%ebp), %eax # op
- movl 12(%ebp), %esi # result
- cpuid
- movl %eax, 0(%esi)
- movl %ebx, 4(%esi)
- movl %ecx, 8(%esi)
- movl %edx, 12(%esi)
-
- popl %esi
- popl %ebx
- popl %ebp
- ret
-
-FUNC_TAIL(cpuid_x86)
- .ident "Hand coded cpuid assembly"
-
-
-#if defined(__linux__) && defined(__ELF__)
-.section .note.GNU-stack,"",%progbits
-#endif
diff --git a/gnuradio-core/src/lib/filter/cpuid_x86_64.S b/gnuradio-core/src/lib/filter/cpuid_x86_64.S
deleted file mode 100644
index 32b1847cd..000000000
--- a/gnuradio-core/src/lib/filter/cpuid_x86_64.S
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# Copyright 2003,2005 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.
-#
-
-#
-# execute CPUID instruction, return EAX, EBX, ECX and EDX values in result
-#
-# void cpuid_x86 (unsigned int op, unsigned int result[4]);
-#
-
-#include "assembly.h"
-
-.file "cpuid_x86_64.S"
- .version "01.01"
-.text
-.globl GLOB_SYMB(cpuid_x86)
- DEF_FUNC_HEAD(cpuid_x86)
-GLOB_SYMB(cpuid_x86):
- mov %rbx, %r11 # must save in PIC mode, holds GOT pointer
-
- mov %rdi, %rax # op
- cpuid
- movl %eax, 0(%rsi) # result
- movl %ebx, 4(%rsi)
- movl %ecx, 8(%rsi)
- movl %edx, 12(%rsi)
-
- mov %r11, %rbx
- retq
-
-FUNC_TAIL(cpuid_x86)
- .ident "Hand coded cpuid64 assembly"
-
-
-#if defined(__linux__) && defined(__ELF__)
-.section .note.GNU-stack,"",%progbits
-#endif
diff --git a/gnuradio-core/src/lib/filter/gcc_x86_cpuid.h b/gnuradio-core/src/lib/filter/gcc_x86_cpuid.h
new file mode 100644
index 000000000..2d0916fb3
--- /dev/null
+++ b/gnuradio-core/src/lib/filter/gcc_x86_cpuid.h
@@ -0,0 +1,178 @@
+/*
+ * Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+ *
+ * This file 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.
+ *
+ * This file 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.
+ *
+ * Under Section 7 of GPL version 3, you are granted additional
+ * permissions described in the GCC Runtime Library Exception, version
+ * 3.1, as published by the Free Software Foundation.
+ *
+ * You should have received a copy of the GNU General Public License and
+ * a copy of the GCC Runtime Library Exception along with this program;
+ * see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+/* %ecx */
+#define bit_SSE3 (1 << 0)
+#define bit_PCLMUL (1 << 1)
+#define bit_SSSE3 (1 << 9)
+#define bit_FMA (1 << 12)
+#define bit_CMPXCHG16B (1 << 13)
+#define bit_SSE4_1 (1 << 19)
+#define bit_SSE4_2 (1 << 20)
+#define bit_MOVBE (1 << 22)
+#define bit_POPCNT (1 << 23)
+#define bit_AES (1 << 25)
+#define bit_XSAVE (1 << 26)
+#define bit_OSXSAVE (1 << 27)
+#define bit_AVX (1 << 28)
+
+/* %edx */
+#define bit_CMPXCHG8B (1 << 8)
+#define bit_CMOV (1 << 15)
+#define bit_MMX (1 << 23)
+#define bit_FXSAVE (1 << 24)
+#define bit_SSE (1 << 25)
+#define bit_SSE2 (1 << 26)
+
+/* Extended Features */
+/* %ecx */
+#define bit_LAHF_LM (1 << 0)
+#define bit_SSE4a (1 << 6)
+#define bit_SSE5 (1 << 11)
+
+/* %edx */
+#define bit_LM (1 << 29)
+#define bit_3DNOWP (1 << 30)
+#define bit_3DNOW (1 << 31)
+
+
+#if defined(__i386__) && defined(__PIC__)
+/* %ebx may be the PIC register. */
+#if __GNUC__ >= 3
+#define __cpuid(level, a, b, c, d) \
+ __asm__ ("xchg{l}\t{%%}ebx, %1\n\t" \
+ "cpuid\n\t" \
+ "xchg{l}\t{%%}ebx, %1\n\t" \
+ : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \
+ : "0" (level))
+
+#define __cpuid_count(level, count, a, b, c, d) \
+ __asm__ ("xchg{l}\t{%%}ebx, %1\n\t" \
+ "cpuid\n\t" \
+ "xchg{l}\t{%%}ebx, %1\n\t" \
+ : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \
+ : "0" (level), "2" (count))
+#else
+/* Host GCCs older than 3.0 weren't supporting Intel asm syntax
+ nor alternatives in i386 code. */
+#define __cpuid(level, a, b, c, d) \
+ __asm__ ("xchgl\t%%ebx, %1\n\t" \
+ "cpuid\n\t" \
+ "xchgl\t%%ebx, %1\n\t" \
+ : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \
+ : "0" (level))
+
+#define __cpuid_count(level, count, a, b, c, d) \
+ __asm__ ("xchgl\t%%ebx, %1\n\t" \
+ "cpuid\n\t" \
+ "xchgl\t%%ebx, %1\n\t" \
+ : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \
+ : "0" (level), "2" (count))
+#endif
+#else
+#define __cpuid(level, a, b, c, d) \
+ __asm__ ("cpuid\n\t" \
+ : "=a" (a), "=b" (b), "=c" (c), "=d" (d) \
+ : "0" (level))
+
+#define __cpuid_count(level, count, a, b, c, d) \
+ __asm__ ("cpuid\n\t" \
+ : "=a" (a), "=b" (b), "=c" (c), "=d" (d) \
+ : "0" (level), "2" (count))
+#endif
+
+/* Return highest supported input value for cpuid instruction. ext can
+ be either 0x0 or 0x8000000 to return highest supported value for
+ basic or extended cpuid information. Function returns 0 if cpuid
+ is not supported or whatever cpuid returns in eax register. If sig
+ pointer is non-null, then first four bytes of the signature
+ (as found in ebx register) are returned in location pointed by sig. */
+
+static __inline unsigned int
+__get_cpuid_max (unsigned int __ext, unsigned int *__sig)
+{
+ unsigned int __eax, __ebx, __ecx, __edx;
+
+#ifndef __x86_64__
+#if __GNUC__ >= 3
+ /* See if we can use cpuid. On AMD64 we always can. */
+ __asm__ ("pushf{l|d}\n\t"
+ "pushf{l|d}\n\t"
+ "pop{l}\t%0\n\t"
+ "mov{l}\t{%0, %1|%1, %0}\n\t"
+ "xor{l}\t{%2, %0|%0, %2}\n\t"
+ "push{l}\t%0\n\t"
+ "popf{l|d}\n\t"
+ "pushf{l|d}\n\t"
+ "pop{l}\t%0\n\t"
+ "popf{l|d}\n\t"
+ : "=&r" (__eax), "=&r" (__ebx)
+ : "i" (0x00200000));
+#else
+/* Host GCCs older than 3.0 weren't supporting Intel asm syntax
+ nor alternatives in i386 code. */
+ __asm__ ("pushfl\n\t"
+ "pushfl\n\t"
+ "popl\t%0\n\t"
+ "movl\t%0, %1\n\t"
+ "xorl\t%2, %0\n\t"
+ "pushl\t%0\n\t"
+ "popfl\n\t"
+ "pushfl\n\t"
+ "popl\t%0\n\t"
+ "popfl\n\t"
+ : "=&r" (__eax), "=&r" (__ebx)
+ : "i" (0x00200000));
+#endif
+
+ if (!((__eax ^ __ebx) & 0x00200000))
+ return 0;
+#endif
+
+ /* Host supports cpuid. Return highest supported cpuid input value. */
+ __cpuid (__ext, __eax, __ebx, __ecx, __edx);
+
+ if (__sig)
+ *__sig = __ebx;
+
+ return __eax;
+}
+
+/* Return cpuid data for requested cpuid level, as found in returned
+ eax, ebx, ecx and edx registers. The function checks if cpuid is
+ supported and returns 1 for valid cpuid information or 0 for
+ unsupported cpuid level. All pointers are required to be non-null. */
+
+static __inline int
+__get_cpuid (unsigned int __level,
+ unsigned int *__eax, unsigned int *__ebx,
+ unsigned int *__ecx, unsigned int *__edx)
+{
+ unsigned int __ext = __level & 0x80000000;
+
+ if (__get_cpuid_max (__ext, 0) < __level)
+ return 0;
+
+ __cpuid (__level, *__eax, *__ebx, *__ecx, *__edx);
+ return 1;
+}
diff --git a/gnuradio-core/src/lib/filter/gr_cpu_x86.cc b/gnuradio-core/src/lib/filter/gr_cpu_x86.cc
index ac8a2eeb7..da970e133 100644
--- a/gnuradio-core/src/lib/filter/gr_cpu_x86.cc
+++ b/gnuradio-core/src/lib/filter/gr_cpu_x86.cc
@@ -21,13 +21,12 @@
*/
#include <gr_cpu.h>
+#include "gcc_x86_cpuid.h"
/*
* execute CPUID instruction, return EAX, EBX, ECX and EDX values in result
*/
-extern "C" {
-void cpuid_x86 (unsigned int op, unsigned int result[4]);
-};
+#define cpuid_x86(op, r) __get_cpuid(op, r+0, r+1, r+2, r+3)
/*
* CPUID functions returning a single datum
@@ -35,28 +34,28 @@ void cpuid_x86 (unsigned int op, unsigned int result[4]);
static inline unsigned int cpuid_eax(unsigned int op)
{
- unsigned int regs[4];
+ unsigned int regs[4] = {0,0,0,0};
cpuid_x86 (op, regs);
return regs[0];
}
static inline unsigned int cpuid_ebx(unsigned int op)
{
- unsigned int regs[4];
+ unsigned int regs[4] = {0,0,0,0};
cpuid_x86 (op, regs);
return regs[1];
}
static inline unsigned int cpuid_ecx(unsigned int op)
{
- unsigned int regs[4];
+ unsigned int regs[4] = {0,0,0,0};
cpuid_x86 (op, regs);
return regs[2];
}
static inline unsigned int cpuid_edx(unsigned int op)
{
- unsigned int regs[4];
+ unsigned int regs[4] = {0,0,0,0};
cpuid_x86 (op, regs);
return regs[3];
}
diff --git a/gnuradio-core/src/lib/filter/gri_fft_filter_ccc_generic.cc b/gnuradio-core/src/lib/filter/gri_fft_filter_ccc_generic.cc
index 1bf4a6f4b..891905dd0 100644
--- a/gnuradio-core/src/lib/filter/gri_fft_filter_ccc_generic.cc
+++ b/gnuradio-core/src/lib/filter/gri_fft_filter_ccc_generic.cc
@@ -99,7 +99,7 @@ gri_fft_filter_ccc_generic::compute_sizes(int ntaps)
{
int old_fftsize = d_fftsize;
d_ntaps = ntaps;
- d_fftsize = (int) (2 * pow(2.0, ceil(log(ntaps) / log(2))));
+ d_fftsize = (int) (2 * pow(2.0, ceil(log(double(ntaps)) / log(2.0))));
d_nsamples = d_fftsize - d_ntaps + 1;
if (0)
diff --git a/gnuradio-core/src/lib/filter/gri_fft_filter_fff_generic.cc b/gnuradio-core/src/lib/filter/gri_fft_filter_fff_generic.cc
index 74058fa93..b3fbe1d1a 100644
--- a/gnuradio-core/src/lib/filter/gri_fft_filter_fff_generic.cc
+++ b/gnuradio-core/src/lib/filter/gri_fft_filter_fff_generic.cc
@@ -86,7 +86,7 @@ gri_fft_filter_fff_generic::compute_sizes(int ntaps)
{
int old_fftsize = d_fftsize;
d_ntaps = ntaps;
- d_fftsize = (int) (2 * pow(2.0, ceil(log(ntaps) / log(2))));
+ d_fftsize = (int) (2 * pow(2.0, ceil(log(double(ntaps)) / log(2.0))));
d_nsamples = d_fftsize - d_ntaps + 1;
if (0)
diff --git a/gnuradio-core/src/lib/general/Makefile.am b/gnuradio-core/src/lib/general/Makefile.am
index 08610c58a..3ceea7a6d 100644
--- a/gnuradio-core/src/lib/general/Makefile.am
+++ b/gnuradio-core/src/lib/general/Makefile.am
@@ -100,7 +100,6 @@ libgeneral_la_SOURCES = \
gr_lms_dfe_cc.cc \
gr_lms_dfe_ff.cc \
gr_map_bb.cc \
- gr_math.cc \
gr_misc.cc \
gr_mpsk_receiver_cc.cc \
gr_nlog10_ff.cc \
diff --git a/gnuradio-core/src/lib/general/gr_decode_ccsds_27_fb.cc b/gnuradio-core/src/lib/general/gr_decode_ccsds_27_fb.cc
index d5425bfc8..c5e1320a3 100644
--- a/gnuradio-core/src/lib/general/gr_decode_ccsds_27_fb.cc
+++ b/gnuradio-core/src/lib/general/gr_decode_ccsds_27_fb.cc
@@ -39,7 +39,7 @@ gr_decode_ccsds_27_fb::gr_decode_ccsds_27_fb()
{
float RATE = 0.5;
float ebn0 = 12.0;
- float esn0 = RATE*pow(10.0, ebn0/10);
+ float esn0 = RATE*pow(10.0, ebn0/10.0);
gen_met(d_mettab, 100, esn0, 0.0, 256);
viterbi_chunks_init(d_state0);
diff --git a/gnuradio-core/src/lib/general/gr_firdes.cc b/gnuradio-core/src/lib/general/gr_firdes.cc
index 8efeb3438..5d192d67e 100644
--- a/gnuradio-core/src/lib/general/gr_firdes.cc
+++ b/gnuradio-core/src/lib/general/gr_firdes.cc
@@ -574,7 +574,7 @@ gr_firdes::gaussian (double gain,
vector<float> taps(ntaps);
double scale = 0;
double dt = 1.0/spb;
- double s = 1.0/(sqrt(log(2)) / (2*M_PI*bt));
+ double s = 1.0/(sqrt(log(2.0)) / (2*M_PI*bt));
double t0 = -0.5 * ntaps;
double ts;
for(int i=0;i<ntaps;i++)
diff --git a/gnuradio-core/src/lib/general/gr_fxpt.cc b/gnuradio-core/src/lib/general/gr_fxpt.cc
index e752364a5..fae02c71e 100644
--- a/gnuradio-core/src/lib/general/gr_fxpt.cc
+++ b/gnuradio-core/src/lib/general/gr_fxpt.cc
@@ -30,9 +30,8 @@ const float gr_fxpt::s_sine_table[1 << NBITS][2] = {
#include "sine_table.h"
};
-// gcc 4.x fix
-const float gr_fxpt::TWO_TO_THE_31;
-const float gr_fxpt::PI;
+const float gr_fxpt::PI = 3.14159265358979323846;
+const float gr_fxpt::TWO_TO_THE_31 = 2147483648.0;
#if 0
/*
diff --git a/gnuradio-core/src/lib/general/gr_fxpt.h b/gnuradio-core/src/lib/general/gr_fxpt.h
index 520729f8d..c98d31b27 100644
--- a/gnuradio-core/src/lib/general/gr_fxpt.h
+++ b/gnuradio-core/src/lib/general/gr_fxpt.h
@@ -40,8 +40,8 @@ class gr_fxpt
static const int WORDBITS = 32;
static const int NBITS = 10;
static const float s_sine_table[1 << NBITS][2];
- static const float PI = 3.14159265358979323846;
- static const float TWO_TO_THE_31 = 2147483648.0;
+ static const float PI;
+ static const float TWO_TO_THE_31;
public:
static gr_int32
diff --git a/gnuradio-core/src/lib/general/gr_math.cc b/gnuradio-core/src/lib/general/gr_math.cc
deleted file mode 100644
index 82dff469c..000000000
--- a/gnuradio-core/src/lib/general/gr_math.cc
+++ /dev/null
@@ -1,102 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2003 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <gr_math.h>
-#include <math.h>
-
-/*
- * Greatest Common Divisor, using Euclid's algorithm.
- * [There are faster algorithms. See Knuth 4.5.2 if you care]
- */
-
-long
-gr_gcd (long m, long n)
-{
- if (m < 0)
- m = -m;
-
- if (n < 0)
- n = -n;
-
- while (n != 0){
- long t = m % n;
- m = n;
- n = t;
- }
-
- return m;
-}
-
-
-/*
- * These really need some configure hacking to figure out the right answer.
- * As a stop gap, try for a macro, and if not that, then try std::
- */
-
-// returns a non-zero value if value is "not-a-number" (NaN), and 0 otherwise
-
-#if defined(isnan) || !defined(CXX_HAS_STD_ISNAN)
-
-int
-gr_isnan (double value)
-{
- return isnan (value);
-}
-
-#else
-
-int
-gr_isnan (double value)
-{
- return std::isnan (value);
-}
-
-#endif
-
-// returns a non-zero value if the value of x has its sign bit set.
-//
-// This is not the same as `x < 0.0', because IEEE 754 floating point
-// allows zero to be signed. The comparison `-0.0 < 0.0' is false, but
-// `gr_signbit (-0.0)' will return a nonzero value.
-
-#ifdef signbit
-
-int
-gr_signbit (double x)
-{
- return signbit (x);
-}
-
-#else
-
-int
-gr_signbit (double x)
-{
- return std::signbit (x);
-}
-
-
-#endif
diff --git a/gnuradio-core/src/lib/general/gr_math.h b/gnuradio-core/src/lib/general/gr_math.h
index ea0f20027..f5935c1da 100644
--- a/gnuradio-core/src/lib/general/gr_math.h
+++ b/gnuradio-core/src/lib/general/gr_math.h
@@ -35,19 +35,6 @@ gr_is_power_of_2(long x)
return x != 0 && (x & (x-1)) == 0;
}
-long gr_gcd (long m, long n);
-
-// returns a non-zero value if value is "not-a-number" (NaN), and 0 otherwise
-int gr_isnan (double value);
-
-// returns a non-zero value if the value of x has its sign bit set.
-//
-// This is not the same as `x < 0.0', because IEEE 754 floating point
-// allows zero to be signed. The comparison `-0.0 < 0.0' is false, but
-// `gr_signbit (-0.0)' will return a nonzero value.
-
-int gr_signbit (double x);
-
/*!
* \brief Fast arc tangent using table lookup and linear interpolation
* \ingroup misc
diff --git a/gnuradio-core/src/lib/general/gr_ofdm_frame_sink.cc b/gnuradio-core/src/lib/general/gr_ofdm_frame_sink.cc
index 3457370eb..279945766 100644
--- a/gnuradio-core/src/lib/general/gr_ofdm_frame_sink.cc
+++ b/gnuradio-core/src/lib/general/gr_ofdm_frame_sink.cc
@@ -281,7 +281,7 @@ gr_ofdm_frame_sink::set_sym_value_out(const std::vector<gr_complex> &sym_positio
d_sym_position = sym_position;
d_sym_value_out = sym_value_out;
- d_nbits = (unsigned long)ceil(log10(d_sym_value_out.size()) / log10(2.0));
+ d_nbits = (unsigned long)ceil(log10(float(d_sym_value_out.size())) / log10(2.0));
return true;
}
diff --git a/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.cc b/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.cc
index 370b029cd..cc4aba0cb 100644
--- a/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.cc
+++ b/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.cc
@@ -113,7 +113,7 @@ gr_ofdm_mapper_bcv::gr_ofdm_mapper_bcv (const std::vector<gr_complex> &constella
throw std::invalid_argument("gr_ofdm_mapper_bcv: subcarriers allocated exceeds size of occupied carriers");
}
- d_nbits = (unsigned long)ceil(log10(d_constellation.size()) / log10(2.0));
+ d_nbits = (unsigned long)ceil(log10(float(d_constellation.size())) / log10(2.0));
}
gr_ofdm_mapper_bcv::~gr_ofdm_mapper_bcv(void)
diff --git a/gnuradio-core/src/lib/general/gri_fft.cc b/gnuradio-core/src/lib/general/gri_fft.cc
index e535f28c7..f20b15ca0 100644
--- a/gnuradio-core/src/lib/general/gri_fft.cc
+++ b/gnuradio-core/src/lib/general/gri_fft.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2003,2008 Free Software Foundation, Inc.
+ * Copyright 2003,2008,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -21,6 +21,7 @@
*/
#include <gri_fft.h>
+#include <gr_sys_paths.h>
#include <fftw3.h>
#include <gr_complex.h>
#include <stdlib.h>
@@ -29,6 +30,9 @@
#include <cassert>
#include <stdexcept>
+#include <boost/filesystem/operations.hpp>
+#include <boost/filesystem/path.hpp>
+namespace fs = boost::filesystem;
boost::mutex &
gri_fft_planner::mutex()
@@ -38,26 +42,18 @@ gri_fft_planner::mutex()
return s_planning_mutex;
}
-static char *
+static const char *
wisdom_filename ()
{
- static const char *filename = ".gr_fftw_wisdom";
-
- char *home = getenv ("HOME");
- if (home){
- char *p = new char[strlen (home) + strlen (filename) + 2];
- strcpy (p, home);
- strcat (p, "/");
- strcat (p, filename);
- return p;
- }
- return 0;
+ static fs::path path;
+ path = fs::path(gr_appdata_path()) / ".gr_fftw_wisdom";
+ return path.string().c_str();
}
static void
gri_fftw_import_wisdom ()
{
- char *filename = wisdom_filename ();
+ const char *filename = wisdom_filename ();
FILE *fp = fopen (filename, "r");
if (fp != 0){
int r = fftwf_import_wisdom_from_file (fp);
@@ -66,13 +62,12 @@ gri_fftw_import_wisdom ()
fprintf (stderr, "gri_fftw: can't import wisdom from %s\n", filename);
}
}
- delete [] filename;
}
static void
gri_fftw_export_wisdom ()
{
- char *filename = wisdom_filename ();
+ const char *filename = wisdom_filename ();
FILE *fp = fopen (filename, "w");
if (fp != 0){
fftwf_export_wisdom_to_file (fp);
@@ -82,7 +77,6 @@ gri_fftw_export_wisdom ()
fprintf (stderr, "gri_fftw: ");
perror (filename);
}
- delete [] filename;
}
// ----------------------------------------------------------------
diff --git a/gnuradio-core/src/lib/general/qa_gr_fxpt_vco.cc b/gnuradio-core/src/lib/general/qa_gr_fxpt_vco.cc
index 9885b3852..113006a22 100644
--- a/gnuradio-core/src/lib/general/qa_gr_fxpt_vco.cc
+++ b/gnuradio-core/src/lib/general/qa_gr_fxpt_vco.cc
@@ -53,7 +53,7 @@ qa_gr_fxpt_vco::t0 ()
float input[SIN_COS_BLOCK_SIZE];
for (int i = 0; i < SIN_COS_BLOCK_SIZE; i++){
- input[i] = sin(i);
+ input[i] = sin(double(i));
}
for (int i = 0; i < SIN_COS_BLOCK_SIZE; i++){
@@ -85,7 +85,7 @@ qa_gr_fxpt_vco::t1 ()
double max_error = 0;
for (int i = 0; i < SIN_COS_BLOCK_SIZE; i++){
- input[i] = sin(i);
+ input[i] = sin(double(i));
}
ref_vco.cos (ref_block, input, SIN_COS_BLOCK_SIZE, SIN_COS_K, SIN_COS_AMPL);
diff --git a/gnuradio-core/src/lib/missing/Makefile.am b/gnuradio-core/src/lib/missing/Makefile.am
index bd18cf143..1cc6014a1 100644
--- a/gnuradio-core/src/lib/missing/Makefile.am
+++ b/gnuradio-core/src/lib/missing/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2003,2004,2008,2009 Free Software Foundation, Inc.
+# Copyright 2003,2004,2008,2009,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -21,7 +21,7 @@
include $(top_srcdir)/Makefile.common
-AM_CPPFLAGS = $(GNURADIO_INCLUDES) $(WITH_INCLUDES)
+AM_CPPFLAGS = $(GRUEL_INCLUDES) $(GNURADIO_INCLUDES) $(WITH_INCLUDES)
EXTRA_DIST += \
getopt.h \
diff --git a/gnuradio-core/src/lib/runtime/Makefile.am b/gnuradio-core/src/lib/runtime/Makefile.am
index 3dd2b42f5..eca92e526 100644
--- a/gnuradio-core/src/lib/runtime/Makefile.am
+++ b/gnuradio-core/src/lib/runtime/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2003,2004,2007,2008,2009,2010 Free Software Foundation, Inc.
+# Copyright 2003,2004,2007,2008,2009,2010,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -58,7 +58,7 @@ libruntime_la_SOURCES = \
gr_sync_block.cc \
gr_sync_decimator.cc \
gr_sync_interpolator.cc \
- gr_tmp_path.cc \
+ gr_sys_paths.cc \
gr_top_block.cc \
gr_top_block_impl.cc \
gr_tpb_detail.cc \
@@ -121,7 +121,7 @@ grinclude_HEADERS = \
gr_tpb_detail.h \
gr_tpb_thread_body.h \
gr_timer.h \
- gr_tmp_path.h \
+ gr_sys_paths.h \
gr_types.h \
gr_unittests.h \
gr_vmcircbuf.h \
diff --git a/gnuradio-core/src/lib/runtime/gr_buffer.cc b/gnuradio-core/src/lib/runtime/gr_buffer.cc
index 03d5a8738..fa3722714 100644
--- a/gnuradio-core/src/lib/runtime/gr_buffer.cc
+++ b/gnuradio-core/src/lib/runtime/gr_buffer.cc
@@ -31,6 +31,7 @@
#include <iostream>
#include <assert.h>
#include <algorithm>
+#include <boost/math/common_factor_rt.hpp>
static long s_buffer_count = 0; // counts for debugging storage mgmt
static long s_buffer_reader_count = 0;
@@ -73,7 +74,7 @@ static long s_buffer_reader_count = 0;
static long
minimum_buffer_items (long type_size, long page_size)
{
- return page_size / gr_gcd (type_size, page_size);
+ return page_size / boost::math::gcd (type_size, page_size);
}
diff --git a/gnuradio-core/src/lib/runtime/gr_preferences.cc b/gnuradio-core/src/lib/runtime/gr_preferences.cc
index 5f7412248..c2ca047a8 100644
--- a/gnuradio-core/src/lib/runtime/gr_preferences.cc
+++ b/gnuradio-core/src/lib/runtime/gr_preferences.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2003,2010 Free Software Foundation, Inc.
+ * Copyright 2003,2010,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -25,6 +25,7 @@
#endif
#include <gr_preferences.h>
+#include <gr_sys_paths.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -33,12 +34,9 @@
#include <unistd.h>
#include <string.h>
-
-#ifdef MKDIR_TAKES_ONE_ARG
-#define gr_mkdir(pathname, mode) mkdir(pathname)
-#else
-#define gr_mkdir(pathname, mode) mkdir((pathname), (mode))
-#endif
+#include <boost/filesystem/operations.hpp>
+#include <boost/filesystem/path.hpp>
+namespace fs = boost::filesystem;
/*
* The simplest thing that could possibly work:
@@ -48,27 +46,19 @@
static const char *
pathname (const char *key)
{
- static char buf[200];
- snprintf (buf, sizeof (buf), "%s/.gnuradio/prefs/%s", getenv ("HOME"), key);
- return buf;
+ static fs::path path;
+ path = fs::path(gr_appdata_path()) / ".gnuradio" / "prefs" / key;
+ return path.string().c_str();
}
static void
ensure_dir_path ()
{
- char path[200];
- struct stat statbuf;
-
- snprintf (path, sizeof (path), "%s/.gnuradio/prefs", getenv ("HOME"));
- if (stat (path, &statbuf) == 0 && S_ISDIR (statbuf.st_mode))
- return;
-
- // blindly try to make it // FIXME make this robust. C++ SUCKS!
+ fs::path path = fs::path(gr_appdata_path()) / ".gnuradio";
+ if (!fs::is_directory(path)) fs::create_directory(path);
- snprintf (path, sizeof (path), "%s/.gnuradio", getenv ("HOME"));
- gr_mkdir (path, 0750);
- snprintf (path, sizeof (path), "%s/.gnuradio/prefs", getenv ("HOME"));
- gr_mkdir (path, 0750);
+ path = path / "prefs";
+ if (!fs::is_directory(path)) fs::create_directory(path);
}
const char *
diff --git a/gnuradio-core/src/lib/runtime/gr_sys_paths.cc b/gnuradio-core/src/lib/runtime/gr_sys_paths.cc
new file mode 100644
index 000000000..9d10a3ccd
--- /dev/null
+++ b/gnuradio-core/src/lib/runtime/gr_sys_paths.cc
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+
+#include <gr_sys_paths.h>
+#include <cstdlib> //getenv
+#include <cstdio> //P_tmpdir (maybe)
+
+const char *gr_tmp_path(){
+ const char *path;
+
+ //first case, try TMP environment variable
+ path = getenv("TMP");
+ if (path) return path;
+
+ //second case, try P_tmpdir when its defined
+ #ifdef P_tmpdir
+ if (P_tmpdir) return P_tmpdir;
+ #endif /*P_tmpdir*/
+
+ //fall-through case, nothing worked
+ return "/tmp";
+}
+
+const char *gr_appdata_path(){
+ const char *path;
+
+ //first case, try HOME environment variable (unix)
+ path = getenv("HOME");
+ if (path) return path;
+
+ //second case, try APPDATA environment variable (windows)
+ path = getenv("APPDATA");
+ if (path) return path;
+
+ //fall-through case, nothing worked
+ return gr_tmp_path();
+}
diff --git a/gnuradio-core/src/lib/runtime/gr_tmp_path.h b/gnuradio-core/src/lib/runtime/gr_sys_paths.h
index 3d02043c7..aa8249775 100644
--- a/gnuradio-core/src/lib/runtime/gr_tmp_path.h
+++ b/gnuradio-core/src/lib/runtime/gr_sys_paths.h
@@ -1,6 +1,5 @@
-/* -*- c++ -*- */
/*
- * Copyright 2003 Free Software Foundation, Inc.
+ * Copyright 2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -20,12 +19,13 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef _GR_TMP_PATH_H_
-#define _GR_TMP_PATH_H_
+#ifndef _GR_SYS_PATHS_H_
+#define _GR_SYS_PATHS_H_
-/*!
- * \brief return directory portion of pathname used for temporary files.
- */
-const char *gr_tmp_path ();
+//! directory to create temporary files
+const char *gr_tmp_path();
+
+//! directory to store application data
+const char *gr_appdata_path();
-#endif /* _GR_TMP_PATH_H_ */
+#endif /* _GR_SYS_PATHS_H_ */
diff --git a/gnuradio-core/src/lib/runtime/gr_tmp_path.cc b/gnuradio-core/src/lib/runtime/gr_tmp_path.cc
deleted file mode 100644
index 1f0c830cd..000000000
--- a/gnuradio-core/src/lib/runtime/gr_tmp_path.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2003 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.
- */
-
-#include <gr_tmp_path.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-const char *
-gr_tmp_path ()
-{
- static char *pp = 0;
-
- if (pp)
- return pp;
-
- char *s = getenv ("TMP");
- if (s){
- pp = strdup (s);
- return pp;
- }
-
-#ifdef P_tmpdir
- if (P_tmpdir){
- pp = strdup (P_tmpdir);
- return pp;
- }
-#endif
-
- pp = strdup ("/tmp");
- return pp;
-}
-
diff --git a/gnuradio-core/src/lib/runtime/gr_unittests.h b/gnuradio-core/src/lib/runtime/gr_unittests.h
index 70aa6f294..59149bb2e 100644
--- a/gnuradio-core/src/lib/runtime/gr_unittests.h
+++ b/gnuradio-core/src/lib/runtime/gr_unittests.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2010 Free Software Foundation, Inc.
+ * Copyright 2010,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -31,37 +31,11 @@
#include <sys/stat.h>
#include <unistd.h>
+#include <boost/filesystem/operations.hpp>
+#include <boost/filesystem/path.hpp>
-#ifdef MKDIR_TAKES_ONE_ARG
-#define gr_mkdir(pathname, mode) mkdir(pathname)
-#else
-#define gr_mkdir(pathname, mode) mkdir((pathname), (mode))
-#endif
-
-/*
- * Mostly taken from gr_preferences.cc/h
- * The simplest thing that could possibly work:
- * the key is the filename; the value is the file contents.
- */
-
-static void
-ensure_unittest_path (const char *path)
-{
- struct stat statbuf;
- if (stat (path, &statbuf) == 0 && S_ISDIR (statbuf.st_mode))
- return;
-
- // blindly try to make it // FIXME make this robust. C++ SUCKS!
- gr_mkdir (path, 0750);
+static std::string get_unittest_path(const std::string &filename){
+ boost::filesystem::path path = boost::filesystem::current_path() / ".unittests";
+ if (!boost::filesystem::is_directory(path)) boost::filesystem::create_directory(path);
+ return (path / filename).string();
}
-
-static void
-get_unittest_path (const char *filename, char *fullpath, size_t pathsize)
-{
- char path[200];
- snprintf (path, sizeof(path), "./.unittests");
- snprintf (fullpath, pathsize, "%s/%s", path, filename);
-
- ensure_unittest_path(path);
-}
-
diff --git a/gnuradio-core/src/lib/runtime/gr_vmcircbuf_createfilemapping.cc b/gnuradio-core/src/lib/runtime/gr_vmcircbuf_createfilemapping.cc
index 65fe0c488..42c459484 100644
--- a/gnuradio-core/src/lib/runtime/gr_vmcircbuf_createfilemapping.cc
+++ b/gnuradio-core/src/lib/runtime/gr_vmcircbuf_createfilemapping.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2003,2005 Free Software Foundation, Inc.
+ * Copyright 2003,2005,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -36,7 +36,6 @@
#include <errno.h>
#include <stdio.h>
#include <gr_pagesize.h>
-#include <gr_tmp_path.h>
#include <gr_vmcircbuf_createfilemapping.h>
#ifdef HAVE_CREATEFILEMAPPING
diff --git a/gnuradio-core/src/lib/runtime/gr_vmcircbuf_mmap_shm_open.cc b/gnuradio-core/src/lib/runtime/gr_vmcircbuf_mmap_shm_open.cc
index 3017036ef..4f7ae39cd 100644
--- a/gnuradio-core/src/lib/runtime/gr_vmcircbuf_mmap_shm_open.cc
+++ b/gnuradio-core/src/lib/runtime/gr_vmcircbuf_mmap_shm_open.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2003 Free Software Foundation, Inc.
+ * Copyright 2003,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -37,7 +37,7 @@
#include <errno.h>
#include <stdio.h>
#include <gr_pagesize.h>
-#include <gr_tmp_path.h>
+#include <gr_sys_paths.h>
gr_vmcircbuf_mmap_shm_open::gr_vmcircbuf_mmap_shm_open (int size)
diff --git a/gnuradio-core/src/lib/runtime/gr_vmcircbuf_mmap_tmpfile.cc b/gnuradio-core/src/lib/runtime/gr_vmcircbuf_mmap_tmpfile.cc
index faae4b396..ee8b0c485 100644
--- a/gnuradio-core/src/lib/runtime/gr_vmcircbuf_mmap_tmpfile.cc
+++ b/gnuradio-core/src/lib/runtime/gr_vmcircbuf_mmap_tmpfile.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2003 Free Software Foundation, Inc.
+ * Copyright 2003,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -39,7 +39,7 @@
#include <stdio.h>
#include <string.h>
#include <gr_pagesize.h>
-#include <gr_tmp_path.h>
+#include <gr_sys_paths.h>
gr_vmcircbuf_mmap_tmpfile::gr_vmcircbuf_mmap_tmpfile (int size)
: gr_vmcircbuf (size)
diff --git a/gnuradio-core/src/tests/Makefile.am b/gnuradio-core/src/tests/Makefile.am
index c75bb8c2a..5879a13d8 100644
--- a/gnuradio-core/src/tests/Makefile.am
+++ b/gnuradio-core/src/tests/Makefile.am
@@ -59,7 +59,7 @@ noinst_SCRIPTS = \
benchmark_dotprod
-LIBGNURADIO = $(GNURADIO_CORE_LA)
+LIBGNURADIO = $(GNURADIO_CORE_LA) $(BOOST_FILESYSTEM_LIB)
LIBGNURADIOQA = $(top_builddir)/gnuradio-core/src/lib/libgnuradio-core-qa.la $(LIBGNURADIO)
benchmark_dotprod_fff_SOURCES = benchmark_dotprod_fff.cc
diff --git a/gnuradio-core/src/tests/benchmark_vco.cc b/gnuradio-core/src/tests/benchmark_vco.cc
index ed0ae3b67..3a6ade78c 100644
--- a/gnuradio-core/src/tests/benchmark_vco.cc
+++ b/gnuradio-core/src/tests/benchmark_vco.cc
@@ -63,7 +63,7 @@ benchmark (void test (float *x, const float *y), const char *implementation_name
// touch memory
memset(output, 0, BLOCK_SIZE*sizeof(float));
for (int i = 0; i<BLOCK_SIZE; i++)
- input[i] = sin(i);
+ input[i] = sin(double(i));
// get starting CPU usage
#ifdef HAVE_SYS_RESOURCE_H
diff --git a/gnuradio-core/src/tests/test_all.cc b/gnuradio-core/src/tests/test_all.cc
index 17ee32f34..6cec8ad0e 100644
--- a/gnuradio-core/src/tests/test_all.cc
+++ b/gnuradio-core/src/tests/test_all.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2002,2010 Free Software Foundation, Inc.
+ * Copyright 2002,2010,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -34,11 +34,8 @@
int
main (int argc, char **argv)
{
- char path[200];
- get_unittest_path ("gnuradio_core_all.xml", path, 200);
-
CppUnit::TextTestRunner runner;
- std::ofstream xmlfile(path);
+ std::ofstream xmlfile(get_unittest_path("gnuradio_core_all.xml").c_str());
CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile);
runner.addTest (qa_runtime::suite ());
diff --git a/gnuradio-core/src/tests/test_atsc.cc b/gnuradio-core/src/tests/test_atsc.cc
index 51642f81a..66cb2a312 100644
--- a/gnuradio-core/src/tests/test_atsc.cc
+++ b/gnuradio-core/src/tests/test_atsc.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2002 Free Software Foundation, Inc.
+ * Copyright 2002,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -29,11 +29,8 @@
int
main (int argc, char **argv)
{
- char path[200];
- get_unittest_path ("gnuradio_core_atsc.xml", path, 200);
-
CppUnit::TextTestRunner runner;
- std::ofstream xmlfile(path);
+ std::ofstream xmlfile(get_unittest_path("gnuradio_core_atsc.xml").c_str());
CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile);
runner.addTest (qa_atsc::suite ());
diff --git a/gnuradio-core/src/tests/test_filter.cc b/gnuradio-core/src/tests/test_filter.cc
index 2781cfb35..3227a9ff2 100644
--- a/gnuradio-core/src/tests/test_filter.cc
+++ b/gnuradio-core/src/tests/test_filter.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2002,2010 Free Software Foundation, Inc.
+ * Copyright 2002,2010,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -29,11 +29,8 @@
int
main (int argc, char **argv)
{
- char path[200];
- get_unittest_path ("gnuradio_core_filter.xml", path, 200);
-
CppUnit::TextTestRunner runner;
- std::ofstream xmlfile(path);
+ std::ofstream xmlfile(get_unittest_path("gnuradio_core_filter.xml").c_str());
CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile);
runner.addTest (qa_filter::suite ());
diff --git a/gnuradio-core/src/tests/test_general.cc b/gnuradio-core/src/tests/test_general.cc
index 16ee9c3ad..ca6dee40a 100644
--- a/gnuradio-core/src/tests/test_general.cc
+++ b/gnuradio-core/src/tests/test_general.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2002,2010 Free Software Foundation, Inc.
+ * Copyright 2002,2010,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -29,11 +29,8 @@
int
main (int argc, char **argv)
{
- char path[200];
- get_unittest_path ("gnuradio_core_general.xml", path, 200);
-
CppUnit::TextTestRunner runner;
- std::ofstream xmlfile(path);
+ std::ofstream xmlfile(get_unittest_path("gnuradio_core_general.xml").c_str());
CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile);
runner.addTest (qa_general::suite ());
diff --git a/gnuradio-core/src/tests/test_runtime.cc b/gnuradio-core/src/tests/test_runtime.cc
index c7983a23e..77af3001b 100644
--- a/gnuradio-core/src/tests/test_runtime.cc
+++ b/gnuradio-core/src/tests/test_runtime.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2002,2010 Free Software Foundation, Inc.
+ * Copyright 2002,2010,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -29,11 +29,8 @@
int
main (int argc, char **argv)
{
- char path[200];
- get_unittest_path ("gnuradio_core_runtime.xml", path, 200);
-
CppUnit::TextTestRunner runner;
- std::ofstream xmlfile(path);
+ std::ofstream xmlfile(get_unittest_path("gnuradio_core_runtime.xml").c_str());
CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile);
runner.addTest (qa_runtime::suite ());
diff --git a/gr-atsc/src/lib/atsci_equalizer_lms2.cc b/gr-atsc/src/lib/atsci_equalizer_lms2.cc
index 345f6209f..f9fb57c7b 100644
--- a/gr-atsc/src/lib/atsci_equalizer_lms2.cc
+++ b/gr-atsc/src/lib/atsci_equalizer_lms2.cc
@@ -28,6 +28,7 @@
#include <stdlib.h>
#include <gr_math.h>
#include <stdio.h>
+#include <boost/math/special_functions/fpclassify.hpp>
using std::min;
using std::max;
@@ -55,7 +56,7 @@ wrap (int d)
static inline float
slice (float d)
{
- if (gr_isnan (d))
+ if (boost::math::isnan (d))
return 0.0;
if (d >= 0.0){
@@ -247,7 +248,7 @@ atsci_equalizer_lms2::filter1 (const float input[])
acc -= d_taps_fb[i] * d_old_output[wrap(i + d_output_ptr)];
}
- if (gr_isnan (acc)){
+ if (boost::math::isnan (acc)){
abort ();
}
diff --git a/gr-atsc/src/lib/atsci_sssr.cc b/gr-atsc/src/lib/atsci_sssr.cc
index dc5c01b0d..4ccee85de 100644
--- a/gr-atsc/src/lib/atsci_sssr.cc
+++ b/gr-atsc/src/lib/atsci_sssr.cc
@@ -28,6 +28,7 @@
#include <atsci_diag_output.h>
#include <gr_math.h>
#include <stdio.h>
+#include <boost/math/special_functions/sign.hpp>
/*
* ----------------------------------------------------------------
@@ -141,7 +142,7 @@ atsci_sssr::update (sssr::sample_t sample_in, // input
double qo = d_quad_filter.update (sample_in);
d_quad_output[d_counter] = qo;
- int bit = gr_signbit (sample_in) ^ 1; // slice on sign: + => 1, - => 0
+ int bit = boost::math::signbit (sample_in) ^ 1; // slice on sign: + => 1, - => 0
int corr_out = d_correlator.update (bit);
int weight = sipp (corr_out);
int corr_value = d_integrator.update (weight, d_counter);
diff --git a/gr-atsc/src/lib/test_atsci.cc b/gr-atsc/src/lib/test_atsci.cc
index 184895a90..031ca42ae 100644
--- a/gr-atsc/src/lib/test_atsci.cc
+++ b/gr-atsc/src/lib/test_atsci.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2002,2006,2010 Free Software Foundation, Inc.
+ * Copyright 2002,2006,2010,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -28,11 +28,8 @@
int
main (int argc, char **argv)
{
- char path[200];
- get_unittest_path ("gr_atsc.xml", path, 200);
-
CppUnit::TextTestRunner runner;
- std::ofstream xmlfile(path);
+ std::ofstream xmlfile(get_unittest_path("gr_atsc.xml").c_str());
CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile);
runner.addTest (qa_atsc::suite ());
diff --git a/gr-howto-write-a-block/config/gr_pwin32.m4 b/gr-howto-write-a-block/config/gr_pwin32.m4
index 495e9dd4d..6b27b439f 100644
--- a/gr-howto-write-a-block/config/gr_pwin32.m4
+++ b/gr-howto-write-a-block/config/gr_pwin32.m4
@@ -1,6 +1,6 @@
# Check for (mingw)win32 POSIX replacements. -*- Autoconf -*-
-# Copyright 2003,2004,2005 Free Software Foundation, Inc.
+# Copyright 2003,2004,2005,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -61,17 +61,6 @@ AC_TRY_LINK([ #include <windows.h>
AC_MSG_RESULT(no)
)
-dnl Under Win32, mkdir prototype in io.h has only one arg
-AC_MSG_CHECKING(whether mkdir accepts only one arg)
-AC_TRY_COMPILE([#include <sys/types.h>
- #include <sys/stat.h>
- #include <fcntl.h>], [
- mkdir("")
- ], [ AC_MSG_RESULT(yes)
- AC_DEFINE(MKDIR_TAKES_ONE_ARG,[],[Define if mkdir accepts only one arg]) ],
- [ AC_MSG_RESULT(no)
- ])
-
AH_BOTTOM(
[
/* Define missing prototypes, implemented in replacement lib */
diff --git a/gr-howto-write-a-block/config/lf_cxx.m4 b/gr-howto-write-a-block/config/lf_cxx.m4
index dfc6bfbfe..7cce5f8a4 100644
--- a/gr-howto-write-a-block/config/lf_cxx.m4
+++ b/gr-howto-write-a-block/config/lf_cxx.m4
@@ -46,22 +46,5 @@ AC_DEFUN([LF_CXX_PORTABILITY],[
dnl Check for common C++ portability problems
dnl
- dnl AC_LANG_PUSH
- dnl AC_LANG_CPLUSPLUS
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
-
-
- dnl Test whether C++ has std::isnan
- AC_MSG_CHECKING(whether C++ has std::isnan)
- AC_TRY_COMPILE([#include <cmath>], [
- std::isnan(0);
-], [ AC_MSG_RESULT(yes)
- AC_DEFINE(CXX_HAS_STD_ISNAN,[],[Define if has std::isnan]) ],
- [ AC_MSG_RESULT(no) ])
-
- dnl Done with the portability checks
- dnl AC_LANG_POP([C++])
- AC_LANG_RESTORE
])
diff --git a/gr-howto-write-a-block/config/mkstemp.m4 b/gr-howto-write-a-block/config/mkstemp.m4
index 4af0f0a9b..2d1fbee9b 100644
--- a/gr-howto-write-a-block/config/mkstemp.m4
+++ b/gr-howto-write-a-block/config/mkstemp.m4
@@ -75,15 +75,4 @@ AC_DEFUN([jm_PREREQ_TEMPNAME],
AC_CHECK_FUNCS(__secure_getenv gettimeofday lstat)
AC_CHECK_DECLS_ONCE(getenv)
# AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
-
- dnl Under Win32, mkdir prototype in io.h has only one arg
- AC_MSG_CHECKING(whether mkdir accepts only one arg)
- AC_TRY_COMPILE([#include <sys/types.h>
- #include <sys/stat.h>
- #include <fcntl.h>], [
- mkdir("")
- ], [ AC_MSG_RESULT(yes)
- AC_DEFINE(MKDIR_TAKES_ONE_ARG,[],[Define if mkdir accepts only one arg]) ],
- [ AC_MSG_RESULT(no)
- ])
])
diff --git a/gr-howto-write-a-block/lib/test_all.cc b/gr-howto-write-a-block/lib/test_all.cc
index ac1e83839..c12958691 100644
--- a/gr-howto-write-a-block/lib/test_all.cc
+++ b/gr-howto-write-a-block/lib/test_all.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2009,2010 Free Software Foundation, Inc.
+ * Copyright 2009,2010,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -29,11 +29,8 @@
int
main (int argc, char **argv)
{
- char path[200];
- get_unittest_path ("gr_howto_write_a_block.xml", path, 200);
-
CppUnit::TextTestRunner runner;
- std::ofstream xmlfile(path);
+ std::ofstream xmlfile(get_unittest_path("gr_howto_write_a_block.xml").c_str());
CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile);
runner.addTest(qa_howto::suite ());
diff --git a/gr-qtgui/src/lib/FrequencyDisplayPlot.h b/gr-qtgui/src/lib/FrequencyDisplayPlot.h
index c78e1667e..3c22c1397 100644
--- a/gr-qtgui/src/lib/FrequencyDisplayPlot.h
+++ b/gr-qtgui/src/lib/FrequencyDisplayPlot.h
@@ -1,6 +1,7 @@
#ifndef FREQUENCY_DISPLAY_PLOT_HPP
#define FREQUENCY_DISPLAY_PLOT_HPP
+#include <stdint.h>
#include <cstdio>
#include <qwt_plot.h>
#include <qwt_painter.h>
diff --git a/gr-qtgui/src/lib/Makefile.am b/gr-qtgui/src/lib/Makefile.am
index b45b25c9d..446a07fd0 100644
--- a/gr-qtgui/src/lib/Makefile.am
+++ b/gr-qtgui/src/lib/Makefile.am
@@ -25,7 +25,7 @@ include $(top_srcdir)/Makefile.swig
EXTRA_DIST += spectrumdisplayform.ui
AM_CPPFLAGS = -I. $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \
- $(QT_INCLUDES) $(WITH_INCLUDES)
+ $(QT_INCLUDES) $(BOOST_CPPFLAGS) $(WITH_INCLUDES)
# Only include these files in the build if qtgui passes configure checks
# This is mostly to help make distcheck pass
@@ -82,10 +82,12 @@ QT_MOC_FLAGS=-DQT_SHARED -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LI
$(QT_UIC_EXEC) $< -o $@
# magic flags
-libgnuradio_qtgui_la_LDFLAGS = $(NO_UNDEFINED) $(LTVERSIONFLAGS)
+libgnuradio_qtgui_la_LDFLAGS = $(NO_UNDEFINED) $(BOOST_LDFLAGS) $(LTVERSIONFLAGS)
libgnuradio_qtgui_la_LIBADD = \
$(GNURADIO_CORE_LA) \
+ $(BOOST_THREAD_LIB) \
+ $(BOOST_DATE_TIME_LIB) \
-lstdc++ \
$(QT_LIBS)
diff --git a/gr-qtgui/src/lib/SpectrumGUIClass.cc b/gr-qtgui/src/lib/SpectrumGUIClass.cc
index 563ed34ba..052730fc2 100644
--- a/gr-qtgui/src/lib/SpectrumGUIClass.cc
+++ b/gr-qtgui/src/lib/SpectrumGUIClass.cc
@@ -6,8 +6,8 @@
#include <QEvent>
#include <QCustomEvent>
-const long SpectrumGUIClass::MAX_FFT_SIZE;
-const long SpectrumGUIClass::MIN_FFT_SIZE;
+const long SpectrumGUIClass::MAX_FFT_SIZE = 32768;
+const long SpectrumGUIClass::MIN_FFT_SIZE = 1024;
SpectrumGUIClass::SpectrumGUIClass(const uint64_t maxDataSize,
const uint64_t fftSize,
diff --git a/gr-qtgui/src/lib/SpectrumGUIClass.h b/gr-qtgui/src/lib/SpectrumGUIClass.h
index 63a340c34..57a749a6a 100644
--- a/gr-qtgui/src/lib/SpectrumGUIClass.h
+++ b/gr-qtgui/src/lib/SpectrumGUIClass.h
@@ -67,8 +67,8 @@ public:
void DecrementPendingGUIUpdateEvents();
void ResetPendingGUIUpdateEvents();
- static const long MAX_FFT_SIZE = /*1048576*/32768;
- static const long MIN_FFT_SIZE = 1024;
+ static const long MAX_FFT_SIZE;
+ static const long MIN_FFT_SIZE;
QWidget* qwidget();
diff --git a/gr-qtgui/src/lib/TimeDomainDisplayPlot.h b/gr-qtgui/src/lib/TimeDomainDisplayPlot.h
index 5525bbabe..952b5c8cf 100644
--- a/gr-qtgui/src/lib/TimeDomainDisplayPlot.h
+++ b/gr-qtgui/src/lib/TimeDomainDisplayPlot.h
@@ -1,6 +1,7 @@
#ifndef TIME_DOMAIN_DISPLAY_PLOT_HPP
#define TIME_DOMAIN_DISPLAY_PLOT_HPP
+#include <stdint.h>
#include <cstdio>
#include <qwt_plot.h>
#include <qwt_painter.h>
diff --git a/gr-qtgui/src/lib/WaterfallDisplayPlot.cc b/gr-qtgui/src/lib/WaterfallDisplayPlot.cc
index 680c44756..a8e5361e7 100644
--- a/gr-qtgui/src/lib/WaterfallDisplayPlot.cc
+++ b/gr-qtgui/src/lib/WaterfallDisplayPlot.cc
@@ -12,6 +12,9 @@
#include <qapplication.h>
+#include <boost/date_time/posix_time/posix_time.hpp>
+namespace pt = boost::posix_time;
+
class FreqOffsetAndPrecisionClass
{
public:
@@ -135,16 +138,14 @@ public:
virtual QwtText label(double value) const
{
- QwtText returnLabel("");
-
timespec lineTime = timespec_add(GetZeroTime(), (-value) * GetSecondsPerLine());
- struct tm timeTm;
- gmtime_r(&lineTime.tv_sec, &timeTm);
- returnLabel = (QString("").sprintf("%04d/%02d/%02d\n%02d:%02d:%02d.%03ld",
- timeTm.tm_year+1900, timeTm.tm_mon+1,
- timeTm.tm_mday, timeTm.tm_hour, timeTm.tm_min,
- timeTm.tm_sec, lineTime.tv_nsec/1000000));
- return returnLabel;
+ std::string time_str = pt::to_simple_string(pt::from_time_t(lineTime.tv_sec));
+
+ // lops off the YYYY-mmm-DD part of the string
+ int ind = time_str.find(" ");
+ if(ind != std::string::npos)
+ time_str = time_str.substr(ind);
+ return QwtText(QString("").sprintf("%s.%03ld", time_str.c_str(), lineTime.tv_nsec/1000000));
}
virtual void initiateUpdate()
@@ -189,15 +190,14 @@ protected:
using QwtPlotZoomer::trackerText;
virtual QwtText trackerText( const QwtDoublePoint& p ) const
{
- QString yLabel("");
-
timespec lineTime = timespec_add(GetZeroTime(), (-p.y()) * GetSecondsPerLine());
- struct tm timeTm;
- gmtime_r(&lineTime.tv_sec, &timeTm);
- yLabel = (QString("").sprintf("%04d/%02d/%02d %02d:%02d:%02d.%03ld",
- timeTm.tm_year+1900, timeTm.tm_mon+1,
- timeTm.tm_mday, timeTm.tm_hour, timeTm.tm_min,
- timeTm.tm_sec, lineTime.tv_nsec/1000000));
+ std::string time_str = pt::to_simple_string(pt::from_time_t(lineTime.tv_sec));
+
+ // lops off the YYYY-mmm-DD part of the string
+ int ind = time_str.find(" ");
+ if(ind != std::string::npos)
+ time_str = time_str.substr(ind);
+ QString yLabel(QString("").sprintf("%s.%03ld", time_str.c_str(), lineTime.tv_nsec/1000000));
QwtText t(QString("%1 %2, %3").
arg(p.x(), 0, 'f', GetFrequencyPrecision()).
@@ -210,12 +210,6 @@ private:
};
-const int WaterfallDisplayPlot::INTENSITY_COLOR_MAP_TYPE_MULTI_COLOR;
-const int WaterfallDisplayPlot::INTENSITY_COLOR_MAP_TYPE_WHITE_HOT;
-const int WaterfallDisplayPlot::INTENSITY_COLOR_MAP_TYPE_BLACK_HOT;
-const int WaterfallDisplayPlot::INTENSITY_COLOR_MAP_TYPE_INCANDESCENT;
-const int WaterfallDisplayPlot::INTENSITY_COLOR_MAP_TYPE_USER_DEFINED;
-
WaterfallDisplayPlot::WaterfallDisplayPlot(QWidget* parent)
: QwtPlot(parent)
{
diff --git a/gr-qtgui/src/lib/WaterfallDisplayPlot.h b/gr-qtgui/src/lib/WaterfallDisplayPlot.h
index a5ccaec40..6b4e978bb 100644
--- a/gr-qtgui/src/lib/WaterfallDisplayPlot.h
+++ b/gr-qtgui/src/lib/WaterfallDisplayPlot.h
@@ -1,6 +1,7 @@
#ifndef WATERFALL_DISPLAY_PLOT_HPP
#define WATERFALL_DISPLAY_PLOT_HPP
+#include <stdint.h>
#include <cstdio>
#include <qwt_plot.h>
#include <qwt_plot_zoomer.h>
@@ -39,11 +40,13 @@ public:
const QColor GetUserDefinedLowIntensityColor()const;
const QColor GetUserDefinedHighIntensityColor()const;
- static const int INTENSITY_COLOR_MAP_TYPE_MULTI_COLOR = 0;
- static const int INTENSITY_COLOR_MAP_TYPE_WHITE_HOT = 1;
- static const int INTENSITY_COLOR_MAP_TYPE_BLACK_HOT = 2;
- static const int INTENSITY_COLOR_MAP_TYPE_INCANDESCENT = 3;
- static const int INTENSITY_COLOR_MAP_TYPE_USER_DEFINED = 4;
+ enum{
+ INTENSITY_COLOR_MAP_TYPE_MULTI_COLOR = 0,
+ INTENSITY_COLOR_MAP_TYPE_WHITE_HOT = 1,
+ INTENSITY_COLOR_MAP_TYPE_BLACK_HOT = 2,
+ INTENSITY_COLOR_MAP_TYPE_INCANDESCENT = 3,
+ INTENSITY_COLOR_MAP_TYPE_USER_DEFINED = 4
+ };
public slots:
void resizeSlot( QSize *s );
diff --git a/gr-qtgui/src/lib/plot_waterfall.h b/gr-qtgui/src/lib/plot_waterfall.h
index 91746e3f3..a11461611 100644
--- a/gr-qtgui/src/lib/plot_waterfall.h
+++ b/gr-qtgui/src/lib/plot_waterfall.h
@@ -19,7 +19,7 @@ class QwtColorMap;
\sa QwtRasterData, QwtColorMap
*/
-class QWT_EXPORT PlotWaterfall: public QwtPlotRasterItem
+class PlotWaterfall: public QwtPlotRasterItem
{
public:
explicit PlotWaterfall(WaterfallData* data, const QString &title = QString::null);
diff --git a/gr-uhd/grc/gen_uhd_multi_usrp_blocks_xml.py b/gr-uhd/grc/gen_uhd_multi_usrp_blocks_xml.py
index 9f413f2a8..fc44501de 100755
--- a/gr-uhd/grc/gen_uhd_multi_usrp_blocks_xml.py
+++ b/gr-uhd/grc/gen_uhd_multi_usrp_blocks_xml.py
@@ -32,7 +32,7 @@ MAIN_TMPL = """\
)
\#if \$sync()
self.\$(id).set_clock_config(uhd.clock_config.external(), uhd.ALL_MBOARDS);
-self.\$(id).setime_unknown_pps(uhd.time_spec())
+self.\$(id).set_time_unknown_pps(uhd.time_spec())
\#end if
#for $m in range($max_mboards)
\#if \$num_mboards() > $m and \$sd_spec$(m)()
diff --git a/gruel/src/lib/Makefile.am b/gruel/src/lib/Makefile.am
index 5c3302f19..b9b35ae10 100644
--- a/gruel/src/lib/Makefile.am
+++ b/gruel/src/lib/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2008,2009,2010 Free Software Foundation, Inc.
+# Copyright 2008,2009,2010,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -51,6 +51,8 @@ libgruel_la_SOURCES = \
libgruel_la_LIBADD = \
$(BOOST_THREAD_LIB) \
+ $(BOOST_SYSTEM_LIB) \
+ $(BOOST_FILESYSTEM_LIB) \
$(PMT_LIB) \
$(MSG_LIB) \
-lstdc++
diff --git a/gruel/src/lib/test_gruel.cc b/gruel/src/lib/test_gruel.cc
index 2c9528b0a..7ef3520e6 100644
--- a/gruel/src/lib/test_gruel.cc
+++ b/gruel/src/lib/test_gruel.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2006,2009,2010 Free Software Foundation, Inc.
+ * Copyright 2006,2009,2010,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -28,16 +28,19 @@
#include "pmt/qa_pmt.h"
-static void get_unittest_path (const char *filename, char *fullpath, size_t pathsize);
+#include <boost/filesystem/operations.hpp>
+#include <boost/filesystem/path.hpp>
+namespace fs = boost::filesystem;
int
main(int argc, char **argv)
{
- char path[200];
- get_unittest_path ("gruel.xml", path, 200);
-
+ fs::path path = fs::current_path() / ".unittests";
+ if (!fs::is_directory(path)) fs::create_directory(path);
+ path = path / "gruel.xml";
+
CppUnit::TextTestRunner runner;
- std::ofstream xmlfile(path);
+ std::ofstream xmlfile(path.string().c_str());
CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile);
runner.addTest(qa_pmt::suite ());
@@ -47,41 +50,3 @@ main(int argc, char **argv)
return was_successful ? 0 : 1;
}
-
-
-// NOTE: These are defined in gr_unittest.h for the rest of the project;
-// rewriting here since we don't depend on gnuradio-core in gruel
-
-#ifdef MKDIR_TAKES_ONE_ARG
-#define gr_mkdir(pathname, mode) mkdir(pathname)
-#else
-#define gr_mkdir(pathname, mode) mkdir((pathname), (mode))
-#endif
-
-/*
- * Mostly taken from gr_preferences.cc/h
- * The simplest thing that could possibly work:
- * the key is the filename; the value is the file contents.
- */
-
-static void
-ensure_unittest_path (const char *path)
-{
- struct stat statbuf;
- if (stat (path, &statbuf) == 0 && S_ISDIR (statbuf.st_mode))
- return;
-
- // blindly try to make it // FIXME make this robust. C++ SUCKS!
- gr_mkdir (path, 0750);
-}
-
-static void
-get_unittest_path (const char *filename, char *fullpath, size_t pathsize)
-{
- char path[200];
- snprintf (path, sizeof(path), "./.unittests");
- snprintf (fullpath, pathsize, "%s/%s", path, filename);
-
- ensure_unittest_path(path);
-}
-
diff --git a/volk/Makefile.common b/volk/Makefile.common
index daa8d78b6..e91a55e9c 100644
--- a/volk/Makefile.common
+++ b/volk/Makefile.common
@@ -26,19 +26,8 @@ if MD_CPU_generic
endif
if MD_CPU_x86
-if MD_SUBCPU_x86_64
platform_CODE = \
- $(top_srcdir)/lib/volk_cpu_x86.c \
- $(top_srcdir)/lib/cpuid_x86_64.S
-endif
-endif
-
-if MD_CPU_x86
-if !MD_SUBCPU_x86_64
- platform_CODE = \
- $(top_srcdir)/lib/volk_cpu_x86.c \
- $(top_srcdir)/lib/cpuid_x86.S
-endif
+ $(top_srcdir)/lib/volk_cpu_x86.c
endif
if MD_CPU_powerpc
diff --git a/volk/config/gr_pwin32.m4 b/volk/config/gr_pwin32.m4
index 7b99cba6b..b55bc64b1 100644
--- a/volk/config/gr_pwin32.m4
+++ b/volk/config/gr_pwin32.m4
@@ -1,6 +1,6 @@
# Check for (mingw)win32 POSIX replacements. -*- Autoconf -*-
-# Copyright 2003,2004,2005 Free Software Foundation, Inc.
+# Copyright 2003,2004,2005,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -61,17 +61,6 @@ AC_TRY_LINK([ #include <windows.h>
AC_MSG_RESULT(no)
)
-dnl Under Win32, mkdir prototype in io.h has only one arg
-AC_MSG_CHECKING(whether mkdir accepts only one arg)
-AC_TRY_COMPILE([#include <sys/types.h>
- #include <sys/stat.h>
- #include <fcntl.h>], [
- mkdir("")
- ], [ AC_MSG_RESULT(yes)
- AC_DEFINE(MKDIR_TAKES_ONE_ARG,[],[Define if mkdir accepts only one arg]) ],
- [ AC_MSG_RESULT(no)
- ])
-
AH_BOTTOM(
[
/* Define missing prototypes, implemented in replacement lib */
diff --git a/volk/config/lf_cxx.m4 b/volk/config/lf_cxx.m4
index dfc6bfbfe..7cce5f8a4 100644
--- a/volk/config/lf_cxx.m4
+++ b/volk/config/lf_cxx.m4
@@ -46,22 +46,5 @@ AC_DEFUN([LF_CXX_PORTABILITY],[
dnl Check for common C++ portability problems
dnl
- dnl AC_LANG_PUSH
- dnl AC_LANG_CPLUSPLUS
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
-
-
- dnl Test whether C++ has std::isnan
- AC_MSG_CHECKING(whether C++ has std::isnan)
- AC_TRY_COMPILE([#include <cmath>], [
- std::isnan(0);
-], [ AC_MSG_RESULT(yes)
- AC_DEFINE(CXX_HAS_STD_ISNAN,[],[Define if has std::isnan]) ],
- [ AC_MSG_RESULT(no) ])
-
- dnl Done with the portability checks
- dnl AC_LANG_POP([C++])
- AC_LANG_RESTORE
])
diff --git a/volk/config/mkstemp.m4 b/volk/config/mkstemp.m4
index 4af0f0a9b..2d1fbee9b 100644
--- a/volk/config/mkstemp.m4
+++ b/volk/config/mkstemp.m4
@@ -75,15 +75,4 @@ AC_DEFUN([jm_PREREQ_TEMPNAME],
AC_CHECK_FUNCS(__secure_getenv gettimeofday lstat)
AC_CHECK_DECLS_ONCE(getenv)
# AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
-
- dnl Under Win32, mkdir prototype in io.h has only one arg
- AC_MSG_CHECKING(whether mkdir accepts only one arg)
- AC_TRY_COMPILE([#include <sys/types.h>
- #include <sys/stat.h>
- #include <fcntl.h>], [
- mkdir("")
- ], [ AC_MSG_RESULT(yes)
- AC_DEFINE(MKDIR_TAKES_ONE_ARG,[],[Define if mkdir accepts only one arg]) ],
- [ AC_MSG_RESULT(no)
- ])
])
diff --git a/volk/include/volk/make_cpuid_x86_c.py b/volk/include/volk/make_cpuid_x86_c.py
index 48a406fa4..2b2bd7c91 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 019833b43..c74b0464d 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";
diff --git a/volk/include/volk/volk_32fc_conjugate_dot_prod_unaligned.h b/volk/include/volk/volk_32fc_conjugate_dot_prod_unaligned.h
new file mode 100644
index 000000000..ead1573fe
--- /dev/null
+++ b/volk/include/volk/volk_32fc_conjugate_dot_prod_unaligned.h
@@ -0,0 +1,144 @@
+#ifndef INCLUDED_VOLK_32fc_CONJUGATE_DOT_PROD_UNALIGNED_H
+#define INCLUDED_VOLK_32fc_CONJUGATE_DOT_PROD_UNALIGNED_H
+
+
+#include<volk/volk_complex.h>
+
+
+#if LV_HAVE_GENERIC
+
+
+static inline void volk_32fc_conjugate_dot_prod_unaligned_generic(lv_32fc_t* result, const lv_32fc_t* input, const lv_32fc_t* taps, unsigned int num_bytes) {
+
+ float * res = (float*) result;
+ float * in = (float*) input;
+ float * tp = (float*) taps;
+ unsigned int n_2_ccomplex_blocks = num_bytes >> 4;
+ unsigned int isodd = (num_bytes >> 3) &1;
+
+
+
+ float sum0[2] = {0,0};
+ float sum1[2] = {0,0};
+ int i = 0;
+
+
+ for(i = 0; i < n_2_ccomplex_blocks; ++i) {
+
+ sum0[0] += in[0] * tp[0] + in[1] * tp[1];
+ sum0[1] += (-in[0] * tp[1]) + in[1] * tp[0];
+ sum1[0] += in[2] * tp[2] + in[3] * tp[3];
+ sum1[1] += (-in[2] * tp[3]) + in[3] * tp[2];
+
+
+ in += 4;
+ tp += 4;
+
+ }
+
+
+ res[0] = sum0[0] + sum1[0];
+ res[1] = sum0[1] + sum1[1];
+
+
+
+ for(i = 0; i < isodd; ++i) {
+
+
+ *result += input[(num_bytes >> 3) - 1] * lv_conj(taps[(num_bytes >> 3) - 1]);
+
+ }
+ /*
+ for(i = 0; i < num_bytes >> 3; ++i) {
+ *result += input[i] * conjf(taps[i]);
+ }
+ */
+}
+
+#endif /*LV_HAVE_GENERIC*/
+
+#if LV_HAVE_SSE3
+
+#include <xmmintrin.h>
+#include <pmmintrin.h>
+#include <mmintrin.h>
+
+
+static inline void volk_32fc_conjugate_dot_prod_unaligned_sse3(lv_32fc_t* result, const lv_32fc_t* input, const lv_32fc_t* taps, unsigned int num_bytes) {
+
+ static const uint32_t conjugator[4] __attribute__((aligned(16)))= {0x00000000, 0x80000000, 0x00000000, 0x80000000};
+
+ union HalfMask {
+ uint32_t intRep[4];
+ __m128 vec;
+ } halfMask;
+
+ union NegMask {
+ int intRep[4];
+ __m128 vec;
+ } negMask;
+
+ unsigned int offset = 0;
+ float Rsum=0, Isum=0;
+ float Im,Re;
+
+ __m128 in1, in2, Rv, fehg, Iv, Rs, Ivm, Is;
+ __m128 zv = {0,0,0,0};
+
+ halfMask.intRep[0] = halfMask.intRep[1] = 0xFFFFFFFF;
+ halfMask.intRep[2] = halfMask.intRep[3] = 0x00000000;
+
+ negMask.intRep[0] = negMask.intRep[2] = 0x80000000;
+ negMask.intRep[1] = negMask.intRep[3] = 0;
+
+ // main loop
+ while(num_bytes >= 4*sizeof(float)){
+
+ in1 = _mm_loadu_ps( (float*) (input+offset) );
+ in2 = _mm_loadu_ps( (float*) (taps+offset) );
+ Rv = in1*in2;
+ fehg = _mm_shuffle_ps(in2, in2, _MM_SHUFFLE(2,3,0,1));
+ Iv = in1*fehg;
+ Rs = _mm_hadd_ps( _mm_hadd_ps(Rv, zv) ,zv);
+ Ivm = _mm_xor_ps( negMask.vec, Iv );
+ Is = _mm_hadd_ps( _mm_hadd_ps(Ivm, zv) ,zv);
+ _mm_store_ss( &Im, Is );
+ _mm_store_ss( &Re, Rs );
+ num_bytes -= 4*sizeof(float);
+ offset += 2;
+ Rsum += Re;
+ Isum += Im;
+ }
+
+ // handle the last complex case ...
+ if(num_bytes > 0){
+
+ if(num_bytes != 4){
+ // bad things are happening
+ }
+
+ in1 = _mm_loadu_ps( (float*) (input+offset) );
+ in2 = _mm_loadu_ps( (float*) (taps+offset) );
+ Rv = _mm_and_ps(in1*in2, halfMask.vec);
+ fehg = _mm_shuffle_ps(in2, in2, _MM_SHUFFLE(2,3,0,1));
+ Iv = _mm_and_ps(in1*fehg, halfMask.vec);
+ Rs = _mm_hadd_ps(_mm_hadd_ps(Rv, zv),zv);
+ Ivm = _mm_xor_ps( negMask.vec, Iv );
+ Is = _mm_hadd_ps(_mm_hadd_ps(Ivm, zv),zv);
+ _mm_store_ss( &Im, Is );
+ _mm_store_ss( &Re, Rs );
+ Rsum += Re;
+ Isum += Im;
+ }
+
+ result[0] = lv_32fc_init(Rsum,Isum);
+ return;
+}
+
+#endif /*LV_HAVE_SSE3*/
+
+
+#endif /*INCLUDED_VOLK_32fc_CONJUGATE_DOT_PROD_UNALIGNED_H*/
+
+
+
diff --git a/volk/lib/assembly.h b/volk/lib/assembly.h
deleted file mode 100644
index 8a99aa07c..000000000
--- a/volk/lib/assembly.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2002 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.
- */
-
-#ifndef _ASSEMBLY_H_
-#define _ASSEMBLY_H_
-
-#if defined (__APPLE__) && defined (__APPLE_CC__)
-
-// XCode ignores the .scl and .type functions in XCode 2.2.1 and 2.3,
-// but creates an error in XCode 2.4. Just ignore them.
-
-#define GLOB_SYMB(f) _ ## f
-
-#define DEF_FUNC_HEAD(f) /* none */
-
-#define FUNC_TAIL(f) /* none*/
-
-#elif !defined (__ELF__)
-
-/*
- * Too bad, the following define does not work as expected --SF
- * #define GLOB_SYMB(f) __USER_LABEL_PREFIX__ ## f
- */
-#define GLOB_SYMB(f) _ ## f
-
-#define DEF_FUNC_HEAD(f) \
- .def GLOB_SYMB(f); .scl 2; .type 32; .endef
-
-#define FUNC_TAIL(f) /* none */
-
-
-#else /* !__ELF__ */
-
-
-#define GLOB_SYMB(f) f
-
-#define DEF_FUNC_HEAD(f) \
- .type GLOB_SYMB(f),@function \
-
-#define FUNC_TAIL(f) \
- .Lfe1: \
- .size GLOB_SYMB(f),.Lfe1-GLOB_SYMB(f)
-
-
-#endif /* !__ELF__ */
-
-
-#endif /* _ASSEMBLY_H_ */
diff --git a/volk/lib/cpuid_x86.S b/volk/lib/cpuid_x86.S
deleted file mode 100644
index 4e1a9404f..000000000
--- a/volk/lib/cpuid_x86.S
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# Copyright 2003 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.
-#
-
-#
-# execute CPUID instruction, return EAX, EBX, ECX and EDX values in result
-#
-# void cpuid_x86 (unsigned int op, unsigned int result[4]);
-#
-
-#include "assembly.h"
-
-.file "cpuid_x86.S"
- .version "01.01"
-.text
-.globl GLOB_SYMB(cpuid_x86)
- DEF_FUNC_HEAD(cpuid_x86)
-GLOB_SYMB(cpuid_x86):
- pushl %ebp
- movl %esp, %ebp
- pushl %ebx # must save in PIC mode, holds GOT pointer
- pushl %esi
-
- movl 8(%ebp), %eax # op
- movl 12(%ebp), %esi # result
- cpuid
- movl %eax, 0(%esi)
- movl %ebx, 4(%esi)
- movl %ecx, 8(%esi)
- movl %edx, 12(%esi)
-
- popl %esi
- popl %ebx
- popl %ebp
- ret
-
-FUNC_TAIL(cpuid_x86)
- .ident "Hand coded cpuid assembly"
-
-
-#if defined(__linux__) && defined(__ELF__)
-.section .note.GNU-stack,"",%progbits
-#endif
diff --git a/volk/lib/cpuid_x86_64.S b/volk/lib/cpuid_x86_64.S
deleted file mode 100644
index 32b1847cd..000000000
--- a/volk/lib/cpuid_x86_64.S
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# Copyright 2003,2005 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.
-#
-
-#
-# execute CPUID instruction, return EAX, EBX, ECX and EDX values in result
-#
-# void cpuid_x86 (unsigned int op, unsigned int result[4]);
-#
-
-#include "assembly.h"
-
-.file "cpuid_x86_64.S"
- .version "01.01"
-.text
-.globl GLOB_SYMB(cpuid_x86)
- DEF_FUNC_HEAD(cpuid_x86)
-GLOB_SYMB(cpuid_x86):
- mov %rbx, %r11 # must save in PIC mode, holds GOT pointer
-
- mov %rdi, %rax # op
- cpuid
- movl %eax, 0(%rsi) # result
- movl %ebx, 4(%rsi)
- movl %ecx, 8(%rsi)
- movl %edx, 12(%rsi)
-
- mov %r11, %rbx
- retq
-
-FUNC_TAIL(cpuid_x86)
- .ident "Hand coded cpuid64 assembly"
-
-
-#if defined(__linux__) && defined(__ELF__)
-.section .note.GNU-stack,"",%progbits
-#endif
diff --git a/volk/lib/gcc_x86_cpuid.h b/volk/lib/gcc_x86_cpuid.h
new file mode 100644
index 000000000..2d0916fb3
--- /dev/null
+++ b/volk/lib/gcc_x86_cpuid.h
@@ -0,0 +1,178 @@
+/*
+ * Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+ *
+ * This file 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.
+ *
+ * This file 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.
+ *
+ * Under Section 7 of GPL version 3, you are granted additional
+ * permissions described in the GCC Runtime Library Exception, version
+ * 3.1, as published by the Free Software Foundation.
+ *
+ * You should have received a copy of the GNU General Public License and
+ * a copy of the GCC Runtime Library Exception along with this program;
+ * see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+/* %ecx */
+#define bit_SSE3 (1 << 0)
+#define bit_PCLMUL (1 << 1)
+#define bit_SSSE3 (1 << 9)
+#define bit_FMA (1 << 12)
+#define bit_CMPXCHG16B (1 << 13)
+#define bit_SSE4_1 (1 << 19)
+#define bit_SSE4_2 (1 << 20)
+#define bit_MOVBE (1 << 22)
+#define bit_POPCNT (1 << 23)
+#define bit_AES (1 << 25)
+#define bit_XSAVE (1 << 26)
+#define bit_OSXSAVE (1 << 27)
+#define bit_AVX (1 << 28)
+
+/* %edx */
+#define bit_CMPXCHG8B (1 << 8)
+#define bit_CMOV (1 << 15)
+#define bit_MMX (1 << 23)
+#define bit_FXSAVE (1 << 24)
+#define bit_SSE (1 << 25)
+#define bit_SSE2 (1 << 26)
+
+/* Extended Features */
+/* %ecx */
+#define bit_LAHF_LM (1 << 0)
+#define bit_SSE4a (1 << 6)
+#define bit_SSE5 (1 << 11)
+
+/* %edx */
+#define bit_LM (1 << 29)
+#define bit_3DNOWP (1 << 30)
+#define bit_3DNOW (1 << 31)
+
+
+#if defined(__i386__) && defined(__PIC__)
+/* %ebx may be the PIC register. */
+#if __GNUC__ >= 3
+#define __cpuid(level, a, b, c, d) \
+ __asm__ ("xchg{l}\t{%%}ebx, %1\n\t" \
+ "cpuid\n\t" \
+ "xchg{l}\t{%%}ebx, %1\n\t" \
+ : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \
+ : "0" (level))
+
+#define __cpuid_count(level, count, a, b, c, d) \
+ __asm__ ("xchg{l}\t{%%}ebx, %1\n\t" \
+ "cpuid\n\t" \
+ "xchg{l}\t{%%}ebx, %1\n\t" \
+ : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \
+ : "0" (level), "2" (count))
+#else
+/* Host GCCs older than 3.0 weren't supporting Intel asm syntax
+ nor alternatives in i386 code. */
+#define __cpuid(level, a, b, c, d) \
+ __asm__ ("xchgl\t%%ebx, %1\n\t" \
+ "cpuid\n\t" \
+ "xchgl\t%%ebx, %1\n\t" \
+ : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \
+ : "0" (level))
+
+#define __cpuid_count(level, count, a, b, c, d) \
+ __asm__ ("xchgl\t%%ebx, %1\n\t" \
+ "cpuid\n\t" \
+ "xchgl\t%%ebx, %1\n\t" \
+ : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \
+ : "0" (level), "2" (count))
+#endif
+#else
+#define __cpuid(level, a, b, c, d) \
+ __asm__ ("cpuid\n\t" \
+ : "=a" (a), "=b" (b), "=c" (c), "=d" (d) \
+ : "0" (level))
+
+#define __cpuid_count(level, count, a, b, c, d) \
+ __asm__ ("cpuid\n\t" \
+ : "=a" (a), "=b" (b), "=c" (c), "=d" (d) \
+ : "0" (level), "2" (count))
+#endif
+
+/* Return highest supported input value for cpuid instruction. ext can
+ be either 0x0 or 0x8000000 to return highest supported value for
+ basic or extended cpuid information. Function returns 0 if cpuid
+ is not supported or whatever cpuid returns in eax register. If sig
+ pointer is non-null, then first four bytes of the signature
+ (as found in ebx register) are returned in location pointed by sig. */
+
+static __inline unsigned int
+__get_cpuid_max (unsigned int __ext, unsigned int *__sig)
+{
+ unsigned int __eax, __ebx, __ecx, __edx;
+
+#ifndef __x86_64__
+#if __GNUC__ >= 3
+ /* See if we can use cpuid. On AMD64 we always can. */
+ __asm__ ("pushf{l|d}\n\t"
+ "pushf{l|d}\n\t"
+ "pop{l}\t%0\n\t"
+ "mov{l}\t{%0, %1|%1, %0}\n\t"
+ "xor{l}\t{%2, %0|%0, %2}\n\t"
+ "push{l}\t%0\n\t"
+ "popf{l|d}\n\t"
+ "pushf{l|d}\n\t"
+ "pop{l}\t%0\n\t"
+ "popf{l|d}\n\t"
+ : "=&r" (__eax), "=&r" (__ebx)
+ : "i" (0x00200000));
+#else
+/* Host GCCs older than 3.0 weren't supporting Intel asm syntax
+ nor alternatives in i386 code. */
+ __asm__ ("pushfl\n\t"
+ "pushfl\n\t"
+ "popl\t%0\n\t"
+ "movl\t%0, %1\n\t"
+ "xorl\t%2, %0\n\t"
+ "pushl\t%0\n\t"
+ "popfl\n\t"
+ "pushfl\n\t"
+ "popl\t%0\n\t"
+ "popfl\n\t"
+ : "=&r" (__eax), "=&r" (__ebx)
+ : "i" (0x00200000));
+#endif
+
+ if (!((__eax ^ __ebx) & 0x00200000))
+ return 0;
+#endif
+
+ /* Host supports cpuid. Return highest supported cpuid input value. */
+ __cpuid (__ext, __eax, __ebx, __ecx, __edx);
+
+ if (__sig)
+ *__sig = __ebx;
+
+ return __eax;
+}
+
+/* Return cpuid data for requested cpuid level, as found in returned
+ eax, ebx, ecx and edx registers. The function checks if cpuid is
+ supported and returns 1 for valid cpuid information or 0 for
+ unsupported cpuid level. All pointers are required to be non-null. */
+
+static __inline int
+__get_cpuid (unsigned int __level,
+ unsigned int *__eax, unsigned int *__ebx,
+ unsigned int *__ecx, unsigned int *__edx)
+{
+ unsigned int __ext = __level & 0x80000000;
+
+ if (__get_cpuid_max (__ext, 0) < __level)
+ return 0;
+
+ __cpuid (__level, *__eax, *__ebx, *__ecx, *__edx);
+ return 1;
+}
diff --git a/volk/lib/qa_32fc_conjugate_dot_prod_unaligned.cc b/volk/lib/qa_32fc_conjugate_dot_prod_unaligned.cc
new file mode 100644
index 000000000..a0680bab6
--- /dev/null
+++ b/volk/lib/qa_32fc_conjugate_dot_prod_unaligned.cc
@@ -0,0 +1,138 @@
+#include <volk/volk.h>
+#include <qa_32fc_conjugate_dot_prod_unaligned.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+
+#define assertcomplexEqual(expected, actual, delta) \
+ CPPUNIT_ASSERT_DOUBLES_EQUAL (std::real(expected), std::real(actual), fabs(std::real(expected)) * delta); \
+ CPPUNIT_ASSERT_DOUBLES_EQUAL (std::imag(expected), std::imag(actual), fabs(std::imag(expected))* delta);
+
+#define ERR_DELTA (1e-4)
+
+//test for sse
+
+#if LV_HAVE_SSE && LV_HAVE_64
+
+static float uniform() {
+ return 2.0 * ((float) rand() / RAND_MAX - 0.5); // uniformly (-1, 1)
+}
+
+static void
+random_floats (float *buf, unsigned n)
+{
+ for (unsigned i = 0; i < n; i++)
+ buf[i] = uniform () * 32767;
+}
+
+
+void qa_32fc_conjugate_dot_prod_unaligned::t1() {
+ const int vlen = 789743;
+
+ volk_environment_init();
+ int ret;
+
+ std::complex<float>* input;
+ std::complex<float>* taps;
+
+ std::complex<float>* result_generic;
+ std::complex<float>* result;
+
+ ret = posix_memalign((void**)&input, 16, vlen << 3);
+ ret = posix_memalign((void**)&taps, 16, vlen << 3);
+ ret = posix_memalign((void**)&result_generic, 16, 8);
+ ret = posix_memalign((void**)&result, 16, 8);
+
+
+ result_generic[0] = std::complex<float>(0,0);
+ result[0] = std::complex<float>(0,0);
+
+ random_floats((float*)input, vlen * 2);
+ random_floats((float*)taps, vlen * 2);
+
+
+
+ volk_32fc_conjugate_dot_prod_unaligned_manual(result_generic, input, taps, vlen * 8, "generic");
+
+
+ volk_32fc_conjugate_dot_prod_unaligned_manual(result, input, taps, vlen * 8, "sse");
+
+ printf("32fc_conjugate_dot_prod_unaligned\n");
+ printf("generic: %f +i%f ... sse: %f +i%f\n", std::real(result_generic[0]), std::imag(result_generic[0]), std::real(result[0]), std::imag(result[0]));
+
+ assertcomplexEqual(result_generic[0], result[0], ERR_DELTA);
+
+ free(input);
+ free(taps);
+ free(result_generic);
+ free(result);
+
+}
+
+
+#elif LV_HAVE_SSE && LV_HAVE_32
+
+static float uniform() {
+ return 2.0 * ((float) rand() / RAND_MAX - 0.5); // uniformly (-1, 1)
+}
+
+static void
+random_floats (float *buf, unsigned n)
+{
+ for (unsigned i = 0; i < n; i++)
+ buf[i] = uniform () * 32767;
+}
+
+
+void qa_32fc_conjugate_dot_prod_unaligned::t1() {
+ const int vlen = 789743;
+
+ volk_environment_init();
+ int ret;
+
+ std::complex<float>* input;
+ std::complex<float>* taps;
+
+ std::complex<float>* result_generic;
+ std::complex<float>* result;
+
+ ret = posix_memalign((void**)&input, 16, vlen << 3);
+ ret = posix_memalign((void**)&taps, 16, vlen << 3);
+ ret = posix_memalign((void**)&result_generic, 16, 8);
+ ret = posix_memalign((void**)&result, 16, 8);
+
+
+ result_generic[0] = std::complex<float>(0,0);
+ result[0] = std::complex<float>(0,0);
+
+ random_floats((float*)input, vlen * 2);
+ random_floats((float*)taps, vlen * 2);
+
+
+
+ volk_32fc_conjugate_dot_prod_unaligned_manual(result_generic, input, taps, vlen * 8, "generic");
+
+
+ volk_32fc_conjugate_dot_prod_unaligned_manual(result, input, taps, vlen * 8, "sse_32");
+
+ printf("32fc_conjugate_dot_prod_unaligned\n");
+ printf("generic: %f +i%f ... sse: %f +i%f\n", std::real(result_generic[0]), std::imag(result_generic[0]), std::real(result[0]), std::imag(result[0]));
+
+ assertcomplexEqual(result_generic[0], result[0], ERR_DELTA);
+
+ free(input);
+ free(taps);
+ free(result_generic);
+ free(result);
+
+}
+
+
+#else
+
+void qa_32fc_conjugate_dot_prod_unaligned::t1() {
+ printf("sse not available... no test performed\n");
+}
+
+#endif /*LV_HAVE_SSE*/
diff --git a/volk/lib/qa_32fc_conjugate_dot_prod_unaligned.h b/volk/lib/qa_32fc_conjugate_dot_prod_unaligned.h
new file mode 100644
index 000000000..7aead53a1
--- /dev/null
+++ b/volk/lib/qa_32fc_conjugate_dot_prod_unaligned.h
@@ -0,0 +1,18 @@
+#ifndef INCLUDED_QA_32FC_CONJUGATE_DOT_PROD_UNALIGNED_H
+#define INCLUDED_QA_32FC_CONJUGATE_DOT_PROD_UNALIGNED_H
+
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/TestCase.h>
+
+class qa_32fc_conjugate_dot_prod_unaligned : public CppUnit::TestCase {
+
+ CPPUNIT_TEST_SUITE (qa_32fc_conjugate_dot_prod_unaligned);
+ CPPUNIT_TEST (t1);
+ CPPUNIT_TEST_SUITE_END ();
+
+ private:
+ void t1 ();
+};
+
+
+#endif /* INCLUDED_QA_32FC_CONJUGATE_DOT_PROD_UNALIGNED_H */
diff --git a/volk/lib/qa_volk.cc b/volk/lib/qa_volk.cc
new file mode 100644
index 000000000..98d3e9728
--- /dev/null
+++ b/volk/lib/qa_volk.cc
@@ -0,0 +1,213 @@
+/*
+ * Copyright 2008 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.
+ */
+
+/*
+ * This class gathers together all the test cases for the example
+ * directory into a single test suite. As you create new test cases,
+ * add them here.
+ */
+
+#include <qa_volk.h>
+#include <qa_16s_quad_max_star_aligned16.h>
+#include <qa_32fc_dot_prod_aligned16.h>
+#include <qa_32fc_square_dist_aligned16.h>
+#include <qa_32fc_square_dist_scalar_mult_aligned16.h>
+#include <qa_32f_sum_of_poly_aligned16.h>
+#include <qa_32fc_index_max_aligned16.h>
+#include <qa_32f_index_max_aligned16.h>
+#include <qa_32fc_conjugate_dot_prod_aligned16.h>
+#include <qa_32fc_conjugate_dot_prod_unaligned.h>
+#include <qa_16s_permute_and_scalar_add_aligned16.h>
+#include <qa_16s_branch_4_state_8_aligned16.h>
+#include <qa_16s_max_star_horizontal_aligned16.h>
+#include <qa_16s_max_star_aligned16.h>
+#include <qa_16s_add_quad_aligned16.h>
+#include <qa_32f_add_aligned16.h>
+#include <qa_32f_subtract_aligned16.h>
+#include <qa_32f_max_aligned16.h>
+#include <qa_32f_min_aligned16.h>
+#include <qa_64f_max_aligned16.h>
+#include <qa_64f_min_aligned16.h>
+#include <qa_32s_and_aligned16.h>
+#include <qa_32s_or_aligned16.h>
+#include <qa_32f_dot_prod_aligned16.h>
+#include <qa_32f_dot_prod_unaligned16.h>
+#include <qa_32f_fm_detect_aligned16.h>
+#include <qa_32fc_32f_multiply_aligned16.h>
+#include <qa_32fc_multiply_aligned16.h>
+#include <qa_32f_divide_aligned16.h>
+#include <qa_32f_multiply_aligned16.h>
+#include <qa_32f_sqrt_aligned16.h>
+#include <qa_8sc_multiply_conjugate_16sc_aligned16.h>
+#include <qa_8sc_multiply_conjugate_32fc_aligned16.h>
+#include <qa_32u_popcnt_aligned16.h>
+#include <qa_64u_popcnt_aligned16.h>
+#include <qa_16u_byteswap_aligned16.h>
+#include <qa_32u_byteswap_aligned16.h>
+#include <qa_64u_byteswap_aligned16.h>
+#include <qa_32f_normalize_aligned16.h>
+#include <qa_16sc_deinterleave_16s_aligned16.h>
+#include <qa_16sc_deinterleave_32f_aligned16.h>
+#include <qa_16sc_deinterleave_real_16s_aligned16.h>
+#include <qa_16sc_deinterleave_real_32f_aligned16.h>
+#include <qa_16sc_deinterleave_real_8s_aligned16.h>
+#include <qa_16sc_magnitude_16s_aligned16.h>
+#include <qa_16sc_magnitude_32f_aligned16.h>
+#include <qa_32fc_deinterleave_32f_aligned16.h>
+#include <qa_32fc_deinterleave_64f_aligned16.h>
+#include <qa_32fc_deinterleave_real_16s_aligned16.h>
+#include <qa_32fc_deinterleave_real_32f_aligned16.h>
+#include <qa_32fc_deinterleave_real_64f_aligned16.h>
+#include <qa_32fc_magnitude_16s_aligned16.h>
+#include <qa_32fc_magnitude_32f_aligned16.h>
+#include <qa_32f_interleave_16sc_aligned16.h>
+#include <qa_32f_interleave_32fc_aligned16.h>
+#include <qa_8sc_deinterleave_16s_aligned16.h>
+#include <qa_8sc_deinterleave_32f_aligned16.h>
+#include <qa_8sc_deinterleave_real_16s_aligned16.h>
+#include <qa_8sc_deinterleave_real_32f_aligned16.h>
+#include <qa_8sc_deinterleave_real_8s_aligned16.h>
+#include <qa_16s_convert_32f_aligned16.h>
+#include <qa_16s_convert_32f_unaligned16.h>
+#include <qa_16s_convert_8s_aligned16.h>
+#include <qa_16s_convert_8s_unaligned16.h>
+#include <qa_32f_convert_16s_aligned16.h>
+#include <qa_32f_convert_16s_unaligned16.h>
+#include <qa_32f_convert_32s_aligned16.h>
+#include <qa_32f_convert_32s_unaligned16.h>
+#include <qa_32f_convert_64f_aligned16.h>
+#include <qa_32f_convert_64f_unaligned16.h>
+#include <qa_32f_convert_8s_aligned16.h>
+#include <qa_32f_convert_8s_unaligned16.h>
+#include <qa_32s_convert_32f_aligned16.h>
+#include <qa_32s_convert_32f_unaligned16.h>
+#include <qa_64f_convert_32f_aligned16.h>
+#include <qa_64f_convert_32f_unaligned16.h>
+#include <qa_8s_convert_16s_aligned16.h>
+#include <qa_8s_convert_16s_unaligned16.h>
+#include <qa_8s_convert_32f_aligned16.h>
+#include <qa_8s_convert_32f_unaligned16.h>
+#include <qa_32fc_32f_power_32fc_aligned16.h>
+#include <qa_32f_power_aligned16.h>
+#include <qa_32fc_atan2_32f_aligned16.h>
+#include <qa_32fc_power_spectral_density_32f_aligned16.h>
+#include <qa_32fc_power_spectrum_32f_aligned16.h>
+#include <qa_32f_calc_spectral_noise_floor_aligned16.h>
+#include <qa_32f_accumulator_aligned16.h>
+#include <qa_32f_stddev_aligned16.h>
+#include <qa_32f_stddev_and_mean_aligned16.h>
+
+CppUnit::TestSuite *
+qa_volk::suite()
+{
+ CppUnit::TestSuite *s = new CppUnit::TestSuite("volk");
+
+ s->addTest(qa_16s_quad_max_star_aligned16::suite());
+ s->addTest(qa_32fc_dot_prod_aligned16::suite());
+ s->addTest(qa_32fc_square_dist_scalar_mult_aligned16::suite());
+ s->addTest(qa_32fc_square_dist_aligned16::suite());
+ s->addTest(qa_32f_sum_of_poly_aligned16::suite());
+ s->addTest(qa_32fc_index_max_aligned16::suite());
+ s->addTest(qa_32f_index_max_aligned16::suite());
+ s->addTest(qa_32fc_conjugate_dot_prod_aligned16::suite());
+ s->addTest(qa_32fc_conjugate_dot_prod_unaligned::suite());
+ s->addTest(qa_16s_permute_and_scalar_add_aligned16::suite());
+ s->addTest(qa_16s_branch_4_state_8_aligned16::suite());
+ s->addTest(qa_16s_max_star_horizontal_aligned16::suite());
+ s->addTest(qa_16s_max_star_aligned16::suite());
+ s->addTest(qa_16s_add_quad_aligned16::suite());
+ s->addTest(qa_32f_add_aligned16::suite());
+ s->addTest(qa_32f_subtract_aligned16::suite());
+ s->addTest(qa_32f_max_aligned16::suite());
+ s->addTest(qa_32f_min_aligned16::suite());
+ s->addTest(qa_64f_max_aligned16::suite());
+ s->addTest(qa_64f_min_aligned16::suite());
+ s->addTest(qa_32s_and_aligned16::suite());
+ s->addTest(qa_32s_or_aligned16::suite());
+ s->addTest(qa_32f_dot_prod_aligned16::suite());
+ s->addTest(qa_32f_dot_prod_unaligned16::suite());
+ s->addTest(qa_32f_fm_detect_aligned16::suite());
+ s->addTest(qa_32fc_32f_multiply_aligned16::suite());
+ s->addTest(qa_32fc_multiply_aligned16::suite());
+ s->addTest(qa_32f_divide_aligned16::suite());
+ s->addTest(qa_32f_multiply_aligned16::suite());
+ s->addTest(qa_32f_sqrt_aligned16::suite());
+ s->addTest(qa_8sc_multiply_conjugate_16sc_aligned16::suite());
+ s->addTest(qa_8sc_multiply_conjugate_32fc_aligned16::suite());
+ s->addTest(qa_32u_popcnt_aligned16::suite());
+ s->addTest(qa_64u_popcnt_aligned16::suite());
+ s->addTest(qa_16u_byteswap_aligned16::suite());
+ s->addTest(qa_32u_byteswap_aligned16::suite());
+ s->addTest(qa_64u_byteswap_aligned16::suite());
+ s->addTest(qa_32f_normalize_aligned16::suite());
+ s->addTest(qa_16sc_deinterleave_16s_aligned16::suite());
+ s->addTest(qa_16sc_deinterleave_32f_aligned16::suite());
+ s->addTest(qa_16sc_deinterleave_real_16s_aligned16::suite());
+ s->addTest(qa_16sc_deinterleave_real_32f_aligned16::suite());
+ s->addTest(qa_16sc_deinterleave_real_8s_aligned16::suite());
+ s->addTest(qa_16sc_magnitude_16s_aligned16::suite());
+ s->addTest(qa_16sc_magnitude_32f_aligned16::suite());
+ s->addTest(qa_32fc_deinterleave_32f_aligned16::suite());
+ s->addTest(qa_32fc_deinterleave_64f_aligned16::suite());
+ s->addTest(qa_32fc_deinterleave_real_16s_aligned16::suite());
+ s->addTest(qa_32fc_deinterleave_real_32f_aligned16::suite());
+ s->addTest(qa_32fc_deinterleave_real_64f_aligned16::suite());
+ s->addTest(qa_32fc_magnitude_16s_aligned16::suite());
+ s->addTest(qa_32fc_magnitude_32f_aligned16::suite());
+ s->addTest(qa_32f_interleave_16sc_aligned16::suite());
+ s->addTest(qa_32f_interleave_32fc_aligned16::suite());
+ s->addTest(qa_8sc_deinterleave_16s_aligned16::suite());
+ s->addTest(qa_8sc_deinterleave_32f_aligned16::suite());
+ s->addTest(qa_8sc_deinterleave_real_16s_aligned16::suite());
+ s->addTest(qa_8sc_deinterleave_real_32f_aligned16::suite());
+ s->addTest(qa_8sc_deinterleave_real_8s_aligned16::suite());
+ s->addTest(qa_16s_convert_32f_aligned16::suite());
+ s->addTest(qa_16s_convert_32f_unaligned16::suite());
+ s->addTest(qa_16s_convert_8s_aligned16::suite());
+ s->addTest(qa_16s_convert_8s_unaligned16::suite());
+ s->addTest(qa_32f_convert_16s_aligned16::suite());
+ s->addTest(qa_32f_convert_16s_unaligned16::suite());
+ s->addTest(qa_32f_convert_32s_aligned16::suite());
+ s->addTest(qa_32f_convert_32s_unaligned16::suite());
+ s->addTest(qa_32f_convert_64f_aligned16::suite());
+ s->addTest(qa_32f_convert_64f_unaligned16::suite());
+ s->addTest(qa_32f_convert_8s_aligned16::suite());
+ s->addTest(qa_32f_convert_8s_unaligned16::suite());
+ s->addTest(qa_32s_convert_32f_aligned16::suite());
+ s->addTest(qa_32s_convert_32f_unaligned16::suite());
+ s->addTest(qa_64f_convert_32f_aligned16::suite());
+ s->addTest(qa_64f_convert_32f_unaligned16::suite());
+ s->addTest(qa_8s_convert_16s_aligned16::suite());
+ s->addTest(qa_8s_convert_16s_unaligned16::suite());
+ s->addTest(qa_8s_convert_32f_aligned16::suite());
+ s->addTest(qa_8s_convert_32f_unaligned16::suite());
+ s->addTest(qa_32fc_32f_power_32fc_aligned16::suite());
+ s->addTest(qa_32f_power_aligned16::suite());
+ s->addTest(qa_32fc_atan2_32f_aligned16::suite());
+ s->addTest(qa_32fc_power_spectral_density_32f_aligned16::suite());
+ s->addTest(qa_32fc_power_spectrum_32f_aligned16::suite());
+ s->addTest(qa_32f_calc_spectral_noise_floor_aligned16::suite());
+ s->addTest(qa_32f_accumulator_aligned16::suite());
+ s->addTest(qa_32f_stddev_aligned16::suite());
+ s->addTest(qa_32f_stddev_and_mean_aligned16::suite());
+
+ return s;
+}