1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-01-31 11:19:18 +00:00

Merge branch 'next' of https://github.com/gnss-sdr/gnss-sdr into next

This commit is contained in:
Javier 2020-02-24 13:04:59 +01:00
commit 736cd93b01
3 changed files with 49 additions and 33 deletions

View File

@ -223,13 +223,15 @@ gnsssdr_check_build_type(${CMAKE_BUILD_TYPE})
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "") set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "")
# Enable optimization options in GCC for Release and RelWithDebInfo build types # Enable optimization options in GCC for Release and RelWithDebInfo build types
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if((${CMAKE_SYSTEM_NAME} MATCHES "Linux|kFreeBSD|GNU") AND (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))
if(NOT (${LINUX_DISTRIBUTION} MATCHES "Fedora") AND NOT (${LINUX_DISTRIBUTION} MATCHES "Gentoo"))
# flag -O3 enables tree vectorization # flag -O3 enables tree vectorization
# See https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html # See https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG") set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG")
set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG") set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG") set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG")
endif()
endif() endif()
# allow 'large' files in 32 bit builds # allow 'large' files in 32 bit builds

View File

@ -150,6 +150,19 @@ if(NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) AND NOT (CMAKE_CXX
endif() endif()
endif() endif()
# Disable complex math NaN/INFO range checking for performance
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-fcx-limited-range HAVE_CX_LIMITED_RANGE)
if(HAVE_CX_LIMITED_RANGE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcx-limited-range")
endif()
include(CheckCCompilerFlag)
check_c_compiler_flag(-fcx-limited-range HAVE_C_LIMITED_RANGE)
if(HAVE_C_LIMITED_RANGE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fcx-limited-range")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_FLAGS} -Wall") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_FLAGS} -Wall")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")

View File

