[clang] [clang] VectorExprEvaluator::VisitCallExpr - add constant folding for X86 pslldqi/psrldqi intrinsics (PR #157403)

Simon Pilgrim via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 19 03:03:21 PDT 2025


================
@@ -2607,3 +2607,19 @@ void test_mm512_mask_cvtusepi16_storeu_epi8 (void * __P, __mmask32 __M, __m512i
  // CHECK: @llvm.x86.avx512.mask.pmovus.wb.mem.512
  _mm512_mask_cvtusepi16_storeu_epi8 ( __P, __M, __A);
 }
+
+__m512i test_mm512_bslli_epi16(__m512i a) {
+  // CHECK-LABEL: @test_bslli
+  // CHECK: shufflevector
+  return _mm512_bslli_epi128(a, 4);
+}
+TEST_CONSTEXPR(match_v64qi(_mm512_bslli_epi128((__m512i)(__v64qi){1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16, 17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32, 33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64}, 4), 0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12, 0,0,0,0,17,18,19,20,21,22,23,24,25,26,27,28, 0,0,0,0,33,34,35,36,37,38,39,40,41,42,43,44, 0,0,0,0,49,50,51,52,53,54,55,56,57,58,59,60));
+TEST_CONSTEXPR(match_v64qi(_mm512_bslli_epi128((__m512i)(__v64qi){1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16, 17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32, 33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48, 49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64}, 16), 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));
+
+__m512i test_mm512_bsrli_epi16(__m512i a) {
+  // CHECK-LABEL: @test_bsrli
+  // CHECK: shufflevector
----------------
RKSimon wrote:

fill in this shufflevector check

https://github.com/llvm/llvm-project/pull/157403


More information about the cfe-commits mailing list