diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-09-17 20:40:39 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-09-17 20:40:39 +0300 |
commit | 91e87f5cf28c035eca59ab645747d1d2854571a5 (patch) | |
tree | 055a8830745e691b6ea857094bb1c6e21212ea2b /intern | |
parent | 731d0d8d0f499d8eb8a21ae12d0d5a6c61f1a37a (diff) | |
parent | 39c18c54136323fbf56e667fdb1f1345c7d0f89b (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/util/util_avxb.h | 54 | ||||
-rw-r--r-- | intern/cycles/util/util_sseb.h | 2 |
2 files changed, 2 insertions, 54 deletions
diff --git a/intern/cycles/util/util_avxb.h b/intern/cycles/util/util_avxb.h index 60d9bb44256..b6d77857c6f 100644 --- a/intern/cycles/util/util_avxb.h +++ b/intern/cycles/util/util_avxb.h @@ -44,17 +44,6 @@ struct avxb __forceinline operator const __m256i( void ) const { return _mm256_castps_si256(m256); } __forceinline operator const __m256d( void ) const { return _mm256_castps_pd(m256); } - //__forceinline avxb ( bool a ) - // : m256(_mm_lookupmask_ps[(size_t(a) << 3) | (size_t(a) << 2) | (size_t(a) << 1) | size_t(a)]) {} - //__forceinline avxb ( bool a, bool b) - // : m256(_mm_lookupmask_ps[(size_t(b) << 3) | (size_t(a) << 2) | (size_t(b) << 1) | size_t(a)]) {} - //__forceinline avxb ( bool a, bool b, bool c, bool d) - // : m256(_mm_lookupmask_ps[(size_t(d) << 3) | (size_t(c) << 2) | (size_t(b) << 1) | size_t(a)]) {} - //__forceinline avxb(int mask) { - // assert(mask >= 0 && mask < 16); - // m128 = _mm_lookupmask_ps[mask]; - //} - //////////////////////////////////////////////////////////////////////////////// /// Constants //////////////////////////////////////////////////////////////////////////////// @@ -114,47 +103,6 @@ __forceinline const avxb select( const avxb& m, const avxb& t, const avxb& f ) { __forceinline const avxb unpacklo( const avxb& a, const avxb& b ) { return _mm256_unpacklo_ps(a, b); } __forceinline const avxb unpackhi( const avxb& a, const avxb& b ) { return _mm256_unpackhi_ps(a, b); } -#define _MM256_SHUFFLE(fp7,fp6,fp5,fp4,fp3,fp2,fp1,fp0) (((fp7) << 14) | ((fp6) << 12) | ((fp5) << 10) | ((fp4) << 8) | \ - ((fp3) << 6) | ((fp2) << 4) | ((fp1) << 2) | ((fp0))) - -template<size_t i0, size_t i1, size_t i2, size_t i3, size_t i4, size_t i5, size_t i6, size_t i7> -__forceinline const avxb shuffle( const avxb& a ) { - return _mm256_cvtepi32_ps(_mm256_shuffle_epi32(a, _MM256_SHUFFLE(i7, i6, i5, i4, i3, i2, i1, i0))); -} - -/* -template<> __forceinline const avxb shuffle<0, 1, 0, 1, 0, 1, 0, 1>( const avxb& 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); } -#endif - -#if defined(__KERNEL_SSE41__) -template<size_t dst, size_t src, size_t clr> __forceinline const sseb insert( const sseb& a, const sseb& b ) { return _mm_insert_ps(a, b, (dst << 4) | (src << 6) | clr); } -template<size_t dst, size_t src> __forceinline const sseb insert( const sseb& a, const sseb& b ) { return insert<dst, src, 0>(a, b); } -template<size_t dst> __forceinline const sseb insert( const sseb& a, const bool b ) { return insert<dst,0>(a, sseb(b)); } -#endif -*/ - //////////////////////////////////////////////////////////////////////////////// /// Reduction Operations //////////////////////////////////////////////////////////////////////////////// @@ -180,7 +128,7 @@ __forceinline size_t movemask( const avxb& a ) { return _mm256_movemask_ps(a); } ccl_device_inline void print_avxb(const char *label, const avxb &a) { - printf("%s: %df %df %df %df %df %df %df %d\n", + printf("%s: %d %d %d %d %d %d %d %d\n", label, a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7]); } diff --git a/intern/cycles/util/util_sseb.h b/intern/cycles/util/util_sseb.h index 115b133c662..f6810505126 100644 --- a/intern/cycles/util/util_sseb.h +++ b/intern/cycles/util/util_sseb.h @@ -177,7 +177,7 @@ __forceinline size_t movemask( const sseb& a ) { return _mm_movemask_ps(a); } ccl_device_inline void print_sseb(const char *label, const sseb &a) { - printf("%s: %df %df %df %d\n", + printf("%s: %d %d %d %d\n", label, a[0], a[1], a[2], a[3]); } |