File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,26 @@ func.func @reciprocal_div_neg_infinity() -> tensor<f32> {
73
73
return %1 : tensor <f32 >
74
74
}
75
75
76
+ // CHECK-LABEL: @reciprocal_div_underflow
77
+ func.func @reciprocal_div_underflow () -> tensor <2 xf16 > {
78
+ // CHECK: [[RES:]] ={{.*}}tosa.const{{.*}}-0.{{0*}}e+00, 0.{{0*}}e+00
79
+ // CHECK-NOT: tosa.reciprocal
80
+ // CHECK: return [[RES]]
81
+ %0 = " tosa.const" () {value = dense <[-6.0e+15 , 6.0e+15 ]> : tensor <2 xf16 >} : () -> tensor <2 xf16 >
82
+ %1 = " tosa.reciprocal" (%0 ) : (tensor <2 xf16 >) -> tensor <2 xf16 >
83
+ return %1 : tensor <2 xf16 >
84
+ }
85
+
86
+ // CHECK-LABEL: @reciprocal_div_overflow
87
+ func.func @reciprocal_div_overflow () -> tensor <2 xf16 > {
88
+ // CHECK: [[RES:]] ={{.*}}tosa.const{{.*}}0x7C00, 0xFC00
89
+ // CHECK-NOT: tosa.reciprocal
90
+ // CHECK: return [[RES]]
91
+ %0 = " tosa.const" () {value = dense <[0.0000001 , -0.0000001 ]> : tensor <2 xf16 >} : () -> tensor <2 xf16 >
92
+ %1 = " tosa.reciprocal" (%0 ) : (tensor <2 xf16 >) -> tensor <2 xf16 >
93
+ return %1 : tensor <2 xf16 >
94
+ }
95
+
76
96
// CHECK-LABEL: @reciprocal_no_fold
77
97
// The folding optimization works only intra-procedurally, so we won't be able
78
98
// to fold anything here
You can’t perform that action at this time.
0 commit comments