return rewriter.create<arith::ExtUIOp>(loc, resultTypes, args,
mlir::None);
- // All other si-to-fp conversions should be handled by SIToFP.
- if (arith::SIToFPOp::areCastCompatible(srcTy, dstTy))
- return rewriter.create<arith::SIToFPOp>(loc, resultTypes, args,
- mlir::None);
-
// Unsigned integers need an unrealized cast so that they can be passed
// to UIToFP.
if (srcTy.isUnsignedInteger() && dstTy.isa<FloatType>()) {
unrealizedCast);
}
+ // All other si-to-fp conversions should be handled by SIToFP.
+ if (arith::SIToFPOp::areCastCompatible(srcTy, dstTy))
+ return rewriter.create<arith::SIToFPOp>(loc, resultTypes, args,
+ mlir::None);
+
// Casting to boolean, floats need to only be checked as not-equal to zero.
if (srcTy.isa<FloatType>() && dstTy.isInteger(1)) {
Value zero = rewriter.create<arith::ConstantOp>(
// -----
+// CHECK-LABEL: @test_simple_ui8
+func @test_simple_ui8(%arg0: tensor<1xui8>) -> () {
+ // CHECK: arith.uitofp
+ %0 = "tosa.cast"(%arg0) : (tensor<1xui8>) -> tensor<1xf32>
+ return
+}
+
+// -----
+
// CHECK-LABEL: @test_simple_i32
func @test_simple_i32(%arg0: tensor<1xi32>) -> () {
// CHECK: linalg.generic