[cfe-commits] r147240 - in /cfe/trunk: include/clang/Basic/BuiltinsX86.def test/CodeGen/avx2-builtins.c

Craig Topper craig.topper at gmail.com
Fri Dec 23 21:19:47 PST 2011


Author: ctopper
Date: Fri Dec 23 23:19:47 2011
New Revision: 147240

URL: http://llvm.org/viewvc/llvm-project?rev=147240&view=rev
Log:
Add AVX2 intrinsics for FP vbroadcast, vbroadcasti128, and vpblendd.

Modified:
    cfe/trunk/include/clang/Basic/BuiltinsX86.def
    cfe/trunk/test/CodeGen/avx2-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=147240&r1=147239&r2=147240&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Fri Dec 23 23:19:47 2011
@@ -555,5 +555,12 @@
 BUILTIN(__builtin_ia32_psrld256, "V8iV8iV4i", "")
 BUILTIN(__builtin_ia32_psrlqi256, "V4LLiV4LLii", "")
 BUILTIN(__builtin_ia32_psrlq256, "V4LLiV4LLiV2LLi", "")
+BUILTIN(__builtin_ia32_movntdqa256, "V4LLiV4LLi*", "")
+BUILTIN(__builtin_ia32_vbroadcastss_ps, "V4fV4f", "")
+BUILTIN(__builtin_ia32_vbroadcastss_ps256, "V8fV4f", "")
+BUILTIN(__builtin_ia32_vbroadcastsd_pd256, "V4dV2d", "")
+BUILTIN(__builtin_ia32_vbroadcastsi256, "V4LLiV2LLiC*", "")
+BUILTIN(__builtin_ia32_pblendd128, "V4iV4iV4iIi", "")
+BUILTIN(__builtin_ia32_pblendd256, "V8iV8iV8iIi", "")
 
 #undef BUILTIN

Modified: cfe/trunk/test/CodeGen/avx2-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx2-builtins.c?rev=147240&r1=147239&r2=147240&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/avx2-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx2-builtins.c Fri Dec 23 23:19:47 2011
@@ -580,3 +580,38 @@
   // CHECK: shufflevector <4 x i64> %{{.*}}, <4 x i64> %{{.*}}, <4 x i32> <i32 0, i32 4, i32 2, i32 6>
   return _mm256_unpacklo_epi64(a, b);
 }
+
+__m256i test_mm256_stream_load_si256(__m256i *a) {
+  // CHECK: @llvm.x86.avx2.movntdqa
+  return _mm256_stream_load_si256(a);
+}
+
+__m128 test_mm_broadcastss_ps(__m128 a) {
+  // CHECK: @llvm.x86.avx2.vbroadcast.ss.ps
+  return _mm_broadcastss_ps(a);
+}
+
+__m256 test_mm256_broadcastss_ps(__m128 a) {
+  // CHECK: @llvm.x86.avx2.vbroadcast.ss.ps.256
+  return _mm256_broadcastss_ps(a);
+}
+
+__m256d test_mm256_broadcastsd_pd(__m128d a) {
+  // CHECK: @llvm.x86.avx2.vbroadcast.sd.pd.256
+  return _mm256_broadcastsd_pd(a);
+}
+
+__m256i test_mm_broadcastsi128_si256(__m128i *a) {
+  // CHECK: @llvm.x86.avx2.vbroadcasti128
+  return _mm_broadcastsi128_si256(a);
+}
+
+__m128i test_mm_blend_epi32(__m128i a, __m128i b) {
+  // CHECK: @llvm.x86.avx2.pblendd.128
+  return _mm_blend_epi32(a, b, 57);
+}
+
+__m256i test_mm256_blend_epi32(__m256i a, __m256i b) {
+  // CHECK: @llvm.x86.avx2.pblendd.256
+  return _mm256_blend_epi32(a, b, 57);
+}





More information about the cfe-commits mailing list