[Bf-blender-cvs] [acc1f8f] master: Cycles: Add AVX intrinsics helpers

Sergey Sharybin noreply at git.blender.org
Fri Dec 2 12:23:47 CET 2016


Commit: acc1f8fbed5dfe78d33fa03783205c8ff65f092f
Author: Sergey Sharybin
Date:   Fri Dec 2 10:42:31 2016 +0100
Branches: master
https://developer.blender.org/rBacc1f8fbed5dfe78d33fa03783205c8ff65f092f

Cycles: Add AVX intrinsics helpers

They are defined for MSVC but seems to be missing in GCC and CLang-3.8.

Maybe some further tweaks to policy when to define those functions is
needed, but should be fine for now.

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

M	intern/cycles/util/util_avxf.h

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

diff --git a/intern/cycles/util/util_avxf.h b/intern/cycles/util/util_avxf.h
index 2db2c4d..2451213 100644
--- a/intern/cycles/util/util_avxf.h
+++ b/intern/cycles/util/util_avxf.h
@@ -180,6 +180,14 @@ __forceinline const avxf nmadd(const avxf& a, const avxf& b, const avxf& c) {
 }
 #endif
 
+#ifndef _mm256_set_m128
+#  define _mm256_set_m128(/* __m128 */ hi, /* __m128 */ lo) \
+    _mm256_insertf128_ps(_mm256_castps128_ps256(lo), (hi), 0x1)
+#endif
+
+#define _mm256_loadu2_m128(/* float const* */ hiaddr, /* float const* */ loaddr) \
+    _mm256_set_m128(_mm_loadu_ps(hiaddr), _mm_loadu_ps(loaddr))
+
 CCL_NAMESPACE_END
 
 #endif




More information about the Bf-blender-cvs mailing list