From acc1f8fbed5dfe78d33fa03783205c8ff65f092f Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 2 Dec 2016 10:42:31 +0100 Subject: 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. --- intern/cycles/util/util_avxf.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'intern') diff --git a/intern/cycles/util/util_avxf.h b/intern/cycles/util/util_avxf.h index 2db2c4dad1a..2451213963a 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 -- cgit v1.2.3