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
path: root/intern
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2020-04-02 18:25:48 +0300
committerBrecht Van Lommel <brecht@blender.org>2020-04-02 18:30:56 +0300
commit868d4526a8818fbffc5ea993fbbbd3890046a6e9 (patch)
treee708f8d78ed580ada43a00ab8b7573200a4d3bb6 /intern
parent343a874831d3b9cc548d3fd72caa3e39d5cdaa71 (diff)
Fix more build errors/warnings after recent AVX changes
Thanks to Sergey and Ray for the help identifying the problem.
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/util/util_avxf.h3
-rw-r--r--intern/cycles/util/util_simd.h7
2 files changed, 9 insertions, 1 deletions
diff --git a/intern/cycles/util/util_avxf.h b/intern/cycles/util/util_avxf.h
index 47d416afbb7..1fb3ded422f 100644
--- a/intern/cycles/util/util_avxf.h
+++ b/intern/cycles/util/util_avxf.h
@@ -266,7 +266,8 @@ template<size_t i0> __forceinline const avxf shuffle(const avxf &a)
template<size_t i> __forceinline float extract(const avxf &a)
{
- return _mm256_cvtss_f32(shuffle<i, i, i, i>(a).m256);
+ __m256 b = shuffle<i, i, i, i>(a).m256;
+ return _mm256_cvtss_f32(b);
}
template<> __forceinline float extract<0>(const avxf &a)
{
diff --git a/intern/cycles/util/util_simd.h b/intern/cycles/util/util_simd.h
index 922f5dd274e..ac2893692df 100644
--- a/intern/cycles/util/util_simd.h
+++ b/intern/cycles/util/util_simd.h
@@ -588,6 +588,13 @@ __forceinline __m128 _mm_round_ps_emu(__m128 value, const int flags)
# endif /* !(defined(__KERNEL_SSE41__) || defined(__SSE4_1__) || defined(__SSE4_2__)) */
+/* Older GCC versions do not have _mm256_cvtss_f32 yet, so define it ourselves.
+ * _mm256_castps256_ps128 generates no instructions so this is jus as efficient. */
+# ifdef __KERNEL_AVX__
+# undef _mm256_cvtss_f32
+# define _mm256_cvtss_f32(a) (_mm_cvtss_f32(_mm256_castps256_ps128(a)))
+# endif
+
# else /* __KERNEL_SSE2__ */
/* This section is for utility functions which operates on non-register data