[Mlir-commits] [mlir] [mlir][spirv] Add 6 Element Binary operators to TOSA Ext Inst Set (PR #179627)
Jakub Kuderski
llvmlistbot at llvm.org
Mon Feb 23 07:23:33 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();
+ }
----------------
kuhar wrote:
Right, but why do we also need the Lhs and Rhs variants? Maybe drop these and used Input1 / Input2 uniformly?
https://github.com/llvm/llvm-project/pull/179627
More information about the Mlir-commits
mailing list