================
@@ -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));
----------------
RKSimon wrote:

This isn't going to work as currently the intrinsics take `<X x long long int>` 
types - we're going to have to change these to `<8X x char>` types to make this 
a lot easier to deal with - see the palignr builtins for an example

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