@@ -482,9 +482,7 @@ def Tosa_ErfOp : Tosa_ElementwiseUnaryOp<"erf"> {
482482//===----------------------------------------------------------------------===//
483483def Tosa_AddOp : Tosa_ElementwiseOp<"add", [
484484 Commutative,
485- ResultsBroadcastableShape,
486- SameOperandsAndResultElementType,
487- SameOperandsAndResultRank]> {
485+ SameOperandsAndResultElementType]> {
488486 let summary = "Elementwise addition operator";
489487
490488 let description = [{
@@ -517,10 +515,8 @@ def Tosa_AddOp : Tosa_ElementwiseOp<"add", [
517515//===----------------------------------------------------------------------===//
518516// Operator: arithmetic_right_shift
519517//===----------------------------------------------------------------------===//
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]> {
524520 let summary = "Elementwise Arithmetic Right Shift";
525521
526522 let description = [{
@@ -544,9 +540,7 @@ def Tosa_ArithmeticRightShiftOp : Tosa_ElementwiseOp<"arithmetic_right_shift", [
544540//===----------------------------------------------------------------------===//
545541def Tosa_BitwiseAndOp : Tosa_ElementwiseOp<"bitwise_and", [
546542 Commutative,
547- ResultsBroadcastableShape,
548- SameOperandsAndResultElementType,
549- SameOperandsAndResultRank]> {
543+ SameOperandsAndResultElementType]> {
550544 let summary = "Bitwise AND operator";
551545
552546 let description = [{
@@ -569,9 +563,7 @@ def Tosa_BitwiseAndOp : Tosa_ElementwiseOp<"bitwise_and", [
569563//===----------------------------------------------------------------------===//
570564def Tosa_BitwiseOrOp : Tosa_ElementwiseOp<"bitwise_or", [
571565 Commutative,
572- ResultsBroadcastableShape,
573- SameOperandsAndResultElementType,
574- SameOperandsAndResultRank]> {
566+ SameOperandsAndResultElementType]> {
575567 let summary = "Bitwise OR operator";
576568
577569 let description = [{
@@ -594,9 +586,7 @@ def Tosa_BitwiseOrOp : Tosa_ElementwiseOp<"bitwise_or", [
594586//===----------------------------------------------------------------------===//
595587def Tosa_BitwiseXorOp : Tosa_ElementwiseOp<"bitwise_xor", [
596588 Commutative,
597- ResultsBroadcastableShape,
598- SameOperandsAndResultElementType,
599- SameOperandsAndResultRank]> {
589+ SameOperandsAndResultElementType]> {
600590 let summary = "Bitwise XOR operator";
601591
602592 let description = [{
@@ -617,10 +607,7 @@ def Tosa_BitwiseXorOp : Tosa_ElementwiseOp<"bitwise_xor", [
617607//===----------------------------------------------------------------------===//
618608// Operator: int_div
619609//===----------------------------------------------------------------------===//
620- def Tosa_IntDivOp : Tosa_ElementwiseOp<"int_div", [
621- ResultsBroadcastableShape,
622- SameOperandsAndResultRank,
623- SameOperandsAndResultElementType]> {
610+ def Tosa_IntDivOp : Tosa_ElementwiseOp<"int_div", [SameOperandsAndResultElementType]> {
624611 let summary = "Integer divide operator";
625612
626613 let description = [{
@@ -645,9 +632,7 @@ def Tosa_IntDivOp : Tosa_ElementwiseOp<"int_div", [
645632//===----------------------------------------------------------------------===//
646633def Tosa_LogicalAndOp : Tosa_ElementwiseOp<"logical_and", [
647634 Commutative,
648- ResultsBroadcastableShape,
649- SameOperandsAndResultElementType,
650- SameOperandsAndResultRank]> {
635+ SameOperandsAndResultElementType]> {
651636 let summary = "Returns the truth value of x AND y element-wise.";
652637
653638 let description = [{
@@ -668,10 +653,8 @@ def Tosa_LogicalAndOp : Tosa_ElementwiseOp<"logical_and", [
668653//===----------------------------------------------------------------------===//
669654// Operator: logical_left_shift
670655//===----------------------------------------------------------------------===//
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]> {
675658 let summary = "Elementwise Logical Left Shift";
676659
677660 let description = [{
@@ -692,10 +675,8 @@ def Tosa_LogicalLeftShiftOp : Tosa_ElementwiseOp<"logical_left_shift", [
692675//===----------------------------------------------------------------------===//
693676// Operator: logical_right_shift
694677//===----------------------------------------------------------------------===//
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]> {
699680 let summary = "Elementwise Logical Right Shift";
700681
701682 let description = [{
@@ -718,9 +699,7 @@ def Tosa_LogicalRightShiftOp : Tosa_ElementwiseOp<"logical_right_shift", [
718699//===----------------------------------------------------------------------===//
719700def Tosa_LogicalOrOp : Tosa_ElementwiseOp<"logical_or", [
720701 Commutative,
721- ResultsBroadcastableShape,
722- SameOperandsAndResultElementType,
723- SameOperandsAndResultRank]> {
702+ SameOperandsAndResultElementType]> {
724703 let summary = "Returns the truth value of x OR y element-wise.";
725704
726705 let description = [{
@@ -743,9 +722,7 @@ def Tosa_LogicalOrOp : Tosa_ElementwiseOp<"logical_or", [
743722//===----------------------------------------------------------------------===//
744723def Tosa_LogicalXorOp : Tosa_ElementwiseOp<"logical_xor", [
745724 Commutative,
746- ResultsBroadcastableShape,
747- SameOperandsAndResultElementType,
748- SameOperandsAndResultRank]> {
725+ SameOperandsAndResultElementType]> {
749726 let summary = "Returns the truth value of x XOR y element-wise.";
750727
751728 let description = [{
@@ -768,9 +745,7 @@ def Tosa_LogicalXorOp : Tosa_ElementwiseOp<"logical_xor", [
768745//===----------------------------------------------------------------------===//
769746def Tosa_MaximumOp : Tosa_ElementwiseOp<"maximum", [
770747 Commutative,
771- ResultsBroadcastableShape,
772- SameOperandsAndResultElementType,
773- SameOperandsAndResultRank]> {
748+ SameOperandsAndResultElementType]> {
774749 let summary = "Elementwise Maximum";
775750
776751 let description = [{
@@ -794,9 +769,7 @@ def Tosa_MaximumOp : Tosa_ElementwiseOp<"maximum", [
794769//===----------------------------------------------------------------------===//
795770def Tosa_MinimumOp : Tosa_ElementwiseOp<"minimum", [
796771 Commutative,
797- ResultsBroadcastableShape,
798- SameOperandsAndResultElementType,
799- SameOperandsAndResultRank]> {
772+ SameOperandsAndResultElementType]> {
800773 let summary = "Elementwise Minimum";
801774
802775 let description = [{
@@ -823,9 +796,11 @@ def MulOperandsAndResultElementType :
823796//===----------------------------------------------------------------------===//
824797// Operator: mul
825798//===----------------------------------------------------------------------===//
826- def Tosa_MulOp : Tosa_ElementwiseOp<"mul", [
799+ def Tosa_MulOp : Tosa_Op<"mul", [
800+ DeclareOpInterfaceMethods<InferShapedTypeOpInterface,
801+ ["inferReturnTypeComponents"]>,
827802 Commutative,
828- MulOperandsAndResultElementType ]> {
803+ Pure ]> {
829804 let summary = "Multiplication operator";
830805
831806 let description = [{
@@ -846,15 +821,15 @@ def Tosa_MulOp : Tosa_ElementwiseOp<"mul", [
846821
847822 let hasFolder = 1;
848823 let hasVerifier = 1;
824+
825+ let assemblyFormat =
826+ "operands attr-dict `:` functional-type(operands, results)";
849827}
850828
851829//===----------------------------------------------------------------------===//
852830// Operator: pow
853831//===----------------------------------------------------------------------===//
854- def Tosa_PowOp : Tosa_ElementwiseOp<"pow", [
855- ResultsBroadcastableShape,
856- SameOperandsAndResultElementType,
857- SameOperandsAndResultRank]> {
832+ def Tosa_PowOp : Tosa_ElementwiseOp<"pow", [SameOperandsAndResultElementType]> {
858833 let summary = "Computes the power of one value to another.";
859834
860835 let description = [{
@@ -875,10 +850,7 @@ def Tosa_PowOp : Tosa_ElementwiseOp<"pow", [
875850//===----------------------------------------------------------------------===//
876851// Operator: sub
877852//===----------------------------------------------------------------------===//
878- def Tosa_SubOp : Tosa_ElementwiseOp<"sub", [
879- ResultsBroadcastableShape,
880- SameOperandsAndResultElementType,
881- SameOperandsAndResultRank]> {
853+ def Tosa_SubOp : Tosa_ElementwiseOp<"sub", [SameOperandsAndResultElementType]> {
882854 let summary = "Elementwise subtraction operator";
883855
884856 let description = [{
@@ -1229,9 +1201,7 @@ def Tosa_SinOp : Tosa_ElementwiseUnaryOp<"sin"> {
12291201//===----------------------------------------------------------------------===//
12301202// Operator: select
12311203//===----------------------------------------------------------------------===//
1232- def Tosa_SelectOp : Tosa_ElementwiseOp<"select", [
1233- ResultsBroadcastableShape,
1234- SameOperandsAndResultRank]> {
1204+ def Tosa_SelectOp : Tosa_ElementwiseOp<"select"> {
12351205 let summary = "Elementwise select operator";
12361206
12371207 let description = [{
@@ -1267,9 +1237,7 @@ def Tosa_SelectOp : Tosa_ElementwiseOp<"select", [
12671237def Tosa_EqualOp : Tosa_ElementwiseOp<"equal", [
12681238 InferTensorType,
12691239 Commutative,
1270- ResultsBroadcastableShape,
1271- SameOperandsElementType,
1272- SameOperandsAndResultRank]> {
1240+ SameOperandsElementType]> {
12731241 let summary = "Returns the truth value of (x == y) element-wise.";
12741242
12751243 let description = [{
@@ -1297,10 +1265,7 @@ def Tosa_EqualOp : Tosa_ElementwiseOp<"equal", [
12971265//===----------------------------------------------------------------------===//
12981266// Operator: greater
12991267//===----------------------------------------------------------------------===//
1300- def Tosa_GreaterOp : Tosa_ElementwiseOp<"greater", [
1301- ResultsBroadcastableShape,
1302- SameOperandsElementType,
1303- SameOperandsAndResultRank]> {
1268+ def Tosa_GreaterOp : Tosa_ElementwiseOp<"greater", [SameOperandsElementType]> {
13041269 let summary = "Returns the truth value of (x > y) element-wise.";
13051270
13061271 let description = [{
@@ -1322,11 +1287,8 @@ def Tosa_GreaterOp : Tosa_ElementwiseOp<"greater", [
13221287//===----------------------------------------------------------------------===//
13231288// Operator: greater_equal
13241289//===----------------------------------------------------------------------===//
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]> {
13301292 let summary = "Returns the truth value of (x >= y) element-wise.";
13311293
13321294 let description = [{
0 commit comments