[Bf-blender-cvs] [f08191a4596] blender2.7: Fix Cycles build error on non-x86 processors.

Brecht Van Lommel noreply at git.blender.org
Wed Mar 6 13:38:39 CET 2019


Commit: f08191a4596a23dd6372b5b82ed3d5623899b139
Author: Brecht Van Lommel
Date:   Wed Mar 6 13:27:29 2019 +0100
Branches: blender2.7
https://developer.blender.org/rBf08191a4596a23dd6372b5b82ed3d5623899b139

Fix Cycles build error on non-x86 processors.

===================================================================

M	intern/cycles/device/device_cpu.cpp
M	intern/cycles/util/util_simd.h

===================================================================

diff --git a/intern/cycles/device/device_cpu.cpp b/intern/cycles/device/device_cpu.cpp
index 93c63b92a55..27f091d4188 100644
--- a/intern/cycles/device/device_cpu.cpp
+++ b/intern/cycles/device/device_cpu.cpp
@@ -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()) {
diff --git a/intern/cycles/util/util_simd.h b/intern/cycles/util/util_simd.h
index 565ea768089..c92fc1ae391 100644
--- a/intern/cycles/util/util_simd.h
+++ b/intern/cycles/util/util_simd.h
@@ -45,6 +45,14 @@
 
 #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__



More information about the Bf-blender-cvs mailing list