[PATCH] D119239: [VE] v256i1 and|or|xor isel and tests

Simon Moll via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 13 23:48:16 PST 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGce48fe47af29: [VE] v256i1 and|or|xor isel and tests (authored by simoll).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119239/new/

https://reviews.llvm.org/D119239

Files:
  llvm/lib/Target/VE/VEInstrPatternsVec.td
  llvm/test/CodeGen/VE/Vector/mask_binary.ll


Index: llvm/test/CodeGen/VE/Vector/mask_binary.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/VE/Vector/mask_binary.ll
@@ -0,0 +1,33 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=ve -mattr=+vpu | FileCheck %s
+
+; Function Attrs: nounwind
+define fastcc <256 x i1> @and_mm_v256i1(<256 x i1> %x, <256 x i1> %y) {
+; CHECK-LABEL: and_mm_v256i1:
+; CHECK:       # %bb.0:
+; CHECK-NEXT:    andm %vm1, %vm1, %vm2
+; CHECK-NEXT:    b.l.t (, %s10)
+  %z = and <256 x i1> %x, %y
+  ret <256 x i1> %z
+}
+
+; Function Attrs: nounwind
+define fastcc <256 x i1> @or_mm_v256i1(<256 x i1> %x, <256 x i1> %y) {
+; CHECK-LABEL: or_mm_v256i1:
+; CHECK:       # %bb.0:
+; CHECK-NEXT:    orm %vm1, %vm1, %vm2
+; CHECK-NEXT:    b.l.t (, %s10)
+  %z = or <256 x i1> %x, %y
+  ret <256 x i1> %z
+}
+
+; Function Attrs: nounwind
+define fastcc <256 x i1> @xor_mm_v256i1(<256 x i1> %x, <256 x i1> %y) {
+; CHECK-LABEL: xor_mm_v256i1:
+; CHECK:       # %bb.0:
+; CHECK-NEXT:    xorm %vm1, %vm1, %vm2
+; CHECK-NEXT:    b.l.t (, %s10)
+  %z = xor <256 x i1> %x, %y
+  ret <256 x i1> %z
+}
+
Index: llvm/lib/Target/VE/VEInstrPatternsVec.td
===================================================================
--- llvm/lib/Target/VE/VEInstrPatternsVec.td
+++ llvm/lib/Target/VE/VEInstrPatternsVec.td
@@ -105,3 +105,10 @@
 defm : vbrd_elem64<v512f32, i64, simm7, LO7>;
 defm : vbrd_elem64<v512i32, f64, simm7fp, LO7FP>;
 defm : vbrd_elem64<v512f32, f64, simm7fp, LO7FP>;
+
+class Mask_Binary<ValueType MaskVT, SDPatternOperator MaskOp, string InstName> :
+  Pat<(MaskVT (MaskOp MaskVT:$ma, MaskVT:$mb)), (!cast<Instruction>(InstName#"mm") $ma, $mb)>;
+
+def: Mask_Binary<v256i1, and, "ANDM">;
+def: Mask_Binary<v256i1, or,  "ORM">;
+def: Mask_Binary<v256i1, xor, "XORM">;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119239.408339.patch
Type: text/x-patch
Size: 1864 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220214/cf925053/attachment.bin>


More information about the llvm-commits mailing list