================
@@ -546,11 +567,51 @@ mlir::Value CIRGenFunction::emitX86BuiltinExpr(unsigned
builtinID,
case X86::BI__builtin_ia32_kshiftliqi:
case X86::BI__builtin_ia32_kshiftlihi:
case X86::BI__builtin_ia32_kshiftlisi:
- case X86::BI__builtin_ia32_kshiftlidi:
+ case X86::BI__builtin_ia32_kshiftlidi: {
+ unsigned shiftVal =
+ ops[1].getDefiningOp<cir::ConstantOp>().getIntValue().getZExtValue() &
+ 0xff;
+ auto numElems = cast<cir::IntType>(ops[0].getType()).getWidth();
+
+ if (shiftVal >= numElems)
+ return builder.getNullValue(ops[0].getType(),
getLoc(expr->getExprLoc()));
+
+ mlir::Value in = getMaskVecValue(*this, expr, ops[0], numElems);
+
+ SmallVector<int64_t, 64> indices;
+ for (auto i : llvm::seq<unsigned>(0, numElems))
+ indices.push_back(numElems + i - shiftVal);
----------------
andykaylor wrote:
As above, create the cir::IntAttr directly here.
https://github.com/llvm/llvm-project/pull/168591
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits