1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // RUN: %clang_cc1 -triple thumbv8.1m.main-none-none-eabi -target-feature +mve.fp -mfloat-abi hard -O0 -disable-O0-optnone -emit-llvm -o - %s | opt -S -passes='mem2reg,sroa,early-cse<>' | FileCheck %s --check-prefixes=CHECK,CHECK-LE
3 // RUN: %clang_cc1 -triple thumbv8.1m.main-none-none-eabi -target-feature +mve.fp -mfloat-abi hard -O0 -disable-O0-optnone -DPOLYMORPHIC -emit-llvm -o - %s | opt -S -passes='mem2reg,sroa,early-cse<>' | FileCheck %s --check-prefixes=CHECK,CHECK-LE
4 // RUN: %clang_cc1 -triple thumbebv8.1m.main-none-none-eabi -target-feature +mve.fp -mfloat-abi hard -O0 -disable-O0-optnone -emit-llvm -o - %s | opt -S -passes='mem2reg,sroa,early-cse<>' | FileCheck %s --check-prefixes=CHECK,CHECK-BE
5 // RUN: %clang_cc1 -triple thumbebv8.1m.main-none-none-eabi -target-feature +mve.fp -mfloat-abi hard -O0 -disable-O0-optnone -DPOLYMORPHIC -emit-llvm -o - %s | opt -S -passes='mem2reg,sroa,early-cse<>' | FileCheck %s --check-prefixes=CHECK,CHECK-BE
7 // REQUIRES: aarch64-registered-target || arm-registered-target
11 // CHECK-LE-LABEL: @test_vcreateq_f16(
12 // CHECK-LE-NEXT: entry:
13 // CHECK-LE-NEXT: [[TMP0:%.*]] = insertelement <2 x i64> undef, i64 [[A:%.*]], i64 0
14 // CHECK-LE-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B:%.*]], i64 1
15 // CHECK-LE-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[TMP1]] to <8 x half>
16 // CHECK-LE-NEXT: ret <8 x half> [[TMP2]]
18 // CHECK-BE-LABEL: @test_vcreateq_f16(
19 // CHECK-BE-NEXT: entry:
20 // CHECK-BE-NEXT: [[TMP0:%.*]] = insertelement <2 x i64> undef, i64 [[A:%.*]], i64 0
21 // CHECK-BE-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B:%.*]], i64 1
22 // CHECK-BE-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vreinterpretq.v8f16.v2i64(<2 x i64> [[TMP1]])
23 // CHECK-BE-NEXT: ret <8 x half> [[TMP2]]
25 float16x8_t
test_vcreateq_f16(uint64_t a
, uint64_t b
)
27 return vcreateq_f16(a
, b
);
30 // CHECK-LE-LABEL: @test_vcreateq_f32(
31 // CHECK-LE-NEXT: entry:
32 // CHECK-LE-NEXT: [[TMP0:%.*]] = insertelement <2 x i64> undef, i64 [[A:%.*]], i64 0
33 // CHECK-LE-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B:%.*]], i64 1
34 // CHECK-LE-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[TMP1]] to <4 x float>
35 // CHECK-LE-NEXT: ret <4 x float> [[TMP2]]
37 // CHECK-BE-LABEL: @test_vcreateq_f32(
38 // CHECK-BE-NEXT: entry:
39 // CHECK-BE-NEXT: [[TMP0:%.*]] = insertelement <2 x i64> undef, i64 [[A:%.*]], i64 0
40 // CHECK-BE-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B:%.*]], i64 1
41 // CHECK-BE-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vreinterpretq.v4f32.v2i64(<2 x i64> [[TMP1]])
42 // CHECK-BE-NEXT: ret <4 x float> [[TMP2]]
44 float32x4_t
test_vcreateq_f32(uint64_t a
, uint64_t b
)
46 return vcreateq_f32(a
, b
);
49 // CHECK-LE-LABEL: @test_vcreateq_s16(
50 // CHECK-LE-NEXT: entry:
51 // CHECK-LE-NEXT: [[TMP0:%.*]] = insertelement <2 x i64> undef, i64 [[A:%.*]], i64 0
52 // CHECK-LE-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B:%.*]], i64 1
53 // CHECK-LE-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[TMP1]] to <8 x i16>
54 // CHECK-LE-NEXT: ret <8 x i16> [[TMP2]]
56 // CHECK-BE-LABEL: @test_vcreateq_s16(
57 // CHECK-BE-NEXT: entry:
58 // CHECK-BE-NEXT: [[TMP0:%.*]] = insertelement <2 x i64> undef, i64 [[A:%.*]], i64 0
59 // CHECK-BE-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B:%.*]], i64 1
60 // CHECK-BE-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vreinterpretq.v8i16.v2i64(<2 x i64> [[TMP1]])
61 // CHECK-BE-NEXT: ret <8 x i16> [[TMP2]]
63 int16x8_t
test_vcreateq_s16(uint64_t a
, uint64_t b
)
65 return vcreateq_s16(a
, b
);
68 // CHECK-LE-LABEL: @test_vcreateq_s32(
69 // CHECK-LE-NEXT: entry:
70 // CHECK-LE-NEXT: [[TMP0:%.*]] = insertelement <2 x i64> undef, i64 [[A:%.*]], i64 0
71 // CHECK-LE-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B:%.*]], i64 1
72 // CHECK-LE-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[TMP1]] to <4 x i32>
73 // CHECK-LE-NEXT: ret <4 x i32> [[TMP2]]
75 // CHECK-BE-LABEL: @test_vcreateq_s32(
76 // CHECK-BE-NEXT: entry:
77 // CHECK-BE-NEXT: [[TMP0:%.*]] = insertelement <2 x i64> undef, i64 [[A:%.*]], i64 0
78 // CHECK-BE-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B:%.*]], i64 1
79 // CHECK-BE-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vreinterpretq.v4i32.v2i64(<2 x i64> [[TMP1]])
80 // CHECK-BE-NEXT: ret <4 x i32> [[TMP2]]
82 int32x4_t
test_vcreateq_s32(uint64_t a
, uint64_t b
)
84 return vcreateq_s32(a
, b
);
87 // CHECK-LABEL: @test_vcreateq_s64(
89 // CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x i64> undef, i64 [[A:%.*]], i64 0
90 // CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B:%.*]], i64 1
91 // CHECK-NEXT: ret <2 x i64> [[TMP1]]
93 int64x2_t
test_vcreateq_s64(uint64_t a
, uint64_t b
)
95 return vcreateq_s64(a
, b
);
98 // CHECK-LE-LABEL: @test_vcreateq_s8(
99 // CHECK-LE-NEXT: entry:
100 // CHECK-LE-NEXT: [[TMP0:%.*]] = insertelement <2 x i64> undef, i64 [[A:%.*]], i64 0
101 // CHECK-LE-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B:%.*]], i64 1
102 // CHECK-LE-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[TMP1]] to <16 x i8>
103 // CHECK-LE-NEXT: ret <16 x i8> [[TMP2]]
105 // CHECK-BE-LABEL: @test_vcreateq_s8(
106 // CHECK-BE-NEXT: entry:
107 // CHECK-BE-NEXT: [[TMP0:%.*]] = insertelement <2 x i64> undef, i64 [[A:%.*]], i64 0
108 // CHECK-BE-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B:%.*]], i64 1
109 // CHECK-BE-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vreinterpretq.v16i8.v2i64(<2 x i64> [[TMP1]])
110 // CHECK-BE-NEXT: ret <16 x i8> [[TMP2]]
112 int8x16_t
test_vcreateq_s8(uint64_t a
, uint64_t b
)
114 return vcreateq_s8(a
, b
);
117 // CHECK-LE-LABEL: @test_vcreateq_u16(
118 // CHECK-LE-NEXT: entry:
119 // CHECK-LE-NEXT: [[TMP0:%.*]] = insertelement <2 x i64> undef, i64 [[A:%.*]], i64 0
120 // CHECK-LE-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B:%.*]], i64 1
121 // CHECK-LE-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[TMP1]] to <8 x i16>
122 // CHECK-LE-NEXT: ret <8 x i16> [[TMP2]]
124 // CHECK-BE-LABEL: @test_vcreateq_u16(
125 // CHECK-BE-NEXT: entry:
126 // CHECK-BE-NEXT: [[TMP0:%.*]] = insertelement <2 x i64> undef, i64 [[A:%.*]], i64 0
127 // CHECK-BE-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B:%.*]], i64 1
128 // CHECK-BE-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vreinterpretq.v8i16.v2i64(<2 x i64> [[TMP1]])
129 // CHECK-BE-NEXT: ret <8 x i16> [[TMP2]]
131 uint16x8_t
test_vcreateq_u16(uint64_t a
, uint64_t b
)
133 return vcreateq_u16(a
, b
);
136 // CHECK-LE-LABEL: @test_vcreateq_u32(
137 // CHECK-LE-NEXT: entry:
138 // CHECK-LE-NEXT: [[TMP0:%.*]] = insertelement <2 x i64> undef, i64 [[A:%.*]], i64 0
139 // CHECK-LE-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B:%.*]], i64 1
140 // CHECK-LE-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[TMP1]] to <4 x i32>
141 // CHECK-LE-NEXT: ret <4 x i32> [[TMP2]]
143 // CHECK-BE-LABEL: @test_vcreateq_u32(
144 // CHECK-BE-NEXT: entry:
145 // CHECK-BE-NEXT: [[TMP0:%.*]] = insertelement <2 x i64> undef, i64 [[A:%.*]], i64 0
146 // CHECK-BE-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B:%.*]], i64 1
147 // CHECK-BE-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vreinterpretq.v4i32.v2i64(<2 x i64> [[TMP1]])
148 // CHECK-BE-NEXT: ret <4 x i32> [[TMP2]]
150 uint32x4_t
test_vcreateq_u32(uint64_t a
, uint64_t b
)
152 return vcreateq_u32(a
, b
);
155 // CHECK-LABEL: @test_vcreateq_u64(
156 // CHECK-NEXT: entry:
157 // CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x i64> undef, i64 [[A:%.*]], i64 0
158 // CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B:%.*]], i64 1
159 // CHECK-NEXT: ret <2 x i64> [[TMP1]]
161 uint64x2_t
test_vcreateq_u64(uint64_t a
, uint64_t b
)
163 return vcreateq_u64(a
, b
);
166 // CHECK-LE-LABEL: @test_vcreateq_u8(
167 // CHECK-LE-NEXT: entry:
168 // CHECK-LE-NEXT: [[TMP0:%.*]] = insertelement <2 x i64> undef, i64 [[A:%.*]], i64 0
169 // CHECK-LE-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B:%.*]], i64 1
170 // CHECK-LE-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[TMP1]] to <16 x i8>
171 // CHECK-LE-NEXT: ret <16 x i8> [[TMP2]]
173 // CHECK-BE-LABEL: @test_vcreateq_u8(
174 // CHECK-BE-NEXT: entry:
175 // CHECK-BE-NEXT: [[TMP0:%.*]] = insertelement <2 x i64> undef, i64 [[A:%.*]], i64 0
176 // CHECK-BE-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B:%.*]], i64 1
177 // CHECK-BE-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vreinterpretq.v16i8.v2i64(<2 x i64> [[TMP1]])
178 // CHECK-BE-NEXT: ret <16 x i8> [[TMP2]]
180 uint8x16_t
test_vcreateq_u8(uint64_t a
, uint64_t b
)
182 return vcreateq_u8(a
, b
);
185 // CHECK-LABEL: @test_vuninitializedq_polymorphic_f16(
186 // CHECK-NEXT: entry:
187 // CHECK-NEXT: ret <8 x half> undef
189 float16x8_t
test_vuninitializedq_polymorphic_f16(float16x8_t (*funcptr
)(void))
191 return vuninitializedq(funcptr());
194 // CHECK-LABEL: @test_vuninitializedq_polymorphic_f32(
195 // CHECK-NEXT: entry:
196 // CHECK-NEXT: ret <4 x float> undef
198 float32x4_t
test_vuninitializedq_polymorphic_f32(float32x4_t (*funcptr
)(void))
200 return vuninitializedq(funcptr());
203 // CHECK-LABEL: @test_vuninitializedq_polymorphic_s8(
204 // CHECK-NEXT: entry:
205 // CHECK-NEXT: ret <16 x i8> undef
207 int8x16_t
test_vuninitializedq_polymorphic_s8(int8x16_t (*funcptr
)(void))
209 return vuninitializedq(funcptr());
212 // CHECK-LABEL: @test_vuninitializedq_polymorphic_s16(
213 // CHECK-NEXT: entry:
214 // CHECK-NEXT: ret <8 x i16> undef
216 int16x8_t
test_vuninitializedq_polymorphic_s16(int16x8_t (*funcptr
)(void))
218 return vuninitializedq(funcptr());
221 // CHECK-LABEL: @test_vuninitializedq_polymorphic_s32(
222 // CHECK-NEXT: entry:
223 // CHECK-NEXT: ret <4 x i32> undef
225 int32x4_t
test_vuninitializedq_polymorphic_s32(int32x4_t (*funcptr
)(void))
227 return vuninitializedq(funcptr());
230 // CHECK-LABEL: @test_vuninitializedq_polymorphic_s64(
231 // CHECK-NEXT: entry:
232 // CHECK-NEXT: ret <2 x i64> undef
234 int64x2_t
test_vuninitializedq_polymorphic_s64(int64x2_t (*funcptr
)(void))
236 return vuninitializedq(funcptr());
239 // CHECK-LABEL: @test_vuninitializedq_polymorphic_u8(
240 // CHECK-NEXT: entry:
241 // CHECK-NEXT: ret <16 x i8> undef
243 uint8x16_t
test_vuninitializedq_polymorphic_u8(uint8x16_t (*funcptr
)(void))
245 return vuninitializedq(funcptr());
248 // CHECK-LABEL: @test_vuninitializedq_polymorphic_u16(
249 // CHECK-NEXT: entry:
250 // CHECK-NEXT: ret <8 x i16> undef
252 uint16x8_t
test_vuninitializedq_polymorphic_u16(uint16x8_t (*funcptr
)(void))
254 return vuninitializedq(funcptr());
257 // CHECK-LABEL: @test_vuninitializedq_polymorphic_u32(
258 // CHECK-NEXT: entry:
259 // CHECK-NEXT: ret <4 x i32> undef
261 uint32x4_t
test_vuninitializedq_polymorphic_u32(uint32x4_t (*funcptr
)(void))
263 return vuninitializedq(funcptr());
266 // CHECK-LABEL: @test_vuninitializedq_polymorphic_u64(
267 // CHECK-NEXT: entry:
268 // CHECK-NEXT: ret <2 x i64> undef
270 uint64x2_t
test_vuninitializedq_polymorphic_u64(uint64x2_t (*funcptr
)(void))
272 return vuninitializedq(funcptr());
275 // CHECK-LABEL: @test_vuninitializedq_f16(
276 // CHECK-NEXT: entry:
277 // CHECK-NEXT: ret <8 x half> undef
279 float16x8_t
test_vuninitializedq_f16(void)
281 return vuninitializedq_f16();
284 // CHECK-LABEL: @test_vuninitializedq_f32(
285 // CHECK-NEXT: entry:
286 // CHECK-NEXT: ret <4 x float> undef
288 float32x4_t
test_vuninitializedq_f32(void)
290 return vuninitializedq_f32();
293 // CHECK-LABEL: @test_vuninitializedq_s16(
294 // CHECK-NEXT: entry:
295 // CHECK-NEXT: ret <8 x i16> undef
297 int16x8_t
test_vuninitializedq_s16(void)
299 return vuninitializedq_s16();
302 // CHECK-LABEL: @test_vuninitializedq_s32(
303 // CHECK-NEXT: entry:
304 // CHECK-NEXT: ret <4 x i32> undef
306 int32x4_t
test_vuninitializedq_s32(void)
308 return vuninitializedq_s32();
311 // CHECK-LABEL: @test_vuninitializedq_s64(
312 // CHECK-NEXT: entry:
313 // CHECK-NEXT: ret <2 x i64> undef
315 int64x2_t
test_vuninitializedq_s64(void)
317 return vuninitializedq_s64();
320 // CHECK-LABEL: @test_vuninitializedq_s8(
321 // CHECK-NEXT: entry:
322 // CHECK-NEXT: ret <16 x i8> undef
324 int8x16_t
test_vuninitializedq_s8(void)
326 return vuninitializedq_s8();
329 // CHECK-LABEL: @test_vuninitializedq_u16(
330 // CHECK-NEXT: entry:
331 // CHECK-NEXT: ret <8 x i16> undef
333 uint16x8_t
test_vuninitializedq_u16(void)
335 return vuninitializedq_u16();
338 // CHECK-LABEL: @test_vuninitializedq_u32(
339 // CHECK-NEXT: entry:
340 // CHECK-NEXT: ret <4 x i32> undef
342 uint32x4_t
test_vuninitializedq_u32(void)
344 return vuninitializedq_u32();
347 // CHECK-LABEL: @test_vuninitializedq_u64(
348 // CHECK-NEXT: entry:
349 // CHECK-NEXT: ret <2 x i64> undef
351 uint64x2_t
test_vuninitializedq_u64(void)
353 return vuninitializedq_u64();
356 // CHECK-LABEL: @test_vuninitializedq_u8(
357 // CHECK-NEXT: entry:
358 // CHECK-NEXT: ret <16 x i8> undef
360 uint8x16_t
test_vuninitializedq_u8(void)
362 return vuninitializedq_u8();