Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--intern/cycles/util/util_simd.cpp9
-rw-r--r--intern/cycles/util/util_simd.h6
2 files changed, 9 insertions, 6 deletions
diff --git a/intern/cycles/util/util_simd.cpp b/intern/cycles/util/util_simd.cpp
index 8f5e78d9fbd..0436823e62a 100644
--- a/intern/cycles/util/util_simd.cpp
+++ b/intern/cycles/util/util_simd.cpp
@@ -15,15 +15,13 @@
* limitations under the License
*/
-/* SSE optimization disabled for now on 32 bit, see bug #36316 */
-#if !(defined(__GNUC__) && (defined(i386) || defined(_M_IX86)))
+#ifdef WITH_KERNEL_SSE2
+#define __KERNEL_SSE2__
#include "util_simd.h"
CCL_NAMESPACE_BEGIN
-#ifdef WITH_KERNEL_SSE2
-
const __m128 _mm_lookupmask_ps[16] = {
_mm_castsi128_ps(_mm_set_epi32( 0, 0, 0, 0)),
_mm_castsi128_ps(_mm_set_epi32( 0, 0, 0,-1)),
@@ -43,8 +41,7 @@ const __m128 _mm_lookupmask_ps[16] = {
_mm_castsi128_ps(_mm_set_epi32(-1,-1,-1,-1))
};
-#endif // WITH_KERNEL_SSE2
CCL_NAMESPACE_END
-#endif
+#endif // WITH_KERNEL_SSE2
diff --git a/intern/cycles/util/util_simd.h b/intern/cycles/util/util_simd.h
index b6d8f3d25f0..9b86e8be72e 100644
--- a/intern/cycles/util/util_simd.h
+++ b/intern/cycles/util/util_simd.h
@@ -225,9 +225,11 @@ __forceinline int __btr(int v, int i) {
int r = 0; asm ("btr %1,%0" : "=r"(r) : "r"(i), "0"(v) : "flags"); return r;
}
+#if defined(__KERNEL_64_BIT__)
__forceinline size_t __bsf(size_t v) {
size_t r = 0; asm ("bsf %1,%0" : "=r"(r) : "r"(v)); return r;
}
+#endif
__forceinline unsigned int __bsf(unsigned int v) {
unsigned int r = 0; asm ("bsf %1,%0" : "=r"(r) : "r"(v)); return r;
@@ -265,6 +267,7 @@ __forceinline unsigned int bitscan(unsigned int v) {
#endif
}
+#if defined(__KERNEL_64_BIT__)
__forceinline size_t bitscan(size_t v) {
#if defined(__KERNEL_AVX2__)
#if defined(__KERNEL_64_BIT__)
@@ -276,6 +279,7 @@ __forceinline size_t bitscan(size_t v) {
return __bsf(v);
#endif
}
+#endif
__forceinline int clz(const int x)
{
@@ -305,6 +309,7 @@ __forceinline unsigned int __bscf(unsigned int& v)
return i;
}
+#if defined(__KERNEL_64_BIT__)
__forceinline size_t __bscf(size_t& v)
{
size_t i = bitscan(v);
@@ -315,6 +320,7 @@ __forceinline size_t __bscf(size_t& v)
#endif
return i;
}
+#endif
#endif /* _WIN32 */