1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=thumbv8.1m.main-arm-none-eabi -mattr=+mve -verify-machineinstrs %s -o - | FileCheck %s
4 define arm_aapcs_vfpcc void @vstrw32() {
5 ; CHECK-LABEL: vstrw32:
6 ; CHECK: @ %bb.0: @ %entry
7 ; CHECK-NEXT: .save {r7, lr}
8 ; CHECK-NEXT: push {r7, lr}
10 ; CHECK-NEXT: sub sp, #16
11 ; CHECK-NEXT: vmov.i32 q0, #0x0
12 ; CHECK-NEXT: mov r0, sp
13 ; CHECK-NEXT: vstrw.32 q0, [sp, #8]
15 ; CHECK-NEXT: add sp, #16
16 ; CHECK-NEXT: pop {r7, pc}
18 %d = alloca [4 x i32], align 2
19 %g = getelementptr inbounds [4 x i32], [4 x i32]* %d, i32 0, i32 2
20 %b = bitcast i32* %g to <4 x i32>*
21 store <4 x i32> zeroinitializer, <4 x i32>* %b, align 2
22 %arraydecay = getelementptr inbounds [4 x i32], [4 x i32]* %d, i32 0, i32 0
23 call arm_aapcs_vfpcc void bitcast (void (...)* @func to void (i32*)*)(i32* %arraydecay)
27 define arm_aapcs_vfpcc void @vstrh16() {
28 ; CHECK-LABEL: vstrh16:
29 ; CHECK: @ %bb.0: @ %entry
30 ; CHECK-NEXT: .save {r7, lr}
31 ; CHECK-NEXT: push {r7, lr}
32 ; CHECK-NEXT: .pad #16
33 ; CHECK-NEXT: sub sp, #16
34 ; CHECK-NEXT: vmov.i32 q0, #0x0
35 ; CHECK-NEXT: mov r0, sp
36 ; CHECK-NEXT: vstrh.16 q0, [sp, #4]
38 ; CHECK-NEXT: add sp, #16
39 ; CHECK-NEXT: pop {r7, pc}
41 %d = alloca [8 x i16], align 2
42 %g = getelementptr inbounds [8 x i16], [8 x i16]* %d, i32 0, i32 2
43 %b = bitcast i16* %g to <8 x i16>*
44 store <8 x i16> zeroinitializer, <8 x i16>* %b, align 2
45 %arraydecay = getelementptr inbounds [8 x i16], [8 x i16]* %d, i32 0, i32 0
46 call arm_aapcs_vfpcc void bitcast (void (...)* @func to void (i16*)*)(i16* %arraydecay)
50 define arm_aapcs_vfpcc void @vstrb8() {
51 ; CHECK-LABEL: vstrb8:
52 ; CHECK: @ %bb.0: @ %entry
53 ; CHECK-NEXT: .save {r7, lr}
54 ; CHECK-NEXT: push {r7, lr}
55 ; CHECK-NEXT: .pad #16
56 ; CHECK-NEXT: sub sp, #16
57 ; CHECK-NEXT: vmov.i32 q0, #0x0
58 ; CHECK-NEXT: mov r0, sp
59 ; CHECK-NEXT: vstrh.16 q0, [sp, #2]
61 ; CHECK-NEXT: add sp, #16
62 ; CHECK-NEXT: pop {r7, pc}
64 %d = alloca [16 x i8], align 2
65 %g = getelementptr inbounds [16 x i8], [16 x i8]* %d, i32 0, i32 2
66 %b = bitcast i8* %g to <16 x i8>*
67 store <16 x i8> zeroinitializer, <16 x i8>* %b, align 2
68 %arraydecay = getelementptr inbounds [16 x i8], [16 x i8]* %d, i32 0, i32 0
69 call arm_aapcs_vfpcc void bitcast (void (...)* @func to void (i8*)*)(i8* %arraydecay)
73 define arm_aapcs_vfpcc void @vstrh32() {
74 ; CHECK-LABEL: vstrh32:
75 ; CHECK: @ %bb.0: @ %entry
76 ; CHECK-NEXT: .save {r7, lr}
77 ; CHECK-NEXT: push {r7, lr}
79 ; CHECK-NEXT: sub sp, #8
80 ; CHECK-NEXT: mov r0, sp
81 ; CHECK-NEXT: vmov.i32 q0, #0x6
82 ; CHECK-NEXT: vstrh.32 q0, [r0, #4]
84 ; CHECK-NEXT: add sp, #8
85 ; CHECK-NEXT: pop {r7, pc}
87 %d = alloca [4 x i16], align 2
88 %g = getelementptr inbounds [4 x i16], [4 x i16]* %d, i32 0, i32 2
89 %b = bitcast i16* %g to <4 x i16>*
90 store <4 x i16> <i16 6, i16 6, i16 6, i16 6>, <4 x i16>* %b, align 2
91 %arraydecay = getelementptr inbounds [4 x i16], [4 x i16]* %d, i32 0, i32 0
92 call arm_aapcs_vfpcc void bitcast (void (...)* @func to void (i16*)*)(i16* %arraydecay)
96 define arm_aapcs_vfpcc void @vstrb32() {
97 ; CHECK-LABEL: vstrb32:
98 ; CHECK: @ %bb.0: @ %entry
99 ; CHECK-NEXT: .save {r7, lr}
100 ; CHECK-NEXT: push {r7, lr}
101 ; CHECK-NEXT: .pad #8
102 ; CHECK-NEXT: sub sp, #8
103 ; CHECK-NEXT: add r0, sp, #4
104 ; CHECK-NEXT: vmov.i32 q0, #0x6
105 ; CHECK-NEXT: vstrb.32 q0, [r0, #2]
106 ; CHECK-NEXT: bl func
107 ; CHECK-NEXT: add sp, #8
108 ; CHECK-NEXT: pop {r7, pc}
110 %d = alloca [4 x i8], align 2
111 %g = getelementptr inbounds [4 x i8], [4 x i8]* %d, i32 0, i32 2
112 %b = bitcast i8* %g to <4 x i8>*
113 store <4 x i8> <i8 6, i8 6, i8 6, i8 6>, <4 x i8>* %b, align 2
114 %arraydecay = getelementptr inbounds [4 x i8], [4 x i8]* %d, i32 0, i32 0
115 call arm_aapcs_vfpcc void bitcast (void (...)* @func to void (i8*)*)(i8* %arraydecay)
119 define arm_aapcs_vfpcc void @vstrb16() {
120 ; CHECK-LABEL: vstrb16:
121 ; CHECK: @ %bb.0: @ %entry
122 ; CHECK-NEXT: .save {r7, lr}
123 ; CHECK-NEXT: push {r7, lr}
124 ; CHECK-NEXT: .pad #8
125 ; CHECK-NEXT: sub sp, #8
126 ; CHECK-NEXT: mov r0, sp
127 ; CHECK-NEXT: vmov.i32 q0, #0x0
128 ; CHECK-NEXT: vstrb.16 q0, [r0, #2]
129 ; CHECK-NEXT: bl func
130 ; CHECK-NEXT: add sp, #8
131 ; CHECK-NEXT: pop {r7, pc}
133 %d = alloca [8 x i8], align 2
134 %g = getelementptr inbounds [8 x i8], [8 x i8]* %d, i32 0, i32 2
135 %b = bitcast i8* %g to <8 x i8>*
136 store <8 x i8> zeroinitializer, <8 x i8>* %b, align 2
137 %arraydecay = getelementptr inbounds [8 x i8], [8 x i8]* %d, i32 0, i32 0
138 call arm_aapcs_vfpcc void bitcast (void (...)* @func to void (i8*)*)(i8* %arraydecay)
143 define arm_aapcs_vfpcc <4 x i32> @vldrw32() {
144 ; CHECK-LABEL: vldrw32:
145 ; CHECK: @ %bb.0: @ %entry
146 ; CHECK-NEXT: .save {r7, lr}
147 ; CHECK-NEXT: push {r7, lr}
148 ; CHECK-NEXT: .pad #16
149 ; CHECK-NEXT: sub sp, #16
150 ; CHECK-NEXT: mov r0, sp
151 ; CHECK-NEXT: bl func
152 ; CHECK-NEXT: vldrw.u32 q0, [sp, #8]
153 ; CHECK-NEXT: add sp, #16
154 ; CHECK-NEXT: pop {r7, pc}
156 %d = alloca [4 x i32], align 2
157 %arraydecay = getelementptr inbounds [4 x i32], [4 x i32]* %d, i32 0, i32 0
158 call arm_aapcs_vfpcc void bitcast (void (...)* @func to void (i32*)*)(i32* %arraydecay)
159 %g = getelementptr inbounds [4 x i32], [4 x i32]* %d, i32 0, i32 2
160 %b = bitcast i32* %g to <4 x i32>*
161 %l = load <4 x i32>, <4 x i32>* %b, align 2
165 define arm_aapcs_vfpcc <8 x i16> @vldrh16() {
166 ; CHECK-LABEL: vldrh16:
167 ; CHECK: @ %bb.0: @ %entry
168 ; CHECK-NEXT: .save {r7, lr}
169 ; CHECK-NEXT: push {r7, lr}
170 ; CHECK-NEXT: .pad #16
171 ; CHECK-NEXT: sub sp, #16
172 ; CHECK-NEXT: mov r0, sp
173 ; CHECK-NEXT: bl func
174 ; CHECK-NEXT: vldrh.u16 q0, [sp, #4]
175 ; CHECK-NEXT: add sp, #16
176 ; CHECK-NEXT: pop {r7, pc}
178 %d = alloca [8 x i16], align 2
179 %arraydecay = getelementptr inbounds [8 x i16], [8 x i16]* %d, i32 0, i32 0
180 call arm_aapcs_vfpcc void bitcast (void (...)* @func to void (i16*)*)(i16* %arraydecay)
181 %g = getelementptr inbounds [8 x i16], [8 x i16]* %d, i32 0, i32 2
182 %b = bitcast i16* %g to <8 x i16>*
183 %l = load <8 x i16>, <8 x i16>* %b, align 2
187 define arm_aapcs_vfpcc <16 x i8> @vldrb8() {
188 ; CHECK-LABEL: vldrb8:
189 ; CHECK: @ %bb.0: @ %entry
190 ; CHECK-NEXT: .save {r7, lr}
191 ; CHECK-NEXT: push {r7, lr}
192 ; CHECK-NEXT: .pad #16
193 ; CHECK-NEXT: sub sp, #16
194 ; CHECK-NEXT: mov r0, sp
195 ; CHECK-NEXT: bl func
196 ; CHECK-NEXT: vldrh.u16 q0, [sp, #2]
197 ; CHECK-NEXT: add sp, #16
198 ; CHECK-NEXT: pop {r7, pc}
200 %d = alloca [16 x i8], align 2
201 %arraydecay = getelementptr inbounds [16 x i8], [16 x i8]* %d, i32 0, i32 0
202 call arm_aapcs_vfpcc void bitcast (void (...)* @func to void (i8*)*)(i8* %arraydecay)
203 %g = getelementptr inbounds [16 x i8], [16 x i8]* %d, i32 0, i32 2
204 %b = bitcast i8* %g to <16 x i8>*
205 %l = load <16 x i8>, <16 x i8>* %b, align 2
209 define arm_aapcs_vfpcc <4 x i16> @vldrh32() {
210 ; CHECK-LABEL: vldrh32:
211 ; CHECK: @ %bb.0: @ %entry
212 ; CHECK-NEXT: .save {r4, lr}
213 ; CHECK-NEXT: push {r4, lr}
214 ; CHECK-NEXT: .pad #8
215 ; CHECK-NEXT: sub sp, #8
216 ; CHECK-NEXT: mov r4, sp
217 ; CHECK-NEXT: mov r0, r4
218 ; CHECK-NEXT: bl func
219 ; CHECK-NEXT: vldrh.u32 q0, [r4, #4]
220 ; CHECK-NEXT: add sp, #8
221 ; CHECK-NEXT: pop {r4, pc}
223 %d = alloca [4 x i16], align 2
224 %arraydecay = getelementptr inbounds [4 x i16], [4 x i16]* %d, i32 0, i32 0
225 call arm_aapcs_vfpcc void bitcast (void (...)* @func to void (i16*)*)(i16* %arraydecay)
226 %g = getelementptr inbounds [4 x i16], [4 x i16]* %d, i32 0, i32 2
227 %b = bitcast i16* %g to <4 x i16>*
228 %l = load <4 x i16>, <4 x i16>* %b, align 2
232 define arm_aapcs_vfpcc <4 x i8> @vldrb32() {
233 ; CHECK-LABEL: vldrb32:
234 ; CHECK: @ %bb.0: @ %entry
235 ; CHECK-NEXT: .save {r4, lr}
236 ; CHECK-NEXT: push {r4, lr}
237 ; CHECK-NEXT: .pad #8
238 ; CHECK-NEXT: sub sp, #8
239 ; CHECK-NEXT: add r4, sp, #4
240 ; CHECK-NEXT: mov r0, r4
241 ; CHECK-NEXT: bl func
242 ; CHECK-NEXT: vldrb.u32 q0, [r4, #2]
243 ; CHECK-NEXT: add sp, #8
244 ; CHECK-NEXT: pop {r4, pc}
246 %d = alloca [4 x i8], align 2
247 %arraydecay = getelementptr inbounds [4 x i8], [4 x i8]* %d, i32 0, i32 0
248 call arm_aapcs_vfpcc void bitcast (void (...)* @func to void (i8*)*)(i8* %arraydecay)
249 %g = getelementptr inbounds [4 x i8], [4 x i8]* %d, i32 0, i32 2
250 %b = bitcast i8* %g to <4 x i8>*
251 %l = load <4 x i8>, <4 x i8>* %b, align 2
255 define arm_aapcs_vfpcc <8 x i8> @vldrb16() {
256 ; CHECK-LABEL: vldrb16:
257 ; CHECK: @ %bb.0: @ %entry
258 ; CHECK-NEXT: .save {r4, lr}
259 ; CHECK-NEXT: push {r4, lr}
260 ; CHECK-NEXT: .pad #8
261 ; CHECK-NEXT: sub sp, #8
262 ; CHECK-NEXT: mov r4, sp
263 ; CHECK-NEXT: mov r0, r4
264 ; CHECK-NEXT: bl func
265 ; CHECK-NEXT: vldrb.u16 q0, [r4, #2]
266 ; CHECK-NEXT: add sp, #8
267 ; CHECK-NEXT: pop {r4, pc}
269 %d = alloca [8 x i8], align 2
270 %arraydecay = getelementptr inbounds [8 x i8], [8 x i8]* %d, i32 0, i32 0
271 call arm_aapcs_vfpcc void bitcast (void (...)* @func to void (i8*)*)(i8* %arraydecay)
272 %g = getelementptr inbounds [8 x i8], [8 x i8]* %d, i32 0, i32 2
273 %b = bitcast i8* %g to <8 x i8>*
274 %l = load <8 x i8>, <8 x i8>* %b, align 2
278 declare dso_local arm_aapcs_vfpcc void @func(...)