1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=thumbv8.1m.main-arm-none-eabi -O0 -mattr=+mve %s -o - | FileCheck %s
4 declare void @external_function()
6 define arm_aapcs_vfpcc void @spill_vector_i32(<4 x i32> %v, <4 x i32>* %p) {
7 ; CHECK-LABEL: spill_vector_i32:
8 ; CHECK: @ %bb.0: @ %entry
9 ; CHECK-NEXT: .save {r7, lr}
10 ; CHECK-NEXT: push {r7, lr}
11 ; CHECK-NEXT: .pad #40
12 ; CHECK-NEXT: sub sp, #40
13 ; CHECK-NEXT: vmov q1, q0
14 ; CHECK-NEXT: str r0, [sp, #36] @ 4-byte Spill
15 ; CHECK-NEXT: vstrw.32 q0, [sp, #16] @ 16-byte Spill
16 ; CHECK-NEXT: vstrw.32 q1, [sp] @ 16-byte Spill
17 ; CHECK-NEXT: bl external_function
18 ; CHECK-NEXT: vldrw.u32 q0, [sp, #16] @ 16-byte Reload
19 ; CHECK-NEXT: ldr r0, [sp, #36] @ 4-byte Reload
20 ; CHECK-NEXT: vstrw.32 q0, [r0]
21 ; CHECK-NEXT: add sp, #40
22 ; CHECK-NEXT: pop {r7, pc}
24 call void @external_function()
25 store <4 x i32> %v, <4 x i32>* %p, align 4
29 define arm_aapcs_vfpcc void @spill_vector_i16(<8 x i16> %v, <8 x i16>* %p) {
30 ; CHECK-LABEL: spill_vector_i16:
31 ; CHECK: @ %bb.0: @ %entry
32 ; CHECK-NEXT: .save {r7, lr}
33 ; CHECK-NEXT: push {r7, lr}
34 ; CHECK-NEXT: .pad #40
35 ; CHECK-NEXT: sub sp, #40
36 ; CHECK-NEXT: vmov q1, q0
37 ; CHECK-NEXT: str r0, [sp, #36] @ 4-byte Spill
38 ; CHECK-NEXT: vstrw.32 q0, [sp, #16] @ 16-byte Spill
39 ; CHECK-NEXT: vstrw.32 q1, [sp] @ 16-byte Spill
40 ; CHECK-NEXT: bl external_function
41 ; CHECK-NEXT: vldrw.u32 q0, [sp, #16] @ 16-byte Reload
42 ; CHECK-NEXT: ldr r0, [sp, #36] @ 4-byte Reload
43 ; CHECK-NEXT: vstrh.16 q0, [r0]
44 ; CHECK-NEXT: add sp, #40
45 ; CHECK-NEXT: pop {r7, pc}
47 call void @external_function()
48 store <8 x i16> %v, <8 x i16>* %p, align 2
52 define arm_aapcs_vfpcc void @spill_vector_i8(<16 x i8> %v, <16 x i8>* %p) {
53 ; CHECK-LABEL: spill_vector_i8:
54 ; CHECK: @ %bb.0: @ %entry
55 ; CHECK-NEXT: .save {r7, lr}
56 ; CHECK-NEXT: push {r7, lr}
57 ; CHECK-NEXT: .pad #40
58 ; CHECK-NEXT: sub sp, #40
59 ; CHECK-NEXT: vmov q1, q0
60 ; CHECK-NEXT: str r0, [sp, #36] @ 4-byte Spill
61 ; CHECK-NEXT: vstrw.32 q0, [sp, #16] @ 16-byte Spill
62 ; CHECK-NEXT: vstrw.32 q1, [sp] @ 16-byte Spill
63 ; CHECK-NEXT: bl external_function
64 ; CHECK-NEXT: vldrw.u32 q0, [sp, #16] @ 16-byte Reload
65 ; CHECK-NEXT: ldr r0, [sp, #36] @ 4-byte Reload
66 ; CHECK-NEXT: vstrb.8 q0, [r0]
67 ; CHECK-NEXT: add sp, #40
68 ; CHECK-NEXT: pop {r7, pc}
70 call void @external_function()
71 store <16 x i8> %v, <16 x i8>* %p, align 1
75 define arm_aapcs_vfpcc void @spill_vector_i64(<2 x i64> %v, <2 x i64>* %p) {
76 ; CHECK-LABEL: spill_vector_i64:
77 ; CHECK: @ %bb.0: @ %entry
78 ; CHECK-NEXT: .save {r7, lr}
79 ; CHECK-NEXT: push {r7, lr}
80 ; CHECK-NEXT: .pad #40
81 ; CHECK-NEXT: sub sp, #40
82 ; CHECK-NEXT: vmov q1, q0
83 ; CHECK-NEXT: str r0, [sp, #36] @ 4-byte Spill
84 ; CHECK-NEXT: vstrw.32 q0, [sp, #16] @ 16-byte Spill
85 ; CHECK-NEXT: vstrw.32 q1, [sp] @ 16-byte Spill
86 ; CHECK-NEXT: bl external_function
87 ; CHECK-NEXT: vldrw.u32 q0, [sp, #16] @ 16-byte Reload
88 ; CHECK-NEXT: ldr r0, [sp, #36] @ 4-byte Reload
89 ; CHECK-NEXT: vstrw.32 q0, [r0]
90 ; CHECK-NEXT: add sp, #40
91 ; CHECK-NEXT: pop {r7, pc}
93 call void @external_function()
94 store <2 x i64> %v, <2 x i64>* %p, align 8
98 define arm_aapcs_vfpcc void @spill_vector_f32(<4 x float> %v, <4 x float>* %p) {
99 ; CHECK-LABEL: spill_vector_f32:
100 ; CHECK: @ %bb.0: @ %entry
101 ; CHECK-NEXT: .save {r7, lr}
102 ; CHECK-NEXT: push {r7, lr}
103 ; CHECK-NEXT: .pad #40
104 ; CHECK-NEXT: sub sp, #40
105 ; CHECK-NEXT: vmov q1, q0
106 ; CHECK-NEXT: str r0, [sp, #36] @ 4-byte Spill
107 ; CHECK-NEXT: vstrw.32 q0, [sp, #16] @ 16-byte Spill
108 ; CHECK-NEXT: vstrw.32 q1, [sp] @ 16-byte Spill
109 ; CHECK-NEXT: bl external_function
110 ; CHECK-NEXT: vldrw.u32 q0, [sp, #16] @ 16-byte Reload
111 ; CHECK-NEXT: ldr r0, [sp, #36] @ 4-byte Reload
112 ; CHECK-NEXT: vstrw.32 q0, [r0]
113 ; CHECK-NEXT: add sp, #40
114 ; CHECK-NEXT: pop {r7, pc}
116 call void @external_function()
117 store <4 x float> %v, <4 x float>* %p, align 8
121 define arm_aapcs_vfpcc void @spill_vector_f16(<8 x half> %v, <8 x half>* %p) {
122 ; CHECK-LABEL: spill_vector_f16:
123 ; CHECK: @ %bb.0: @ %entry
124 ; CHECK-NEXT: .save {r7, lr}
125 ; CHECK-NEXT: push {r7, lr}
126 ; CHECK-NEXT: .pad #40
127 ; CHECK-NEXT: sub sp, #40
128 ; CHECK-NEXT: vmov q1, q0
129 ; CHECK-NEXT: str r0, [sp, #36] @ 4-byte Spill
130 ; CHECK-NEXT: vstrw.32 q0, [sp, #16] @ 16-byte Spill
131 ; CHECK-NEXT: vstrw.32 q1, [sp] @ 16-byte Spill
132 ; CHECK-NEXT: bl external_function
133 ; CHECK-NEXT: vldrw.u32 q0, [sp, #16] @ 16-byte Reload
134 ; CHECK-NEXT: ldr r0, [sp, #36] @ 4-byte Reload
135 ; CHECK-NEXT: vstrw.32 q0, [r0]
136 ; CHECK-NEXT: add sp, #40
137 ; CHECK-NEXT: pop {r7, pc}
139 call void @external_function()
140 store <8 x half> %v, <8 x half>* %p, align 8
144 define arm_aapcs_vfpcc void @spill_vector_f64(<2 x double> %v, <2 x double>* %p) {
145 ; CHECK-LABEL: spill_vector_f64:
146 ; CHECK: @ %bb.0: @ %entry
147 ; CHECK-NEXT: .save {r7, lr}
148 ; CHECK-NEXT: push {r7, lr}
149 ; CHECK-NEXT: .pad #24
150 ; CHECK-NEXT: sub sp, #24
151 ; CHECK-NEXT: str r0, [sp, #20] @ 4-byte Spill
152 ; CHECK-NEXT: vstrw.32 q0, [sp] @ 16-byte Spill
153 ; CHECK-NEXT: bl external_function
154 ; CHECK-NEXT: vldrw.u32 q0, [sp] @ 16-byte Reload
155 ; CHECK-NEXT: ldr r0, [sp, #20] @ 4-byte Reload
156 ; CHECK-NEXT: vstrw.32 q0, [r0]
157 ; CHECK-NEXT: add sp, #24
158 ; CHECK-NEXT: pop {r7, pc}
160 call void @external_function()
161 store <2 x double> %v, <2 x double>* %p, align 8