@ -18,15 +18,15 @@
// //
// Cross-platform attribute macros not included in VOLK // Cross-platform attribute macros not included in VOLK
// //
#if defined __clang__ #if _MSC_VER
#define __VOLK_GNSSSDR_PREFETCH(addr) __builtin_prefetch(addr)
#define __VOLK_GNSSSDR_PREFETCH_LOCALITY(addr, rw, locality) __builtin_prefetch(addr, rw, locality)
#elif defined __GNUC__
#define __VOLK_GNSSSDR_PREFETCH(addr) __builtin_prefetch(addr)
#define __VOLK_GNSSSDR_PREFETCH_LOCALITY(addr, rw, locality) __builtin_prefetch(addr, rw, locality)
#elif _MSC_VER
#define __VOLK_GNSSSDR_PREFETCH(addr) #define __VOLK_GNSSSDR_PREFETCH(addr)
#define __VOLK_GNSSSDR_PREFETCH_LOCALITY(addr, rw, locality) #define __VOLK_GNSSSDR_PREFETCH_LOCALITY(addr, rw, locality)
#elif defined(__clang__)
#define __VOLK_GNSSSDR_PREFETCH(addr) __builtin_prefetch(addr)
#define __VOLK_GNSSSDR_PREFETCH_LOCALITY(addr, rw, locality) __builtin_prefetch(addr, rw, locality)
#elif defined(__GNUC__)
#define __VOLK_GNSSSDR_PREFETCH(addr) __builtin_prefetch(addr)
#define __VOLK_GNSSSDR_PREFETCH_LOCALITY(addr, rw, locality) __builtin_prefetch(addr, rw, locality)
#else #else
#define __VOLK_GNSSSDR_PREFETCH(addr) #define __VOLK_GNSSSDR_PREFETCH(addr)
#define __VOLK_GNSSSDR_PREFETCH_LOCALITY(addr, rw, locality) #define __VOLK_GNSSSDR_PREFETCH_LOCALITY(addr, rw, locality)
@ -38,7 +38,17 @@
// //
// Cross-platform attribute macros // Cross-platform attribute macros
// //
#if defined(__clang__) && (!defined(_MSC_VER)) #if _MSC_VER
#define __VOLK_ATTR_ALIGNED(x) __declspec(align(x))
#define __VOLK_ATTR_UNUSED
#define __VOLK_ATTR_INLINE __forceinline
#define __VOLK_ATTR_DEPRECATED __declspec(deprecated)
#define __VOLK_ATTR_EXPORT __declspec(dllexport)
#define __VOLK_ATTR_IMPORT __declspec(dllimport)
#define __VOLK_PREFETCH(addr)
#define __VOLK_ASM __asm
#define __VOLK_VOLATILE
#elif defined(__clang__)
// AppleClang also defines __GNUC__, so do this check first. These // AppleClang also defines __GNUC__, so do this check first. These
// will probably be the same as for __GNUC__, but let's keep them // will probably be the same as for __GNUC__, but let's keep them
// separate just to be safe. // separate just to be safe.
@ -51,7 +61,7 @@
#define __VOLK_ATTR_EXPORT __attribute__((visibility("default"))) #define __VOLK_ATTR_EXPORT __attribute__((visibility("default")))
#define __VOLK_ATTR_IMPORT __attribute__((visibility("default"))) #define __VOLK_ATTR_IMPORT __attribute__((visibility("default")))
#define __VOLK_PREFETCH(addr) __builtin_prefetch(addr) #define __VOLK_PREFETCH(addr) __builtin_prefetch(addr)
#elif defined __GNUC__ #elif defined(__GNUC__)
#define __VOLK_ATTR_ALIGNED(x) __attribute__((aligned(x))) #define __VOLK_ATTR_ALIGNED(x) __attribute__((aligned(x)))
#define __VOLK_ATTR_UNUSED __attribute__((unused)) #define __VOLK_ATTR_UNUSED __attribute__((unused))
#define __VOLK_ATTR_INLINE __attribute__((always_inline)) #define __VOLK_ATTR_INLINE __attribute__((always_inline))
@ -66,17 +76,8 @@
#define __VOLK_ATTR_IMPORT #define __VOLK_ATTR_IMPORT
#endif #endif
#define __VOLK_PREFETCH(addr) __builtin_prefetch(addr) #define __VOLK_PREFETCH(addr) __builtin_prefetch(addr)
#elif _MSC_VER
#define __VOLK_ATTR_ALIGNED(x) __declspec(align(x))
#define __VOLK_ATTR_UNUSED
#define __VOLK_ATTR_INLINE __forceinline
#define __VOLK_ATTR_DEPRECATED __declspec(deprecated)
#define __VOLK_ATTR_EXPORT __declspec(dllexport)
#define __VOLK_ATTR_IMPORT __declspec(dllimport)
#define __VOLK_PREFETCH(addr)
#define __VOLK_ASM __asm
#define __VOLK_VOLATILE
#else #else
#warning "Unknown compiler. Using default VOLK macros, which may or not work."
#define __VOLK_ATTR_ALIGNED(x) #define __VOLK_ATTR_ALIGNED(x)
#define __VOLK_ATTR_UNUSED #define __VOLK_ATTR_UNUSED
#define __VOLK_ATTR_INLINE #define __VOLK_ATTR_INLINE
@ -88,19 +89,19 @@
#define __VOLK_VOLATILE __volatile__ #define __VOLK_VOLATILE __volatile__
#endif #endif
// ////////////////////////////////////////////////////////////////////////
// Ignore annoying warnings in MSVC // Ignore annoying warnings in MSVC
// ////////////////////////////////////////////////////////////////////////
#if defined(_MSC_VER) #if defined(_MSC_VER)
#pragma warning(disable : 4244) // 'conversion' conversion from 'type1' to 'type2', possible loss of data #pragma warning(disable : 4244) //'conversion' conversion from 'type1' to 'type2', possible loss of data
#pragma warning(disable : 4305) // 'identifier' : truncation from 'type1' to 'type2' #pragma warning(disable : 4305) //'identifier' : truncation from 'type1' to 'type2'
#endif #endif
// ////////////////////////////////////////////////////////////////////////
// C-linkage declaration macros // C-linkage declaration macros
// FIXME: due to the usage of complex.h, require gcc for c-linkage // FIXME: due to the usage of complex.h, require gcc for c-linkage
// ////////////////////////////////////////////////////////////////////////
#if defined(__cplusplus) && (__GNUC__) #if defined(__cplusplus) && (defined(__GNUC__) || defined(__clang__))
#define __VOLK_DECL_BEGIN \ #define __VOLK_DECL_BEGIN \
extern "C" \ extern "C" \
{ {