[PATCH] D21058: [Clang][AVX512][BUILTIN]Adding missing intrinsics srl and sll

michael zuckerman via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 7 00:21:01 PDT 2016


m_zuckerman created this revision.
m_zuckerman added reviewers: AsafBadouh, igorb, delena.
m_zuckerman added a subscriber: cfe-commits.

http://reviews.llvm.org/D21058

Files:
  include/clang/Basic/BuiltinsX86.def
  lib/Headers/avx512bwintrin.h
  test/CodeGen/avx512bw-builtins.c

Index: test/CodeGen/avx512bw-builtins.c
===================================================================
--- test/CodeGen/avx512bw-builtins.c
+++ test/CodeGen/avx512bw-builtins.c
@@ -1505,8 +1505,6 @@
    return _mm512_maskz_alignr_epi8(__U, __A, __B, 2); 
 }
 
-
-
 __m512i test_mm512_mm_dbsad_epu8(__m512i __A, __m512i __B) {
   // CHECK-LABEL: @test_mm512_mm_dbsad_epu8
   // CHECK: @llvm.x86.avx512.mask.dbpsadbw.512
@@ -1537,3 +1535,15 @@
   return _mm512_movepi16_mask(__A); 
 }
 
+__m512i test_mm512_bslli_epi128 (__m512i __A){
+  // CHECK-LABEL: @test_mm512_bslli_epi128
+  // CHECK: @lvm.x86.avx512.psll.dq.512(
+  return (__m512i) __builtin_ia32_pslldq512 (__A, 4);
+}
+
+__m512i test_mm512_bsrli_epi128 (__m512i __A){
+  // CHECK-LABEL: @test_mm512_bsrli_epi128
+  // CHECK: @lvm.x86.avx512.psrl.dq.512(
+  return (__m512i) __builtin_ia32_psrldq512 (__A, 4);
+}
+
Index: lib/Headers/avx512bwintrin.h
===================================================================
--- lib/Headers/avx512bwintrin.h
+++ lib/Headers/avx512bwintrin.h
@@ -2186,6 +2186,14 @@
                (__v64qi) __B);
 }
 
+#define _mm512_bslli_epi128 (__A,__N)({\
+  return (__m512i) __builtin_ia32_pslldq512 ((__m512i)__A,(int) __N);\
+})
+
+#define _mm512_bsrli_epi128 ( __A, __N)({\
+  return (__m512i) __builtin_ia32_psrldq512 ((__m512i)__A, (int)__N);\
+})
+
 
 
 #undef __DEFAULT_FN_ATTRS
Index: include/clang/Basic/BuiltinsX86.def
===================================================================
--- include/clang/Basic/BuiltinsX86.def
+++ include/clang/Basic/BuiltinsX86.def
@@ -2255,6 +2255,8 @@
 TARGET_BUILTIN(__builtin_ia32_vpmultishiftqb512_mask, "V64cV64cV64cV64cULLi","","avx512vbmi")
 TARGET_BUILTIN(__builtin_ia32_vpmultishiftqb128_mask, "V16cV16cV16cV16cUs","","avx512vbmi,avx512vl")
 TARGET_BUILTIN(__builtin_ia32_vpmultishiftqb256_mask, "V32cV32cV32cV32cUi","","avx512vbmi,avx512vl")
+TARGET_BUILTIN(__builtin_ia32_pslldq512, "V8dV8dIi","","avx512bw")
+TARGET_BUILTIN(__builtin_ia32_psrldq512, "V8dV8dIi","","avx512bw")
 
 // MONITORX/MWAITX
 TARGET_BUILTIN(__builtin_ia32_monitorx, "vv*UiUi", "", "mwaitx")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21058.59837.patch
Type: text/x-patch
Size: 2117 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160607/7e0ee7b7/attachment.bin>


More information about the cfe-commits mailing list