================
@@ -5551,6 +5634,41 @@ mlir::LogicalResult 
CIRToLLVMVecCmpOpLowering::matchAndRewrite(
   return mlir::success();
 }
 
+mlir::LogicalResult CIRToLLVMVecFCmpOpLowering::matchAndRewrite(
+    cir::VecFCmpOp op, OpAdaptor adaptor,
+    mlir::ConversionPatternRewriter &rewriter) const {
+  mlir::Type elementType = op.getLhs().getType().getElementType();
+  if (!mlir::isa<cir::FPTypeInterface>(elementType))
+    return op.emitError() << "unsupported type for VecFCmpOp: " << elementType;
+
+  mlir::Value bitResult;
+  if (cir::FenvAttr fenv = op.getFenvAttr()) {
+    llvm::ElementCount size = op.getLhs().getType().getSize();
+    auto i1VecTy = mlir::VectorType::get(
+        size.getKnownMinValue(), rewriter.getI1Type(), {size.isScalable()});
+    bitResult = createConstrainedFCmpCall(
+                    rewriter, op.getLoc(), adaptor.getLhs(), adaptor.getRhs(),
+                    op.getKind(), op.getSignaling(), fenv, i1VecTy)
+                    .getResult(0);
----------------
steffenlarsen wrote:

This would be a little easier to read if it was split up in a temporary 
variable containing the result of `createConstrainedFCmpCall` and then setting 
`bitResult` to the `.getResult(0)` of that.

https://github.com/llvm/llvm-project/pull/235843
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to