From ce48fe47af29b725168b262bc89ff87ded272949 Mon Sep 17 00:00:00 2001 From: Simon Moll Date: Mon, 14 Feb 2022 08:46:55 +0100 Subject: [PATCH] [VE] v256i1 and|or|xor isel and tests Reviewed By: kaz7 Differential Revision: https://reviews.llvm.org/D119239 --- llvm/lib/Target/VE/VEInstrPatternsVec.td | 7 +++++++ llvm/test/CodeGen/VE/Vector/mask_binary.ll | 33 ++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 llvm/test/CodeGen/VE/Vector/mask_binary.ll diff --git a/llvm/lib/Target/VE/VEInstrPatternsVec.td b/llvm/lib/Target/VE/VEInstrPatternsVec.td index 6c5b803..f33c4ac 100644 --- a/llvm/lib/Target/VE/VEInstrPatternsVec.td +++ b/llvm/lib/Target/VE/VEInstrPatternsVec.td @@ -105,3 +105,10 @@ defm : vbrd_elem64; defm : vbrd_elem64; defm : vbrd_elem64; defm : vbrd_elem64; + +class Mask_Binary : + Pat<(MaskVT (MaskOp MaskVT:$ma, MaskVT:$mb)), (!cast(InstName#"mm") $ma, $mb)>; + +def: Mask_Binary; +def: Mask_Binary; +def: Mask_Binary; diff --git a/llvm/test/CodeGen/VE/Vector/mask_binary.ll b/llvm/test/CodeGen/VE/Vector/mask_binary.ll new file mode 100644 index 0000000..84afa6d --- /dev/null +++ b/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 +} + -- 2.7.4