Skip to content

Commit ce48fe4

Browse files
author
Simon Moll
committed
[VE] v256i1 and|or|xor isel and tests
Reviewed By: kaz7 Differential Revision: https://reviews.llvm.org/D119239
1 parent 83028ad commit ce48fe4

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

llvm/lib/Target/VE/VEInstrPatternsVec.td

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,10 @@ defm : vbrd_elem64<v512i32, i64, simm7, LO7>;
105105
defm : vbrd_elem64<v512f32, i64, simm7, LO7>;
106106
defm : vbrd_elem64<v512i32, f64, simm7fp, LO7FP>;
107107
defm : vbrd_elem64<v512f32, f64, simm7fp, LO7FP>;
108+
109+
class Mask_Binary<ValueType MaskVT, SDPatternOperator MaskOp, string InstName> :
110+
Pat<(MaskVT (MaskOp MaskVT:$ma, MaskVT:$mb)), (!cast<Instruction>(InstName#"mm") $ma, $mb)>;
111+
112+
def: Mask_Binary<v256i1, and, "ANDM">;
113+
def: Mask_Binary<v256i1, or, "ORM">;
114+
def: Mask_Binary<v256i1, xor, "XORM">;
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2+
; RUN: llc < %s -mtriple=ve -mattr=+vpu | FileCheck %s
3+
4+
; Function Attrs: nounwind
5+
define fastcc <256 x i1> @and_mm_v256i1(<256 x i1> %x, <256 x i1> %y) {
6+
; CHECK-LABEL: and_mm_v256i1:
7+
; CHECK: # %bb.0:
8+
; CHECK-NEXT: andm %vm1, %vm1, %vm2
9+
; CHECK-NEXT: b.l.t (, %s10)
10+
%z = and <256 x i1> %x, %y
11+
ret <256 x i1> %z
12+
}
13+
14+
; Function Attrs: nounwind
15+
define fastcc <256 x i1> @or_mm_v256i1(<256 x i1> %x, <256 x i1> %y) {
16+
; CHECK-LABEL: or_mm_v256i1:
17+
; CHECK: # %bb.0:
18+
; CHECK-NEXT: orm %vm1, %vm1, %vm2
19+
; CHECK-NEXT: b.l.t (, %s10)
20+
%z = or <256 x i1> %x, %y
21+
ret <256 x i1> %z
22+
}
23+
24+
; Function Attrs: nounwind
25+
define fastcc <256 x i1> @xor_mm_v256i1(<256 x i1> %x, <256 x i1> %y) {
26+
; CHECK-LABEL: xor_mm_v256i1:
27+
; CHECK: # %bb.0:
28+
; CHECK-NEXT: xorm %vm1, %vm1, %vm2
29+
; CHECK-NEXT: b.l.t (, %s10)
30+
%z = xor <256 x i1> %x, %y
31+
ret <256 x i1> %z
32+
}
33+

0 commit comments

Comments
 (0)