Skip to content

Commit 0d899c3

Browse files
lhutton1git-crd
authored andcommitted
[mlir][tosa] Allow int64 tensors in tosa.intdiv (llvm#167367)
This commit extends the tosa.intdiv operand/result types to allow int64 tensors.
1 parent f30eb68 commit 0d899c3

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -826,12 +826,12 @@ def Tosa_IntDivOp : Tosa_ElementwiseOp<"intdiv", [SameOperandsAndResultElementTy
826826
}];
827827

828828
let arguments = (ins
829-
Tosa_Int32Tensor:$input1,
830-
Tosa_Int32Tensor:$input2
829+
Tosa_Int32Or64Tensor:$input1,
830+
Tosa_Int32Or64Tensor:$input2
831831
);
832832

833833
let results = (outs
834-
Tosa_Int32Tensor:$output
834+
Tosa_Int32Or64Tensor:$output
835835
);
836836

837837
list<Availability> availability = [

mlir/test/Dialect/Tosa/ops.mlir

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,13 @@ func.func @test_intdiv(%arg0: tensor<13x21x1xi32>, %arg1: tensor<13x21x3xi32>) -
342342
return %0 : tensor<13x21x3xi32>
343343
}
344344

345+
// -----
346+
// CHECK-LABEL: intdiv_i64
347+
func.func @test_intdiv_i64(%arg0: tensor<13x21x1xi64>, %arg1: tensor<13x21x3xi64>) -> tensor<13x21x3xi64> {
348+
%0 = tosa.intdiv %arg0, %arg1 : (tensor<13x21x1xi64>, tensor<13x21x3xi64>) -> tensor<13x21x3xi64>
349+
return %0 : tensor<13x21x3xi64>
350+
}
351+
345352
// -----
346353
// CHECK-LABEL: logical_and
347354
func.func @test_logical_and(%arg0: tensor<13x21x3xi1>, %arg1: tensor<13x21x1xi1>) -> tensor<13x21x3xi1> {

0 commit comments

Comments
 (0)