[llvm] [Xtensa] Implement lowering SELECT_CC, SETCC. (PR #97017)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 6 18:15:46 PDT 2024


================
@@ -574,3 +575,12 @@ let Defs = [SP], Uses = [SP] in {
                                "#ADJCALLSTACKUP",
                                [(Xtensa_callseq_end timm:$amt1, timm:$amt2)]>;
 }
+
+//===----------------------------------------------------------------------===//
+// Generic select instruction
+//===----------------------------------------------------------------------===//
+let usesCustomInserter = 1 in {
+  def SELECT : Pseudo<(outs AR:$dst), (ins AR:$lhs, AR:$rhs, AR:$t, AR:$f, i32imm:$cond),
+                     "!select $dst, $lhs, $rhs, $t, $f, $cond",
+                     [(set AR:$dst, (Xtensa_select_cc AR:$lhs, AR:$rhs, AR:$t, AR:$f, imm:$cond))]>;
----------------
s-barannikov wrote:

Pattern should use types instead of register classes, e.g. `set i32:$dst, (Xtensa_select_cc i32:$lhs, i32:$rhs i32:$t, i32:$f, imm:$cond)`.
(It probably doesn't make any difference for Xtensa because AR is only associated with i32.)


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


More information about the llvm-commits mailing list