diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-12-02 12:42:31 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-12-02 14:23:38 +0300 |
commit | acc1f8fbed5dfe78d33fa03783205c8ff65f092f (patch) | |
tree | 3b9d3f14db352b3d8ed5c7a843bcb06b5d894c78 /intern/cycles/util | |
parent | 0c958b9f8e933605497a59faf8838a544b9da740 (diff) |
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.
Diffstat (limited to 'intern/cycles/util')
-rw-r--r-- | intern/cycles/util/util_avxf.h | 8 |
1 files changed, 8 insertions, 0 deletions
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 |