================
@@ -417,8 +417,26 @@ static mlir::Value emitX86vpcom(CIRGenBuilderTy &builder,
mlir::Location loc,
return builder.createVecCompare(loc, pred, op0, op1);
}
-std::optional<mlir::Value>
-CIRGenFunction::emitX86BuiltinExpr(unsigned builtinID, const CallExpr *expr) {
+static mlir::Value emitX86VectorSelect(CIRGenBuilderTy &builder,
+ mlir::Location loc, mlir::Value mask,
+ mlir::Value Op0, mlir::Value Op1) {
+ return cir::VecTernaryOp::create(builder, loc, Op0.getType(), mask, Op0,
Op1);
+}
+
+static mlir::Value emitX86ScalarSelect(CIRGenBuilderTy &builder,
+ mlir::Location loc, mlir::Value mask,
+ mlir::Value Op0, mlir::Value Op1) {
+
+ auto zeroAttr = builder.getZeroAttr(mask.getType());
+ mlir::Value zero =
+ cir::ConstantOp::create(builder, loc, mask.getType(), zeroAttr);
+ mlir::Value cond = builder.createCompare(loc, cir::CmpOpKind::ne, mask,
zero);
----------------
Priyanshu3820 wrote:
updated
https://github.com/llvm/llvm-project/pull/172299
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits