From 4d9ada77ebeca215b8346ec76dfc203e76aac38d Mon Sep 17 00:00:00 2001 From: Ingo Date: Thu, 6 Jun 2013 18:41:49 +0200 Subject: [PATCH] Changes to SLEEF for Issue 1893 --- rtengine/helpersse2.h | 2 ++ rtengine/sleefsseavx.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/rtengine/helpersse2.h b/rtengine/helpersse2.h index 3f83ba16e..f07c47631 100644 --- a/rtengine/helpersse2.h +++ b/rtengine/helpersse2.h @@ -27,6 +27,8 @@ typedef __m128i vint2; // #define LVFU(x) _mm_loadu_ps(&x) +#define LC2VFU(a) _mm_shuffle_ps( LVFU(a), _mm_loadu_ps( (&a) + 4 ), _MM_SHUFFLE( 2,0,2,0 ) ) + static INLINE vint vrint_vi_vd(vdouble vd) { return _mm_cvtpd_epi32(vd); } static INLINE vint vtruncate_vi_vd(vdouble vd) { return _mm_cvttpd_epi32(vd); } diff --git a/rtengine/sleefsseavx.c b/rtengine/sleefsseavx.c index 057064b26..64a89d1d6 100644 --- a/rtengine/sleefsseavx.c +++ b/rtengine/sleefsseavx.c @@ -1292,6 +1292,14 @@ static INLINE vfloat xcbrtf(vfloat d) { return y; } +static INLINE vfloat LIMV( vfloat a, vfloat b, vfloat c ) { +return _mm_max_ps( b, _mm_min_ps(a,c)); +} + +static INLINE vfloat ULIMV( vfloat a, vfloat b, vfloat c ){ + return vself( vmaskf_lt(b,c), LIMV(a,b,c), LIMV(a,c,b)); +} + static INLINE vfloat SQRV(vfloat a){ return _mm_mul_ps( a,a ); }