diff options
author | Sv. Lockal <lockalsash@gmail.com> | 2015-03-07 20:25:21 +0300 |
---|---|---|
committer | Sv. Lockal <lockalsash@gmail.com> | 2015-03-07 20:25:21 +0300 |
commit | c32ded36548b26c5722803556e2b502d3dbbba8a (patch) | |
tree | ecfcbcbf3455e5f238866ce39d2b6328cc5f45d8 /intern/cycles/util/util_sseb.h | |
parent | c8fb488b087f91ba58ac16e4e76050b660122417 (diff) |
Cycles: add better specializations for SSE shuffle function and few more wrappers.
Diffstat (limited to 'intern/cycles/util/util_sseb.h')
-rw-r--r-- | intern/cycles/util/util_sseb.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/intern/cycles/util/util_sseb.h b/intern/cycles/util/util_sseb.h index ea38e53b59f..6e669701f3b 100644 --- a/intern/cycles/util/util_sseb.h +++ b/intern/cycles/util/util_sseb.h @@ -119,14 +119,29 @@ template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const sseb sh return _mm_shuffle_epi32(a, _MM_SHUFFLE(i3, i2, i1, i0)); } +template<> __forceinline const sseb shuffle<0, 1, 0, 1>( const sseb& a ) { + return _mm_movelh_ps(a, a); +} + +template<> __forceinline const sseb shuffle<2, 3, 2, 3>( const sseb& a ) { + return _mm_movehl_ps(a, a); +} + template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const sseb shuffle( const sseb& a, const sseb& b ) { return _mm_shuffle_ps(a, b, _MM_SHUFFLE(i3, i2, i1, i0)); } +template<> __forceinline const sseb shuffle<0, 1, 0, 1>( const sseb& a, const sseb& b ) { + return _mm_movelh_ps(a, b); +} + +template<> __forceinline const sseb shuffle<2, 3, 2, 3>( const sseb& a, const sseb& b ) { + return _mm_movehl_ps(b, a); +} + #if defined(__KERNEL_SSE3__) template<> __forceinline const sseb shuffle<0, 0, 2, 2>( const sseb& a ) { return _mm_moveldup_ps(a); } template<> __forceinline const sseb shuffle<1, 1, 3, 3>( const sseb& a ) { return _mm_movehdup_ps(a); } -template<> __forceinline const sseb shuffle<0, 1, 0, 1>( const sseb& a ) { return _mm_castpd_ps(_mm_movedup_pd (a)); } #endif #if defined(__KERNEL_SSE41__) |