1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve < %s | FileCheck %s
6 define i1 @andv_nxv32i1(<vscale x 32 x i1> %a) {
7 ; CHECK-LABEL: andv_nxv32i1:
9 ; CHECK-NEXT: ptrue p2.b
10 ; CHECK-NEXT: and p0.b, p0/z, p0.b, p1.b
11 ; CHECK-NEXT: nots p0.b, p2/z, p0.b
12 ; CHECK-NEXT: cset w0, eq
14 %res = call i1 @llvm.vector.reduce.and.nxv32i1(<vscale x 32 x i1> %a)
18 define i1 @andv_nxv64i1(<vscale x 64 x i1> %a) {
19 ; CHECK-LABEL: andv_nxv64i1:
21 ; CHECK-NEXT: and p1.b, p1/z, p1.b, p3.b
22 ; CHECK-NEXT: and p0.b, p0/z, p0.b, p2.b
23 ; CHECK-NEXT: and p0.b, p0/z, p0.b, p1.b
24 ; CHECK-NEXT: ptrue p1.b
25 ; CHECK-NEXT: nots p0.b, p1/z, p0.b
26 ; CHECK-NEXT: cset w0, eq
28 %res = call i1 @llvm.vector.reduce.and.nxv64i1(<vscale x 64 x i1> %a)
34 define i1 @orv_nxv32i1(<vscale x 32 x i1> %a) {
35 ; CHECK-LABEL: orv_nxv32i1:
37 ; CHECK-NEXT: sel p0.b, p0, p0.b, p1.b
38 ; CHECK-NEXT: ptest p0, p0.b
39 ; CHECK-NEXT: cset w0, ne
41 %res = call i1 @llvm.vector.reduce.or.nxv32i1(<vscale x 32 x i1> %a)
47 define i1 @xorv_nxv32i1(<vscale x 32 x i1> %a) {
48 ; CHECK-LABEL: xorv_nxv32i1:
50 ; CHECK-NEXT: ptrue p2.b
51 ; CHECK-NEXT: eor p0.b, p2/z, p0.b, p1.b
52 ; CHECK-NEXT: cntp x8, p2, p0.b
53 ; CHECK-NEXT: and w0, w8, #0x1
55 %res = call i1 @llvm.vector.reduce.xor.nxv32i1(<vscale x 32 x i1> %a)
61 define i1 @smaxv_nxv32i1(<vscale x 32 x i1> %a) {
62 ; CHECK-LABEL: smaxv_nxv32i1:
64 ; CHECK-NEXT: ptrue p2.b
65 ; CHECK-NEXT: and p0.b, p0/z, p0.b, p1.b
66 ; CHECK-NEXT: nots p0.b, p2/z, p0.b
67 ; CHECK-NEXT: cset w0, eq
69 %res = call i1 @llvm.vector.reduce.smax.nxv32i1(<vscale x 32 x i1> %a)
75 define i1 @sminv_nxv32i1(<vscale x 32 x i1> %a) {
76 ; CHECK-LABEL: sminv_nxv32i1:
78 ; CHECK-NEXT: sel p0.b, p0, p0.b, p1.b
79 ; CHECK-NEXT: ptest p0, p0.b
80 ; CHECK-NEXT: cset w0, ne
82 %res = call i1 @llvm.vector.reduce.smin.nxv32i1(<vscale x 32 x i1> %a)
88 define i1 @umaxv_nxv32i1(<vscale x 32 x i1> %a) {
89 ; CHECK-LABEL: umaxv_nxv32i1:
91 ; CHECK-NEXT: sel p0.b, p0, p0.b, p1.b
92 ; CHECK-NEXT: ptest p0, p0.b
93 ; CHECK-NEXT: cset w0, ne
95 %res = call i1 @llvm.vector.reduce.umax.nxv32i1(<vscale x 32 x i1> %a)
101 define i1 @uminv_nxv32i1(<vscale x 32 x i1> %a) {
102 ; CHECK-LABEL: uminv_nxv32i1:
104 ; CHECK-NEXT: ptrue p2.b
105 ; CHECK-NEXT: and p0.b, p0/z, p0.b, p1.b
106 ; CHECK-NEXT: nots p0.b, p2/z, p0.b
107 ; CHECK-NEXT: cset w0, eq
109 %res = call i1 @llvm.vector.reduce.umin.nxv32i1(<vscale x 32 x i1> %a)
113 declare i1 @llvm.vector.reduce.and.nxv32i1(<vscale x 32 x i1>)
114 declare i1 @llvm.vector.reduce.and.nxv64i1(<vscale x 64 x i1>)
116 declare i1 @llvm.vector.reduce.or.nxv32i1(<vscale x 32 x i1>)
118 declare i1 @llvm.vector.reduce.xor.nxv32i1(<vscale x 32 x i1>)
120 declare i1 @llvm.vector.reduce.smax.nxv32i1(<vscale x 32 x i1>)
122 declare i1 @llvm.vector.reduce.smin.nxv32i1(<vscale x 32 x i1>)
124 declare i1 @llvm.vector.reduce.umax.nxv32i1(<vscale x 32 x i1>)
126 declare i1 @llvm.vector.reduce.umin.nxv32i1(<vscale x 32 x i1>)