1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve \
3 // RUN: -disable-O0-optnone \
4 // RUN: -emit-llvm -o - %s | opt -S -passes=sroa | FileCheck %s
6 // REQUIRES: aarch64-registered-target
12 // CHECK-LABEL: @and_bool(
14 // CHECK-NEXT: [[AND:%.*]] = and <vscale x 16 x i1> [[A:%.*]], [[B:%.*]]
15 // CHECK-NEXT: ret <vscale x 16 x i1> [[AND]]
17 svbool_t
and_bool(svbool_t a
, svbool_t b
) {
21 // CHECK-LABEL: @and_i8(
23 // CHECK-NEXT: [[AND:%.*]] = and <vscale x 16 x i8> [[A:%.*]], [[B:%.*]]
24 // CHECK-NEXT: ret <vscale x 16 x i8> [[AND]]
26 svint8_t
and_i8(svint8_t a
, svint8_t b
) {
30 // CHECK-LABEL: @and_i16(
32 // CHECK-NEXT: [[AND:%.*]] = and <vscale x 8 x i16> [[A:%.*]], [[B:%.*]]
33 // CHECK-NEXT: ret <vscale x 8 x i16> [[AND]]
35 svint16_t
and_i16(svint16_t a
, svint16_t b
) {
39 // CHECK-LABEL: @and_i32(
41 // CHECK-NEXT: [[AND:%.*]] = and <vscale x 4 x i32> [[A:%.*]], [[B:%.*]]
42 // CHECK-NEXT: ret <vscale x 4 x i32> [[AND]]
44 svint32_t
and_i32(svint32_t a
, svint32_t b
) {
48 // CHECK-LABEL: @and_i64(
50 // CHECK-NEXT: [[AND:%.*]] = and <vscale x 2 x i64> [[A:%.*]], [[B:%.*]]
51 // CHECK-NEXT: ret <vscale x 2 x i64> [[AND]]
53 svint64_t
and_i64(svint64_t a
, svint64_t b
) {
57 // CHECK-LABEL: @and_u8(
59 // CHECK-NEXT: [[AND:%.*]] = and <vscale x 16 x i8> [[A:%.*]], [[B:%.*]]
60 // CHECK-NEXT: ret <vscale x 16 x i8> [[AND]]
62 svuint8_t
and_u8(svuint8_t a
, svuint8_t b
) {
66 // CHECK-LABEL: @and_u16(
68 // CHECK-NEXT: [[AND:%.*]] = and <vscale x 8 x i16> [[A:%.*]], [[B:%.*]]
69 // CHECK-NEXT: ret <vscale x 8 x i16> [[AND]]
71 svuint16_t
and_u16(svuint16_t a
, svuint16_t b
) {
75 // CHECK-LABEL: @and_u32(
77 // CHECK-NEXT: [[AND:%.*]] = and <vscale x 4 x i32> [[A:%.*]], [[B:%.*]]
78 // CHECK-NEXT: ret <vscale x 4 x i32> [[AND]]
80 svuint32_t
and_u32(svuint32_t a
, svuint32_t b
) {
84 // CHECK-LABEL: @and_u64(
86 // CHECK-NEXT: [[AND:%.*]] = and <vscale x 2 x i64> [[A:%.*]], [[B:%.*]]
87 // CHECK-NEXT: ret <vscale x 2 x i64> [[AND]]
89 svuint64_t
and_u64(svuint64_t a
, svuint64_t b
) {
95 // CHECK-LABEL: @or_bool(
97 // CHECK-NEXT: [[OR:%.*]] = or <vscale x 16 x i1> [[A:%.*]], [[B:%.*]]
98 // CHECK-NEXT: ret <vscale x 16 x i1> [[OR]]
100 svbool_t
or_bool(svbool_t a
, svbool_t b
) {
104 // CHECK-LABEL: @or_i8(
105 // CHECK-NEXT: entry:
106 // CHECK-NEXT: [[OR:%.*]] = or <vscale x 16 x i8> [[A:%.*]], [[B:%.*]]
107 // CHECK-NEXT: ret <vscale x 16 x i8> [[OR]]
109 svint8_t
or_i8(svint8_t a
, svint8_t b
) {
113 // CHECK-LABEL: @or_i16(
114 // CHECK-NEXT: entry:
115 // CHECK-NEXT: [[OR:%.*]] = or <vscale x 8 x i16> [[A:%.*]], [[B:%.*]]
116 // CHECK-NEXT: ret <vscale x 8 x i16> [[OR]]
118 svint16_t
or_i16(svint16_t a
, svint16_t b
) {
122 // CHECK-LABEL: @or_i32(
123 // CHECK-NEXT: entry:
124 // CHECK-NEXT: [[OR:%.*]] = or <vscale x 4 x i32> [[A:%.*]], [[B:%.*]]
125 // CHECK-NEXT: ret <vscale x 4 x i32> [[OR]]
127 svint32_t
or_i32(svint32_t a
, svint32_t b
) {
131 // CHECK-LABEL: @or_i64(
132 // CHECK-NEXT: entry:
133 // CHECK-NEXT: [[OR:%.*]] = or <vscale x 2 x i64> [[A:%.*]], [[B:%.*]]
134 // CHECK-NEXT: ret <vscale x 2 x i64> [[OR]]
136 svint64_t
or_i64(svint64_t a
, svint64_t b
) {
140 // CHECK-LABEL: @or_u8(
141 // CHECK-NEXT: entry:
142 // CHECK-NEXT: [[OR:%.*]] = or <vscale x 16 x i8> [[A:%.*]], [[B:%.*]]
143 // CHECK-NEXT: ret <vscale x 16 x i8> [[OR]]
145 svuint8_t
or_u8(svuint8_t a
, svuint8_t b
) {
149 // CHECK-LABEL: @or_u16(
150 // CHECK-NEXT: entry:
151 // CHECK-NEXT: [[OR:%.*]] = or <vscale x 8 x i16> [[A:%.*]], [[B:%.*]]
152 // CHECK-NEXT: ret <vscale x 8 x i16> [[OR]]
154 svuint16_t
or_u16(svuint16_t a
, svuint16_t b
) {
158 // CHECK-LABEL: @or_u32(
159 // CHECK-NEXT: entry:
160 // CHECK-NEXT: [[OR:%.*]] = or <vscale x 4 x i32> [[A:%.*]], [[B:%.*]]
161 // CHECK-NEXT: ret <vscale x 4 x i32> [[OR]]
163 svuint32_t
or_u32(svuint32_t a
, svuint32_t b
) {
167 // CHECK-LABEL: @or_u64(
168 // CHECK-NEXT: entry:
169 // CHECK-NEXT: [[OR:%.*]] = or <vscale x 2 x i64> [[A:%.*]], [[B:%.*]]
170 // CHECK-NEXT: ret <vscale x 2 x i64> [[OR]]
172 svuint64_t
or_u64(svuint64_t a
, svuint64_t b
) {
178 // CHECK-LABEL: @xor_bool(
179 // CHECK-NEXT: entry:
180 // CHECK-NEXT: [[XOR:%.*]] = xor <vscale x 16 x i1> [[A:%.*]], [[B:%.*]]
181 // CHECK-NEXT: ret <vscale x 16 x i1> [[XOR]]
183 svbool_t
xor_bool(svbool_t a
, svbool_t b
) {
187 // CHECK-LABEL: @xor_i8(
188 // CHECK-NEXT: entry:
189 // CHECK-NEXT: [[XOR:%.*]] = xor <vscale x 16 x i8> [[A:%.*]], [[B:%.*]]
190 // CHECK-NEXT: ret <vscale x 16 x i8> [[XOR]]
192 svint8_t
xor_i8(svint8_t a
, svint8_t b
) {
196 // CHECK-LABEL: @xor_i16(
197 // CHECK-NEXT: entry:
198 // CHECK-NEXT: [[XOR:%.*]] = xor <vscale x 8 x i16> [[A:%.*]], [[B:%.*]]
199 // CHECK-NEXT: ret <vscale x 8 x i16> [[XOR]]
201 svint16_t
xor_i16(svint16_t a
, svint16_t b
) {
205 // CHECK-LABEL: @xor_i32(
206 // CHECK-NEXT: entry:
207 // CHECK-NEXT: [[XOR:%.*]] = xor <vscale x 4 x i32> [[A:%.*]], [[B:%.*]]
208 // CHECK-NEXT: ret <vscale x 4 x i32> [[XOR]]
210 svint32_t
xor_i32(svint32_t a
, svint32_t b
) {
214 // CHECK-LABEL: @xor_i64(
215 // CHECK-NEXT: entry:
216 // CHECK-NEXT: [[XOR:%.*]] = xor <vscale x 2 x i64> [[A:%.*]], [[B:%.*]]
217 // CHECK-NEXT: ret <vscale x 2 x i64> [[XOR]]
219 svint64_t
xor_i64(svint64_t a
, svint64_t b
) {
223 // CHECK-LABEL: @xor_u8(
224 // CHECK-NEXT: entry:
225 // CHECK-NEXT: [[XOR:%.*]] = xor <vscale x 16 x i8> [[A:%.*]], [[B:%.*]]
226 // CHECK-NEXT: ret <vscale x 16 x i8> [[XOR]]
228 svuint8_t
xor_u8(svuint8_t a
, svuint8_t b
) {
232 // CHECK-LABEL: @xor_u16(
233 // CHECK-NEXT: entry:
234 // CHECK-NEXT: [[XOR:%.*]] = xor <vscale x 8 x i16> [[A:%.*]], [[B:%.*]]
235 // CHECK-NEXT: ret <vscale x 8 x i16> [[XOR]]
237 svuint16_t
xor_u16(svuint16_t a
, svuint16_t b
) {
241 // CHECK-LABEL: @xor_u32(
242 // CHECK-NEXT: entry:
243 // CHECK-NEXT: [[XOR:%.*]] = xor <vscale x 4 x i32> [[A:%.*]], [[B:%.*]]
244 // CHECK-NEXT: ret <vscale x 4 x i32> [[XOR]]
246 svuint32_t
xor_u32(svuint32_t a
, svuint32_t b
) {
250 // CHECK-LABEL: @xor_u64(
251 // CHECK-NEXT: entry:
252 // CHECK-NEXT: [[XOR:%.*]] = xor <vscale x 2 x i64> [[A:%.*]], [[B:%.*]]
253 // CHECK-NEXT: ret <vscale x 2 x i64> [[XOR]]
255 svuint64_t
xor_u64(svuint64_t a
, svuint64_t b
) {
261 // CHECK-LABEL: @neg_bool(
262 // CHECK-NEXT: entry:
263 // CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 16 x i1> [[A:%.*]], shufflevector (<vscale x 16 x i1> insertelement (<vscale x 16 x i1> poison, i1 true, i64 0), <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer)
264 // CHECK-NEXT: ret <vscale x 16 x i1> [[NEG]]
266 svbool_t
neg_bool(svbool_t a
) {
270 // CHECK-LABEL: @neg_i8(
271 // CHECK-NEXT: entry:
272 // CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 16 x i8> [[A:%.*]], shufflevector (<vscale x 16 x i8> insertelement (<vscale x 16 x i8> poison, i8 -1, i64 0), <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer)
273 // CHECK-NEXT: ret <vscale x 16 x i8> [[NEG]]
275 svint8_t
neg_i8(svint8_t a
) {
279 // CHECK-LABEL: @neg_i16(
280 // CHECK-NEXT: entry:
281 // CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 8 x i16> [[A:%.*]], shufflevector (<vscale x 8 x i16> insertelement (<vscale x 8 x i16> poison, i16 -1, i64 0), <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer)
282 // CHECK-NEXT: ret <vscale x 8 x i16> [[NEG]]
284 svint16_t
neg_i16(svint16_t a
) {
288 // CHECK-LABEL: @neg_i32(
289 // CHECK-NEXT: entry:
290 // CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 4 x i32> [[A:%.*]], shufflevector (<vscale x 4 x i32> insertelement (<vscale x 4 x i32> poison, i32 -1, i64 0), <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer)
291 // CHECK-NEXT: ret <vscale x 4 x i32> [[NEG]]
293 svint32_t
neg_i32(svint32_t a
) {
297 // CHECK-LABEL: @neg_i64(
298 // CHECK-NEXT: entry:
299 // CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 2 x i64> [[A:%.*]], shufflevector (<vscale x 2 x i64> insertelement (<vscale x 2 x i64> poison, i64 -1, i64 0), <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer)
300 // CHECK-NEXT: ret <vscale x 2 x i64> [[NEG]]
302 svint64_t
neg_i64(svint64_t a
) {
306 // CHECK-LABEL: @neg_u8(
307 // CHECK-NEXT: entry:
308 // CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 16 x i8> [[A:%.*]], shufflevector (<vscale x 16 x i8> insertelement (<vscale x 16 x i8> poison, i8 -1, i64 0), <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer)
309 // CHECK-NEXT: ret <vscale x 16 x i8> [[NEG]]
311 svuint8_t
neg_u8(svuint8_t a
) {
315 // CHECK-LABEL: @neg_u16(
316 // CHECK-NEXT: entry:
317 // CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 8 x i16> [[A:%.*]], shufflevector (<vscale x 8 x i16> insertelement (<vscale x 8 x i16> poison, i16 -1, i64 0), <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer)
318 // CHECK-NEXT: ret <vscale x 8 x i16> [[NEG]]
320 svuint16_t
neg_u16(svuint16_t a
) {
324 // CHECK-LABEL: @neg_u32(
325 // CHECK-NEXT: entry:
326 // CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 4 x i32> [[A:%.*]], shufflevector (<vscale x 4 x i32> insertelement (<vscale x 4 x i32> poison, i32 -1, i64 0), <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer)
327 // CHECK-NEXT: ret <vscale x 4 x i32> [[NEG]]
329 svuint32_t
neg_u32(svuint32_t a
) {
333 // CHECK-LABEL: @neg_u64(
334 // CHECK-NEXT: entry:
335 // CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 2 x i64> [[A:%.*]], shufflevector (<vscale x 2 x i64> insertelement (<vscale x 2 x i64> poison, i64 -1, i64 0), <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer)
336 // CHECK-NEXT: ret <vscale x 2 x i64> [[NEG]]
338 svuint64_t
neg_u64(svuint64_t a
) {