[Mlir-commits] [mlir] [mlir][spirv] Add comparison and elementwise ternary ops in TOSA Ext Inst Set (PR #186356)

Jakub Kuderski llvmlistbot at llvm.org
Fri Mar 13 06:24:00 PDT 2026


================
@@ -1742,4 +1771,114 @@ def SPIRV_TosaSinOp : SPIRV_TosaFloatElementwiseUnaryOp<"Sin", 43> {
 }
 
 
+def SPIRV_TosaSelectOp : SPIRV_TosaOpWithResult<"Select", 44, [Pure,
+  AllElementTypesMatch<["input2", "input3", "output"]>,
+  TernaryMatchBroadcastableShapes<"input1", "input2", "input3", "output">]> {
+  let summary = "Select operator.";
+
+  let description = [{
+    Elementwise Select of the output based on a condition.
----------------
kuhar wrote:

I think it would make sense to explain how the broadcasting behavior composes with a scalar select, i.e., is it possible to select either input2 or input3 if the condition is `tensor<1xi1>`?

https://github.com/llvm/llvm-project/pull/186356


More information about the Mlir-commits mailing list