================
@@ -12001,6 +12001,70 @@ bool VectorExprEvaluator::VisitCallExpr(const CallExpr 
*E) {
     return Success(APValue(ResultElements.data(), ResultElements.size()), E);
   }
 
+  case X86::BI__builtin_ia32_pslldqi128_byteshift:
+  case X86::BI__builtin_ia32_psrldqi128_byteshift: {
+    unsigned BuiltinID = E->getBuiltinCallee();
+
+    APSInt Amt;
+    if (!EvaluateInteger(E->getArg(1), Amt, Info))
+      break;
+    unsigned Shift = (unsigned)Amt.getZExtValue();
+
+    APValue Vec;
+    if (!Evaluate(Vec, Info, E->getArg(0)) || !Vec.isVector())
+      break;
+
+    SmallVector<APValue, 16> ResultElements;
+    ResultElements.reserve(16);
+
+    bool isLeft = (BuiltinID == X86::BI__builtin_ia32_pslldqi128_byteshift);
+
+    for (unsigned i = 0; i < 16; i++) {
+      int SrcIdx = -1;
+      if (isLeft)
+        SrcIdx = i + Shift;
+      else if (i >= Shift)
+        SrcIdx = i - Shift;
+
+      if (SrcIdx >= 0 && (unsigned)SrcIdx < 16)
+        ResultElements.push_back(Vec.getVectorElt(SrcIdx));
----------------
kimyounhoex1 wrote:

 ā€œI’m done with this one, could you please check one more?ā€

https://github.com/llvm/llvm-project/pull/157403
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to