File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -754,15 +754,23 @@ func.func @truncExtf3(%arg0: f32) -> f16 {
754
754
}
755
755
756
756
// CHECK-LABEL: @truncSitofp
757
- // CHECK-NOT: truncf
758
757
// CHECK: %[[SITOFP:.*]] = arith.sitofp %[[ARG0:.*]] : i32 to f32
758
+ // CHECK-NOT: truncf
759
759
// CHECK: return %[[SITOFP]]
760
760
func.func @truncSitofp (%arg0: i32 ) -> f32 {
761
761
%sitofp = arith.sitofp %arg0 : i32 to f64
762
762
%trunc = arith.truncf %sitofp : f64 to f32
763
763
return %trunc : f32
764
764
}
765
765
766
+ // CHECK-LABEL: @truncSitofpConstrained
767
+ // CHECK: truncf
768
+ func.func @truncSitofpConstrained (%arg0: i32 ) -> f32 {
769
+ %sitofp = arith.sitofp %arg0 : i32 to f64
770
+ %trunc = arith.truncf %sitofp to_nearest_even : f64 to f32
771
+ return %trunc : f32
772
+ }
773
+
766
774
// TODO: We should also add a test for not folding arith.extf on information loss.
767
775
// This may happen when extending f8E5M2FNUZ to f16.
768
776
You can’t perform that action at this time.
0 commit comments