aboutsummaryrefslogtreecommitdiff
path: root/src/core/NEON/kernels/arm_gemm/kernels/sve_interleaved_bf16fp32_dot_8x3VL/generic.cpp
blob: adee9003370941872d89ce2b715c11cd336deb44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
/*
 * Copyright (c) 2019-2020 Arm Limited.
 *
 * SPDX-License-Identifier: MIT
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to
 * deal in the Software without restriction, including without limitation the
 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 * sell copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
#ifdef __ARM_FEATURE_SVE

#include "../../bfloat.hpp"
#include "../../asmlib.hpp"

namespace arm_gemm {

void sve_interleaved_bf16fp32_dot_8x3VL(const bfloat16 *Apanel, const bfloat16 *Bpanel, float *Cpanel, int ablocks, int bblocks, int K) {
    const bfloat16 *a_ptr = Apanel;
    float *c_ptr = Cpanel;

    K /= 2;
    const long loops_count = (K / 2) - 1;
    const long tails_count = K % 2;

    for (int yb=0; yb<ablocks; yb++) {
        const bfloat16 *a_ptr0 = a_ptr;
        const bfloat16 *b_ptr = Bpanel;

        for (int xb=0; xb<bblocks; xb++) {
            a_ptr = a_ptr0;
            long loops = loops_count;
            long tails = tails_count;

            __asm __volatile (
                "mov z8.s, #0\n"
                "ptrue p0.h\n"
                "mov z9.s, #0\n"
                "mov z10.s, #0\n"
                "mov z11.s, #0\n"
                "ld1rqh z0.h, p0/z, [%[a_ptr]]\n"
                "mov z12.s, #0\n"
                "ld1h z4.h, p0/z, [%[b_ptr]]\n"
                "mov z13.s, #0\n"
                "ld1rqh z1.h, p0/z, [%[a_ptr], #0x10]\n"
                "mov z14.s, #0\n"
                "ld1h z5.h, p0/z, [%[b_ptr], #1, MUL VL]\n"
                "mov z15.s, #0\n"
                "ld1rqh z2.h, p0/z, [%[a_ptr], #0x20]\n"
                "mov z16.s, #0\n"
                "add %[a_ptr], %[a_ptr], #0x40\n"
                "mov z17.s, #0\n"
                "addvl %[b_ptr], %[b_ptr], #3\n"
                "mov z18.s, #0\n"
                "mov z19.s, #0\n"
                "mov z20.s, #0\n"
                "mov z21.s, #0\n"
                "mov z22.s, #0\n"
                "mov z23.s, #0\n"
                "mov z24.s, #0\n"
                "mov z25.s, #0\n"
                "mov z26.s, #0\n"
                "mov z27.s, #0\n"
                "mov z28.s, #0\n"
                "mov z29.s, #0\n"
                "mov z30.s, #0\n"
                "mov z31.s, #0\n"
                "cbz %[loops], 1f\n"
                "2:\n"
                ".inst 0x64604088 // bfdot z8.s, z4.h, z0.h[0]\n"
                "ld1h z6.h, p0/z, [%[b_ptr], #-1, MUL VL]\n"
                ".inst 0x64684089 // bfdot z9.s, z4.h, z0.h[1]\n"
                "ld1rqh z3.h, p0/z, [%[a_ptr], #-0x10]\n"
                ".inst 0x6470408a // bfdot z10.s, z4.h, z0.h[2]\n"
                "subs %[loops], %[loops], #0x1\n"
                ".inst 0x6478408b // bfdot z11.s, z4.h, z0.h[3]\n"
                ".inst 0x64614094 // bfdot z20.s, z4.h, z1.h[0]\n"
                ".inst 0x64694095 // bfdot z21.s, z4.h, z1.h[1]\n"
                ".inst 0x64714096 // bfdot z22.s, z4.h, z1.h[2]\n"
                ".inst 0x64794097 // bfdot z23.s, z4.h, z1.h[3]\n"
                "ld1h z4.h, p0/z, [%[b_ptr]]\n"
                ".inst 0x646040ac // bfdot z12.s, z5.h, z0.h[0]\n"
                ".inst 0x646840ad // bfdot z13.s, z5.h, z0.h[1]\n"
                ".inst 0x647040ae // bfdot z14.s, z5.h, z0.h[2]\n"
                ".inst 0x647840af // bfdot z15.s, z5.h, z0.h[3]\n"
                ".inst 0x646140b8 // bfdot z24.s, z5.h, z1.h[0]\n"
                ".inst 0x646940b9 // bfdot z25.s, z5.h, z1.h[1]\n"
                ".inst 0x647140ba // bfdot z26.s, z5.h, z1.h[2]\n"
                ".inst 0x647940bb // bfdot z27.s, z5.h, z1.h[3]\n"
                "ld1h z5.h, p0/z, [%[b_ptr], #1, MUL VL]\n"
                ".inst 0x646040d0 // bfdot z16.s, z6.h, z0.h[0]\n"
                ".inst 0x646840d1 // bfdot z17.s, z6.h, z0.h[1]\n"
                ".inst 0x647040d2 // bfdot z18.s, z6.h, z0.h[2]\n"
                ".inst 0x647840d3 // bfdot z19.s, z6.h, z0.h[3]\n"
                "ld1rqh z0.h, p0/z, [%[a_ptr]]\n"
                ".inst 0x646140dc // bfdot z28.s, z6.h, z1.h[0]\n"
                ".inst 0x646940dd // bfdot z29.s, z6.h, z1.h[1]\n"
                ".inst 0x647140de // bfdot z30.s, z6.h, z1.h[2]\n"
                ".inst 0x647940df // bfdot z31.s, z6.h, z1.h[3]\n"
                "ld1h z6.h, p0/z, [%[b_ptr], #2, MUL VL]\n"
                ".inst 0x64624088 // bfdot z8.s, z4.h, z2.h[0]\n"
                "ld1rqh z1.h, p0/z, [%[a_ptr], #0x10]\n"
                ".inst 0x646a4089 // bfdot z9.s, z4.h, z2.h[1]\n"
                "add %[a_ptr], %[a_ptr], #0x40\n"
                ".inst 0x6472408a // bfdot z10.s, z4.h, z2.h[2]\n"
                "addvl %[b_ptr], %[b_ptr], #6\n"
                ".inst 0x647a408b // bfdot z11.s, z4.h, z2.h[3]\n"
                ".inst 0x64634094 // bfdot z20.s, z4.h, z3.h[0]\n"
                ".inst 0x646b4095 // bfdot z21.s, z4.h, z3.h[1]\n"
                ".inst 0x64734096 // bfdot z22.s, z4.h, z3.h[2]\n"
                ".inst 0x647b4097 // bfdot z23.s, z4.h, z3.h[3]\n"
                "ld1h z4.h, p0/z, [%[b_ptr], #-3, MUL VL]\n"
                ".inst 0x646240ac // bfdot z12.s, z5.h, z2.h[0]\n"
                ".inst 0x646a40ad // bfdot z13.s, z5.h, z2.h[1]\n"
                ".inst 0x647240ae // bfdot z14.s, z5.h, z2.h[2]\n"
                ".inst 0x647a40af // bfdot z15.s, z5.h, z2.h[3]\n"
                ".inst 0x646340b8 // bfdot z24.s, z5.h, z3.h[0]\n"
                ".inst 0x646b40b9 // bfdot z25.s, z5.h, z3.h[1]\n"
                ".inst 0x647340ba // bfdot z26.s, z5.h, z3.h[2]\n"
                ".inst 0x647b40bb // bfdot z27.s, z5.h, z3.h[3]\n"
                "ld1h z5.h, p0/z, [%[b_ptr], #-2, MUL VL]\n"
                ".inst 0x646240d0 // bfdot z16.s, z6.h, z2.h[0]\n"
                ".inst 0x646a40d1 // bfdot z17.s, z6.h, z2.h[1]\n"
                ".inst 0x647240d2 // bfdot z18.s, z6.h, z2.h[2]\n"
                ".inst 0x647a40d3 // bfdot z19.s, z6.h, z2.h[3]\n"
                "ld1rqh z2.h, p0/z, [%[a_ptr], #-0x20]\n"
                ".inst 0x646340dc // bfdot z28.s, z6.h, z3.h[0]\n"
                ".inst 0x646b40dd // bfdot z29.s, z6.h, z3.h[1]\n"
                ".inst 0x647340de // bfdot z30.s, z6.h, z3.h[2]\n"
                ".inst 0x647b40df // bfdot z31.s, z6.h, z3.h[3]\n"
                "b.ne 2b\n"
                "1:\n"
                "cbz %[tails], 3f\n"
                ".inst 0x64604088 // bfdot z8.s, z4.h, z0.h[0]\n"
                "ld1h z6.h, p0/z, [%[b_ptr], #-1, MUL VL]\n"
                ".inst 0x64684089 // bfdot z9.s, z4.h, z0.h[1]\n"
                "ld1rqh z3.h, p0/z, [%[a_ptr], #-0x10]\n"
                ".inst 0x6470408a // bfdot z10.s, z4.h, z0.h[2]\n"
                ".inst 0x6478408b // bfdot z11.s, z4.h, z0.h[3]\n"
                ".inst 0x64614094 // bfdot z20.s, z4.h, z1.h[0]\n"
                ".inst 0x64694095 // bfdot z21.s, z4.h, z1.h[1]\n"
                ".inst 0x64714096 // bfdot z22.s, z4.h, z1.h[2]\n"
                ".inst 0x64794097 // bfdot z23.s, z4.h, z1.h[3]\n"
                "ld1h z4.h, p0/z, [%[b_ptr]]\n"
                ".inst 0x646040ac // bfdot z12.s, z5.h, z0.h[0]\n"
                ".inst 0x646840ad // bfdot z13.s, z5.h, z0.h[1]\n"
                ".inst 0x647040ae // bfdot z14.s, z5.h, z0.h[2]\n"
                ".inst 0x647840af // bfdot z15.s, z5.h, z0.h[3]\n"
                ".inst 0x646140b8 // bfdot z24.s, z5.h, z1.h[0]\n"
                ".inst 0x646940b9 // bfdot z25.s, z5.h, z1.h[1]\n"
                ".inst 0x647140ba // bfdot z26.s, z5.h, z1.h[2]\n"
                ".inst 0x647940bb // bfdot z27.s, z5.h, z1.h[3]\n"
                "ld1h z5.h, p0/z, [%[b_ptr], #1, MUL VL]\n"
                ".inst 0x646040d0 // bfdot z16.s, z6.h, z0.h[0]\n"
                ".inst 0x646840d1 // bfdot z17.s, z6.h, z0.h[1]\n"
                ".inst 0x647040d2 // bfdot z18.s, z6.h, z0.h[2]\n"
                ".inst 0x647840d3 // bfdot z19.s, z6.h, z0.h[3]\n"
                "ld1rqh z0.h, p0/z, [%[a_ptr]]\n"
                ".inst 0x646140dc // bfdot z28.s, z6.h, z1.h[0]\n"
                ".inst 0x646940dd // bfdot z29.s, z6.h, z1.h[1]\n"
                ".inst 0x647140de // bfdot z30.s, z6.h, z1.h[2]\n"
                ".inst 0x647940df // bfdot z31.s, z6.h, z1.h[3]\n"
                "ld1h z6.h, p0/z, [%[b_ptr], #2, MUL VL]\n"
                ".inst 0x64624088 // bfdot z8.s, z4.h, z2.h[0]\n"
                "ld1rqh z1.h, p0/z, [%[a_ptr], #0x10]\n"
                ".inst 0x646a4089 // bfdot z9.s, z4.h, z2.h[1]\n"
                "add %[a_ptr], %[a_ptr], #0x20\n"
                ".inst 0x6472408a // bfdot z10.s, z4.h, z2.h[2]\n"
                "addvl %[b_ptr], %[b_ptr], #6\n"
                ".inst 0x647a408b // bfdot z11.s, z4.h, z2.h[3]\n"
                ".inst 0x64634094 // bfdot z20.s, z4.h, z3.h[0]\n"
                ".inst 0x646b4095 // bfdot z21.s, z4.h, z3.h[1]\n"
                ".inst 0x64734096 // bfdot z22.s, z4.h, z3.h[2]\n"
                ".inst 0x647b4097 // bfdot z23.s, z4.h, z3.h[3]\n"
                "ld1h z4.h, p0/z, [%[b_ptr], #-3, MUL VL]\n"
                ".inst 0x646240ac // bfdot z12.s, z5.h, z2.h[0]\n"
                ".inst 0x646a40ad // bfdot z13.s, z5.h, z2.h[1]\n"
                ".inst 0x647240ae // bfdot z14.s, z5.h, z2.h[2]\n"
                ".inst 0x647a40af // bfdot z15.s, z5.h, z2.h[3]\n"
                ".inst 0x646340b8 // bfdot z24.s, z5.h, z3.h[0]\n"
                ".inst 0x646b40b9 // bfdot z25.s, z5.h, z3.h[1]\n"
                ".inst 0x647340ba // bfdot z26.s, z5.h, z3.h[2]\n"
                ".inst 0x647b40bb // bfdot z27.s, z5.h, z3.h[3]\n"
                "ld1h z5.h, p0/z, [%[b_ptr], #-2, MUL VL]\n"
                ".inst 0x646240d0 // bfdot z16.s, z6.h, z2.h[0]\n"
                ".inst 0x646a40d1 // bfdot z17.s, z6.h, z2.h[1]\n"
                ".inst 0x647240d2 // bfdot z18.s, z6.h, z2.h[2]\n"
                ".inst 0x647a40d3 // bfdot z19.s, z6.h, z2.h[3]\n"
                ".inst 0x646340dc // bfdot z28.s, z6.h, z3.h[0]\n"
                ".inst 0x646b40dd // bfdot z29.s, z6.h, z3.h[1]\n"
                ".inst 0x647340de // bfdot z30.s, z6.h, z3.h[2]\n"
                ".inst 0x647b40df // bfdot z31.s, z6.h, z3.h[3]\n"
                "ld1h z6.h, p0/z, [%[b_ptr], #-1, MUL VL]\n"
                ".inst 0x64604088 // bfdot z8.s, z4.h, z0.h[0]\n"
                ".inst 0x64684089 // bfdot z9.s, z4.h, z0.h[1]\n"
                ".inst 0x6470408a // bfdot z10.s, z4.h, z0.h[2]\n"
                ".inst 0x6478408b // bfdot z11.s, z4.h, z0.h[3]\n"
                "st1w z8.s, p0, [%[c_ptr]]\n"
                ".inst 0x64614094 // bfdot z20.s, z4.h, z1.h[0]\n"
                ".inst 0x64694095 // bfdot z21.s, z4.h, z1.h[1]\n"
                ".inst 0x64714096 // bfdot z22.s, z4.h, z1.h[2]\n"
                ".inst 0x64794097 // bfdot z23.s, z4.h, z1.h[3]\n"
                ".inst 0x646040ac // bfdot z12.s, z5.h, z0.h[0]\n"
                ".inst 0x646840ad // bfdot z13.s, z5.h, z0.h[1]\n"
                ".inst 0x647040ae // bfdot z14.s, z5.h, z0.h[2]\n"
                ".inst 0x647840af // bfdot z15.s, z5.h, z0.h[3]\n"
                "st1w z12.s, p0, [%[c_ptr], #1, MUL VL]\n"
                ".inst 0x646140b8 // bfdot z24.s, z5.h, z1.h[0]\n"
                ".inst 0x646940b9 // bfdot z25.s, z5.h, z1.h[1]\n"
                ".inst 0x647140ba // bfdot z26.s, z5.h, z1.h[2]\n"
                ".inst 0x647940bb // bfdot z27.s, z5.h, z1.h[3]\n"
                ".inst 0x646040d0 // bfdot z16.s, z6.h, z0.h[0]\n"
                ".inst 0x646840d1 // bfdot z17.s, z6.h, z0.h[1]\n"
                ".inst 0x647040d2 // bfdot z18.s, z6.h, z0.h[2]\n"
                ".inst 0x647840d3 // bfdot z19.s, z6.h, z0.h[3]\n"
                "st1w z16.s, p0, [%[c_ptr], #2, MUL VL]\n"
                ".inst 0x646140dc // bfdot z28.s, z6.h, z1.h[0]\n"
                ".inst 0x646940dd // bfdot z29.s, z6.h, z1.h[1]\n"
                ".inst 0x647140de // bfdot z30.s, z6.h, z1.h[2]\n"
                "st1w z9.s, p0, [%[c_ptr], #3, MUL VL]\n"
                ".inst 0x647940df // bfdot z31.s, z6.h, z1.h[3]\n"
                "b 4f\n"
                "3:\n"
                ".inst 0x64604088 // bfdot z8.s, z4.h, z0.h[0]\n"
                "ld1h z6.h, p0/z, [%[b_ptr], #-1, MUL VL]\n"
                ".inst 0x64684089 // bfdot z9.s, z4.h, z0.h[1]\n"
                "ld1rqh z3.h, p0/z, [%[a_ptr], #-0x10]\n"
                ".inst 0x6470408a // bfdot z10.s, z4.h, z0.h[2]\n"
                "addvl %[b_ptr], %[b_ptr], #3\n"
                ".inst 0x6478408b // bfdot z11.s, z4.h, z0.h[3]\n"
                ".inst 0x64614094 // bfdot z20.s, z4.h, z1.h[0]\n"
                ".inst 0x64694095 // bfdot z21.s, z4.h, z1.h[1]\n"
                ".inst 0x64714096 // bfdot z22.s, z4.h, z1.h[2]\n"
                ".inst 0x64794097 // bfdot z23.s, z4.h, z1.h[3]\n"
                "ld1h z4.h, p0/z, [%[b_ptr], #-3, MUL VL]\n"
                ".inst 0x646040ac // bfdot z12.s, z5.h, z0.h[0]\n"
                ".inst 0x646840ad // bfdot z13.s, z5.h, z0.h[1]\n"
                ".inst 0x647040ae // bfdot z14.s, z5.h, z0.h[2]\n"
                ".inst 0x647840af // bfdot z15.s, z5.h, z0.h[3]\n"
                ".inst 0x646140b8 // bfdot z24.s, z5.h, z1.h[0]\n"
                ".inst 0x646940b9 // bfdot z25.s, z5.h, z1.h[1]\n"
                ".inst 0x647140ba // bfdot z26.s, z5.h, z1.h[2]\n"
                ".inst 0x647940bb // bfdot z27.s, z5.h, z1.h[3]\n"
                "ld1h z5.h, p0/z, [%[b_ptr], #-2, MUL VL]\n"
                ".inst 0x646040d0 // bfdot z16.s, z6.h, z0.h[0]\n"
                ".inst 0x646840d1 // bfdot z17.s, z6.h, z0.h[1]\n"
                ".inst 0x647040d2 // bfdot z18.s, z6.h, z0.h[2]\n"
                ".inst 0x647840d3 // bfdot z19.s, z6.h, z0.h[3]\n"
                ".inst 0x646140dc // bfdot z28.s, z6.h, z1.h[0]\n"
                ".inst 0x646940dd // bfdot z29.s, z6.h, z1.h[1]\n"
                ".inst 0x647140de // bfdot z30.s, z6.h, z1.h[2]\n"
                ".inst 0x647940df // bfdot z31.s, z6.h, z1.h[3]\n"
                "ld1h z6.h, p0/z, [%[b_ptr], #-1, MUL VL]\n"
                ".inst 0x64624088 // bfdot z8.s, z4.h, z2.h[0]\n"
                ".inst 0x646a4089 // bfdot z9.s, z4.h, z2.h[1]\n"
                ".inst 0x6472408a // bfdot z10.s, z4.h, z2.h[2]\n"
                ".inst 0x647a408b // bfdot z11.s, z4.h, z2.h[3]\n"
                "st1w z8.s, p0, [%[c_ptr]]\n"
                ".inst 0x64634094 // bfdot z20.s, z4.h, z3.h[0]\n"
                ".inst 0x646b4095 // bfdot z21.s, z4.h, z3.h[1]\n"
                ".inst 0x64734096 // bfdot z22.s, z4.h, z3.h[2]\n"
                ".inst 0x647b4097 // bfdot z23.s, z4.h, z3.h[3]\n"
                ".inst 0x646240ac // bfdot z12.s, z5.h, z2.h[0]\n"
                ".inst 0x646a40ad // bfdot z13.s, z5.h, z2.h[1]\n"
                ".inst 0x647240ae // bfdot z14.s, z5.h, z2.h[2]\n"
                ".inst 0x647a40af // bfdot z15.s, z5.h, z2.h[3]\n"
                "st1w z12.s, p0, [%[c_ptr], #1, MUL VL]\n"
                ".inst 0x646340b8 // bfdot z24.s, z5.h, z3.h[0]\n"
                ".inst 0x646b40b9 // bfdot z25.s, z5.h, z3.h[1]\n"
                ".inst 0x647340ba // bfdot z26.s, z5.h, z3.h[2]\n"
                ".inst 0x647b40bb // bfdot z27.s, z5.h, z3.h[3]\n"
                ".inst 0x646240d0 // bfdot z16.s, z6.h, z2.h[0]\n"
                ".inst 0x646a40d1 // bfdot z17.s, z6.h, z2.h[1]\n"
                ".inst 0x647240d2 // bfdot z18.s, z6.h, z2.h[2]\n"
                ".inst 0x647a40d3 // bfdot z19.s, z6.h, z2.h[3]\n"
                "st1w z16.s, p0, [%[c_ptr], #2, MUL VL]\n"
                ".inst 0x646340dc // bfdot z28.s, z6.h, z3.h[0]\n"
                ".inst 0x646b40dd // bfdot z29.s, z6.h, z3.h[1]\n"
                ".inst 0x647340de // bfdot z30.s, z6.h, z3.h[2]\n"
                "st1w z9.s, p0, [%[c_ptr], #3, MUL VL]\n"
                ".inst 0x647b40df // bfdot z31.s, z6.h, z3.h[3]\n"
                "4:\n"
                "st1w z13.s, p0, [%[c_ptr], #4, MUL VL]\n"
                "st1w z17.s, p0, [%[c_ptr], #5, MUL VL]\n"
                "st1w z10.s, p0, [%[c_ptr], #6, MUL VL]\n"
                "st1w z14.s, p0, [%[c_ptr], #7, MUL VL]\n"
                "addvl %[c_ptr], %[c_ptr], #16\n"
                "st1w z18.s, p0, [%[c_ptr], #-8, MUL VL]\n"
                "st1w z11.s, p0, [%[c_ptr], #-7, MUL VL]\n"
                "st1w z15.s, p0, [%[c_ptr], #-6, MUL VL]\n"
                "st1w z19.s, p0, [%[c_ptr], #-5, MUL VL]\n"
                "st1w z20.s, p0, [%[c_ptr], #-4, MUL VL]\n"
                "st1w z24.s, p0, [%[c_ptr], #-3, MUL VL]\n"
                "st1w z28.s, p0, [%[c_ptr], #-2, MUL VL]\n"
                "st1w z21.s, p0, [%[c_ptr], #-1, MUL VL]\n"
                "st1w z25.s, p0, [%[c_ptr]]\n"
                "st1w z29.s, p0, [%[c_ptr], #1, MUL VL]\n"
                "st1w z22.s, p0, [%[c_ptr], #2, MUL VL]\n"
                "st1w z26.s, p0, [%[c_ptr], #3, MUL VL]\n"
                "st1w z30.s, p0, [%[c_ptr], #4, MUL VL]\n"
                "st1w z23.s, p0, [%[c_ptr], #5, MUL VL]\n"
                "st1w z27.s, p0, [%[c_ptr], #6, MUL VL]\n"
                "st1w z31.s, p0, [%[c_ptr], #7, MUL VL]\n"
                "addvl %[c_ptr], %[c_ptr], #8\n"
            : [a_ptr] "+r" (a_ptr), [b_ptr] "+r" (b_ptr), [c_ptr] "+r" (c_ptr),
              [loops] "+r" (loops), [tails] "+r" (tails)
            :
            : "z0", "z1", "z2", "z3", "z4", "z5", "z6", "z8", "z9", "z10", "z11", "z12", "z13", "z14", "z15", "z16", "z17", "z18", "z19", "z20", "z21", "z22", "z23", "z24", "z25", "z26", "z27", "z28", "z29", "z30", "z31", "cc", "memory"
            );
        }
    }
}

} // namespace arm_gemm

#endif // __ARM_FEATURE_SVE