From 750cd87047e89e39a1f79dbb9e0ff9bcebccc694 Mon Sep 17 00:00:00 2001 From: Ingo Date: Tue, 30 Dec 2014 18:19:28 +0100 Subject: [PATCH] Fixed a bug in noise reduction when build with gcc 4.7.x --- rtengine/helpersse2.h | 10 ++++++++++ rtengine/opthelper.h | 10 +++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/rtengine/helpersse2.h b/rtengine/helpersse2.h index 6e4d352bb..0f0a3b876 100644 --- a/rtengine/helpersse2.h +++ b/rtengine/helpersse2.h @@ -25,8 +25,18 @@ typedef __m128 vfloat; typedef __m128i vint2; // +#ifdef __GNUC__ + #if __GNUC__ == 4 && __GNUC_MINOR__ >= 8 + #define LVF(x) _mm_load_ps(&x) + #define LVFU(x) _mm_loadu_ps(&x) + #else // there is a bug in gcc 4.7.x when using openmp and aligned memory and -O3 + #define LVF(x) _mm_loadu_ps(&x) + #define LVFU(x) _mm_loadu_ps(&x) + #endif +#else #define LVF(x) _mm_load_ps(&x) #define LVFU(x) _mm_loadu_ps(&x) +#endif #define LC2VFU(a) _mm_shuffle_ps( LVFU(a), _mm_loadu_ps( (&a) + 4 ), _MM_SHUFFLE( 2,0,2,0 ) ) #define ZEROV _mm_setzero_ps() diff --git a/rtengine/opthelper.h b/rtengine/opthelper.h index 752ad586b..cdb691ddd 100644 --- a/rtengine/opthelper.h +++ b/rtengine/opthelper.h @@ -55,9 +55,13 @@ #define RESTRICT __restrict__ #define LIKELY(x) __builtin_expect (!!(x), 1) #define UNLIKELY(x) __builtin_expect (!!(x), 0) - #define ALIGNED64 __attribute__ ((aligned (64))) - #define ALIGNED16 __attribute__ ((aligned (16))) - + #if __GNUC__ == 4 && __GNUC_MINOR__ >= 8 + #define ALIGNED64 __attribute__ ((aligned (64))) + #define ALIGNED16 __attribute__ ((aligned (16))) + #else // there is a bug in gcc 4.7.x when using openmp and aligned memory and -O3 + #define ALIGNED64 + #define ALIGNED16 + #endif #else #define RESTRICT #define LIKELY(x) (x)