[Mlir-commits] [mlir] [mlir][spirv] Add 6 Element Binary operators to TOSA Ext Inst Set (PR #179627)
Davide Grohmann
llvmlistbot at llvm.org
Mon Feb 23 07:29:55 PST 2026
================
@@ -62,6 +62,39 @@ class SPIRV_TosaOpWithComplexResult<string mnemonic, int opcode, list<Trait> tra
}];
}
+class SPIRV_TosaBinaryOp<string mnemonic, int opcode, list<Trait> traits = []> :
+ SPIRV_TosaOpWithResult<mnemonic, opcode, !listconcat(traits, [
+ AllElementTypesMatch<["input1", "input2"]>,
+ AllRanksMatch<["input1", "input2", "output"]>,
+ MatchBroadcastableShapes<"input1", "input2", "output">])> {
+
+ let extraClassDeclaration = extraBaseClassDeclaration#[{
+ ::mlir::TypedValue<::mlir::spirv::TensorArmType> getLHS() {
+ return getInput1();
+ }
+ ::mlir::TypedValue<::mlir::spirv::TensorArmType> getRHS() {
+ return getInput2();
+ }
----------------
davidegrohmann wrote:
I think someone had a comment to add the Lhs/Rhs variants to match other ops in SPIRV dialect. I cannot find the comment anylonger though...
https://github.com/llvm/llvm-project/pull/179627
More information about the Mlir-commits
mailing list