diff --git a/intern/cycles/kernel/kernel_bvh_traversal.h b/intern/cycles/kernel/kernel_bvh_traversal.h index 9fd466a6731..900aa7e75fb 100644 --- a/intern/cycles/kernel/kernel_bvh_traversal.h +++ b/intern/cycles/kernel/kernel_bvh_traversal.h @@ -80,7 +80,7 @@ __device bool BVH_FUNCTION_NAME isect->u = 0.0f; isect->v = 0.0f; -#if defined(__KERNEL_SSE3__) && !FEATURE(BVH_HAIR_MINIMUM_WIDTH) +#if defined(__KERNEL_SSSE3__) && !FEATURE(BVH_HAIR_MINIMUM_WIDTH) const __m128i shuffle_identity = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); const __m128i shuffle_swap = _mm_set_epi8(7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8); @@ -111,10 +111,10 @@ __device bool BVH_FUNCTION_NAME { bool traverseChild0, traverseChild1; int nodeAddrChild1; - float t = isect->t; -#if !defined(__KERNEL_SSE3__) || FEATURE(BVH_HAIR_MINIMUM_WIDTH) +#if !defined(__KERNEL_SSSE3__) || FEATURE(BVH_HAIR_MINIMUM_WIDTH) /* Intersect two child bounding boxes, non-SSE version */ + float t = isect->t; /* fetch node data */ float4 node0 = kernel_tex_fetch(__bvh_nodes, nodeAddr*BVH_NODE_SIZE+0); @@ -166,8 +166,8 @@ __device bool BVH_FUNCTION_NAME traverseChild1 = (c1max >= c1min); #endif -#else // __KERNEL_SSE3__ - /* Intersect two child bounding boxes, SSE3 version adapted from Embree */ +#else // __KERNEL_SSSE3__ + /* Intersect two child bounding boxes, SSSE3 version adapted from Embree */ /* fetch node data */ __m128 *bvh_nodes = (__m128*)kg->__bvh_nodes.data + nodeAddr*BVH_NODE_SIZE; @@ -190,14 +190,14 @@ __device bool BVH_FUNCTION_NAME traverseChild0 = (_mm_movemask_ps(lrhit) & 1); traverseChild1 = (_mm_movemask_ps(lrhit) & 2); #endif -#endif // __KERNEL_SSE3__ +#endif // __KERNEL_SSSE3__ nodeAddr = __float_as_int(cnodes.x); nodeAddrChild1 = __float_as_int(cnodes.y); if(traverseChild0 && traverseChild1) { /* both children were intersected, push the farther one */ -#if !defined(__KERNEL_SSE3__) || FEATURE(BVH_HAIR_MINIMUM_WIDTH) +#if !defined(__KERNEL_SSSE3__) || FEATURE(BVH_HAIR_MINIMUM_WIDTH) bool closestChild1 = (c1min < c0min); #else union { __m128 m128; float v[4]; } uminmax; @@ -282,7 +282,7 @@ __device bool BVH_FUNCTION_NAME hit = bvh_triangle_intersect(kg, isect, P, idir, visibility, object, primAddr); /* shadow ray early termination */ -#if defined(__KERNEL_SSE3__) && !FEATURE(BVH_HAIR_MINIMUM_WIDTH) +#if defined(__KERNEL_SSSE3__) && !FEATURE(BVH_HAIR_MINIMUM_WIDTH) if(hit) { if(visibility == PATH_RAY_SHADOW_OPAQUE) return true; @@ -315,7 +315,7 @@ __device bool BVH_FUNCTION_NAME bvh_instance_push(kg, object, ray, &P, &idir, &isect->t, tmax); #endif -#if defined(__KERNEL_SSE3__) && !FEATURE(BVH_HAIR_MINIMUM_WIDTH) +#if defined(__KERNEL_SSSE3__) && !FEATURE(BVH_HAIR_MINIMUM_WIDTH) Psplat[0] = _mm_set_ps1(P.x); Psplat[1] = _mm_set_ps1(P.y); Psplat[2] = _mm_set_ps1(P.z); @@ -359,7 +359,7 @@ __device bool BVH_FUNCTION_NAME bvh_instance_pop(kg, object, ray, &P, &idir, &isect->t, tmax); #endif -#if defined(__KERNEL_SSE3__) && !FEATURE(BVH_HAIR_MINIMUM_WIDTH) +#if defined(__KERNEL_SSSE3__) && !FEATURE(BVH_HAIR_MINIMUM_WIDTH) Psplat[0] = _mm_set_ps1(P.x); Psplat[1] = _mm_set_ps1(P.y); Psplat[2] = _mm_set_ps1(P.z); diff --git a/intern/cycles/kernel/kernel_sse3.cpp b/intern/cycles/kernel/kernel_sse3.cpp index ccd3ee5ac74..ff6bb412d5b 100644 --- a/intern/cycles/kernel/kernel_sse3.cpp +++ b/intern/cycles/kernel/kernel_sse3.cpp @@ -16,13 +16,14 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -/* Optimized CPU kernel entry points. This file is compiled with SSE3 +/* Optimized CPU kernel entry points. This file is compiled with SSE3/SSSE3 * optimization flags and nearly all functions inlined, while kernel.cpp * is compiled without for other CPU's. */ #ifdef WITH_OPTIMIZED_KERNEL #define __KERNEL_SSE3__ +#define __KERNEL_SSSE3__ #include "kernel.h" #include "kernel_compat_cpu.h" diff --git a/intern/cycles/util/util_system.cpp b/intern/cycles/util/util_system.cpp index c3ecc303a34..7ba749f4287 100644 --- a/intern/cycles/util/util_system.cpp +++ b/intern/cycles/util/util_system.cpp @@ -194,7 +194,7 @@ bool system_cpu_support_sse2() bool system_cpu_support_sse3() { CPUCapabilities& caps = system_cpu_capabilities(); - return caps.sse && caps.sse2 && caps.sse3; + return caps.sse && caps.sse2 && caps.sse3 && caps.ssse3; } #else diff --git a/intern/cycles/util/util_types.h b/intern/cycles/util/util_types.h index 7ad0403e6c6..d0116186ee8 100644 --- a/intern/cycles/util/util_types.h +++ b/intern/cycles/util/util_types.h @@ -69,15 +69,19 @@ #include /* SSE 1 */ #include /* SSE 2 */ #include /* SSE 3 */ -#include /* SSE 3 */ +#include /* SSSE 3 */ #include /* SSE 4 */ #ifndef __KERNEL_SSE2__ #define __KERNEL_SSE2__ #endif -#ifndef __KERNEL_SSE3__ -#define __KERNEL_SSE3__ +#ifndef __KERNEL_SSSE3__ +#define __KERNEL_SSSE3__ +#endif + +#ifndef __KERNEL_SSSE3__ +#define __KERNEL_SSSE3__ #endif #ifndef __KERNEL_SSE4__ @@ -86,7 +90,7 @@ #else -#if defined(__x86_64__) || defined(__KERNEL_SSE3__) +#if defined(__x86_64__) || defined(__KERNEL_SSSE3__) /* MinGW64 has conflicting declarations for these SSE headers in . * Since we can't avoid including , better only include that */ @@ -96,9 +100,11 @@ #include /* SSE 1 */ #include /* SSE 2 */ -#ifdef __KERNEL_SSE3__ +#ifdef __KERNEL_SSSE3__ #include /* SSE 3 */ -#include /* SSE 3 */ +#endif +#ifdef __KERNEL_SSSE3__ +#include /* SSSE 3 */ #endif #endif @@ -110,10 +116,9 @@ #endif +/* int8_t, uint16_t, and friends */ #ifndef _WIN32 - #include - #endif #endif @@ -486,7 +491,7 @@ __device_inline int4 make_int4(const float3& f) #endif -#ifdef __KERNEL_SSE3__ +#ifdef __KERNEL_SSSE3__ /* SSE shuffle utility functions */