@@ -482,9 +482,7 @@ def Tosa_ErfOp : Tosa_ElementwiseUnaryOp<"erf"> {
482
482
//===----------------------------------------------------------------------===//
483
483
def Tosa_AddOp : Tosa_ElementwiseOp<"add", [
484
484
Commutative,
485
- ResultsBroadcastableShape,
486
- SameOperandsAndResultElementType,
487
- SameOperandsAndResultRank]> {
485
+ SameOperandsAndResultElementType]> {
488
486
let summary = "Elementwise addition operator";
489
487
490
488
let description = [{
@@ -517,10 +515,8 @@ def Tosa_AddOp : Tosa_ElementwiseOp<"add", [
517
515
//===----------------------------------------------------------------------===//
518
516
// Operator: arithmetic_right_shift
519
517
//===----------------------------------------------------------------------===//
520
- def Tosa_ArithmeticRightShiftOp : Tosa_ElementwiseOp<"arithmetic_right_shift", [
521
- ResultsBroadcastableShape,
522
- SameOperandsAndResultElementType,
523
- SameOperandsAndResultRank]> {
518
+ def Tosa_ArithmeticRightShiftOp : Tosa_ElementwiseOp<"arithmetic_right_shift",
519
+ [SameOperandsAndResultElementType]> {
524
520
let summary = "Elementwise Arithmetic Right Shift";
525
521
526
522
let description = [{
@@ -544,9 +540,7 @@ def Tosa_ArithmeticRightShiftOp : Tosa_ElementwiseOp<"arithmetic_right_shift", [
544
540
//===----------------------------------------------------------------------===//
545
541
def Tosa_BitwiseAndOp : Tosa_ElementwiseOp<"bitwise_and", [
546
542
Commutative,
547
- ResultsBroadcastableShape,
548
- SameOperandsAndResultElementType,
549
- SameOperandsAndResultRank]> {
543
+ SameOperandsAndResultElementType]> {
550
544
let summary = "Bitwise AND operator";
551
545
552
546
let description = [{
@@ -569,9 +563,7 @@ def Tosa_BitwiseAndOp : Tosa_ElementwiseOp<"bitwise_and", [
569
563
//===----------------------------------------------------------------------===//
570
564
def Tosa_BitwiseOrOp : Tosa_ElementwiseOp<"bitwise_or", [
571
565
Commutative,
572
- ResultsBroadcastableShape,
573
- SameOperandsAndResultElementType,
574
- SameOperandsAndResultRank]> {
566
+ SameOperandsAndResultElementType]> {
575
567
let summary = "Bitwise OR operator";
576
568
577
569
let description = [{
@@ -594,9 +586,7 @@ def Tosa_BitwiseOrOp : Tosa_ElementwiseOp<"bitwise_or", [
594
586
//===----------------------------------------------------------------------===//
595
587
def Tosa_BitwiseXorOp : Tosa_ElementwiseOp<"bitwise_xor", [
596
588
Commutative,
597
- ResultsBroadcastableShape,
598
- SameOperandsAndResultElementType,
599
- SameOperandsAndResultRank]> {
589
+ SameOperandsAndResultElementType]> {
600
590
let summary = "Bitwise XOR operator";
601
591
602
592
let description = [{
@@ -617,10 +607,7 @@ def Tosa_BitwiseXorOp : Tosa_ElementwiseOp<"bitwise_xor", [
617
607
//===----------------------------------------------------------------------===//
618
608
// Operator: int_div
619
609
//===----------------------------------------------------------------------===//
620
- def Tosa_IntDivOp : Tosa_ElementwiseOp<"int_div", [
621
- ResultsBroadcastableShape,
622
- SameOperandsAndResultRank,
623
- SameOperandsAndResultElementType]> {
610
+ def Tosa_IntDivOp : Tosa_ElementwiseOp<"int_div", [SameOperandsAndResultElementType]> {
624
611
let summary = "Integer divide operator";
625
612
626
613
let description = [{
@@ -645,9 +632,7 @@ def Tosa_IntDivOp : Tosa_ElementwiseOp<"int_div", [
645
632
//===----------------------------------------------------------------------===//
646
633
def Tosa_LogicalAndOp : Tosa_ElementwiseOp<"logical_and", [
647
634
Commutative,
648
- ResultsBroadcastableShape,
649
- SameOperandsAndResultElementType,
650
- SameOperandsAndResultRank]> {
635
+ SameOperandsAndResultElementType]> {
651
636
let summary = "Returns the truth value of x AND y element-wise.";
652
637
653
638
let description = [{
@@ -668,10 +653,8 @@ def Tosa_LogicalAndOp : Tosa_ElementwiseOp<"logical_and", [
668
653
//===----------------------------------------------------------------------===//
669
654
// Operator: logical_left_shift
670
655
//===----------------------------------------------------------------------===//
671
- def Tosa_LogicalLeftShiftOp : Tosa_ElementwiseOp<"logical_left_shift", [
672
- ResultsBroadcastableShape,
673
- SameOperandsAndResultElementType,
674
- SameOperandsAndResultRank]> {
656
+ def Tosa_LogicalLeftShiftOp : Tosa_ElementwiseOp<"logical_left_shift",
657
+ [SameOperandsAndResultElementType]> {
675
658
let summary = "Elementwise Logical Left Shift";
676
659
677
660
let description = [{
@@ -692,10 +675,8 @@ def Tosa_LogicalLeftShiftOp : Tosa_ElementwiseOp<"logical_left_shift", [
692
675
//===----------------------------------------------------------------------===//
693
676
// Operator: logical_right_shift
694
677
//===----------------------------------------------------------------------===//
695
- def Tosa_LogicalRightShiftOp : Tosa_ElementwiseOp<"logical_right_shift", [
696
- ResultsBroadcastableShape,
697
- SameOperandsAndResultElementType,
698
- SameOperandsAndResultRank]> {
678
+ def Tosa_LogicalRightShiftOp : Tosa_ElementwiseOp<"logical_right_shift",
679
+ [SameOperandsAndResultElementType]> {
699
680
let summary = "Elementwise Logical Right Shift";
700
681
701
682
let description = [{
@@ -718,9 +699,7 @@ def Tosa_LogicalRightShiftOp : Tosa_ElementwiseOp<"logical_right_shift", [
718
699
//===----------------------------------------------------------------------===//
719
700
def Tosa_LogicalOrOp : Tosa_ElementwiseOp<"logical_or", [
720
701
Commutative,
721
- ResultsBroadcastableShape,
722
- SameOperandsAndResultElementType,
723
- SameOperandsAndResultRank]> {
702
+ SameOperandsAndResultElementType]> {
724
703
let summary = "Returns the truth value of x OR y element-wise.";
725
704
726
705
let description = [{
@@ -743,9 +722,7 @@ def Tosa_LogicalOrOp : Tosa_ElementwiseOp<"logical_or", [
743
722
//===----------------------------------------------------------------------===//
744
723
def Tosa_LogicalXorOp : Tosa_ElementwiseOp<"logical_xor", [
745
724
Commutative,
746
- ResultsBroadcastableShape,
747
- SameOperandsAndResultElementType,
748
- SameOperandsAndResultRank]> {
725
+ SameOperandsAndResultElementType]> {
749
726
let summary = "Returns the truth value of x XOR y element-wise.";
750
727
751
728
let description = [{
@@ -768,9 +745,7 @@ def Tosa_LogicalXorOp : Tosa_ElementwiseOp<"logical_xor", [
768
745
//===----------------------------------------------------------------------===//
769
746
def Tosa_MaximumOp : Tosa_ElementwiseOp<"maximum", [
770
747
Commutative,
771
- ResultsBroadcastableShape,
772
- SameOperandsAndResultElementType,
773
- SameOperandsAndResultRank]> {
748
+ SameOperandsAndResultElementType]> {
774
749
let summary = "Elementwise Maximum";
775
750
776
751
let description = [{
@@ -794,9 +769,7 @@ def Tosa_MaximumOp : Tosa_ElementwiseOp<"maximum", [
794
769
//===----------------------------------------------------------------------===//
795
770
def Tosa_MinimumOp : Tosa_ElementwiseOp<"minimum", [
796
771
Commutative,
797
- ResultsBroadcastableShape,
798
- SameOperandsAndResultElementType,
799
- SameOperandsAndResultRank]> {
772
+ SameOperandsAndResultElementType]> {
800
773
let summary = "Elementwise Minimum";
801
774
802
775
let description = [{
@@ -823,9 +796,11 @@ def MulOperandsAndResultElementType :
823
796
//===----------------------------------------------------------------------===//
824
797
// Operator: mul
825
798
//===----------------------------------------------------------------------===//
826
- def Tosa_MulOp : Tosa_ElementwiseOp<"mul", [
799
+ def Tosa_MulOp : Tosa_Op<"mul", [
800
+ DeclareOpInterfaceMethods<InferShapedTypeOpInterface,
801
+ ["inferReturnTypeComponents"]>,
827
802
Commutative,
828
- MulOperandsAndResultElementType ]> {
803
+ Pure ]> {
829
804
let summary = "Multiplication operator";
830
805
831
806
let description = [{
@@ -846,15 +821,15 @@ def Tosa_MulOp : Tosa_ElementwiseOp<"mul", [
846
821
847
822
let hasFolder = 1;
848
823
let hasVerifier = 1;
824
+
825
+ let assemblyFormat =
826
+ "operands attr-dict `:` functional-type(operands, results)";
849
827
}
850
828
851
829
//===----------------------------------------------------------------------===//
852
830
// Operator: pow
853
831
//===----------------------------------------------------------------------===//
854
- def Tosa_PowOp : Tosa_ElementwiseOp<"pow", [
855
- ResultsBroadcastableShape,
856
- SameOperandsAndResultElementType,
857
- SameOperandsAndResultRank]> {
832
+ def Tosa_PowOp : Tosa_ElementwiseOp<"pow", [SameOperandsAndResultElementType]> {
858
833
let summary = "Computes the power of one value to another.";
859
834
860
835
let description = [{
@@ -875,10 +850,7 @@ def Tosa_PowOp : Tosa_ElementwiseOp<"pow", [
875
850
//===----------------------------------------------------------------------===//
876
851
// Operator: sub
877
852
//===----------------------------------------------------------------------===//
878
- def Tosa_SubOp : Tosa_ElementwiseOp<"sub", [
879
- ResultsBroadcastableShape,
880
- SameOperandsAndResultElementType,
881
- SameOperandsAndResultRank]> {
853
+ def Tosa_SubOp : Tosa_ElementwiseOp<"sub", [SameOperandsAndResultElementType]> {
882
854
let summary = "Elementwise subtraction operator";
883
855
884
856
let description = [{
@@ -1229,9 +1201,7 @@ def Tosa_SinOp : Tosa_ElementwiseUnaryOp<"sin"> {
1229
1201
//===----------------------------------------------------------------------===//
1230
1202
// Operator: select
1231
1203
//===----------------------------------------------------------------------===//
1232
- def Tosa_SelectOp : Tosa_ElementwiseOp<"select", [
1233
- ResultsBroadcastableShape,
1234
- SameOperandsAndResultRank]> {
1204
+ def Tosa_SelectOp : Tosa_ElementwiseOp<"select"> {
1235
1205
let summary = "Elementwise select operator";
1236
1206
1237
1207
let description = [{
@@ -1267,9 +1237,7 @@ def Tosa_SelectOp : Tosa_ElementwiseOp<"select", [
1267
1237
def Tosa_EqualOp : Tosa_ElementwiseOp<"equal", [
1268
1238
InferTensorType,
1269
1239
Commutative,
1270
- ResultsBroadcastableShape,
1271
- SameOperandsElementType,
1272
- SameOperandsAndResultRank]> {
1240
+ SameOperandsElementType]> {
1273
1241
let summary = "Returns the truth value of (x == y) element-wise.";
1274
1242
1275
1243
let description = [{
@@ -1297,10 +1265,7 @@ def Tosa_EqualOp : Tosa_ElementwiseOp<"equal", [
1297
1265
//===----------------------------------------------------------------------===//
1298
1266
// Operator: greater
1299
1267
//===----------------------------------------------------------------------===//
1300
- def Tosa_GreaterOp : Tosa_ElementwiseOp<"greater", [
1301
- ResultsBroadcastableShape,
1302
- SameOperandsElementType,
1303
- SameOperandsAndResultRank]> {
1268
+ def Tosa_GreaterOp : Tosa_ElementwiseOp<"greater", [SameOperandsElementType]> {
1304
1269
let summary = "Returns the truth value of (x > y) element-wise.";
1305
1270
1306
1271
let description = [{
@@ -1322,11 +1287,8 @@ def Tosa_GreaterOp : Tosa_ElementwiseOp<"greater", [
1322
1287
//===----------------------------------------------------------------------===//
1323
1288
// Operator: greater_equal
1324
1289
//===----------------------------------------------------------------------===//
1325
- def Tosa_GreaterEqualOp : Tosa_ElementwiseOp<"greater_equal", [
1326
- ResultsBroadcastableShape,
1327
- SameOperandsElementType,
1328
- SameOperandsAndResultRank
1329
- ]> {
1290
+ def Tosa_GreaterEqualOp : Tosa_ElementwiseOp<"greater_equal",
1291
+ [SameOperandsElementType]> {
1330
1292
let summary = "Returns the truth value of (x >= y) element-wise.";
1331
1293
1332
1294
let description = [{
0 commit comments