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 <vscale x 16 x i1> @add_nxv16i1(<vscale x 16 x i1> %a, <vscale x 16 x i1> %b) {
7 ; CHECK-LABEL: add_nxv16i1:
9 ; CHECK-NEXT: ptrue p2.b
10 ; CHECK-NEXT: eor p0.b, p2/z, p0.b, p1.b
12 %res = add <vscale x 16 x i1> %a, %b
13 ret <vscale x 16 x i1> %res;
16 define <vscale x 8 x i1> @add_nxv8i1(<vscale x 8 x i1> %a, <vscale x 8 x i1> %b) {
17 ; CHECK-LABEL: add_nxv8i1:
19 ; CHECK-NEXT: ptrue p2.h
20 ; CHECK-NEXT: eor p0.b, p2/z, p0.b, p1.b
22 %res = add <vscale x 8 x i1> %a, %b
23 ret <vscale x 8 x i1> %res;
26 define <vscale x 4 x i1> @add_nxv4i1(<vscale x 4 x i1> %a, <vscale x 4 x i1> %b) {
27 ; CHECK-LABEL: add_nxv4i1:
29 ; CHECK-NEXT: ptrue p2.s
30 ; CHECK-NEXT: eor p0.b, p2/z, p0.b, p1.b
32 %res = add <vscale x 4 x i1> %a, %b
33 ret <vscale x 4 x i1> %res;
36 define <vscale x 2 x i1> @add_nxv2i1(<vscale x 2 x i1> %a, <vscale x 2 x i1> %b) {
37 ; CHECK-LABEL: add_nxv2i1:
39 ; CHECK-NEXT: ptrue p2.d
40 ; CHECK-NEXT: eor p0.b, p2/z, p0.b, p1.b
42 %res = add <vscale x 2 x i1> %a, %b
43 ret <vscale x 2 x i1> %res;
49 define aarch64_sve_vector_pcs <vscale x 64 x i1> @add_nxv64i1(<vscale x 64 x i1> %a, <vscale x 64 x i1> %b) {
50 ; CHECK-LABEL: add_nxv64i1:
52 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
53 ; CHECK-NEXT: addvl sp, sp, #-1
54 ; CHECK-NEXT: str p8, [sp, #3, mul vl] // 2-byte Folded Spill
55 ; CHECK-NEXT: str p7, [sp, #4, mul vl] // 2-byte Folded Spill
56 ; CHECK-NEXT: str p6, [sp, #5, mul vl] // 2-byte Folded Spill
57 ; CHECK-NEXT: str p5, [sp, #6, mul vl] // 2-byte Folded Spill
58 ; CHECK-NEXT: str p4, [sp, #7, mul vl] // 2-byte Folded Spill
59 ; CHECK-NEXT: .cfi_escape 0x0f, 0x0c, 0x8f, 0x00, 0x11, 0x10, 0x22, 0x11, 0x08, 0x92, 0x2e, 0x00, 0x1e, 0x22 // sp + 16 + 8 * VG
60 ; CHECK-NEXT: .cfi_offset w29, -16
61 ; CHECK-NEXT: ldr p4, [x3]
62 ; CHECK-NEXT: ldr p5, [x0]
63 ; CHECK-NEXT: ldr p6, [x1]
64 ; CHECK-NEXT: ldr p7, [x2]
65 ; CHECK-NEXT: ptrue p8.b
66 ; CHECK-NEXT: eor p0.b, p8/z, p0.b, p5.b
67 ; CHECK-NEXT: eor p1.b, p8/z, p1.b, p6.b
68 ; CHECK-NEXT: eor p2.b, p8/z, p2.b, p7.b
69 ; CHECK-NEXT: eor p3.b, p8/z, p3.b, p4.b
70 ; CHECK-NEXT: ldr p8, [sp, #3, mul vl] // 2-byte Folded Reload
71 ; CHECK-NEXT: ldr p7, [sp, #4, mul vl] // 2-byte Folded Reload
72 ; CHECK-NEXT: ldr p6, [sp, #5, mul vl] // 2-byte Folded Reload
73 ; CHECK-NEXT: ldr p5, [sp, #6, mul vl] // 2-byte Folded Reload
74 ; CHECK-NEXT: ldr p4, [sp, #7, mul vl] // 2-byte Folded Reload
75 ; CHECK-NEXT: addvl sp, sp, #1
76 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
78 %res = add <vscale x 64 x i1> %a, %b
79 ret <vscale x 64 x i1> %res;
85 define <vscale x 16 x i1> @sub_xv16i1(<vscale x 16 x i1> %a, <vscale x 16 x i1> %b) {
86 ; CHECK-LABEL: sub_xv16i1:
88 ; CHECK-NEXT: ptrue p2.b
89 ; CHECK-NEXT: eor p0.b, p2/z, p0.b, p1.b
91 %res = sub <vscale x 16 x i1> %a, %b
92 ret <vscale x 16 x i1> %res;
95 define <vscale x 8 x i1> @sub_xv8i1(<vscale x 8 x i1> %a, <vscale x 8 x i1> %b) {
96 ; CHECK-LABEL: sub_xv8i1:
98 ; CHECK-NEXT: ptrue p2.h
99 ; CHECK-NEXT: eor p0.b, p2/z, p0.b, p1.b
101 %res = sub <vscale x 8 x i1> %a, %b
102 ret <vscale x 8 x i1> %res;
105 define <vscale x 4 x i1> @sub_xv4i1(<vscale x 4 x i1> %a, <vscale x 4 x i1> %b) {
106 ; CHECK-LABEL: sub_xv4i1:
108 ; CHECK-NEXT: ptrue p2.s
109 ; CHECK-NEXT: eor p0.b, p2/z, p0.b, p1.b
111 %res = sub <vscale x 4 x i1> %a, %b
112 ret <vscale x 4 x i1> %res;
115 define <vscale x 2 x i1> @sub_xv2i1(<vscale x 2 x i1> %a, <vscale x 2 x i1> %b) {
116 ; CHECK-LABEL: sub_xv2i1:
118 ; CHECK-NEXT: ptrue p2.d
119 ; CHECK-NEXT: eor p0.b, p2/z, p0.b, p1.b
121 %res = sub <vscale x 2 x i1> %a, %b
122 ret <vscale x 2 x i1> %res;
129 define aarch64_sve_vector_pcs <vscale x 64 x i1> @sub_nxv64i1(<vscale x 64 x i1> %a, <vscale x 64 x i1> %b) {
130 ; CHECK-LABEL: sub_nxv64i1:
132 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
133 ; CHECK-NEXT: addvl sp, sp, #-1
134 ; CHECK-NEXT: str p8, [sp, #3, mul vl] // 2-byte Folded Spill
135 ; CHECK-NEXT: str p7, [sp, #4, mul vl] // 2-byte Folded Spill
136 ; CHECK-NEXT: str p6, [sp, #5, mul vl] // 2-byte Folded Spill
137 ; CHECK-NEXT: str p5, [sp, #6, mul vl] // 2-byte Folded Spill
138 ; CHECK-NEXT: str p4, [sp, #7, mul vl] // 2-byte Folded Spill
139 ; CHECK-NEXT: .cfi_escape 0x0f, 0x0c, 0x8f, 0x00, 0x11, 0x10, 0x22, 0x11, 0x08, 0x92, 0x2e, 0x00, 0x1e, 0x22 // sp + 16 + 8 * VG
140 ; CHECK-NEXT: .cfi_offset w29, -16
141 ; CHECK-NEXT: ldr p4, [x3]
142 ; CHECK-NEXT: ldr p5, [x0]
143 ; CHECK-NEXT: ldr p6, [x1]
144 ; CHECK-NEXT: ldr p7, [x2]
145 ; CHECK-NEXT: ptrue p8.b
146 ; CHECK-NEXT: eor p0.b, p8/z, p0.b, p5.b
147 ; CHECK-NEXT: eor p1.b, p8/z, p1.b, p6.b
148 ; CHECK-NEXT: eor p2.b, p8/z, p2.b, p7.b
149 ; CHECK-NEXT: eor p3.b, p8/z, p3.b, p4.b
150 ; CHECK-NEXT: ldr p8, [sp, #3, mul vl] // 2-byte Folded Reload
151 ; CHECK-NEXT: ldr p7, [sp, #4, mul vl] // 2-byte Folded Reload
152 ; CHECK-NEXT: ldr p6, [sp, #5, mul vl] // 2-byte Folded Reload
153 ; CHECK-NEXT: ldr p5, [sp, #6, mul vl] // 2-byte Folded Reload
154 ; CHECK-NEXT: ldr p4, [sp, #7, mul vl] // 2-byte Folded Reload
155 ; CHECK-NEXT: addvl sp, sp, #1
156 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
158 %res = sub <vscale x 64 x i1> %a, %b
159 ret <vscale x 64 x i1> %res;