xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/aarch64-neon-across.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc // REQUIRES: aarch64-registered-target
2*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon \
3f4a2713aSLionel Sambuc // RUN:   -ffp-contract=fast -S -O3 -o - %s | FileCheck %s
4f4a2713aSLionel Sambuc 
5f4a2713aSLionel Sambuc // Test new aarch64 intrinsics and types
6f4a2713aSLionel Sambuc 
7f4a2713aSLionel Sambuc #include <arm_neon.h>
8f4a2713aSLionel Sambuc 
test_vaddlv_s8(int8x8_t a)9f4a2713aSLionel Sambuc int16_t test_vaddlv_s8(int8x8_t a) {
10*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vaddlv_s8
11f4a2713aSLionel Sambuc   return vaddlv_s8(a);
12f4a2713aSLionel Sambuc   // CHECK: saddlv {{h[0-9]+}}, {{v[0-9]+}}.8b
13f4a2713aSLionel Sambuc }
14f4a2713aSLionel Sambuc 
test_vaddlv_s16(int16x4_t a)15f4a2713aSLionel Sambuc int32_t test_vaddlv_s16(int16x4_t a) {
16*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vaddlv_s16
17f4a2713aSLionel Sambuc   return vaddlv_s16(a);
18f4a2713aSLionel Sambuc   // CHECK: saddlv {{s[0-9]+}}, {{v[0-9]+}}.4h
19f4a2713aSLionel Sambuc }
20f4a2713aSLionel Sambuc 
test_vaddlv_u8(uint8x8_t a)21f4a2713aSLionel Sambuc uint16_t test_vaddlv_u8(uint8x8_t a) {
22*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vaddlv_u8
23f4a2713aSLionel Sambuc   return vaddlv_u8(a);
24f4a2713aSLionel Sambuc   // CHECK: uaddlv {{h[0-9]+}}, {{v[0-9]+}}.8b
25f4a2713aSLionel Sambuc }
26f4a2713aSLionel Sambuc 
test_vaddlv_u16(uint16x4_t a)27f4a2713aSLionel Sambuc uint32_t test_vaddlv_u16(uint16x4_t a) {
28*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vaddlv_u16
29f4a2713aSLionel Sambuc   return vaddlv_u16(a);
30f4a2713aSLionel Sambuc   // CHECK: uaddlv {{s[0-9]+}}, {{v[0-9]+}}.4h
31f4a2713aSLionel Sambuc }
32f4a2713aSLionel Sambuc 
test_vaddlvq_s8(int8x16_t a)33f4a2713aSLionel Sambuc int16_t test_vaddlvq_s8(int8x16_t a) {
34*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vaddlvq_s8
35f4a2713aSLionel Sambuc   return vaddlvq_s8(a);
36f4a2713aSLionel Sambuc   // CHECK: saddlv {{h[0-9]+}}, {{v[0-9]+}}.16b
37f4a2713aSLionel Sambuc }
38f4a2713aSLionel Sambuc 
test_vaddlvq_s16(int16x8_t a)39f4a2713aSLionel Sambuc int32_t test_vaddlvq_s16(int16x8_t a) {
40*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vaddlvq_s16
41f4a2713aSLionel Sambuc   return vaddlvq_s16(a);
42f4a2713aSLionel Sambuc   // CHECK: saddlv {{s[0-9]+}}, {{v[0-9]+}}.8h
43f4a2713aSLionel Sambuc }
44f4a2713aSLionel Sambuc 
test_vaddlvq_s32(int32x4_t a)45f4a2713aSLionel Sambuc int64_t test_vaddlvq_s32(int32x4_t a) {
46*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vaddlvq_s32
47f4a2713aSLionel Sambuc   return vaddlvq_s32(a);
48f4a2713aSLionel Sambuc   // CHECK: saddlv {{d[0-9]+}}, {{v[0-9]+}}.4s
49f4a2713aSLionel Sambuc }
50f4a2713aSLionel Sambuc 
test_vaddlvq_u8(uint8x16_t a)51f4a2713aSLionel Sambuc uint16_t test_vaddlvq_u8(uint8x16_t a) {
52*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vaddlvq_u8
53f4a2713aSLionel Sambuc   return vaddlvq_u8(a);
54f4a2713aSLionel Sambuc   // CHECK: uaddlv {{h[0-9]+}}, {{v[0-9]+}}.16b
55f4a2713aSLionel Sambuc }
56f4a2713aSLionel Sambuc 
test_vaddlvq_u16(uint16x8_t a)57f4a2713aSLionel Sambuc uint32_t test_vaddlvq_u16(uint16x8_t a) {
58*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vaddlvq_u16
59f4a2713aSLionel Sambuc   return vaddlvq_u16(a);
60f4a2713aSLionel Sambuc   // CHECK: uaddlv {{s[0-9]+}}, {{v[0-9]+}}.8h
61f4a2713aSLionel Sambuc }
62f4a2713aSLionel Sambuc 
test_vaddlvq_u32(uint32x4_t a)63f4a2713aSLionel Sambuc uint64_t test_vaddlvq_u32(uint32x4_t a) {
64*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vaddlvq_u32
65f4a2713aSLionel Sambuc   return vaddlvq_u32(a);
66f4a2713aSLionel Sambuc   // CHECK: uaddlv {{d[0-9]+}}, {{v[0-9]+}}.4s
67f4a2713aSLionel Sambuc }
68f4a2713aSLionel Sambuc 
test_vmaxv_s8(int8x8_t a)69f4a2713aSLionel Sambuc int8_t test_vmaxv_s8(int8x8_t a) {
70*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vmaxv_s8
71f4a2713aSLionel Sambuc   return vmaxv_s8(a);
72f4a2713aSLionel Sambuc   // CHECK: smaxv {{b[0-9]+}}, {{v[0-9]+}}.8b
73f4a2713aSLionel Sambuc }
74f4a2713aSLionel Sambuc 
test_vmaxv_s16(int16x4_t a)75f4a2713aSLionel Sambuc int16_t test_vmaxv_s16(int16x4_t a) {
76*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vmaxv_s16
77f4a2713aSLionel Sambuc   return vmaxv_s16(a);
78f4a2713aSLionel Sambuc   // CHECK: smaxv {{h[0-9]+}}, {{v[0-9]+}}.4h
79f4a2713aSLionel Sambuc }
80f4a2713aSLionel Sambuc 
test_vmaxv_u8(uint8x8_t a)81f4a2713aSLionel Sambuc uint8_t test_vmaxv_u8(uint8x8_t a) {
82*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vmaxv_u8
83f4a2713aSLionel Sambuc   return vmaxv_u8(a);
84f4a2713aSLionel Sambuc   // CHECK: umaxv {{b[0-9]+}}, {{v[0-9]+}}.8b
85f4a2713aSLionel Sambuc }
86f4a2713aSLionel Sambuc 
test_vmaxv_u16(uint16x4_t a)87f4a2713aSLionel Sambuc uint16_t test_vmaxv_u16(uint16x4_t a) {
88*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vmaxv_u16
89f4a2713aSLionel Sambuc   return vmaxv_u16(a);
90f4a2713aSLionel Sambuc   // CHECK: umaxv {{h[0-9]+}}, {{v[0-9]+}}.4h
91f4a2713aSLionel Sambuc }
92f4a2713aSLionel Sambuc 
test_vmaxvq_s8(int8x16_t a)93f4a2713aSLionel Sambuc int8_t test_vmaxvq_s8(int8x16_t a) {
94*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vmaxvq_s8
95f4a2713aSLionel Sambuc   return vmaxvq_s8(a);
96f4a2713aSLionel Sambuc   // CHECK: smaxv {{b[0-9]+}}, {{v[0-9]+}}.16b
97f4a2713aSLionel Sambuc }
98f4a2713aSLionel Sambuc 
test_vmaxvq_s16(int16x8_t a)99f4a2713aSLionel Sambuc int16_t test_vmaxvq_s16(int16x8_t a) {
100*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vmaxvq_s16
101f4a2713aSLionel Sambuc   return vmaxvq_s16(a);
102f4a2713aSLionel Sambuc   // CHECK: smaxv {{h[0-9]+}}, {{v[0-9]+}}.8h
103f4a2713aSLionel Sambuc }
104f4a2713aSLionel Sambuc 
test_vmaxvq_s32(int32x4_t a)105f4a2713aSLionel Sambuc int32_t test_vmaxvq_s32(int32x4_t a) {
106*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vmaxvq_s32
107f4a2713aSLionel Sambuc   return vmaxvq_s32(a);
108f4a2713aSLionel Sambuc   // CHECK: smaxv {{s[0-9]+}}, {{v[0-9]+}}.4s
109f4a2713aSLionel Sambuc }
110f4a2713aSLionel Sambuc 
test_vmaxvq_u8(uint8x16_t a)111f4a2713aSLionel Sambuc uint8_t test_vmaxvq_u8(uint8x16_t a) {
112*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vmaxvq_u8
113f4a2713aSLionel Sambuc   return vmaxvq_u8(a);
114f4a2713aSLionel Sambuc   // CHECK: umaxv {{b[0-9]+}}, {{v[0-9]+}}.16b
115f4a2713aSLionel Sambuc }
116f4a2713aSLionel Sambuc 
test_vmaxvq_u16(uint16x8_t a)117f4a2713aSLionel Sambuc uint16_t test_vmaxvq_u16(uint16x8_t a) {
118*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vmaxvq_u16
119f4a2713aSLionel Sambuc   return vmaxvq_u16(a);
120f4a2713aSLionel Sambuc   // CHECK: umaxv {{h[0-9]+}}, {{v[0-9]+}}.8h
121f4a2713aSLionel Sambuc }
122f4a2713aSLionel Sambuc 
test_vmaxvq_u32(uint32x4_t a)123f4a2713aSLionel Sambuc uint32_t test_vmaxvq_u32(uint32x4_t a) {
124*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vmaxvq_u32
125f4a2713aSLionel Sambuc   return vmaxvq_u32(a);
126f4a2713aSLionel Sambuc   // CHECK: umaxv {{s[0-9]+}}, {{v[0-9]+}}.4s
127f4a2713aSLionel Sambuc }
128f4a2713aSLionel Sambuc 
test_vminv_s8(int8x8_t a)129f4a2713aSLionel Sambuc int8_t test_vminv_s8(int8x8_t a) {
130*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vminv_s8
131f4a2713aSLionel Sambuc   return vminv_s8(a);
132f4a2713aSLionel Sambuc   // CHECK: sminv {{b[0-9]+}}, {{v[0-9]+}}.8b
133f4a2713aSLionel Sambuc }
134f4a2713aSLionel Sambuc 
test_vminv_s16(int16x4_t a)135f4a2713aSLionel Sambuc int16_t test_vminv_s16(int16x4_t a) {
136*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vminv_s16
137f4a2713aSLionel Sambuc   return vminv_s16(a);
138f4a2713aSLionel Sambuc   // CHECK: sminv {{h[0-9]+}}, {{v[0-9]+}}.4h
139f4a2713aSLionel Sambuc }
140f4a2713aSLionel Sambuc 
test_vminv_u8(uint8x8_t a)141f4a2713aSLionel Sambuc uint8_t test_vminv_u8(uint8x8_t a) {
142*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vminv_u8
143f4a2713aSLionel Sambuc   return vminv_u8(a);
144f4a2713aSLionel Sambuc   // CHECK: uminv {{b[0-9]+}}, {{v[0-9]+}}.8b
145f4a2713aSLionel Sambuc }
146f4a2713aSLionel Sambuc 
test_vminv_u16(uint16x4_t a)147f4a2713aSLionel Sambuc uint16_t test_vminv_u16(uint16x4_t a) {
148*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vminv_u16
149f4a2713aSLionel Sambuc   return vminv_u16(a);
150f4a2713aSLionel Sambuc   // CHECK: uminv {{h[0-9]+}}, {{v[0-9]+}}.4h
151f4a2713aSLionel Sambuc }
152f4a2713aSLionel Sambuc 
test_vminvq_s8(int8x16_t a)153f4a2713aSLionel Sambuc int8_t test_vminvq_s8(int8x16_t a) {
154*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vminvq_s8
155f4a2713aSLionel Sambuc   return vminvq_s8(a);
156f4a2713aSLionel Sambuc   // CHECK: sminv {{b[0-9]+}}, {{v[0-9]+}}.16b
157f4a2713aSLionel Sambuc }
158f4a2713aSLionel Sambuc 
test_vminvq_s16(int16x8_t a)159f4a2713aSLionel Sambuc int16_t test_vminvq_s16(int16x8_t a) {
160*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vminvq_s16
161f4a2713aSLionel Sambuc   return vminvq_s16(a);
162f4a2713aSLionel Sambuc   // CHECK: sminv {{h[0-9]+}}, {{v[0-9]+}}.8h
163f4a2713aSLionel Sambuc }
164f4a2713aSLionel Sambuc 
test_vminvq_s32(int32x4_t a)165f4a2713aSLionel Sambuc int32_t test_vminvq_s32(int32x4_t a) {
166*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vminvq_s32
167f4a2713aSLionel Sambuc   return vminvq_s32(a);
168f4a2713aSLionel Sambuc   // CHECK: sminv {{s[0-9]+}}, {{v[0-9]+}}.4s
169f4a2713aSLionel Sambuc }
170f4a2713aSLionel Sambuc 
test_vminvq_u8(uint8x16_t a)171f4a2713aSLionel Sambuc uint8_t test_vminvq_u8(uint8x16_t a) {
172*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vminvq_u8
173f4a2713aSLionel Sambuc   return vminvq_u8(a);
174f4a2713aSLionel Sambuc   // CHECK: uminv {{b[0-9]+}}, {{v[0-9]+}}.16b
175f4a2713aSLionel Sambuc }
176f4a2713aSLionel Sambuc 
test_vminvq_u16(uint16x8_t a)177f4a2713aSLionel Sambuc uint16_t test_vminvq_u16(uint16x8_t a) {
178*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vminvq_u16
179f4a2713aSLionel Sambuc   return vminvq_u16(a);
180f4a2713aSLionel Sambuc   // CHECK: uminv {{h[0-9]+}}, {{v[0-9]+}}.8h
181f4a2713aSLionel Sambuc }
182f4a2713aSLionel Sambuc 
test_vminvq_u32(uint32x4_t a)183f4a2713aSLionel Sambuc uint32_t test_vminvq_u32(uint32x4_t a) {
184*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vminvq_u32
185f4a2713aSLionel Sambuc   return vminvq_u32(a);
186f4a2713aSLionel Sambuc   // CHECK: uminv {{s[0-9]+}}, {{v[0-9]+}}.4s
187f4a2713aSLionel Sambuc }
188f4a2713aSLionel Sambuc 
test_vaddv_s8(int8x8_t a)189f4a2713aSLionel Sambuc int8_t test_vaddv_s8(int8x8_t a) {
190*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vaddv_s8
191f4a2713aSLionel Sambuc   return vaddv_s8(a);
192f4a2713aSLionel Sambuc   // CHECK: addv {{b[0-9]+}}, {{v[0-9]+}}.8b
193f4a2713aSLionel Sambuc }
194f4a2713aSLionel Sambuc 
test_vaddv_s16(int16x4_t a)195f4a2713aSLionel Sambuc int16_t test_vaddv_s16(int16x4_t a) {
196*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vaddv_s16
197f4a2713aSLionel Sambuc   return vaddv_s16(a);
198f4a2713aSLionel Sambuc   // CHECK: addv {{h[0-9]+}}, {{v[0-9]+}}.4h
199f4a2713aSLionel Sambuc }
200f4a2713aSLionel Sambuc 
test_vaddv_u8(uint8x8_t a)201f4a2713aSLionel Sambuc uint8_t test_vaddv_u8(uint8x8_t a) {
202*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vaddv_u8
203f4a2713aSLionel Sambuc   return vaddv_u8(a);
204f4a2713aSLionel Sambuc   // CHECK: addv {{b[0-9]+}}, {{v[0-9]+}}.8b
205f4a2713aSLionel Sambuc }
206f4a2713aSLionel Sambuc 
test_vaddv_u16(uint16x4_t a)207f4a2713aSLionel Sambuc uint16_t test_vaddv_u16(uint16x4_t a) {
208*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vaddv_u16
209f4a2713aSLionel Sambuc   return vaddv_u16(a);
210f4a2713aSLionel Sambuc   // CHECK: addv {{h[0-9]+}}, {{v[0-9]+}}.4h
211f4a2713aSLionel Sambuc }
212f4a2713aSLionel Sambuc 
test_vaddvq_s8(int8x16_t a)213f4a2713aSLionel Sambuc int8_t test_vaddvq_s8(int8x16_t a) {
214*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vaddvq_s8
215f4a2713aSLionel Sambuc   return vaddvq_s8(a);
216f4a2713aSLionel Sambuc   // CHECK: addv {{b[0-9]+}}, {{v[0-9]+}}.16b
217f4a2713aSLionel Sambuc }
218f4a2713aSLionel Sambuc 
test_vaddvq_s16(int16x8_t a)219f4a2713aSLionel Sambuc int16_t test_vaddvq_s16(int16x8_t a) {
220*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vaddvq_s16
221f4a2713aSLionel Sambuc   return vaddvq_s16(a);
222f4a2713aSLionel Sambuc   // CHECK: addv {{h[0-9]+}}, {{v[0-9]+}}.8h
223f4a2713aSLionel Sambuc }
224f4a2713aSLionel Sambuc 
test_vaddvq_s32(int32x4_t a)225f4a2713aSLionel Sambuc int32_t test_vaddvq_s32(int32x4_t a) {
226*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vaddvq_s32
227f4a2713aSLionel Sambuc   return vaddvq_s32(a);
228f4a2713aSLionel Sambuc   // CHECK: addv {{s[0-9]+}}, {{v[0-9]+}}.4s
229f4a2713aSLionel Sambuc }
230f4a2713aSLionel Sambuc 
test_vaddvq_u8(uint8x16_t a)231f4a2713aSLionel Sambuc uint8_t test_vaddvq_u8(uint8x16_t a) {
232*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vaddvq_u8
233f4a2713aSLionel Sambuc   return vaddvq_u8(a);
234f4a2713aSLionel Sambuc   // CHECK: addv {{b[0-9]+}}, {{v[0-9]+}}.16b
235f4a2713aSLionel Sambuc }
236f4a2713aSLionel Sambuc 
test_vaddvq_u16(uint16x8_t a)237f4a2713aSLionel Sambuc uint16_t test_vaddvq_u16(uint16x8_t a) {
238*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vaddvq_u16
239f4a2713aSLionel Sambuc   return vaddvq_u16(a);
240f4a2713aSLionel Sambuc   // CHECK: addv {{h[0-9]+}}, {{v[0-9]+}}.8h
241f4a2713aSLionel Sambuc }
242f4a2713aSLionel Sambuc 
test_vaddvq_u32(uint32x4_t a)243f4a2713aSLionel Sambuc uint32_t test_vaddvq_u32(uint32x4_t a) {
244*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vaddvq_u32
245f4a2713aSLionel Sambuc   return vaddvq_u32(a);
246f4a2713aSLionel Sambuc   // CHECK: addv {{s[0-9]+}}, {{v[0-9]+}}.4s
247f4a2713aSLionel Sambuc }
248f4a2713aSLionel Sambuc 
test_vmaxvq_f32(float32x4_t a)249f4a2713aSLionel Sambuc float32_t test_vmaxvq_f32(float32x4_t a) {
250*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vmaxvq_f32
251f4a2713aSLionel Sambuc   return vmaxvq_f32(a);
252f4a2713aSLionel Sambuc   // CHECK: fmaxv {{s[0-9]+}}, {{v[0-9]+}}.4s
253f4a2713aSLionel Sambuc }
254f4a2713aSLionel Sambuc 
test_vminvq_f32(float32x4_t a)255f4a2713aSLionel Sambuc float32_t test_vminvq_f32(float32x4_t a) {
256*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vminvq_f32
257f4a2713aSLionel Sambuc   return vminvq_f32(a);
258f4a2713aSLionel Sambuc   // CHECK: fminv {{s[0-9]+}}, {{v[0-9]+}}.4s
259f4a2713aSLionel Sambuc }
260f4a2713aSLionel Sambuc 
test_vmaxnmvq_f32(float32x4_t a)261f4a2713aSLionel Sambuc float32_t test_vmaxnmvq_f32(float32x4_t a) {
262*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vmaxnmvq_f32
263f4a2713aSLionel Sambuc   return vmaxnmvq_f32(a);
264f4a2713aSLionel Sambuc   // CHECK: fmaxnmv {{s[0-9]+}}, {{v[0-9]+}}.4s
265f4a2713aSLionel Sambuc }
266f4a2713aSLionel Sambuc 
test_vminnmvq_f32(float32x4_t a)267f4a2713aSLionel Sambuc float32_t test_vminnmvq_f32(float32x4_t a) {
268*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: test_vminnmvq_f32
269f4a2713aSLionel Sambuc   return vminnmvq_f32(a);
270f4a2713aSLionel Sambuc   // CHECK: fminnmv {{s[0-9]+}}, {{v[0-9]+}}.4s
271f4a2713aSLionel Sambuc }
272