1 ; RUN: llc < %s -march=arm -mattr=+neon | FileCheck %s
3 define <8 x i8> @v_movi8() nounwind {
5 ;CHECK: vmov.i8 d{{.*}}, #0x8
6 ret <8 x i8> < i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8 >
9 define <4 x i16> @v_movi16a() nounwind {
11 ;CHECK: vmov.i16 d{{.*}}, #0x10
12 ret <4 x i16> < i16 16, i16 16, i16 16, i16 16 >
15 define <4 x i16> @v_movi16b() nounwind {
17 ;CHECK: vmov.i16 d{{.*}}, #0x1000
18 ret <4 x i16> < i16 4096, i16 4096, i16 4096, i16 4096 >
21 define <4 x i16> @v_mvni16a() nounwind {
23 ;CHECK: vmvn.i16 d{{.*}}, #0x10
24 ret <4 x i16> < i16 65519, i16 65519, i16 65519, i16 65519 >
27 define <4 x i16> @v_mvni16b() nounwind {
29 ;CHECK: vmvn.i16 d{{.*}}, #0x1000
30 ret <4 x i16> < i16 61439, i16 61439, i16 61439, i16 61439 >
33 define <2 x i32> @v_movi32a() nounwind {
35 ;CHECK: vmov.i32 d{{.*}}, #0x20
36 ret <2 x i32> < i32 32, i32 32 >
39 define <2 x i32> @v_movi32b() nounwind {
41 ;CHECK: vmov.i32 d{{.*}}, #0x2000
42 ret <2 x i32> < i32 8192, i32 8192 >
45 define <2 x i32> @v_movi32c() nounwind {
47 ;CHECK: vmov.i32 d{{.*}}, #0x200000
48 ret <2 x i32> < i32 2097152, i32 2097152 >
51 define <2 x i32> @v_movi32d() nounwind {
53 ;CHECK: vmov.i32 d{{.*}}, #0x20000000
54 ret <2 x i32> < i32 536870912, i32 536870912 >
57 define <2 x i32> @v_movi32e() nounwind {
59 ;CHECK: vmov.i32 d{{.*}}, #0x20FF
60 ret <2 x i32> < i32 8447, i32 8447 >
63 define <2 x i32> @v_movi32f() nounwind {
65 ;CHECK: vmov.i32 d{{.*}}, #0x20FFFF
66 ret <2 x i32> < i32 2162687, i32 2162687 >
69 define <2 x i32> @v_mvni32a() nounwind {
71 ;CHECK: vmvn.i32 d{{.*}}, #0x20
72 ret <2 x i32> < i32 4294967263, i32 4294967263 >
75 define <2 x i32> @v_mvni32b() nounwind {
77 ;CHECK: vmvn.i32 d{{.*}}, #0x2000
78 ret <2 x i32> < i32 4294959103, i32 4294959103 >
81 define <2 x i32> @v_mvni32c() nounwind {
83 ;CHECK: vmvn.i32 d{{.*}}, #0x200000
84 ret <2 x i32> < i32 4292870143, i32 4292870143 >
87 define <2 x i32> @v_mvni32d() nounwind {
89 ;CHECK: vmvn.i32 d{{.*}}, #0x20000000
90 ret <2 x i32> < i32 3758096383, i32 3758096383 >
93 define <2 x i32> @v_mvni32e() nounwind {
95 ;CHECK: vmvn.i32 d{{.*}}, #0x20FF
96 ret <2 x i32> < i32 4294958848, i32 4294958848 >
99 define <2 x i32> @v_mvni32f() nounwind {
101 ;CHECK: vmvn.i32 d{{.*}}, #0x20FFFF
102 ret <2 x i32> < i32 4292804608, i32 4292804608 >
105 define <1 x i64> @v_movi64() nounwind {
107 ;CHECK: vmov.i64 d{{.*}}, #0xFF0000FF0000FFFF
108 ret <1 x i64> < i64 18374687574888349695 >
111 define <16 x i8> @v_movQi8() nounwind {
113 ;CHECK: vmov.i8 q{{.*}}, #0x8
114 ret <16 x i8> < i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8 >
117 define <8 x i16> @v_movQi16a() nounwind {
119 ;CHECK: vmov.i16 q{{.*}}, #0x10
120 ret <8 x i16> < i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16 >
123 define <8 x i16> @v_movQi16b() nounwind {
125 ;CHECK: vmov.i16 q{{.*}}, #0x1000
126 ret <8 x i16> < i16 4096, i16 4096, i16 4096, i16 4096, i16 4096, i16 4096, i16 4096, i16 4096 >
129 define <4 x i32> @v_movQi32a() nounwind {
131 ;CHECK: vmov.i32 q{{.*}}, #0x20
132 ret <4 x i32> < i32 32, i32 32, i32 32, i32 32 >
135 define <4 x i32> @v_movQi32b() nounwind {
137 ;CHECK: vmov.i32 q{{.*}}, #0x2000
138 ret <4 x i32> < i32 8192, i32 8192, i32 8192, i32 8192 >
141 define <4 x i32> @v_movQi32c() nounwind {
143 ;CHECK: vmov.i32 q{{.*}}, #0x200000
144 ret <4 x i32> < i32 2097152, i32 2097152, i32 2097152, i32 2097152 >
147 define <4 x i32> @v_movQi32d() nounwind {
149 ;CHECK: vmov.i32 q{{.*}}, #0x20000000
150 ret <4 x i32> < i32 536870912, i32 536870912, i32 536870912, i32 536870912 >
153 define <4 x i32> @v_movQi32e() nounwind {
155 ;CHECK: vmov.i32 q{{.*}}, #0x20FF
156 ret <4 x i32> < i32 8447, i32 8447, i32 8447, i32 8447 >
159 define <4 x i32> @v_movQi32f() nounwind {
161 ;CHECK: vmov.i32 q{{.*}}, #0x20FFFF
162 ret <4 x i32> < i32 2162687, i32 2162687, i32 2162687, i32 2162687 >
165 define <2 x i64> @v_movQi64() nounwind {
167 ;CHECK: vmov.i64 q{{.*}}, #0xFF0000FF0000FFFF
168 ret <2 x i64> < i64 18374687574888349695, i64 18374687574888349695 >
171 ; Check for correct assembler printing for immediate values.
172 %struct.int8x8_t = type { <8 x i8> }
173 define void @vdupn128(%struct.int8x8_t* noalias nocapture sret %agg.result) nounwind {
176 ;CHECK: vmov.i8 d{{.*}}, #0x80
177 %0 = getelementptr inbounds %struct.int8x8_t* %agg.result, i32 0, i32 0 ; <<8 x i8>*> [#uses=1]
178 store <8 x i8> <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>, <8 x i8>* %0, align 8
182 define void @vdupnneg75(%struct.int8x8_t* noalias nocapture sret %agg.result) nounwind {
185 ;CHECK: vmov.i8 d{{.*}}, #0xB5
186 %0 = getelementptr inbounds %struct.int8x8_t* %agg.result, i32 0, i32 0 ; <<8 x i8>*> [#uses=1]
187 store <8 x i8> <i8 -75, i8 -75, i8 -75, i8 -75, i8 -75, i8 -75, i8 -75, i8 -75>, <8 x i8>* %0, align 8
191 define <8 x i16> @vmovls8(<8 x i8>* %A) nounwind {
194 %tmp1 = load <8 x i8>* %A
195 %tmp2 = sext <8 x i8> %tmp1 to <8 x i16>
199 define <4 x i32> @vmovls16(<4 x i16>* %A) nounwind {
202 %tmp1 = load <4 x i16>* %A
203 %tmp2 = sext <4 x i16> %tmp1 to <4 x i32>
207 define <2 x i64> @vmovls32(<2 x i32>* %A) nounwind {
210 %tmp1 = load <2 x i32>* %A
211 %tmp2 = sext <2 x i32> %tmp1 to <2 x i64>
215 define <8 x i16> @vmovlu8(<8 x i8>* %A) nounwind {
218 %tmp1 = load <8 x i8>* %A
219 %tmp2 = zext <8 x i8> %tmp1 to <8 x i16>
223 define <4 x i32> @vmovlu16(<4 x i16>* %A) nounwind {
226 %tmp1 = load <4 x i16>* %A
227 %tmp2 = zext <4 x i16> %tmp1 to <4 x i32>
231 define <2 x i64> @vmovlu32(<2 x i32>* %A) nounwind {
234 %tmp1 = load <2 x i32>* %A
235 %tmp2 = zext <2 x i32> %tmp1 to <2 x i64>
239 define <8 x i8> @vmovni16(<8 x i16>* %A) nounwind {
242 %tmp1 = load <8 x i16>* %A
243 %tmp2 = trunc <8 x i16> %tmp1 to <8 x i8>
247 define <4 x i16> @vmovni32(<4 x i32>* %A) nounwind {
250 %tmp1 = load <4 x i32>* %A
251 %tmp2 = trunc <4 x i32> %tmp1 to <4 x i16>
255 define <2 x i32> @vmovni64(<2 x i64>* %A) nounwind {
258 %tmp1 = load <2 x i64>* %A
259 %tmp2 = trunc <2 x i64> %tmp1 to <2 x i32>
263 define <8 x i8> @vqmovns16(<8 x i16>* %A) nounwind {
266 %tmp1 = load <8 x i16>* %A
267 %tmp2 = call <8 x i8> @llvm.arm.neon.vqmovns.v8i8(<8 x i16> %tmp1)
271 define <4 x i16> @vqmovns32(<4 x i32>* %A) nounwind {
274 %tmp1 = load <4 x i32>* %A
275 %tmp2 = call <4 x i16> @llvm.arm.neon.vqmovns.v4i16(<4 x i32> %tmp1)
279 define <2 x i32> @vqmovns64(<2 x i64>* %A) nounwind {
282 %tmp1 = load <2 x i64>* %A
283 %tmp2 = call <2 x i32> @llvm.arm.neon.vqmovns.v2i32(<2 x i64> %tmp1)
287 define <8 x i8> @vqmovnu16(<8 x i16>* %A) nounwind {
290 %tmp1 = load <8 x i16>* %A
291 %tmp2 = call <8 x i8> @llvm.arm.neon.vqmovnu.v8i8(<8 x i16> %tmp1)
295 define <4 x i16> @vqmovnu32(<4 x i32>* %A) nounwind {
298 %tmp1 = load <4 x i32>* %A
299 %tmp2 = call <4 x i16> @llvm.arm.neon.vqmovnu.v4i16(<4 x i32> %tmp1)
303 define <2 x i32> @vqmovnu64(<2 x i64>* %A) nounwind {
306 %tmp1 = load <2 x i64>* %A
307 %tmp2 = call <2 x i32> @llvm.arm.neon.vqmovnu.v2i32(<2 x i64> %tmp1)
311 define <8 x i8> @vqmovuns16(<8 x i16>* %A) nounwind {
314 %tmp1 = load <8 x i16>* %A
315 %tmp2 = call <8 x i8> @llvm.arm.neon.vqmovnsu.v8i8(<8 x i16> %tmp1)
319 define <4 x i16> @vqmovuns32(<4 x i32>* %A) nounwind {
322 %tmp1 = load <4 x i32>* %A
323 %tmp2 = call <4 x i16> @llvm.arm.neon.vqmovnsu.v4i16(<4 x i32> %tmp1)
327 define <2 x i32> @vqmovuns64(<2 x i64>* %A) nounwind {
330 %tmp1 = load <2 x i64>* %A
331 %tmp2 = call <2 x i32> @llvm.arm.neon.vqmovnsu.v2i32(<2 x i64> %tmp1)
335 declare <8 x i8> @llvm.arm.neon.vqmovns.v8i8(<8 x i16>) nounwind readnone
336 declare <4 x i16> @llvm.arm.neon.vqmovns.v4i16(<4 x i32>) nounwind readnone
337 declare <2 x i32> @llvm.arm.neon.vqmovns.v2i32(<2 x i64>) nounwind readnone
339 declare <8 x i8> @llvm.arm.neon.vqmovnu.v8i8(<8 x i16>) nounwind readnone
340 declare <4 x i16> @llvm.arm.neon.vqmovnu.v4i16(<4 x i32>) nounwind readnone
341 declare <2 x i32> @llvm.arm.neon.vqmovnu.v2i32(<2 x i64>) nounwind readnone
343 declare <8 x i8> @llvm.arm.neon.vqmovnsu.v8i8(<8 x i16>) nounwind readnone
344 declare <4 x i16> @llvm.arm.neon.vqmovnsu.v4i16(<4 x i32>) nounwind readnone
345 declare <2 x i32> @llvm.arm.neon.vqmovnsu.v2i32(<2 x i64>) nounwind readnone
347 ; Truncating vector stores are not supported. The following should not crash.
349 define void @noTruncStore(<4 x i32>* %a, <4 x i16>* %b) nounwind {
351 %tmp1 = load <4 x i32>* %a, align 16
352 %tmp2 = trunc <4 x i32> %tmp1 to <4 x i16>
353 store <4 x i16> %tmp2, <4 x i16>* %b, align 8