Fix Cycles build error on non-x86 processors.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 6 Mar 2019 12:27:29 +0000 (13:27 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 6 Mar 2019 12:37:06 +0000 (13:37 +0100)
intern/cycles/device/device_cpu.cpp
intern/cycles/util/util_simd.h

index 93c63b92a557939c6d2fa82628a7e2cf240a1103..27f091d4188450a367c347be0b347a99d82f6c28 100644 (file)
@@ -761,8 +761,8 @@ public:
                int start_sample = tile.start_sample;
                int end_sample = tile.start_sample + tile.num_samples;
 
-               _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
-               _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON);
+               /* Needed for Embree. */
+               SIMD_SET_FLUSH_TO_ZERO;
 
                for(int sample = start_sample; sample < end_sample; sample++) {
                        if(task.get_cancel() || task_pool.canceled()) {
index 565ea768089bf54fd1e6d4e5f12df72cc4ccb389..c92fc1ae391950f3caebbbd35ef2554c4f4e9709 100644 (file)
 
 #endif
 
+#if defined(__x86_64__) || defined(__i386__) || defined(_M_X64) || defined(_M_IX86)
+  #define SIMD_SET_FLUSH_TO_ZERO \
+    _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON); \
+    _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON);
+#else
+  #define SIMD_SET_FLUSH_TO_ZERO
+#endif
+
 CCL_NAMESPACE_BEGIN
 
 #ifdef __KERNEL_SSE2__