@@ -1149,7 +1149,7 @@ func.func @rescale_i8(%arg0 : tensor<2xi8>) -> () {
11491149 // CHECK-DAG: [[BOUNDED:%.+]] = arith.minsi [[CMAX]], [[LOWER]]
11501150 // CHECK-DAG: [[TRUNC:%.+]] = arith.trunci [[BOUNDED]]
11511151 // CHECK-DAG: linalg.yield [[TRUNC]]
1152- %0 = tosa.rescale %arg0 {input_zp = 17 : i32 , output_zp = 22 : i32 , multiplier = array<i32 : 19689 >, shift = array<i8 : 15 >, scale32 = false , double_round = false , per_channel = false } : (tensor <2 xi8 >) -> tensor <2 xi8 >
1152+ %0 = tosa.rescale %arg0 {input_zp = 17 : i32 , output_zp = 22 : i32 , multiplier = array<i32 : 19689 >, shift = array<i8 : 15 >, scale32 = false , double_round = false , per_channel = false , input_unsigned = false , output_unsigned = false } : (tensor <2 xi8 >) -> tensor <2 xi8 >
11531153
11541154 // CHECK: return
11551155 return
@@ -1178,7 +1178,7 @@ func.func @rescale_i8_unsigned_output(%arg0 : tensor<2xi8>) -> () {
11781178 // CHECK-DAG: [[BOUNDED:%.+]] = arith.minsi [[CMAX]], [[LOWER]]
11791179 // CHECK-DAG: [[TRUNC:%.+]] = arith.trunci [[BOUNDED]]
11801180 // CHECK: linalg.yield [[TRUNC]]
1181- %1 = tosa.rescale %arg0 {input_zp = 17 : i32 , output_zp = 22 : i32 , multiplier = array<i32 : 19689 >, shift = array<i8 : 15 >, scale32 = false , double_round = false , per_channel = false , output_unsigned = true } : (tensor <2 xi8 >) -> tensor <2 xi8 >
1181+ %1 = tosa.rescale %arg0 {input_zp = 17 : i32 , output_zp = 22 : i32 , multiplier = array<i32 : 19689 >, shift = array<i8 : 15 >, scale32 = false , double_round = false , per_channel = false , input_unsigned = false , output_unsigned = true } : (tensor <2 xi8 >) -> tensor <2 xi8 >
11821182
11831183 // CHECK: return
11841184 return
@@ -1195,13 +1195,13 @@ func.func @rescale_i8_dyn_batch(%arg0 : tensor<?x2xi8>) -> () {
11951195 // CHECK: %[[BATCH:.+]] = tensor.dim %[[ARG0]], %[[C0]]
11961196 // CHECK: %[[INIT:.+]] = tensor.empty(%[[BATCH]]) : tensor<?x2xi8>
11971197 // CHECK: [[GENERIC:%.+]] = linalg.generic {indexing_maps = [#[[$MAP0]], #[[$MAP0]]], iterator_types = ["parallel", "parallel"]} ins(%[[ARG0]] : tensor<?x2xi8>) outs(%[[INIT]] : tensor<?x2xi8>)
1198- %0 = tosa.rescale %arg0 {input_zp = 17 : i32 , output_zp = 22 : i32 , multiplier = array<i32 : 19689 >, shift = array<i8 : 15 >, scale32 = false , double_round = false , per_channel = false } : (tensor <?x2 xi8 >) -> tensor <?x2 xi8 >
1198+ %0 = tosa.rescale %arg0 {input_zp = 17 : i32 , output_zp = 22 : i32 , multiplier = array<i32 : 19689 >, shift = array<i8 : 15 >, scale32 = false , double_round = false , per_channel = false , input_unsigned = false , output_unsigned = false } : (tensor <?x2 xi8 >) -> tensor <?x2 xi8 >
11991199
12001200 // CHECK: %[[C0:.+]] = arith.constant 0
12011201 // CHECK: %[[BATCH:.+]] = tensor.dim %[[ARG0]], %[[C0]]
12021202 // CHECK: %[[INIT:.+]] = tensor.empty(%[[BATCH]]) : tensor<?x2xi8>
12031203 // CHECK: [[GENERIC:%.+]] = linalg.generic {indexing_maps = [#[[$MAP0]], #[[$MAP0]]], iterator_types = ["parallel", "parallel"]} ins(%[[ARG0]] : tensor<?x2xi8>) outs(%[[INIT]] : tensor<?x2xi8>)
1204- %1 = tosa.rescale %arg0 {input_zp = 17 : i32 , output_zp = 22 : i32 , multiplier = array<i32 : 19689 >, shift = array<i8 : 15 >, scale32 = false , double_round = false , per_channel = false , output_unsigned = true } : (tensor <?x2 xi8 >) -> tensor <?x2 xi8 >
1204+ %1 = tosa.rescale %arg0 {input_zp = 17 : i32 , output_zp = 22 : i32 , multiplier = array<i32 : 19689 >, shift = array<i8 : 15 >, scale32 = false , double_round = false , per_channel = false , input_unsigned = false , output_unsigned = true } : (tensor <?x2 xi8 >) -> tensor <?x2 xi8 >
12051205
12061206 return
12071207}
@@ -1219,7 +1219,7 @@ func.func @rescale_dyn(%arg0 : tensor<1x?x?x32xi32>) -> () {
12191219 // CHECK: %[[DIM2:.+]] = tensor.dim %[[ARG0]], %[[C2]]
12201220 // CHECK: %[[INIT:.+]] = tensor.empty(%[[DIM1]], %[[DIM2]])
12211221 // CHECK: [[GENERIC:%.+]] = linalg.generic {indexing_maps = [#[[$MAP1]], #[[$MAP1]]], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%[[ARG0]] : tensor<1x?x?x32xi32>) outs(%[[INIT]] : tensor<1x?x?x32xi8>)
1222- %0 = tosa.rescale %arg0 {double_round = true , input_zp = 0 : i32 , multiplier = array<i32 : 1376784203 >, output_zp = 0 : i32 , per_channel = false , scale32 = true , shift = array<i8 : 38 >} : (tensor <1 x?x?x32 xi32 >) -> tensor <1 x?x?x32 xi8 >
1222+ %0 = tosa.rescale %arg0 {double_round = true , input_zp = 0 : i32 , multiplier = array<i32 : 1376784203 >, output_zp = 0 : i32 , per_channel = false , scale32 = true , shift = array<i8 : 38 >, input_unsigned = false , output_unsigned = false } : (tensor <1 x?x?x32 xi32 >) -> tensor <1 x?x?x32 xi8 >
12231223 return
12241224}
12251225
@@ -1247,7 +1247,7 @@ func.func @rescale_i8_unsigned_input(%arg0 : tensor<2xi8>) -> () {
12471247 // CHECK-DAG: [[BOUNDED:%.+]] = arith.minsi [[CMAX]], [[LOWER]]
12481248 // CHECK-DAG: [[TRUNC:%.+]] = arith.trunci [[BOUNDED]]
12491249 // CHECK: linalg.yield [[TRUNC]]
1250- %0 = tosa.rescale %arg0 {input_zp = 17 : i32 , output_zp = 22 : i32 , multiplier = array<i32 : 19689 >, shift = array<i8 : 15 >, scale32 = false , double_round = false , per_channel = false , input_unsigned = true } : (tensor <2 xi8 >) -> tensor <2 xi8 >
1250+ %0 = tosa.rescale %arg0 {input_zp = 17 : i32 , output_zp = 22 : i32 , multiplier = array<i32 : 19689 >, shift = array<i8 : 15 >, scale32 = false , double_round = false , per_channel = false , input_unsigned = true , output_unsigned = false } : (tensor <2 xi8 >) -> tensor <2 xi8 >
12511251
12521252 return
12531253}
@@ -1277,7 +1277,7 @@ func.func @rescale_per_channel(%arg0 : tensor<3xi8>) -> (tensor<3xi8>) {
12771277 // CHECK-DAG: [[BOUNDED:%.+]] = arith.minsi [[CMAX]], [[LOWER]]
12781278 // CHECK-DAG: [[TRUNC:%.+]] = arith.trunci [[BOUNDED]]
12791279 // CHECK-DAG: linalg.yield [[TRUNC]]
1280- %0 = tosa.rescale %arg0 {input_zp = 243 : i32 , output_zp = 252 : i32 , multiplier = array<i32 : 42 , 43 , 44 >, shift = array<i8 : 14 , 15 , 64 >, scale32 = false , double_round = false , per_channel = false } : (tensor <3 xi8 >) -> tensor <3 xi8 >
1280+ %0 = tosa.rescale %arg0 {input_zp = 243 : i32 , output_zp = 252 : i32 , multiplier = array<i32 : 42 , 43 , 44 >, shift = array<i8 : 14 , 15 , 64 >, scale32 = false , double_round = false , per_channel = false , input_unsigned = false , output_unsigned = false } : (tensor <3 xi8 >) -> tensor <3 xi8 >
12811281
12821282 // CHECK: return [[GENERIC]]
12831283 return %0 : tensor <3 xi8 >
@@ -1290,7 +1290,7 @@ func.func @rescaleDoubleRound(%arg0 : tensor<2xi8>) -> (tensor<2xi8>) {
12901290 // CHECK: linalg.generic
12911291 // CHECK: tosa.apply_scale
12921292 // CHECK-SAME: {double_round = true}
1293- %0 = tosa.rescale %arg0 {input_zp = 243 : i32 , output_zp = 252 : i32 , multiplier = array<i32 : 19689 >, shift = array<i8 : 33 >, scale32 = true , double_round = true , per_channel = false } : (tensor <2 xi8 >) -> tensor <2 xi8 >
1293+ %0 = tosa.rescale %arg0 {input_zp = 243 : i32 , output_zp = 252 : i32 , multiplier = array<i32 : 19689 >, shift = array<i8 : 33 >, scale32 = true , double_round = true , per_channel = false , input_unsigned = false , output_unsigned = false } : (tensor <2 xi8 >) -> tensor <2 xi8 >
12941294 return %0 : tensor <2 xi8 >
12951295}
12961296
@@ -1299,7 +1299,7 @@ func.func @rescaleUnnecessaryDoubleRound(%arg0 : tensor<2xi8>) -> (tensor<2xi8>)
12991299 // CHECK: linalg.generic
13001300 // CHECK: tosa.apply_scale
13011301 // CHECK-SAME: {double_round = false}
1302- %0 = tosa.rescale %arg0 {input_zp = 243 : i32 , output_zp = 252 : i32 , multiplier = array<i32 : 19689 >, shift = array<i8 : 15 >, scale32 = true , double_round = true , per_channel = false } : (tensor <2 xi8 >) -> tensor <2 xi8 >
1302+ %0 = tosa.rescale %arg0 {input_zp = 243 : i32 , output_zp = 252 : i32 , multiplier = array<i32 : 19689 >, shift = array<i8 : 15 >, scale32 = true , double_round = true , per_channel = false , input_unsigned = false , output_unsigned = false } : (tensor <2 xi8 >) -> tensor <2 xi8 >
13031303 return %0 : tensor <2 xi8 >
13041304}
13051305
0 commit comments