1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=thumbv8.1m.main-none-none-eabi -mattr=+mve.fp,+fp64 -mve-max-interleave-factor=4 -verify-machineinstrs %s -o - | FileCheck %s
6 define ptr @vld4_v4i32(ptr %src, ptr %dst) {
7 ; CHECK-LABEL: vld4_v4i32:
8 ; CHECK: @ %bb.0: @ %entry
9 ; CHECK-NEXT: vld40.32 {q0, q1, q2, q3}, [r0]
10 ; CHECK-NEXT: vld41.32 {q0, q1, q2, q3}, [r0]
11 ; CHECK-NEXT: vld42.32 {q0, q1, q2, q3}, [r0]
12 ; CHECK-NEXT: vld43.32 {q0, q1, q2, q3}, [r0]!
13 ; CHECK-NEXT: vadd.i32 q2, q2, q3
14 ; CHECK-NEXT: vadd.i32 q0, q0, q1
15 ; CHECK-NEXT: vadd.i32 q0, q0, q2
16 ; CHECK-NEXT: vstrw.32 q0, [r1]
19 %l1 = load <16 x i32>, ptr %src, align 4
20 %s1 = shufflevector <16 x i32> %l1, <16 x i32> undef, <4 x i32> <i32 0, i32 4, i32 8, i32 12>
21 %s2 = shufflevector <16 x i32> %l1, <16 x i32> undef, <4 x i32> <i32 1, i32 5, i32 9, i32 13>
22 %s3 = shufflevector <16 x i32> %l1, <16 x i32> undef, <4 x i32> <i32 2, i32 6, i32 10, i32 14>
23 %s4 = shufflevector <16 x i32> %l1, <16 x i32> undef, <4 x i32> <i32 3, i32 7, i32 11, i32 15>
24 %a1 = add <4 x i32> %s1, %s2
25 %a2 = add <4 x i32> %s3, %s4
26 %a3 = add <4 x i32> %a1, %a2
27 store <4 x i32> %a3, ptr %dst
28 %ret = getelementptr inbounds <16 x i32>, ptr %src, i32 1
34 define ptr @vld4_v8i16(ptr %src, ptr %dst) {
35 ; CHECK-LABEL: vld4_v8i16:
36 ; CHECK: @ %bb.0: @ %entry
37 ; CHECK-NEXT: vld40.16 {q0, q1, q2, q3}, [r0]
38 ; CHECK-NEXT: vld41.16 {q0, q1, q2, q3}, [r0]
39 ; CHECK-NEXT: vld42.16 {q0, q1, q2, q3}, [r0]
40 ; CHECK-NEXT: vld43.16 {q0, q1, q2, q3}, [r0]!
41 ; CHECK-NEXT: vadd.i16 q2, q2, q3
42 ; CHECK-NEXT: vadd.i16 q0, q0, q1
43 ; CHECK-NEXT: vadd.i16 q0, q0, q2
44 ; CHECK-NEXT: vstrw.32 q0, [r1]
47 %l1 = load <32 x i16>, ptr %src, align 4
48 %s1 = shufflevector <32 x i16> %l1, <32 x i16> undef, <8 x i32> <i32 0, i32 4, i32 8, i32 12, i32 16, i32 20, i32 24, i32 28>
49 %s2 = shufflevector <32 x i16> %l1, <32 x i16> undef, <8 x i32> <i32 1, i32 5, i32 9, i32 13, i32 17, i32 21, i32 25, i32 29>
50 %s3 = shufflevector <32 x i16> %l1, <32 x i16> undef, <8 x i32> <i32 2, i32 6, i32 10, i32 14, i32 18, i32 22, i32 26, i32 30>
51 %s4 = shufflevector <32 x i16> %l1, <32 x i16> undef, <8 x i32> <i32 3, i32 7, i32 11, i32 15, i32 19, i32 23, i32 27, i32 31>
52 %a1 = add <8 x i16> %s1, %s2
53 %a2 = add <8 x i16> %s3, %s4
54 %a3 = add <8 x i16> %a1, %a2
55 store <8 x i16> %a3, ptr %dst
56 %ret = getelementptr inbounds <32 x i16>, ptr %src, i32 1
62 define ptr @vld4_v16i8(ptr %src, ptr %dst) {
63 ; CHECK-LABEL: vld4_v16i8:
64 ; CHECK: @ %bb.0: @ %entry
65 ; CHECK-NEXT: vld40.8 {q0, q1, q2, q3}, [r0]
66 ; CHECK-NEXT: vld41.8 {q0, q1, q2, q3}, [r0]
67 ; CHECK-NEXT: vld42.8 {q0, q1, q2, q3}, [r0]
68 ; CHECK-NEXT: vld43.8 {q0, q1, q2, q3}, [r0]!
69 ; CHECK-NEXT: vadd.i8 q2, q2, q3
70 ; CHECK-NEXT: vadd.i8 q0, q0, q1
71 ; CHECK-NEXT: vadd.i8 q0, q0, q2
72 ; CHECK-NEXT: vstrw.32 q0, [r1]
75 %l1 = load <64 x i8>, ptr %src, align 4
76 %s1 = shufflevector <64 x i8> %l1, <64 x i8> undef, <16 x i32> <i32 0, i32 4, i32 8, i32 12, i32 16, i32 20, i32 24, i32 28, i32 32, i32 36, i32 40, i32 44, i32 48, i32 52, i32 56, i32 60>
77 %s2 = shufflevector <64 x i8> %l1, <64 x i8> undef, <16 x i32> <i32 1, i32 5, i32 9, i32 13, i32 17, i32 21, i32 25, i32 29, i32 33, i32 37, i32 41, i32 45, i32 49, i32 53, i32 57, i32 61>
78 %s3 = shufflevector <64 x i8> %l1, <64 x i8> undef, <16 x i32> <i32 2, i32 6, i32 10, i32 14, i32 18, i32 22, i32 26, i32 30, i32 34, i32 38, i32 42, i32 46, i32 50, i32 54, i32 58, i32 62>
79 %s4 = shufflevector <64 x i8> %l1, <64 x i8> undef, <16 x i32> <i32 3, i32 7, i32 11, i32 15, i32 19, i32 23, i32 27, i32 31, i32 35, i32 39, i32 43, i32 47, i32 51, i32 55, i32 59, i32 63>
80 %a1 = add <16 x i8> %s1, %s2
81 %a2 = add <16 x i8> %s3, %s4
82 %a3 = add <16 x i8> %a1, %a2
83 store <16 x i8> %a3, ptr %dst
84 %ret = getelementptr inbounds <64 x i8>, ptr %src, i32 1
90 define ptr @vld4_v2i64(ptr %src, ptr %dst) {
91 ; CHECK-LABEL: vld4_v2i64:
92 ; CHECK: @ %bb.0: @ %entry
93 ; CHECK-NEXT: .save {r4, r5, r6, r7, r8, lr}
94 ; CHECK-NEXT: push.w {r4, r5, r6, r7, r8, lr}
95 ; CHECK-NEXT: .vsave {d8, d9}
96 ; CHECK-NEXT: vpush {d8, d9}
97 ; CHECK-NEXT: vldrw.u32 q0, [r0, #16]
98 ; CHECK-NEXT: vldrw.u32 q2, [r0, #48]
99 ; CHECK-NEXT: vldrw.u32 q4, [r0, #32]
100 ; CHECK-NEXT: vmov.f32 s4, s2
101 ; CHECK-NEXT: vmov.f32 s5, s3
102 ; CHECK-NEXT: vmov.f32 s2, s8
103 ; CHECK-NEXT: vmov.f32 s3, s9
104 ; CHECK-NEXT: vmov lr, r12, d5
105 ; CHECK-NEXT: vldrw.u32 q2, [r0], #64
106 ; CHECK-NEXT: vmov r4, r8, d9
107 ; CHECK-NEXT: vmov.f32 s12, s10
108 ; CHECK-NEXT: vmov.f32 s13, s11
109 ; CHECK-NEXT: vmov r2, r7, d1
110 ; CHECK-NEXT: vmov.f32 s2, s16
111 ; CHECK-NEXT: vmov.f32 s3, s17
112 ; CHECK-NEXT: vmov r3, r6, d1
113 ; CHECK-NEXT: adds.w r2, r2, lr
114 ; CHECK-NEXT: adc.w r7, r7, r12
115 ; CHECK-NEXT: adds r3, r3, r4
116 ; CHECK-NEXT: vmov r4, r5, d2
117 ; CHECK-NEXT: adc.w r6, r6, r8
118 ; CHECK-NEXT: adds.w r12, r3, r2
119 ; CHECK-NEXT: vmov r3, r2, d0
120 ; CHECK-NEXT: adc.w lr, r6, r7
121 ; CHECK-NEXT: adds r3, r3, r4
122 ; CHECK-NEXT: vmov r6, r4, d6
123 ; CHECK-NEXT: adcs r2, r5
124 ; CHECK-NEXT: vmov r5, r7, d4
125 ; CHECK-NEXT: adds r5, r5, r6
126 ; CHECK-NEXT: adcs r4, r7
127 ; CHECK-NEXT: adds r3, r3, r5
128 ; CHECK-NEXT: adcs r2, r4
129 ; CHECK-NEXT: vmov q0[2], q0[0], r3, r12
130 ; CHECK-NEXT: vmov q0[3], q0[1], r2, lr
131 ; CHECK-NEXT: vstrw.32 q0, [r1]
132 ; CHECK-NEXT: vpop {d8, d9}
133 ; CHECK-NEXT: pop.w {r4, r5, r6, r7, r8, pc}
135 %l1 = load <8 x i64>, ptr %src, align 4
136 %s1 = shufflevector <8 x i64> %l1, <8 x i64> undef, <2 x i32> <i32 0, i32 4>
137 %s2 = shufflevector <8 x i64> %l1, <8 x i64> undef, <2 x i32> <i32 1, i32 5>
138 %s3 = shufflevector <8 x i64> %l1, <8 x i64> undef, <2 x i32> <i32 2, i32 6>
139 %s4 = shufflevector <8 x i64> %l1, <8 x i64> undef, <2 x i32> <i32 3, i32 7>
140 %a1 = add <2 x i64> %s1, %s2
141 %a2 = add <2 x i64> %s3, %s4
142 %a3 = add <2 x i64> %a1, %a2
143 store <2 x i64> %a3, ptr %dst
144 %ret = getelementptr inbounds <8 x i64>, ptr %src, i32 1
150 define ptr @vld4_v4f32(ptr %src, ptr %dst) {
151 ; CHECK-LABEL: vld4_v4f32:
152 ; CHECK: @ %bb.0: @ %entry
153 ; CHECK-NEXT: vld40.32 {q0, q1, q2, q3}, [r0]
154 ; CHECK-NEXT: vld41.32 {q0, q1, q2, q3}, [r0]
155 ; CHECK-NEXT: vld42.32 {q0, q1, q2, q3}, [r0]
156 ; CHECK-NEXT: vld43.32 {q0, q1, q2, q3}, [r0]!
157 ; CHECK-NEXT: vadd.f32 q2, q2, q3
158 ; CHECK-NEXT: vadd.f32 q0, q0, q1
159 ; CHECK-NEXT: vadd.f32 q0, q0, q2
160 ; CHECK-NEXT: vstrw.32 q0, [r1]
163 %l1 = load <16 x float>, ptr %src, align 4
164 %s1 = shufflevector <16 x float> %l1, <16 x float> undef, <4 x i32> <i32 0, i32 4, i32 8, i32 12>
165 %s2 = shufflevector <16 x float> %l1, <16 x float> undef, <4 x i32> <i32 1, i32 5, i32 9, i32 13>
166 %s3 = shufflevector <16 x float> %l1, <16 x float> undef, <4 x i32> <i32 2, i32 6, i32 10, i32 14>
167 %s4 = shufflevector <16 x float> %l1, <16 x float> undef, <4 x i32> <i32 3, i32 7, i32 11, i32 15>
168 %a1 = fadd <4 x float> %s1, %s2
169 %a2 = fadd <4 x float> %s3, %s4
170 %a3 = fadd <4 x float> %a1, %a2
171 store <4 x float> %a3, ptr %dst
172 %ret = getelementptr inbounds <16 x float>, ptr %src, i32 1
178 define ptr @vld4_v8f16(ptr %src, ptr %dst) {
179 ; CHECK-LABEL: vld4_v8f16:
180 ; CHECK: @ %bb.0: @ %entry
181 ; CHECK-NEXT: vld40.16 {q0, q1, q2, q3}, [r0]
182 ; CHECK-NEXT: vld41.16 {q0, q1, q2, q3}, [r0]
183 ; CHECK-NEXT: vld42.16 {q0, q1, q2, q3}, [r0]
184 ; CHECK-NEXT: vld43.16 {q0, q1, q2, q3}, [r0]!
185 ; CHECK-NEXT: vadd.f16 q2, q2, q3
186 ; CHECK-NEXT: vadd.f16 q0, q0, q1
187 ; CHECK-NEXT: vadd.f16 q0, q0, q2
188 ; CHECK-NEXT: vstrw.32 q0, [r1]
191 %l1 = load <32 x half>, ptr %src, align 4
192 %s1 = shufflevector <32 x half> %l1, <32 x half> undef, <8 x i32> <i32 0, i32 4, i32 8, i32 12, i32 16, i32 20, i32 24, i32 28>
193 %s2 = shufflevector <32 x half> %l1, <32 x half> undef, <8 x i32> <i32 1, i32 5, i32 9, i32 13, i32 17, i32 21, i32 25, i32 29>
194 %s3 = shufflevector <32 x half> %l1, <32 x half> undef, <8 x i32> <i32 2, i32 6, i32 10, i32 14, i32 18, i32 22, i32 26, i32 30>
195 %s4 = shufflevector <32 x half> %l1, <32 x half> undef, <8 x i32> <i32 3, i32 7, i32 11, i32 15, i32 19, i32 23, i32 27, i32 31>
196 %a1 = fadd <8 x half> %s1, %s2
197 %a2 = fadd <8 x half> %s3, %s4
198 %a3 = fadd <8 x half> %a1, %a2
199 store <8 x half> %a3, ptr %dst
200 %ret = getelementptr inbounds <32 x half>, ptr %src, i32 1
206 define ptr @vld4_v2f64(ptr %src, ptr %dst) {
207 ; CHECK-LABEL: vld4_v2f64:
208 ; CHECK: @ %bb.0: @ %entry
209 ; CHECK-NEXT: vldrw.u32 q0, [r0, #48]
210 ; CHECK-NEXT: vldrw.u32 q1, [r0, #32]
211 ; CHECK-NEXT: vadd.f64 d0, d0, d1
212 ; CHECK-NEXT: vadd.f64 d1, d2, d3
213 ; CHECK-NEXT: vldrw.u32 q1, [r0, #16]
214 ; CHECK-NEXT: vldrw.u32 q2, [r0], #64
215 ; CHECK-NEXT: vadd.f64 d2, d2, d3
216 ; CHECK-NEXT: vadd.f64 d3, d4, d5
217 ; CHECK-NEXT: vadd.f64 d1, d1, d0
218 ; CHECK-NEXT: vadd.f64 d0, d3, d2
219 ; CHECK-NEXT: vstrw.32 q0, [r1]
222 %l1 = load <8 x double>, ptr %src, align 4
223 %s1 = shufflevector <8 x double> %l1, <8 x double> undef, <2 x i32> <i32 0, i32 4>
224 %s2 = shufflevector <8 x double> %l1, <8 x double> undef, <2 x i32> <i32 1, i32 5>
225 %s3 = shufflevector <8 x double> %l1, <8 x double> undef, <2 x i32> <i32 2, i32 6>
226 %s4 = shufflevector <8 x double> %l1, <8 x double> undef, <2 x i32> <i32 3, i32 7>
227 %a1 = fadd <2 x double> %s1, %s2
228 %a2 = fadd <2 x double> %s3, %s4
229 %a3 = fadd <2 x double> %a1, %a2
230 store <2 x double> %a3, ptr %dst
231 %ret = getelementptr inbounds <8 x double>, ptr %src, i32 1