blob: d9aaee17c67e602cf7d6d546355e305e085fb51f [file] [log] [blame]
Pablo Telloeb82fd22018-02-23 13:43:50 +00001/*
2 * Copyright (c) 2017-2018 ARM Limited.
3 *
4 * SPDX-License-Identifier: MIT
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in all
14 * copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
24#ifdef __aarch64__
25
26#include <arm_neon.h>
27
28#include "../../asmlib.hpp"
29
Anthony Barbier5f707732018-07-03 16:22:02 +010030namespace arm_gemm {
31
32void a64_sgemm_asimd_12x8_a55(const float *Apanel, const float *Bpanel, float *Cpanel, int ablocks, int bblocks, int K) {
Pablo Telloeb82fd22018-02-23 13:43:50 +000033 const float *a_ptr = Apanel;
Anthony Barbier5f707732018-07-03 16:22:02 +010034 float *c_ptr = Cpanel;
Pablo Telloeb82fd22018-02-23 13:43:50 +000035
Anthony Barbier5f707732018-07-03 16:22:02 +010036 for (int yb=0; yb<ablocks; yb++) {
Pablo Telloeb82fd22018-02-23 13:43:50 +000037 const float *a_ptr0 = a_ptr;
Anthony Barbier5f707732018-07-03 16:22:02 +010038 const float *b_ptr = Bpanel;
Pablo Telloeb82fd22018-02-23 13:43:50 +000039
Anthony Barbier5f707732018-07-03 16:22:02 +010040 for (int xb=0; xb<bblocks; xb++) {
Pablo Telloeb82fd22018-02-23 13:43:50 +000041 a_ptr = a_ptr0;
42 // Fix up for odd lengths - set a flag if K is odd, but make
43 // sure we round up the iteration count.
44 int oddk = (K & 1);
Anthony Barbier5f707732018-07-03 16:22:02 +010045 int k = ((K+1)/2) - 1;
Pablo Telloeb82fd22018-02-23 13:43:50 +000046
Anthony Barbier5f707732018-07-03 16:22:02 +010047 register float32x4_t a0 asm("v0");
48 register float32x4_t a1 asm("v1");
49 register float32x4_t b0 asm("v2");
50 register float32x4_t b1 asm("v3");
51 register float32x4_t b2 asm("v4");
Pablo Telloeb82fd22018-02-23 13:43:50 +000052 register float32x4_t a0a asm("v5");
53 register float32x4_t a1a asm("v6");
54
Anthony Barbier5f707732018-07-03 16:22:02 +010055 __asm __volatile (
Pablo Telloeb82fd22018-02-23 13:43:50 +000056 // Initialize result registers, load initial operands, prime prefetches.
Anthony Barbier5f707732018-07-03 16:22:02 +010057 "movi v8.4s, #0x0\n"
58 "ldr %q[a0], [%[a_ptr]]\n"
59 "movi v9.4s, #0x0\n"
60 "ldr %q[b0], [%[b_ptr]]\n"
61 "movi v10.4s, #0x0\n"
62 "ldr %q[a1], [%[a_ptr], #16]\n"
63 "movi v11.4s, #0x0\n"
64 "ldr %q[b1], [%[b_ptr], #16]\n"
65 "movi v12.4s, #0x0\n"
66 ASM_PREFETCH("[%[b_ptr], #64]")
67 "movi v13.4s, #0x0\n"
68 ASM_PREFETCH("[%[a_ptr], #64]")
69 "movi v14.4s, #0x0\n"
70 ASM_PREFETCH("[%[b_ptr], #128]")
71 "movi v15.4s, #0x0\n"
72 ASM_PREFETCH("[%[a_ptr], #128]")
73 "movi v16.4s, #0x0\n"
74 ASM_PREFETCH("[%[b_ptr], #192]")
75 "movi v17.4s, #0x0\n"
76 ASM_PREFETCH("[%[b_ptr], #256]")
77 "movi v18.4s, #0x0\n"
78 ASM_PREFETCH("[%[a_ptr], #192]")
79 "movi v19.4s, #0x0\n"
80 ASM_PREFETCH("[%[b_ptr], #320]")
81 "movi v20.4s, #0x0\n"
82 ASM_PREFETCH("[%[a_ptr], #256]")
83 "movi v21.4s, #0x0\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +000084 ASM_PREFETCH("[%[b_ptr], #384]")
Anthony Barbier5f707732018-07-03 16:22:02 +010085 "movi v22.4s, #0x0\n"
86 "movi v23.4s, #0x0\n"
87 "movi v24.4s, #0x0\n"
88 "movi v25.4s, #0x0\n"
89 "movi v26.4s, #0x0\n"
90 "movi v27.4s, #0x0\n"
91 "movi v28.4s, #0x0\n"
92 "movi v29.4s, #0x0\n"
93 "movi v30.4s, #0x0\n"
94 "movi v31.4s, #0x0\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +000095
96 // Skip loop if we are doing zero iterations of it.
Anthony Barbier5f707732018-07-03 16:22:02 +010097 "cbz %w[k], 4f\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +000098
99 "1:\n"
100 // Unroll 0
Anthony Barbier5f707732018-07-03 16:22:02 +0100101 "ldr %d[b2], [%[b_ptr], #32]\n"
102 "fmla v8.4s , %[b0].4s, %[a0].s[0]\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000103
Anthony Barbier5f707732018-07-03 16:22:02 +0100104 "fmla v9.4s , %[b0].4s, %[a0].s[1]\n"
105 "ldr x20, [%[b_ptr], #40]\n"
106 "fmla v10.4s, %[b0].4s, %[a0].s[2]\n"
107 "fmla v11.4s, %[b0].4s, %[a0].s[3]\n"
108 "subs %w[k], %w[k], #1\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000109
Pablo Telloeb82fd22018-02-23 13:43:50 +0000110
Anthony Barbier5f707732018-07-03 16:22:02 +0100111 "ldr %d[a0a], [%[a_ptr], #32]\n"
112 "ins %[b2].d[1], x20\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000113
Anthony Barbier5f707732018-07-03 16:22:02 +0100114 "fmla v12.4s, %[b0].4s, %[a1].s[0]\n"
115 "fmla v13.4s, %[b0].4s, %[a1].s[1]\n"
116 "ldr x20, [%[a_ptr], #40]\n"
117 "fmla v14.4s, %[b0].4s, %[a1].s[2]\n"
118 "fmla v15.4s, %[b0].4s, %[a1].s[3]\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000119
Anthony Barbier5f707732018-07-03 16:22:02 +0100120 "ldr %d[a1a], [%[a_ptr], #48]\n"
121 "ins %[a0a].d[1], x20\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000122
Anthony Barbier5f707732018-07-03 16:22:02 +0100123 "fmla v16.4s, %[b1].4s, %[a0].s[0]\n"
124 "fmla v17.4s, %[b1].4s, %[a0].s[1]\n"
125 "ldr x20, [%[a_ptr], #56]\n"
126 "fmla v18.4s, %[b1].4s, %[a0].s[2]\n"
127 "fmla v19.4s, %[b1].4s, %[a0].s[3]\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000128
Anthony Barbier5f707732018-07-03 16:22:02 +0100129 "ldr %d[b0], [%[b_ptr], #48]\n"
130 "ins %[a1a].d[1], x20\n"
131 ASM_PREFETCH("[%[a_ptr], #320]")
132 "fmla v20.4s, %[b1].4s, %[a1].s[0]\n"
133 "fmla v21.4s, %[b1].4s, %[a1].s[1]\n"
134 "ldr x20, [%[b_ptr], #56]\n"
135 "fmla v22.4s, %[b1].4s, %[a1].s[2]\n"
136 "fmla v23.4s, %[b1].4s, %[a1].s[3]\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000137
Anthony Barbier5f707732018-07-03 16:22:02 +0100138 "ldr %d[b1], [%[b_ptr], #64]\n"
139 "ins %[b0].d[1], x20\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000140
Anthony Barbier5f707732018-07-03 16:22:02 +0100141 "fmla v24.4s, %[b2].4s, %[a0].s[0]\n"
142 "fmla v25.4s, %[b2].4s, %[a0].s[1]\n"
143 "ldr x20, [%[b_ptr], #72]\n"
144 "fmla v26.4s, %[b2].4s, %[a0].s[2]\n"
145 "fmla v27.4s, %[b2].4s, %[a0].s[3]\n"
146 ASM_PREFETCH("[%[b_ptr], #448]")
147
148
149 "fmla v28.4s, %[b2].4s, %[a1].s[0]\n"
150 "fmla v29.4s, %[b2].4s, %[a1].s[1]\n"
151 ASM_PREFETCH("[%[b_ptr], #512]")
152 "fmla v30.4s, %[b2].4s, %[a1].s[2]\n"
153 "fmla v31.4s, %[b2].4s, %[a1].s[3]\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000154
155 // Unroll 1
Anthony Barbier5f707732018-07-03 16:22:02 +0100156 "ldr %d[b2], [%[b_ptr], #80]\n"
157 "ins %[b1].d[1], x20\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000158
Anthony Barbier5f707732018-07-03 16:22:02 +0100159 "fmla v8.4s , %[b0].4s, %[a0a].s[0]\n"
160 "fmla v9.4s , %[b0].4s, %[a0a].s[1]\n"
161 "ldr x20, [%[b_ptr], #88]\n"
162 "fmla v10.4s, %[b0].4s, %[a0a].s[2]\n"
163 "fmla v11.4s, %[b0].4s, %[a0a].s[3]\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000164
Anthony Barbier5f707732018-07-03 16:22:02 +0100165 "ldr %d[a0], [%[a_ptr], #64]\n"
166 "ins %[b2].d[1], x20\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000167
Anthony Barbier5f707732018-07-03 16:22:02 +0100168 "fmla v12.4s, %[b0].4s, %[a1a].s[0]\n"
169 "fmla v13.4s, %[b0].4s, %[a1a].s[1]\n"
170 "ldr x20, [%[a_ptr], #72]\n"
171 "fmla v14.4s, %[b0].4s, %[a1a].s[2]\n"
172 "fmla v15.4s, %[b0].4s, %[a1a].s[3]\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000173
Anthony Barbier5f707732018-07-03 16:22:02 +0100174 "ldr %d[a1], [%[a_ptr], #80]\n"
175 "ins %[a0].d[1], x20\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000176
Anthony Barbier5f707732018-07-03 16:22:02 +0100177 "fmla v16.4s, %[b1].4s, %[a0a].s[0]\n"
178 "fmla v17.4s, %[b1].4s, %[a0a].s[1]\n"
179 "ldr x20, [%[a_ptr], #88]\n"
180 "fmla v18.4s, %[b1].4s, %[a0a].s[2]\n"
181 "fmla v19.4s, %[b1].4s, %[a0a].s[3]\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000182
Pablo Telloeb82fd22018-02-23 13:43:50 +0000183
Anthony Barbier5f707732018-07-03 16:22:02 +0100184 "ldr %d[b0], [%[b_ptr], #96]\n"
185 "ins %[a1].d[1], x20\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000186
Anthony Barbier5f707732018-07-03 16:22:02 +0100187 "fmla v20.4s, %[b1].4s, %[a1a].s[0]\n"
188 "fmla v21.4s, %[b1].4s, %[a1a].s[1]\n"
189 "ldr x20, [%[b_ptr], #104]\n"
190 "fmla v22.4s, %[b1].4s, %[a1a].s[2]\n"
191 "fmla v23.4s, %[b1].4s, %[a1a].s[3]\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000192
Anthony Barbier5f707732018-07-03 16:22:02 +0100193 "ldr %d[b1], [%[b_ptr], #112]\n"
194 "ins %[b0].d[1], x20\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000195
Anthony Barbier5f707732018-07-03 16:22:02 +0100196 "fmla v24.4s, %[b2].4s, %[a0a].s[0]\n"
197 "fmla v25.4s, %[b2].4s, %[a0a].s[1]\n"
198 "ldr x20, [%[b_ptr], #120]\n"
199 "fmla v26.4s, %[b2].4s, %[a0a].s[2]\n"
200 "fmla v27.4s, %[b2].4s, %[a0a].s[3]\n"
201 "add %[a_ptr], %[a_ptr], #64\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000202
Anthony Barbier5f707732018-07-03 16:22:02 +0100203 "fmla v28.4s, %[b2].4s, %[a1a].s[0]\n"
204 "fmla v29.4s, %[b2].4s, %[a1a].s[1]\n"
205 "fmla v30.4s, %[b2].4s, %[a1a].s[2]\n"
206 "add %[b_ptr], %[b_ptr], #96\n"
207 "fmla v31.4s, %[b2].4s, %[a1a].s[3]\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000208
Anthony Barbier5f707732018-07-03 16:22:02 +0100209
210 "ldr %d[b2], [%[b_ptr], #32]\n"
211 "ins %[b1].d[1], x20\n"
212
213
214 "bne 1b\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000215
216 // Branch here if K=1 or 2. Do the right thing for odd/even at the end.
217 "4:\n"
Anthony Barbier5f707732018-07-03 16:22:02 +0100218 "cbnz %w[oddk], 2f\n"
219 "fmla v8.4s , %[b0].4s, %[a0].s[0]\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000220
221 // Detached final iteration. (even K)
Anthony Barbier5f707732018-07-03 16:22:02 +0100222 "ldr x20, [%[b_ptr], #40]\n"
223 "fmla v9.4s , %[b0].4s, %[a0].s[1]\n"
224 "subs %w[k], %w[k], #1\n"
225 "fmla v10.4s, %[b0].4s, %[a0].s[2]\n"
226 "fmla v11.4s, %[b0].4s, %[a0].s[3]\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000227
Anthony Barbier5f707732018-07-03 16:22:02 +0100228 "ldr %d[a0a], [%[a_ptr], #32]\n"
229 "ins %[b2].d[1], x20\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000230
Anthony Barbier5f707732018-07-03 16:22:02 +0100231 "fmla v12.4s, %[b0].4s, %[a1].s[0]\n"
232 "fmla v13.4s, %[b0].4s, %[a1].s[1]\n"
233 "ldr x20, [%[a_ptr], #40]\n"
234 "fmla v14.4s, %[b0].4s, %[a1].s[2]\n"
235 "fmla v15.4s, %[b0].4s, %[a1].s[3]\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000236
Anthony Barbier5f707732018-07-03 16:22:02 +0100237 "ldr %d[a1a], [%[a_ptr], #48]\n"
238 "ins %[a0a].d[1], x20\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000239
Anthony Barbier5f707732018-07-03 16:22:02 +0100240 "fmla v16.4s, %[b1].4s, %[a0].s[0]\n"
241 "fmla v17.4s, %[b1].4s, %[a0].s[1]\n"
242 "ldr x20, [%[a_ptr], #56]\n"
243 "fmla v18.4s, %[b1].4s, %[a0].s[2]\n"
244 "fmla v19.4s, %[b1].4s, %[a0].s[3]\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000245
Anthony Barbier5f707732018-07-03 16:22:02 +0100246 "ldr %d[b0], [%[b_ptr], #48]\n"
247 "ins %[a1a].d[1], x20\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000248
Anthony Barbier5f707732018-07-03 16:22:02 +0100249 "fmla v20.4s, %[b1].4s, %[a1].s[0]\n"
250 "fmla v21.4s, %[b1].4s, %[a1].s[1]\n"
251 "ldr x20, [%[b_ptr], #56]\n"
252 "fmla v22.4s, %[b1].4s, %[a1].s[2]\n"
253 "fmla v23.4s, %[b1].4s, %[a1].s[3]\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000254
Anthony Barbier5f707732018-07-03 16:22:02 +0100255 "fmla v24.4s, %[b2].4s, %[a0].s[0]\n"
256 "fmla v25.4s, %[b2].4s, %[a0].s[1]\n"
257 "fmla v26.4s, %[b2].4s, %[a0].s[2]\n"
258 "fmla v27.4s, %[b2].4s, %[a0].s[3]\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000259
Anthony Barbier5f707732018-07-03 16:22:02 +0100260 "ldr %d[b1], [%[b_ptr], #64]\n"
261 "ins %[b0].d[1], x20\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000262
Anthony Barbier5f707732018-07-03 16:22:02 +0100263 "fmla v28.4s, %[b2].4s, %[a1].s[0]\n"
264 "fmla v29.4s, %[b2].4s, %[a1].s[1]\n"
265 "ldr x20, [%[b_ptr], #72]\n"
266 "fmla v30.4s, %[b2].4s, %[a1].s[2]\n"
267 "fmla v31.4s, %[b2].4s, %[a1].s[3]\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000268
Anthony Barbier5f707732018-07-03 16:22:02 +0100269 "ldr %d[b2], [%[b_ptr], #80]\n"
270 "ins %[b1].d[1], x20\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000271
Anthony Barbier5f707732018-07-03 16:22:02 +0100272 "fmla v8.4s , %[b0].4s, %[a0a].s[0]\n"
273 "fmla v9.4s , %[b0].4s, %[a0a].s[1]\n"
274 "ldr x20, [%[b_ptr], #88]\n"
275 "fmla v10.4s, %[b0].4s, %[a0a].s[2]\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000276
Anthony Barbier5f707732018-07-03 16:22:02 +0100277 "ins %[b2].d[1], x20\n"
278 "fmla v11.4s, %[b0].4s, %[a0a].s[3]\n"
279 "fmla v12.4s, %[b0].4s, %[a1a].s[0]\n"
280 "fmla v13.4s, %[b0].4s, %[a1a].s[1]\n"
281 "fmla v14.4s, %[b0].4s, %[a1a].s[2]\n"
282 "fmla v15.4s, %[b0].4s, %[a1a].s[3]\n"
283 "fmla v16.4s, %[b1].4s, %[a0a].s[0]\n"
284 "fmla v17.4s, %[b1].4s, %[a0a].s[1]\n"
285 "fmla v18.4s, %[b1].4s, %[a0a].s[2]\n"
286 "fmla v19.4s, %[b1].4s, %[a0a].s[3]\n"
287 "fmla v20.4s, %[b1].4s, %[a1a].s[0]\n"
288 "fmla v21.4s, %[b1].4s, %[a1a].s[1]\n"
289 "fmla v22.4s, %[b1].4s, %[a1a].s[2]\n"
290 "fmla v23.4s, %[b1].4s, %[a1a].s[3]\n"
291 "fmla v24.4s, %[b2].4s, %[a0a].s[0]\n"
292 "fmla v25.4s, %[b2].4s, %[a0a].s[1]\n"
293 "fmla v26.4s, %[b2].4s, %[a0a].s[2]\n"
294 "fmla v27.4s, %[b2].4s, %[a0a].s[3]\n"
295 "fmla v28.4s, %[b2].4s, %[a1a].s[0]\n"
296 "fmla v29.4s, %[b2].4s, %[a1a].s[1]\n"
297 "add %[a_ptr], %[a_ptr], #64\n"
298 "fmla v30.4s, %[b2].4s, %[a1a].s[2]\n"
299 "add %[b_ptr], %[b_ptr], #96\n"
300 "fmla v31.4s, %[b2].4s, %[a1a].s[3]\n"
301 "b 3f\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000302
303 // Detached final iteration. (odd K)
304 "2:\n"
305
Anthony Barbier5f707732018-07-03 16:22:02 +0100306 "ldr %d[b2], [%[b_ptr], #32]\n"
307 "fmla v8.4s , %[b0].4s, %[a0].s[0]\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000308
Anthony Barbier5f707732018-07-03 16:22:02 +0100309 "fmla v9.4s , %[b0].4s, %[a0].s[1]\n"
310 "ldr x20, [%[b_ptr], #40]\n"
311 "fmla v10.4s, %[b0].4s, %[a0].s[2]\n"
312 "fmla v11.4s, %[b0].4s, %[a0].s[3]\n"
313 "ins %[b2].d[1], x20\n"
314 "fmla v12.4s, %[b0].4s, %[a1].s[0]\n"
315 "fmla v13.4s, %[b0].4s, %[a1].s[1]\n"
316 "fmla v14.4s, %[b0].4s, %[a1].s[2]\n"
317 "fmla v15.4s, %[b0].4s, %[a1].s[3]\n"
318 "fmla v16.4s, %[b1].4s, %[a0].s[0]\n"
319 "fmla v17.4s, %[b1].4s, %[a0].s[1]\n"
320 "fmla v18.4s, %[b1].4s, %[a0].s[2]\n"
321 "fmla v19.4s, %[b1].4s, %[a0].s[3]\n"
322 "fmla v20.4s, %[b1].4s, %[a1].s[0]\n"
323 "fmla v21.4s, %[b1].4s, %[a1].s[1]\n"
324 "fmla v22.4s, %[b1].4s, %[a1].s[2]\n"
325 "fmla v23.4s, %[b1].4s, %[a1].s[3]\n"
326 "fmla v24.4s, %[b2].4s, %[a0].s[0]\n"
327 "fmla v25.4s, %[b2].4s, %[a0].s[1]\n"
328 "fmla v26.4s, %[b2].4s, %[a0].s[2]\n"
329 "fmla v27.4s, %[b2].4s, %[a0].s[3]\n"
330 "fmla v28.4s, %[b2].4s, %[a1].s[0]\n"
331 "fmla v29.4s, %[b2].4s, %[a1].s[1]\n"
332 "add %[a_ptr], %[a_ptr], #32\n"
333 "fmla v30.4s, %[b2].4s, %[a1].s[2]\n"
334 "add %[b_ptr], %[b_ptr], #48\n"
335 "fmla v31.4s, %[b2].4s, %[a1].s[3]\n"
Pablo Telloeb82fd22018-02-23 13:43:50 +0000336
337 // Common tail
338 "3:\n"
Anthony Barbier5f707732018-07-03 16:22:02 +0100339 "str q8, [%[c_ptr]]\n"
340 "str q16, [%[c_ptr], #16]\n"
341 "str q24, [%[c_ptr], #32]\n"
342 "str q9, [%[c_ptr], #48]\n"
343 "str q17, [%[c_ptr], #64]\n"
344 "str q25, [%[c_ptr], #80]\n"
345 "str q10, [%[c_ptr], #96]\n"
346 "str q18, [%[c_ptr], #112]\n"
347 "str q26, [%[c_ptr], #128]\n"
348 "str q11, [%[c_ptr], #144]\n"
349 "str q19, [%[c_ptr], #160]\n"
350 "str q27, [%[c_ptr], #176]\n"
351 "str q12, [%[c_ptr], #192]\n"
352 "str q20, [%[c_ptr], #208]\n"
353 "str q28, [%[c_ptr], #224]\n"
354 "str q13, [%[c_ptr], #240]\n"
355 "str q21, [%[c_ptr], #256]\n"
356 "str q29, [%[c_ptr], #272]\n"
357 "str q14, [%[c_ptr], #288]\n"
358 "str q22, [%[c_ptr], #304]\n"
359 "str q30, [%[c_ptr], #320]\n"
360 "str q15, [%[c_ptr], #336]\n"
361 "str q23, [%[c_ptr], #352]\n"
362 "str q31, [%[c_ptr], #368]\n"
363 "add %[c_ptr], %[c_ptr], #384\n"
364 :
365 [a_ptr] "+r" (a_ptr), [b_ptr] "+r" (b_ptr), [c_ptr] "+r" (c_ptr),
366 [a0] "+w" (a0), [a1] "+w" (a1), [a0a] "+w" (a0a), [a1a] "+w" (a1a),
367 [b0] "+w" (b0), [b1] "+w" (b1), [b2] "+w" (b2), [k] "+r" (k)
368 : [oddk] "r" (oddk)
369 : "x20", "x21", "v8", "v9", "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", "v18",
370 "v19", "v20", "v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31", "cc"
371 );
Pablo Telloeb82fd22018-02-23 13:43:50 +0000372 }
373 }
374}
375
376} // namespace arm_gemm
377
378#endif