@@ -1149,7 +1149,7 @@ func.func @rescale_i8(%arg0 : tensor<2xi8>) -> () {
1149
1149
// CHECK-DAG: [[BOUNDED:%.+]] = arith.minsi [[CMAX]], [[LOWER]]
1150
1150
// CHECK-DAG: [[TRUNC:%.+]] = arith.trunci [[BOUNDED]]
1151
1151
// 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 >
1153
1153
1154
1154
// CHECK: return
1155
1155
return
@@ -1178,7 +1178,7 @@ func.func @rescale_i8_unsigned_output(%arg0 : tensor<2xi8>) -> () {
1178
1178
// CHECK-DAG: [[BOUNDED:%.+]] = arith.minsi [[CMAX]], [[LOWER]]
1179
1179
// CHECK-DAG: [[TRUNC:%.+]] = arith.trunci [[BOUNDED]]
1180
1180
// 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 >
1182
1182
1183
1183
// CHECK: return
1184
1184
return
@@ -1195,13 +1195,13 @@ func.func @rescale_i8_dyn_batch(%arg0 : tensor<?x2xi8>) -> () {
1195
1195
// CHECK: %[[BATCH:.+]] = tensor.dim %[[ARG0]], %[[C0]]
1196
1196
// CHECK: %[[INIT:.+]] = tensor.empty(%[[BATCH]]) : tensor<?x2xi8>
1197
1197
// 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 >
1199
1199
1200
1200
// CHECK: %[[C0:.+]] = arith.constant 0
1201
1201
// CHECK: %[[BATCH:.+]] = tensor.dim %[[ARG0]], %[[C0]]
1202
1202
// CHECK: %[[INIT:.+]] = tensor.empty(%[[BATCH]]) : tensor<?x2xi8>
1203
1203
// 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 >
1205
1205
1206
1206
return
1207
1207
}
@@ -1219,7 +1219,7 @@ func.func @rescale_dyn(%arg0 : tensor<1x?x?x32xi32>) -> () {
1219
1219
// CHECK: %[[DIM2:.+]] = tensor.dim %[[ARG0]], %[[C2]]
1220
1220
// CHECK: %[[INIT:.+]] = tensor.empty(%[[DIM1]], %[[DIM2]])
1221
1221
// 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 >
1223
1223
return
1224
1224
}
1225
1225
@@ -1247,7 +1247,7 @@ func.func @rescale_i8_unsigned_input(%arg0 : tensor<2xi8>) -> () {
1247
1247
// CHECK-DAG: [[BOUNDED:%.+]] = arith.minsi [[CMAX]], [[LOWER]]
1248
1248
// CHECK-DAG: [[TRUNC:%.+]] = arith.trunci [[BOUNDED]]
1249
1249
// 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 >
1251
1251
1252
1252
return
1253
1253
}
@@ -1277,7 +1277,7 @@ func.func @rescale_per_channel(%arg0 : tensor<3xi8>) -> (tensor<3xi8>) {
1277
1277
// CHECK-DAG: [[BOUNDED:%.+]] = arith.minsi [[CMAX]], [[LOWER]]
1278
1278
// CHECK-DAG: [[TRUNC:%.+]] = arith.trunci [[BOUNDED]]
1279
1279
// 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 >
1281
1281
1282
1282
// CHECK: return [[GENERIC]]
1283
1283
return %0 : tensor <3 xi8 >
@@ -1290,7 +1290,7 @@ func.func @rescaleDoubleRound(%arg0 : tensor<2xi8>) -> (tensor<2xi8>) {
1290
1290
// CHECK: linalg.generic
1291
1291
// CHECK: tosa.apply_scale
1292
1292
// 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 >
1294
1294
return %0 : tensor <2 xi8 >
1295
1295
}
1296
1296
@@ -1299,7 +1299,7 @@ func.func @rescaleUnnecessaryDoubleRound(%arg0 : tensor<2xi8>) -> (tensor<2xi8>)
1299
1299
// CHECK: linalg.generic
1300
1300
// CHECK: tosa.apply_scale
1301
1301
// 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 >
1303
1303
return %0 : tensor <2 xi8 >
1304
1304
}
1305
1305
0 commit comments