Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy B. Terriberry <tterribe@xiph.org>2015-02-27 22:11:57 +0300
committerTimothy B. Terriberry <tterribe@xiph.org>2015-02-27 22:11:57 +0300
commit2d83e7e297a11c729f8723c2f01c1c35cac0c01f (patch)
tree12baed4d54568c2de2248183ccc635a07427c97b
parent3b74d8bd728cc5582db785bc8c1d6ac97e9874ee (diff)
Wrap _mm_cvtepi...() intrinsics in macros on clang.
We already needed these macros for gcc with optimizations disabled, but it appears clang needs them all the time. Thanks to Jonathan Lennox for the report.
-rw-r--r--celt/x86/x86cpu.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/celt/x86/x86cpu.h b/celt/x86/x86cpu.h
index 44b3a597..ef53f0c9 100644
--- a/celt/x86/x86cpu.h
+++ b/celt/x86/x86cpu.h
@@ -53,8 +53,14 @@ int opus_select_arch(void);
We can insert an explicit MOVD or MOVQ using _mm_cvtsi32_si128() or
_mm_loadl_epi64(), which should have the same semantics as an m32 or m64
reference in the PMOVSXWD instruction itself, but gcc is not smart enough to
- optimize this out when optimizations ARE enabled.*/
-# if !defined(__OPTIMIZE__)
+ optimize this out when optimizations ARE enabled.
+
+ It appears clang requires us to do this always (which is fair, since
+ technically the compiler is always allowed to do the dereference before
+ invoking the function implementing the intrinsic). I have not investiaged
+ whether it is any smarter than gcc when it comes to eliminating the extra
+ load instruction.*/
+# if defined(__clang__) || !defined(__OPTIMIZE__)
# define OP_CVTEPI8_EPI32_M32(x) \
(_mm_cvtepi8_epi32(_mm_cvtsi32_si128(*(int *)(x))))