r252712 - [X86] Add 'pause' builtin that's already in llvm and use it instead of inline assembly to implement _mm_pause.
Craig Topper via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 11 00:13:34 PST 2015
Author: ctopper
Date: Wed Nov 11 02:13:33 2015
New Revision: 252712
URL: http://llvm.org/viewvc/llvm-project?rev=252712&view=rev
Log:
[X86] Add 'pause' builtin that's already in llvm and use it instead of inline assembly to implement _mm_pause.
Modified:
cfe/trunk/include/clang/Basic/BuiltinsX86.def
cfe/trunk/lib/Headers/emmintrin.h
cfe/trunk/test/CodeGen/sse-builtins.c
Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsX86.def?rev=252712&r1=252711&r2=252712&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Wed Nov 11 02:13:33 2015
@@ -336,6 +336,7 @@ TARGET_BUILTIN(__builtin_ia32_cvttps2dq,
TARGET_BUILTIN(__builtin_ia32_clflush, "vvC*", "", "sse2")
TARGET_BUILTIN(__builtin_ia32_lfence, "v", "", "sse2")
TARGET_BUILTIN(__builtin_ia32_mfence, "v", "", "sse2")
+TARGET_BUILTIN(__builtin_ia32_pause, "v", "", "sse2")
TARGET_BUILTIN(__builtin_ia32_storedqu, "vc*V16c", "", "sse2")
TARGET_BUILTIN(__builtin_ia32_pmuludq128, "V2LLiV4iV4i", "", "sse2")
TARGET_BUILTIN(__builtin_ia32_psraw128, "V8sV8sV8s", "", "sse2")
Modified: cfe/trunk/lib/Headers/emmintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/emmintrin.h?rev=252712&r1=252711&r2=252712&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/emmintrin.h (original)
+++ cfe/trunk/lib/Headers/emmintrin.h Wed Nov 11 02:13:33 2015
@@ -1481,7 +1481,7 @@ _mm_castsi128_pd(__m128i __a)
static __inline__ void __DEFAULT_FN_ATTRS
_mm_pause(void)
{
- __asm__ volatile ("pause");
+ __builtin_ia32_pause();
}
#undef __DEFAULT_FN_ATTRS
Modified: cfe/trunk/test/CodeGen/sse-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/sse-builtins.c?rev=252712&r1=252711&r2=252712&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/sse-builtins.c (original)
+++ cfe/trunk/test/CodeGen/sse-builtins.c Wed Nov 11 02:13:33 2015
@@ -513,3 +513,9 @@ __m64 test_mm_mul_su32(__m64 __a, __m64
// CHECK @llvm.x86.mmx.pmulu.dq(x86_mmx %{{.*}}, x86_mmx %{{.*}})
return _mm_mul_su32(__a, __b);
}
+
+void test_mm_pause() {
+ // CHECK-LABEL: @test_mm_pause
+ // CHECK @llvm.x86.sse2.pause()
+ return _mm_pause();
+}
More information about the cfe-commits
mailing list