[clang] [CIR][X86] Add support for vpshl/vpshr builtins (PR #179538)
Matt Arsenault via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 4 09:50:13 PST 2026
================
@@ -1246,8 +1246,23 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl &gd, unsigned builtinID,
case Builtin::BI__builtin_elementwise_canonicalize:
case Builtin::BI__builtin_elementwise_copysign:
case Builtin::BI__builtin_elementwise_fma:
- case Builtin::BI__builtin_elementwise_fshl:
- case Builtin::BI__builtin_elementwise_fshr:
+ return errorBuiltinNYI(*this, e, builtinID);
+ case Builtin::BI__builtin_elementwise_fshl: {
+ mlir::Location loc = getLoc(e->getExprLoc());
+ mlir::Value a = emitScalarExpr(e->getArg(0));
+ mlir::Value b = emitScalarExpr(e->getArg(1));
+ mlir::Value c = emitScalarExpr(e->getArg(2));
+ return RValue::get(builder.emitIntrinsicCallOp(loc, "fshl", a.getType(),
+ mlir::ValueRange{a, b, c}));
+ }
+ case Builtin::BI__builtin_elementwise_fshr: {
----------------
arsenm wrote:
These cases aren't in the title and aren't tested
https://github.com/llvm/llvm-project/pull/179538
More information about the cfe-commits
mailing list