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:
Diffstat (limited to 'intern/cycles/util/util_types.h')
-rw-r--r--intern/cycles/util/util_types.h28
1 files changed, 18 insertions, 10 deletions
diff --git a/intern/cycles/util/util_types.h b/intern/cycles/util/util_types.h
index c53d67235f6..3fa1df6ab44 100644
--- a/intern/cycles/util/util_types.h
+++ b/intern/cycles/util/util_types.h
@@ -23,6 +23,12 @@
#endif
+/* Bitness */
+
+#if defined(__ppc64__) || defined(__PPC64__) || defined(__x86_64__) || defined(__ia64__) || defined(_M_X64)
+#define __KERNEL_64_BIT__
+#endif
+
/* Qualifiers for kernel code shared by CPU and GPU */
#ifndef __KERNEL_GPU__
@@ -34,7 +40,11 @@
#if defined(_WIN32) && !defined(FREE_WINDOWS)
#define ccl_device_inline static __forceinline
+#ifdef __KERNEL_64_BIT__
#define ccl_align(...) __declspec(align(__VA_ARGS__))
+#else
+#define ccl_align(...) /* not support for function arguments (error C2719) */
+#endif
#define ccl_may_alias
#else
#define ccl_device_inline static inline __attribute__((always_inline))
@@ -47,12 +57,6 @@
#endif
-/* Bitness */
-
-#if defined(__ppc64__) || defined(__PPC64__) || defined(__x86_64__) || defined(__ia64__) || defined(_M_X64)
-#define __KERNEL_64_BIT__
-#endif
-
/* SIMD Types */
#ifndef __KERNEL_GPU__
@@ -95,6 +99,10 @@
#include <tmmintrin.h> /* SSSE 3 */
#endif
+#ifdef __KERNEL_SSE41__
+#include <smmintrin.h> /* SSE 4.1 */
+#endif
+
#else
/* MinGW64 has conflicting declarations for these SSE headers in <windows.h>.
@@ -199,7 +207,7 @@ struct ccl_align(16) int3 {
__forceinline operator const __m128i&(void) const { return m128; }
__forceinline operator __m128i&(void) { return m128; }
#else
-struct int3 {
+struct ccl_align(16) int3 {
int x, y, z, w;
#endif
@@ -219,7 +227,7 @@ struct ccl_align(16) int4 {
__forceinline operator const __m128i&(void) const { return m128; }
__forceinline operator __m128i&(void) { return m128; }
#else
-struct int4 {
+struct ccl_align(16) int4 {
int x, y, z, w;
#endif
@@ -267,7 +275,7 @@ struct ccl_align(16) float3 {
__forceinline operator const __m128&(void) const { return m128; }
__forceinline operator __m128&(void) { return m128; }
#else
-struct float3 {
+struct ccl_align(16) float3 {
float x, y, z, w;
#endif
@@ -287,7 +295,7 @@ struct ccl_align(16) float4 {
__forceinline operator const __m128&(void) const { return m128; }
__forceinline operator __m128&(void) { return m128; }
#else
-struct float4 {
+struct ccl_align(16) float4 {
float x, y, z, w;
#endif