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") 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: 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); +} +