diff --git a/mlir/lib/Conversion/ArithToSPIRV/ArithToSPIRV.cpp b/mlir/lib/Conversion/ArithToSPIRV/ArithToSPIRV.cpp --- a/mlir/lib/Conversion/ArithToSPIRV/ArithToSPIRV.cpp +++ b/mlir/lib/Conversion/ArithToSPIRV/ArithToSPIRV.cpp @@ -1100,6 +1100,7 @@ TypeCastingOpPattern, TypeCastingOpPattern, UIToFPI1Pattern, TypeCastingOpPattern, + TypeCastingOpPattern, TypeCastingOpPattern, TypeCastingOpPattern, TypeCastingOpPattern, diff --git a/mlir/test/Conversion/ArithToSPIRV/arith-to-spirv.mlir b/mlir/test/Conversion/ArithToSPIRV/arith-to-spirv.mlir --- a/mlir/test/Conversion/ArithToSPIRV/arith-to-spirv.mlir +++ b/mlir/test/Conversion/ArithToSPIRV/arith-to-spirv.mlir @@ -903,6 +903,20 @@ return %0 : vector<4xi1> } +// CHECK-LABEL: @fptoui1 +func.func @fptoui1(%arg0 : f32) -> i32 { + // CHECK: spirv.ConvertFToU %{{.*}} : f32 to i32 + %0 = arith.fptoui %arg0 : f32 to i32 + return %0 : i32 +} + +// CHECK-LABEL: @fptoui2 +func.func @fptoui2(%arg0 : f16) -> i16 { + // CHECK: spirv.ConvertFToU %{{.*}} : f16 to i16 + %0 = arith.fptoui %arg0 : f16 to i16 + return %0 : i16 +} + // CHECK-LABEL: @fptosi1 func.func @fptosi1(%arg0 : f32) -> i32 { // CHECK: spirv.ConvertFToS %{{.*}} : f32 to i32