diff options
author | ghostop14 <ghostop14@gmail.com> | 2020-01-29 17:20:16 -0500 |
---|---|---|
committer | Michael Dickens <michael.dickens@ettus.com> | 2020-02-14 10:05:12 -0500 |
commit | aa0bd44efbf8afdfd93d627e486c1427426b76f9 (patch) | |
tree | dd2acb4ebed83dc5a553678ba46b76424690b90a /gnuradio-runtime/lib | |
parent | 36680f338e0b7ae7e5bcf7d2a860527ca7b14dfe (diff) |
gr-digital: Improve Performance of Costas Loop
This update is focused on improving the throughput of the Costas
loop, however some changes are more global performance enhancements
as this PR has evolved. Updates include an ENABLE_NATIVE added to
CMake, which is off by default but enables native compiling (including
FMA support) if desired; sincos was inlined in sincos.h and sincos.cc
was removed from the appropriate CMake to improve sincos speed, some
constants were added to math.h, inlined functions in costas loop and
nco.h, used switch instead of function pointer (much faster), and
used fast complex multiply to get around all the range checking in
the standard complex.h complex multiply function on all builds.
Diffstat (limited to 'gnuradio-runtime/lib')
-rw-r--r-- | gnuradio-runtime/lib/CMakeLists.txt | 1 | ||||
-rw-r--r-- | gnuradio-runtime/lib/math/sincos.cc | 62 |
2 files changed, 0 insertions, 63 deletions
diff --git a/gnuradio-runtime/lib/CMakeLists.txt b/gnuradio-runtime/lib/CMakeLists.txt index 04cd7b72c7..a56c68cfd7 100644 --- a/gnuradio-runtime/lib/CMakeLists.txt +++ b/gnuradio-runtime/lib/CMakeLists.txt @@ -106,7 +106,6 @@ target_sources(gnuradio-runtime PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/math/fast_atan2f.cc ${CMAKE_CURRENT_SOURCE_DIR}/math/fxpt.cc ${CMAKE_CURRENT_SOURCE_DIR}/math/random.cc - ${CMAKE_CURRENT_SOURCE_DIR}/math/sincos.cc ) # Controlport diff --git a/gnuradio-runtime/lib/math/sincos.cc b/gnuradio-runtime/lib/math/sincos.cc deleted file mode 100644 index b093e09a4a..0000000000 --- a/gnuradio-runtime/lib/math/sincos.cc +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2010,2013 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifndef _GNU_SOURCE -#define _GNU_SOURCE // ask for GNU extensions if available -#endif - -#include <gnuradio/sincos.h> -#include <math.h> - -namespace gr { - -#if defined(HAVE_SINCOS) - -void sincos(double x, double* sinx, double* cosx) { ::sincos(x, sinx, cosx); } - -#else - -void sincos(double x, double* sinx, double* cosx) -{ - *sinx = ::sin(x); - *cosx = ::cos(x); -} - -#endif - -// ---------------------------------------------------------------- - -#if defined(HAVE_SINCOSF) - -void sincosf(float x, float* sinx, float* cosx) { ::sincosf(x, sinx, cosx); } - -#elif defined(HAVE_SINF) && defined(HAVE_COSF) - -void sincosf(float x, float* sinx, float* cosx) -{ - *sinx = ::sinf(x); - *cosx = ::cosf(x); -} - -#else - -void sincosf(float x, float* sinx, float* cosx) -{ - *sinx = ::sin(x); - *cosx = ::cos(x); -} - -#endif - -} /* namespace gr */ |