[llvm] [AArch64][SVE2] SVE2 NBSL instruction lowering. (PR #89732)

David Green via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 23 07:16:53 PDT 2024


================
@@ -3750,6 +3750,23 @@ let Predicates = [HasSVE2orSME] in {
 
   // SVE2 extract vector (immediate offset, constructive)
   def EXT_ZZI_B : sve2_int_perm_extract_i_cons<"ext">;
+
+  // zext(cmpeq(bsl(x, y, z), splat(0))) -> nbsl(x, y, z)
+  def : Pat<(nxv16i8 (zext (nxv16i1 (AArch64setcc_z (nxv16i1 (SVEAllActive)),
+            (nxv16i8 (AArch64bsp nxv16i8:$Op1, nxv16i8:$Op2, nxv16i8:$Op3)), (SVEDup0), SETEQ)))),
+            (NBSL_ZZZZ nxv16i8:$Op1, nxv16i8:$Op2, nxv16i8:$Op3)>;
----------------
davemgreen wrote:

I believe the operands need to be Op2, Op3, Op1. The order of the operands is weird.

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


More information about the llvm-commits mailing list