• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2019-2021 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
14  * all 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
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22  * IN THE SOFTWARE.
23  */
24 #ifdef __aarch64__
25 
26 #include "arm_gemm.hpp"
27 #include "../../utils.hpp"
28 
29 #include <cassert>
30 #include <cstdint>
31 
32 namespace arm_gemm {
33 
a64_hybrid_u8qa_dot_4x16_a55(unsigned int num_strings,const unsigned int * string_lengths,IndirectInputArg<uint8_t> A_arg,size_t M,size_t N,const uint8_t * B_ptr,IndirectOutputArg<uint8_t> output_arg,const Requantize32 * qp,const int32_t * col_bias,unsigned int)34 void a64_hybrid_u8qa_dot_4x16_a55 (
35     unsigned int num_strings, const unsigned int *string_lengths, IndirectInputArg<uint8_t> A_arg,
36     size_t M, size_t N, const uint8_t *B_ptr, IndirectOutputArg<uint8_t> output_arg,
37     const Requantize32 *qp, const int32_t *col_bias, unsigned int
38 )
39 {
40     struct KernelArgs {
41         unsigned int num_strings = {};
42         const unsigned int *string_lengths = {};
43         size_t N = {};
44         const uint8_t *B_ptr = {};
45         size_t output_offset = {};
46         size_t input_initial_col = {};
47         size_t input_offset = {};
48     } ka;
49 
50     unsigned long flags=0;
51     void *output_ptr;
52     void *input_ptr;
53 
54     if (output_arg.is_indirect) {
55         output_ptr=(void *)(output_arg.indirect.ptr);
56         ka.output_offset=output_arg.indirect.offset;
57         flags |= 0x4;
58     } else {
59         output_ptr=(void *)(output_arg.direct.base);
60         ka.output_offset=output_arg.direct.stride;
61     }
62 
63     if (A_arg.is_indirect) {
64         input_ptr=(void *)(A_arg.indirect.ptr);
65         ka.input_offset=A_arg.indirect.start_row;
66         ka.input_initial_col=A_arg.indirect.start_col;
67         flags |= 0x8;
68     } else {
69         assert(num_strings==1);
70         input_ptr=(void *)(A_arg.direct.base);
71         ka.input_offset=A_arg.direct.stride;
72     }
73     ka.num_strings = num_strings;
74     ka.string_lengths = string_lengths;
75     ka.N = N;
76     ka.B_ptr = B_ptr;
77     if (qp->c_offset > qp->minval) {
78         flags |= 0x20;
79     }
80     __asm__ __volatile__(
81 
82       "1:"  // Row loop
83       "cmp %x[M], #0x4\n"
84       "bge 91f\n"
85       "cmp %x[M], #0x2\n"
86       "bgt 61f\n"
87       "beq 31f\n"
88       "movi v11.4s, #0x0\n"
89       "movi v15.16b, #0x1\n"
90       "ldr x11, [%x[args_ptr], %[offsetof_N]]\n"
91       "ldr x10, [%x[args_ptr], %[offsetof_B_ptr]]\n"
92       "mov x9, %x[col_bias]\n"
93       "bic %x[flags], %x[flags], #0x80000000\n"
94       "mov x28, %x[output_ptr]\n"
95       "2:"  // Height 1: Column loop
96       "movi v16.4s, #0x0\n"
97       "movi v17.4s, #0x0\n"
98       "movi v18.4s, #0x0\n"
99       "movi v19.4s, #0x0\n"
100       "3:"  // Height 1: setup done
101       "mov x27, #0x0\n"
102       "4:"  // Height 1: String loop
103       "ldr x20, [%x[args_ptr], %[offsetof_string_lengths]]\n"
104       "ldr x19, [%x[args_ptr], %[offsetof_input_offset]]\n"
105       "ldr w26, [x20, x27, LSL #0x2]\n"
106       "tbz %x[flags], #3, 5f\n"
107       "ldr x20, [%x[input_ptr], x27, LSL #0x3]\n"
108       "add x20, x20, x19, LSL #3\n"
109       "ldr x25, [x20, #0x0]\n"
110       "cbnz x27, 6f\n"
111       "ldr x19, [%x[args_ptr], %[offsetof_input_initial_col]]\n"
112       "add x25, x25, x19\n"
113       "b 6f\n"
114       "5:"  // Height 1: setup direct input
115       "mov x25, %x[input_ptr]\n"
116       "6:"  // Height 1: input setup done
117       "cmp x26, #0x10\n"
118       "blt 11f\n"
119       "ldr q0, [x25, #0x0]\n"
120       "ldr q4, [x10, #0x0]\n"
121       "cmp x26, #0x20\n"
122       "blt 9f\n"
123       "7:"  // Height 1: Multiply loop: Main loop head
124       ".inst 0x6f80e090  // udot v16.4s, v4.16b, v0.4b[0]\n"
125       "ldr d5, [x10, #0x10]\n"
126       "ldr x24, [x10, #0x18]\n"
127       "add x25, x25, #0x10\n"
128       "ldr d6, [x10, #0x20]\n"
129       "ldr x23, [x10, #0x28]\n"
130       "mov v5.d[1], x24\n"
131       "ldr d7, [x10, #0x30]\n"
132       "ldr x19, [x10, #0x38]\n"
133       ".inst 0x6f80e0b1  // udot v17.4s, v5.16b, v0.4b[0]\n"
134       "mov v6.d[1], x23\n"
135       "ldr d8, [x10, #0x40]\n"
136       ".inst 0x6f80e0d2  // udot v18.4s, v6.16b, v0.4b[0]\n"
137       "mov v7.d[1], x19\n"
138       "ldr x23, [x10, #0x48]\n"
139       ".inst 0x6f80e0f3  // udot v19.4s, v7.16b, v0.4b[0]\n"
140       "ldr d9, [x10, #0x50]\n"
141       "ldr x19, [x10, #0x58]\n"
142       "mov v8.d[1], x23\n"
143       "ldr d10, [x10, #0x60]\n"
144       "ldr x23, [x10, #0x68]\n"
145       ".inst 0x6fa0e110  // udot v16.4s, v8.16b, v0.4b[1]\n"
146       "mov v9.d[1], x19\n"
147       "ldr d4, [x10, #0x70]\n"
148       ".inst 0x6fa0e131  // udot v17.4s, v9.16b, v0.4b[1]\n"
149       "mov v10.d[1], x23\n"
150       "ldr x19, [x10, #0x78]\n"
151       ".inst 0x6fa0e152  // udot v18.4s, v10.16b, v0.4b[1]\n"
152       "ldr d5, [x10, #0x80]\n"
153       "ldr x24, [x10, #0x88]\n"
154       "mov v4.d[1], x19\n"
155       "ldr d6, [x10, #0x90]\n"
156       "ldr x23, [x10, #0x98]\n"
157       ".inst 0x6fa0e093  // udot v19.4s, v4.16b, v0.4b[1]\n"
158       "mov v5.d[1], x24\n"
159       "ldr d7, [x10, #0xa0]\n"
160       ".inst 0x6f80e8b0  // udot v16.4s, v5.16b, v0.4b[2]\n"
161       "mov v6.d[1], x23\n"
162       "ldr x19, [x10, #0xa8]\n"
163       ".inst 0x6f80e8d1  // udot v17.4s, v6.16b, v0.4b[2]\n"
164       "ldr d8, [x10, #0xb0]\n"
165       "ldr x23, [x10, #0xb8]\n"
166       "mov v7.d[1], x19\n"
167       "ldr d9, [x10, #0xc0]\n"
168       "ldr x19, [x10, #0xc8]\n"
169       ".inst 0x6f80e8f2  // udot v18.4s, v7.16b, v0.4b[2]\n"
170       "mov v8.d[1], x23\n"
171       "ldr d10, [x10, #0xd0]\n"
172       ".inst 0x6f80e913  // udot v19.4s, v8.16b, v0.4b[2]\n"
173       "mov v9.d[1], x19\n"
174       "ldr x23, [x10, #0xd8]\n"
175       ".inst 0x6fa0e930  // udot v16.4s, v9.16b, v0.4b[3]\n"
176       "ldr d4, [x10, #0xe0]\n"
177       "ldr x19, [x10, #0xe8]\n"
178       "mov v10.d[1], x23\n"
179       "ldr d5, [x10, #0xf0]\n"
180       "ldr x24, [x10, #0xf8]\n"
181       "add x10, x10, #0x100\n"
182       ".inst 0x6fa0e951  // udot v17.4s, v10.16b, v0.4b[3]\n"
183       "mov v4.d[1], x19\n"
184       ".inst 0x6fa0e892  // udot v18.4s, v4.16b, v0.4b[3]\n"
185       "mov v5.d[1], x24\n"
186       ".inst 0x6fa0e8b3  // udot v19.4s, v5.16b, v0.4b[3]\n"
187       "tbnz %x[flags], #31, 8f\n"
188       ".inst 0x6e8f940b  // udot v11.4s, v0.16b, v15.16b\n"
189       "8:"  // Height 1: Multiply loop: unique 1: skip row sum
190       "prfm pldl1keep, [x25, #0x80]\n"
191       "sub x26, x26, #0x10\n"
192       "ldr q0, [x25, #0x0]\n"
193       "cmp x26, #0x20\n"
194       "ldr q4, [x10, #0x0]\n"
195       "bge 7b\n"
196       "9:"  // Height 1: Multiply loop: Single iteration only
197       ".inst 0x6f80e090  // udot v16.4s, v4.16b, v0.4b[0]\n"
198       "ldr q5, [x10, #0x10]\n"
199       "ldr q6, [x10, #0x20]\n"
200       "sub x26, x26, #0x10\n"
201       "ldr q7, [x10, #0x30]\n"
202       "add x25, x25, #0x10\n"
203       ".inst 0x6f80e0b1  // udot v17.4s, v5.16b, v0.4b[0]\n"
204       "ldr q8, [x10, #0x40]\n"
205       ".inst 0x6f80e0d2  // udot v18.4s, v6.16b, v0.4b[0]\n"
206       "ldr q9, [x10, #0x50]\n"
207       ".inst 0x6f80e0f3  // udot v19.4s, v7.16b, v0.4b[0]\n"
208       "ldr q10, [x10, #0x60]\n"
209       ".inst 0x6fa0e110  // udot v16.4s, v8.16b, v0.4b[1]\n"
210       "ldr q4, [x10, #0x70]\n"
211       ".inst 0x6fa0e131  // udot v17.4s, v9.16b, v0.4b[1]\n"
212       "ldr q5, [x10, #0x80]\n"
213       ".inst 0x6fa0e152  // udot v18.4s, v10.16b, v0.4b[1]\n"
214       "ldr q6, [x10, #0x90]\n"
215       ".inst 0x6fa0e093  // udot v19.4s, v4.16b, v0.4b[1]\n"
216       "ldr q7, [x10, #0xa0]\n"
217       ".inst 0x6f80e8b0  // udot v16.4s, v5.16b, v0.4b[2]\n"
218       "ldr q8, [x10, #0xb0]\n"
219       ".inst 0x6f80e8d1  // udot v17.4s, v6.16b, v0.4b[2]\n"
220       "ldr q9, [x10, #0xc0]\n"
221       ".inst 0x6f80e8f2  // udot v18.4s, v7.16b, v0.4b[2]\n"
222       "ldr q10, [x10, #0xd0]\n"
223       ".inst 0x6f80e913  // udot v19.4s, v8.16b, v0.4b[2]\n"
224       "ldr q4, [x10, #0xe0]\n"
225       ".inst 0x6fa0e930  // udot v16.4s, v9.16b, v0.4b[3]\n"
226       "ldr q5, [x10, #0xf0]\n"
227       ".inst 0x6fa0e951  // udot v17.4s, v10.16b, v0.4b[3]\n"
228       "add x10, x10, #0x100\n"
229       ".inst 0x6fa0e892  // udot v18.4s, v4.16b, v0.4b[3]\n"
230       ".inst 0x6fa0e8b3  // udot v19.4s, v5.16b, v0.4b[3]\n"
231       "tbnz %x[flags], #31, 10f\n"
232       ".inst 0x6e8f940b  // udot v11.4s, v0.16b, v15.16b\n"
233       "10:"  // Height 1: Multiply loop: unique 2: skip row sum
234       "prfm pldl1keep, [x25, #0x80]\n"
235       "11:"  // Height 1: Multiply loop: Main loop skip
236       "cbz x26, 18f\n"
237       "cmp x26, #0x4\n"
238       "blt 14f\n"
239       "12:"  // Height 1: Multiply loop: Odd block loop
240       "ldr s0, [x25], #0x4\n"
241       "tbnz %x[flags], #31, 13f\n"
242       ".inst 0x6e8f940b  // udot v11.4s, v0.16b, v15.16b\n"
243       "13:"  // Height 1: Multiply loop: unique 3: skip row sum
244       "ldr q6, [x10, #0x0]\n"
245       "sub x26, x26, #0x4\n"
246       "ldr q7, [x10, #0x10]\n"
247       "cmp x26, #0x4\n"
248       "ldr q8, [x10, #0x20]\n"
249       ".inst 0x6f80e0d0  // udot v16.4s, v6.16b, v0.4b[0]\n"
250       "ldr q9, [x10, #0x30]\n"
251       ".inst 0x6f80e0f1  // udot v17.4s, v7.16b, v0.4b[0]\n"
252       "add x10, x10, #0x40\n"
253       ".inst 0x6f80e112  // udot v18.4s, v8.16b, v0.4b[0]\n"
254       ".inst 0x6f80e133  // udot v19.4s, v9.16b, v0.4b[0]\n"
255       "bge 12b\n"
256       "cbz x26, 18f\n"
257       "14:"  // Height 1: Multiply loop: Skip odd blocks
258       "tbz x26, #1, 15f\n"
259       "ldr h0, [x25], #0x2\n"
260       "tbz x26, #0, 16f\n"
261       "ld1 { v0.b }[2], [x25]\n"
262       "b 16f\n"
263       "15:"  // Height 1: Multiply loop: Ragged operand read: partial_1_0
264       "ldr b0, [x25, #0x0]\n"
265       "16:"  // Height 1: Multiply loop: Ragged operand read: Done
266       "tbnz %x[flags], #31, 17f\n"
267       ".inst 0x6e8f940b  // udot v11.4s, v0.16b, v15.16b\n"
268       "17:"  // Height 1: Multiply loop: unique 4: skip row sum
269       "ldr q10, [x10, #0x0]\n"
270       "ldr q4, [x10, #0x10]\n"
271       "ldr q5, [x10, #0x20]\n"
272       ".inst 0x6f80e150  // udot v16.4s, v10.16b, v0.4b[0]\n"
273       "ldr q6, [x10, #0x30]\n"
274       ".inst 0x6f80e091  // udot v17.4s, v4.16b, v0.4b[0]\n"
275       "add x10, x10, #0x40\n"
276       ".inst 0x6f80e0b2  // udot v18.4s, v5.16b, v0.4b[0]\n"
277       ".inst 0x6f80e0d3  // udot v19.4s, v6.16b, v0.4b[0]\n"
278       "18:"  // Height 1: Multiply loop: No odd multiplies
279       "ldr w19, [%x[args_ptr], %[offsetof_num_strings]]\n"
280       "add x27, x27, #0x1\n"
281       "cmp x27, x19\n"
282       "bne 4b\n"
283       "prfm pstl1keep, [x28, #0x0]\n"
284       "tbnz %x[flags], #31, 19f\n"
285       "addp v11.4s, v11.4s, v11.4s\n"
286       "add x22, %x[qp], %[b_offset]\n"
287       "ld1r { v1.4s }, [x22]\n"
288       "neg v1.4s, v1.4s\n"
289       "addp v11.4s, v11.4s, v11.4s\n"
290       "mul v11.4s, v11.4s, v1.4s\n"
291       "19:"  // Height 1: skip row sum fixup
292       "add v16.4s, v16.4s, v11.4s\n"
293       "add v17.4s, v17.4s, v11.4s\n"
294       "add v18.4s, v18.4s, v11.4s\n"
295       "add v19.4s, v19.4s, v11.4s\n"
296       "ldr q0, [x9, #0x0]\n"
297       "orr %x[flags], %x[flags], #0x80000000\n"
298       "ldr q1, [x9, #0x10]\n"
299       "add x23, %x[qp], %[per_layer_right_shift]\n"
300       "ldr q2, [x9, #0x20]\n"
301       "add x22, %x[qp], %[per_layer_mul]\n"
302       "add v16.4s, v16.4s, v0.4s\n"
303       "ldr q3, [x9, #0x30]\n"
304       "add v17.4s, v17.4s, v1.4s\n"
305       "ld1r { v0.4s }, [x23]\n"
306       "add v18.4s, v18.4s, v2.4s\n"
307       "ld1r { v4.4s }, [x22]\n"
308       "add v19.4s, v19.4s, v3.4s\n"
309       "add x9, x9, #0x40\n"
310       "sqrdmulh v16.4s, v16.4s, v4.4s\n"
311       "sqrdmulh v17.4s, v17.4s, v4.4s\n"
312       "sqrdmulh v18.4s, v18.4s, v4.4s\n"
313       "sqrdmulh v19.4s, v19.4s, v4.4s\n"
314       "tbz %x[flags], #5, 20f\n"
315       "and v4.16b, v16.16b, v0.16b\n"
316       "and v5.16b, v17.16b, v0.16b\n"
317       "and v6.16b, v18.16b, v0.16b\n"
318       "and v7.16b, v19.16b, v0.16b\n"
319       "sshr v4.4s, v4.4s, #0x1f\n"
320       "sshr v5.4s, v5.4s, #0x1f\n"
321       "sshr v6.4s, v6.4s, #0x1f\n"
322       "sshr v7.4s, v7.4s, #0x1f\n"
323       "sqadd v16.4s, v16.4s, v4.4s\n"
324       "sqadd v17.4s, v17.4s, v5.4s\n"
325       "sqadd v18.4s, v18.4s, v6.4s\n"
326       "sqadd v19.4s, v19.4s, v7.4s\n"
327       "20:"  // Height 1: no shift correction
328       "srshl v16.4s, v16.4s, v0.4s\n"
329       "srshl v17.4s, v17.4s, v0.4s\n"
330       "srshl v18.4s, v18.4s, v0.4s\n"
331       "srshl v19.4s, v19.4s, v0.4s\n"
332       "add x22, %x[qp], %[c_offset]\n"
333       "add x23, %x[qp], %[minval]\n"
334       "ld1r { v4.4s }, [x22]\n"
335       "add x22, %x[qp], %[maxval]\n"
336       "ld1r { v5.4s }, [x23]\n"
337       "cmp x11, #0x10\n"
338       "ld1r { v6.4s }, [x22]\n"
339       "add v16.4s, v16.4s, v4.4s\n"
340       "add v17.4s, v17.4s, v4.4s\n"
341       "add v18.4s, v18.4s, v4.4s\n"
342       "add v19.4s, v19.4s, v4.4s\n"
343       "smin v16.4s, v16.4s, v6.4s\n"
344       "smin v17.4s, v17.4s, v6.4s\n"
345       "smin v18.4s, v18.4s, v6.4s\n"
346       "smin v19.4s, v19.4s, v6.4s\n"
347       "smax v16.4s, v16.4s, v5.4s\n"
348       "smax v17.4s, v17.4s, v5.4s\n"
349       "smax v18.4s, v18.4s, v5.4s\n"
350       "smax v19.4s, v19.4s, v5.4s\n"
351       "uzp1 v16.8h, v16.8h, v17.8h\n"
352       "uzp1 v17.8h, v18.8h, v19.8h\n"
353       "uzp1 v16.16b, v16.16b, v17.16b\n"
354       "bge 29f\n"
355       "tbz x11, #3, 24f\n"
356       "str d16, [x28], #0x8\n"
357       "tbz x11, #2, 22f\n"
358       "st1 { v16.s }[2], [x28], #0x4\n"
359       "tbz x11, #1, 21f\n"
360       "st1 { v16.h }[6], [x28], #0x2\n"
361       "tbz x11, #0, 28f\n"
362       "st1 { v16.b }[14], [x28]\n"
363       "b 28f\n"
364       "21:"  // Height 1: Partial direct writeback: partial_1_12
365       "tbz x11, #0, 28f\n"
366       "st1 { v16.b }[12], [x28]\n"
367       "b 28f\n"
368       "22:"  // Height 1: Partial direct writeback: partial_2_8
369       "tbz x11, #1, 23f\n"
370       "st1 { v16.h }[4], [x28], #0x2\n"
371       "tbz x11, #0, 28f\n"
372       "st1 { v16.b }[10], [x28]\n"
373       "b 28f\n"
374       "23:"  // Height 1: Partial direct writeback: partial_1_8
375       "tbz x11, #0, 28f\n"
376       "st1 { v16.b }[8], [x28]\n"
377       "b 28f\n"
378       "24:"  // Height 1: Partial direct writeback: partial_4_0
379       "tbz x11, #2, 26f\n"
380       "str s16, [x28], #0x4\n"
381       "tbz x11, #1, 25f\n"
382       "st1 { v16.h }[2], [x28], #0x2\n"
383       "tbz x11, #0, 28f\n"
384       "st1 { v16.b }[6], [x28]\n"
385       "b 28f\n"
386       "25:"  // Height 1: Partial direct writeback: partial_1_4
387       "tbz x11, #0, 28f\n"
388       "st1 { v16.b }[4], [x28]\n"
389       "b 28f\n"
390       "26:"  // Height 1: Partial direct writeback: partial_2_0
391       "tbz x11, #1, 27f\n"
392       "str h16, [x28], #0x2\n"
393       "tbz x11, #0, 28f\n"
394       "st1 { v16.b }[2], [x28]\n"
395       "b 28f\n"
396       "27:"  // Height 1: Partial direct writeback: partial_1_0
397       "str b16, [x28, #0x0]\n"
398       "28:"  // Height 1: Partial direct writeback: Done
399       "b 30f\n"
400       "29:"  // Height 1: Full writeback
401       "str q16, [x28, #0x0]\n"
402       "add x28, x28, #0x10\n"
403       "30:"  // Height 1: Writeback done
404       "subs x11, x11, #0x10\n"
405       "bgt 2b\n"
406       "b 122f\n"
407       "31:"  // Height 2
408       "movi v11.4s, #0x0\n"
409       "ldr x11, [%x[args_ptr], %[offsetof_N]]\n"
410       "movi v12.4s, #0x0\n"
411       "ldr x10, [%x[args_ptr], %[offsetof_B_ptr]]\n"
412       "movi v15.16b, #0x1\n"
413       "mov x9, %x[col_bias]\n"
414       "bic %x[flags], %x[flags], #0x80000000\n"
415       "mov x28, %x[output_ptr]\n"
416       "32:"  // Height 2: Column loop
417       "movi v16.4s, #0x0\n"
418       "movi v17.4s, #0x0\n"
419       "movi v18.4s, #0x0\n"
420       "movi v19.4s, #0x0\n"
421       "movi v20.4s, #0x0\n"
422       "movi v21.4s, #0x0\n"
423       "movi v22.4s, #0x0\n"
424       "movi v23.4s, #0x0\n"
425       "33:"  // Height 2: setup done
426       "mov x27, #0x0\n"
427       "34:"  // Height 2: String loop
428       "ldr x20, [%x[args_ptr], %[offsetof_string_lengths]]\n"
429       "ldr x19, [%x[args_ptr], %[offsetof_input_offset]]\n"
430       "ldr w26, [x20, x27, LSL #0x2]\n"
431       "tbz %x[flags], #3, 35f\n"
432       "ldr x20, [%x[input_ptr], x27, LSL #0x3]\n"
433       "add x20, x20, x19, LSL #3\n"
434       "ldr x25, [x20, #0x0]\n"
435       "ldr x22, [x20, #0x8]\n"
436       "cbnz x27, 36f\n"
437       "ldr x19, [%x[args_ptr], %[offsetof_input_initial_col]]\n"
438       "add x25, x25, x19\n"
439       "add x22, x22, x19\n"
440       "b 36f\n"
441       "35:"  // Height 2: setup direct input
442       "mov x25, %x[input_ptr]\n"
443       "add x22, x25, x19\n"
444       "36:"  // Height 2: input setup done
445       "cmp x26, #0x10\n"
446       "blt 41f\n"
447       "ldr q0, [x25, #0x0]\n"
448       "ldr q1, [x22, #0x0]\n"
449       "cmp x26, #0x20\n"
450       "ldr q4, [x10, #0x0]\n"
451       "blt 39f\n"
452       "37:"  // Height 2: Multiply loop: Main loop head
453       ".inst 0x6f80e090  // udot v16.4s, v4.16b, v0.4b[0]\n"
454       "ldr d5, [x10, #0x10]\n"
455       ".inst 0x6f81e094  // udot v20.4s, v4.16b, v1.4b[0]\n"
456       "ldr x24, [x10, #0x18]\n"
457       "ldr d6, [x10, #0x20]\n"
458       "add x25, x25, #0x10\n"
459       "ldr x23, [x10, #0x28]\n"
460       "add x22, x22, #0x10\n"
461       "mov v5.d[1], x24\n"
462       "ldr d7, [x10, #0x30]\n"
463       "ldr x19, [x10, #0x38]\n"
464       ".inst 0x6f80e0b1  // udot v17.4s, v5.16b, v0.4b[0]\n"
465       "mov v6.d[1], x23\n"
466       ".inst 0x6f81e0b5  // udot v21.4s, v5.16b, v1.4b[0]\n"
467       "ldr d8, [x10, #0x40]\n"
468       ".inst 0x6f80e0d2  // udot v18.4s, v6.16b, v0.4b[0]\n"
469       "mov v7.d[1], x19\n"
470       ".inst 0x6f81e0d6  // udot v22.4s, v6.16b, v1.4b[0]\n"
471       "ldr x23, [x10, #0x48]\n"
472       ".inst 0x6f80e0f3  // udot v19.4s, v7.16b, v0.4b[0]\n"
473       "ldr d9, [x10, #0x50]\n"
474       ".inst 0x6f81e0f7  // udot v23.4s, v7.16b, v1.4b[0]\n"
475       "ldr x19, [x10, #0x58]\n"
476       "mov v8.d[1], x23\n"
477       "ldr d10, [x10, #0x60]\n"
478       "ldr x23, [x10, #0x68]\n"
479       ".inst 0x6fa0e110  // udot v16.4s, v8.16b, v0.4b[1]\n"
480       "mov v9.d[1], x19\n"
481       ".inst 0x6fa1e114  // udot v20.4s, v8.16b, v1.4b[1]\n"
482       "ldr d4, [x10, #0x70]\n"
483       ".inst 0x6fa0e131  // udot v17.4s, v9.16b, v0.4b[1]\n"
484       "mov v10.d[1], x23\n"
485       ".inst 0x6fa1e135  // udot v21.4s, v9.16b, v1.4b[1]\n"
486       "ldr x19, [x10, #0x78]\n"
487       ".inst 0x6fa0e152  // udot v18.4s, v10.16b, v0.4b[1]\n"
488       "ldr d5, [x10, #0x80]\n"
489       ".inst 0x6fa1e156  // udot v22.4s, v10.16b, v1.4b[1]\n"
490       "ldr x24, [x10, #0x88]\n"
491       "mov v4.d[1], x19\n"
492       "ldr d6, [x10, #0x90]\n"
493       "ldr x23, [x10, #0x98]\n"
494       ".inst 0x6fa0e093  // udot v19.4s, v4.16b, v0.4b[1]\n"
495       "mov v5.d[1], x24\n"
496       ".inst 0x6fa1e097  // udot v23.4s, v4.16b, v1.4b[1]\n"
497       "ldr d7, [x10, #0xa0]\n"
498       ".inst 0x6f80e8b0  // udot v16.4s, v5.16b, v0.4b[2]\n"
499       "mov v6.d[1], x23\n"
500       ".inst 0x6f81e8b4  // udot v20.4s, v5.16b, v1.4b[2]\n"
501       "ldr x19, [x10, #0xa8]\n"
502       ".inst 0x6f80e8d1  // udot v17.4s, v6.16b, v0.4b[2]\n"
503       "ldr d8, [x10, #0xb0]\n"
504       ".inst 0x6f81e8d5  // udot v21.4s, v6.16b, v1.4b[2]\n"
505       "ldr x23, [x10, #0xb8]\n"
506       "mov v7.d[1], x19\n"
507       "ldr d9, [x10, #0xc0]\n"
508       "ldr x19, [x10, #0xc8]\n"
509       ".inst 0x6f80e8f2  // udot v18.4s, v7.16b, v0.4b[2]\n"
510       "mov v8.d[1], x23\n"
511       ".inst 0x6f81e8f6  // udot v22.4s, v7.16b, v1.4b[2]\n"
512       "ldr d10, [x10, #0xd0]\n"
513       ".inst 0x6f80e913  // udot v19.4s, v8.16b, v0.4b[2]\n"
514       "mov v9.d[1], x19\n"
515       ".inst 0x6f81e917  // udot v23.4s, v8.16b, v1.4b[2]\n"
516       "ldr x23, [x10, #0xd8]\n"
517       ".inst 0x6fa0e930  // udot v16.4s, v9.16b, v0.4b[3]\n"
518       "ldr d4, [x10, #0xe0]\n"
519       ".inst 0x6fa1e934  // udot v20.4s, v9.16b, v1.4b[3]\n"
520       "ldr x19, [x10, #0xe8]\n"
521       "mov v10.d[1], x23\n"
522       "ldr d5, [x10, #0xf0]\n"
523       "ldr x24, [x10, #0xf8]\n"
524       "add x10, x10, #0x100\n"
525       ".inst 0x6fa0e951  // udot v17.4s, v10.16b, v0.4b[3]\n"
526       "mov v4.d[1], x19\n"
527       ".inst 0x6fa1e955  // udot v21.4s, v10.16b, v1.4b[3]\n"
528       ".inst 0x6fa0e892  // udot v18.4s, v4.16b, v0.4b[3]\n"
529       "mov v5.d[1], x24\n"
530       ".inst 0x6fa1e896  // udot v22.4s, v4.16b, v1.4b[3]\n"
531       ".inst 0x6fa0e8b3  // udot v19.4s, v5.16b, v0.4b[3]\n"
532       ".inst 0x6fa1e8b7  // udot v23.4s, v5.16b, v1.4b[3]\n"
533       "tbnz %x[flags], #31, 38f\n"
534       ".inst 0x6e8f940b  // udot v11.4s, v0.16b, v15.16b\n"
535       ".inst 0x6e8f942c  // udot v12.4s, v1.16b, v15.16b\n"
536       "38:"  // Height 2: Multiply loop: unique 5: skip row sum
537       "prfm pldl1keep, [x25, #0x80]\n"
538       "sub x26, x26, #0x10\n"
539       "prfm pldl1keep, [x22, #0x80]\n"
540       "cmp x26, #0x20\n"
541       "ldr q0, [x25, #0x0]\n"
542       "ldr q1, [x22, #0x0]\n"
543       "ldr q4, [x10, #0x0]\n"
544       "bge 37b\n"
545       "39:"  // Height 2: Multiply loop: Single iteration only
546       ".inst 0x6f80e090  // udot v16.4s, v4.16b, v0.4b[0]\n"
547       "ldr q5, [x10, #0x10]\n"
548       ".inst 0x6f81e094  // udot v20.4s, v4.16b, v1.4b[0]\n"
549       "ldr q6, [x10, #0x20]\n"
550       "ldr q7, [x10, #0x30]\n"
551       "sub x26, x26, #0x10\n"
552       ".inst 0x6f80e0b1  // udot v17.4s, v5.16b, v0.4b[0]\n"
553       "ldr q8, [x10, #0x40]\n"
554       ".inst 0x6f81e0b5  // udot v21.4s, v5.16b, v1.4b[0]\n"
555       "ldr q9, [x10, #0x50]\n"
556       ".inst 0x6f80e0d2  // udot v18.4s, v6.16b, v0.4b[0]\n"
557       "ldr q10, [x10, #0x60]\n"
558       ".inst 0x6f81e0d6  // udot v22.4s, v6.16b, v1.4b[0]\n"
559       "ldr q4, [x10, #0x70]\n"
560       ".inst 0x6f80e0f3  // udot v19.4s, v7.16b, v0.4b[0]\n"
561       "ldr q5, [x10, #0x80]\n"
562       ".inst 0x6f81e0f7  // udot v23.4s, v7.16b, v1.4b[0]\n"
563       "ldr q6, [x10, #0x90]\n"
564       ".inst 0x6fa0e110  // udot v16.4s, v8.16b, v0.4b[1]\n"
565       "ldr q7, [x10, #0xa0]\n"
566       ".inst 0x6fa1e114  // udot v20.4s, v8.16b, v1.4b[1]\n"
567       "ldr q8, [x10, #0xb0]\n"
568       ".inst 0x6fa0e131  // udot v17.4s, v9.16b, v0.4b[1]\n"
569       "add x25, x25, #0x10\n"
570       ".inst 0x6fa1e135  // udot v21.4s, v9.16b, v1.4b[1]\n"
571       "ldr q9, [x10, #0xc0]\n"
572       ".inst 0x6fa0e152  // udot v18.4s, v10.16b, v0.4b[1]\n"
573       "add x22, x22, #0x10\n"
574       ".inst 0x6fa1e156  // udot v22.4s, v10.16b, v1.4b[1]\n"
575       "ldr q10, [x10, #0xd0]\n"
576       ".inst 0x6fa0e093  // udot v19.4s, v4.16b, v0.4b[1]\n"
577       ".inst 0x6fa1e097  // udot v23.4s, v4.16b, v1.4b[1]\n"
578       "ldr q4, [x10, #0xe0]\n"
579       ".inst 0x6f80e8b0  // udot v16.4s, v5.16b, v0.4b[2]\n"
580       ".inst 0x6f81e8b4  // udot v20.4s, v5.16b, v1.4b[2]\n"
581       "ldr q5, [x10, #0xf0]\n"
582       ".inst 0x6f80e8d1  // udot v17.4s, v6.16b, v0.4b[2]\n"
583       "add x10, x10, #0x100\n"
584       ".inst 0x6f81e8d5  // udot v21.4s, v6.16b, v1.4b[2]\n"
585       ".inst 0x6f80e8f2  // udot v18.4s, v7.16b, v0.4b[2]\n"
586       ".inst 0x6f81e8f6  // udot v22.4s, v7.16b, v1.4b[2]\n"
587       ".inst 0x6f80e913  // udot v19.4s, v8.16b, v0.4b[2]\n"
588       ".inst 0x6f81e917  // udot v23.4s, v8.16b, v1.4b[2]\n"
589       ".inst 0x6fa0e930  // udot v16.4s, v9.16b, v0.4b[3]\n"
590       ".inst 0x6fa1e934  // udot v20.4s, v9.16b, v1.4b[3]\n"
591       ".inst 0x6fa0e951  // udot v17.4s, v10.16b, v0.4b[3]\n"
592       ".inst 0x6fa1e955  // udot v21.4s, v10.16b, v1.4b[3]\n"
593       ".inst 0x6fa0e892  // udot v18.4s, v4.16b, v0.4b[3]\n"
594       ".inst 0x6fa1e896  // udot v22.4s, v4.16b, v1.4b[3]\n"
595       ".inst 0x6fa0e8b3  // udot v19.4s, v5.16b, v0.4b[3]\n"
596       ".inst 0x6fa1e8b7  // udot v23.4s, v5.16b, v1.4b[3]\n"
597       "tbnz %x[flags], #31, 40f\n"
598       ".inst 0x6e8f940b  // udot v11.4s, v0.16b, v15.16b\n"
599       ".inst 0x6e8f942c  // udot v12.4s, v1.16b, v15.16b\n"
600       "40:"  // Height 2: Multiply loop: unique 6: skip row sum
601       "prfm pldl1keep, [x25, #0x80]\n"
602       "prfm pldl1keep, [x22, #0x80]\n"
603       "41:"  // Height 2: Multiply loop: Main loop skip
604       "cbz x26, 48f\n"
605       "cmp x26, #0x4\n"
606       "blt 44f\n"
607       "42:"  // Height 2: Multiply loop: Odd block loop
608       "ldr s0, [x25], #0x4\n"
609       "ldr s1, [x22], #0x4\n"
610       "tbnz %x[flags], #31, 43f\n"
611       ".inst 0x6e8f940b  // udot v11.4s, v0.16b, v15.16b\n"
612       ".inst 0x6e8f942c  // udot v12.4s, v1.16b, v15.16b\n"
613       "43:"  // Height 2: Multiply loop: unique 7: skip row sum
614       "ldr q6, [x10, #0x0]\n"
615       "sub x26, x26, #0x4\n"
616       "ldr q7, [x10, #0x10]\n"
617       "cmp x26, #0x4\n"
618       "ldr q8, [x10, #0x20]\n"
619       ".inst 0x6f80e0d0  // udot v16.4s, v6.16b, v0.4b[0]\n"
620       "ldr q9, [x10, #0x30]\n"
621       ".inst 0x6f81e0d4  // udot v20.4s, v6.16b, v1.4b[0]\n"
622       "add x10, x10, #0x40\n"
623       ".inst 0x6f80e0f1  // udot v17.4s, v7.16b, v0.4b[0]\n"
624       ".inst 0x6f81e0f5  // udot v21.4s, v7.16b, v1.4b[0]\n"
625       ".inst 0x6f80e112  // udot v18.4s, v8.16b, v0.4b[0]\n"
626       ".inst 0x6f81e116  // udot v22.4s, v8.16b, v1.4b[0]\n"
627       ".inst 0x6f80e133  // udot v19.4s, v9.16b, v0.4b[0]\n"
628       ".inst 0x6f81e137  // udot v23.4s, v9.16b, v1.4b[0]\n"
629       "bge 42b\n"
630       "cbz x26, 48f\n"
631       "44:"  // Height 2: Multiply loop: Skip odd blocks
632       "tbz x26, #1, 45f\n"
633       "ldr h0, [x25], #0x2\n"
634       "ldr h1, [x22], #0x2\n"
635       "tbz x26, #0, 46f\n"
636       "ld1 { v0.b }[2], [x25]\n"
637       "ld1 { v1.b }[2], [x22]\n"
638       "b 46f\n"
639       "45:"  // Height 2: Multiply loop: Ragged operand read: partial_1_0
640       "ldr b0, [x25, #0x0]\n"
641       "ldr b1, [x22, #0x0]\n"
642       "46:"  // Height 2: Multiply loop: Ragged operand read: Done
643       "tbnz %x[flags], #31, 47f\n"
644       ".inst 0x6e8f940b  // udot v11.4s, v0.16b, v15.16b\n"
645       ".inst 0x6e8f942c  // udot v12.4s, v1.16b, v15.16b\n"
646       "47:"  // Height 2: Multiply loop: unique 8: skip row sum
647       "ldr q10, [x10, #0x0]\n"
648       "ldr q4, [x10, #0x10]\n"
649       "ldr q5, [x10, #0x20]\n"
650       ".inst 0x6f80e150  // udot v16.4s, v10.16b, v0.4b[0]\n"
651       "ldr q6, [x10, #0x30]\n"
652       ".inst 0x6f81e154  // udot v20.4s, v10.16b, v1.4b[0]\n"
653       "add x10, x10, #0x40\n"
654       ".inst 0x6f80e091  // udot v17.4s, v4.16b, v0.4b[0]\n"
655       ".inst 0x6f81e095  // udot v21.4s, v4.16b, v1.4b[0]\n"
656       ".inst 0x6f80e0b2  // udot v18.4s, v5.16b, v0.4b[0]\n"
657       ".inst 0x6f81e0b6  // udot v22.4s, v5.16b, v1.4b[0]\n"
658       ".inst 0x6f80e0d3  // udot v19.4s, v6.16b, v0.4b[0]\n"
659       ".inst 0x6f81e0d7  // udot v23.4s, v6.16b, v1.4b[0]\n"
660       "48:"  // Height 2: Multiply loop: No odd multiplies
661       "ldr w19, [%x[args_ptr], %[offsetof_num_strings]]\n"
662       "add x27, x27, #0x1\n"
663       "cmp x27, x19\n"
664       "bne 34b\n"
665       "ldr x19, [%x[args_ptr], %[offsetof_output_offset]]\n"
666       "prfm pstl1keep, [x28, #0x0]\n"
667       "add x21, x28, x19\n"
668       "prfm pstl1keep, [x21, #0x0]\n"
669       "tbnz %x[flags], #31, 49f\n"
670       "addp v11.4s, v11.4s, v11.4s\n"
671       "addp v12.4s, v12.4s, v12.4s\n"
672       "add x22, %x[qp], %[b_offset]\n"
673       "ld1r { v2.4s }, [x22]\n"
674       "neg v2.4s, v2.4s\n"
675       "addp v11.4s, v11.4s, v11.4s\n"
676       "addp v12.4s, v12.4s, v12.4s\n"
677       "mul v11.4s, v11.4s, v2.4s\n"
678       "mul v12.4s, v12.4s, v2.4s\n"
679       "49:"  // Height 2: skip row sum fixup
680       "add v16.4s, v16.4s, v11.4s\n"
681       "add v17.4s, v17.4s, v11.4s\n"
682       "add v18.4s, v18.4s, v11.4s\n"
683       "add v19.4s, v19.4s, v11.4s\n"
684       "add v20.4s, v20.4s, v12.4s\n"
685       "add v21.4s, v21.4s, v12.4s\n"
686       "add v22.4s, v22.4s, v12.4s\n"
687       "add v23.4s, v23.4s, v12.4s\n"
688       "ldr q0, [x9, #0x0]\n"
689       "orr %x[flags], %x[flags], #0x80000000\n"
690       "ldr q1, [x9, #0x10]\n"
691       "add x23, %x[qp], %[per_layer_right_shift]\n"
692       "ldr q2, [x9, #0x20]\n"
693       "add x22, %x[qp], %[per_layer_mul]\n"
694       "add v16.4s, v16.4s, v0.4s\n"
695       "add v20.4s, v20.4s, v0.4s\n"
696       "add v17.4s, v17.4s, v1.4s\n"
697       "add v21.4s, v21.4s, v1.4s\n"
698       "add v18.4s, v18.4s, v2.4s\n"
699       "add v22.4s, v22.4s, v2.4s\n"
700       "ldr q3, [x9, #0x30]\n"
701       "add x9, x9, #0x40\n"
702       "ld1r { v0.4s }, [x23]\n"
703       "ld1r { v4.4s }, [x22]\n"
704       "add v19.4s, v19.4s, v3.4s\n"
705       "add v23.4s, v23.4s, v3.4s\n"
706       "sqrdmulh v16.4s, v16.4s, v4.4s\n"
707       "sqrdmulh v17.4s, v17.4s, v4.4s\n"
708       "sqrdmulh v18.4s, v18.4s, v4.4s\n"
709       "sqrdmulh v20.4s, v20.4s, v4.4s\n"
710       "sqrdmulh v21.4s, v21.4s, v4.4s\n"
711       "sqrdmulh v22.4s, v22.4s, v4.4s\n"
712       "sqrdmulh v19.4s, v19.4s, v4.4s\n"
713       "sqrdmulh v23.4s, v23.4s, v4.4s\n"
714       "tbz %x[flags], #5, 50f\n"
715       "and v4.16b, v16.16b, v0.16b\n"
716       "and v5.16b, v17.16b, v0.16b\n"
717       "and v6.16b, v18.16b, v0.16b\n"
718       "and v8.16b, v20.16b, v0.16b\n"
719       "and v9.16b, v21.16b, v0.16b\n"
720       "and v10.16b, v22.16b, v0.16b\n"
721       "and v7.16b, v19.16b, v0.16b\n"
722       "sshr v4.4s, v4.4s, #0x1f\n"
723       "sshr v5.4s, v5.4s, #0x1f\n"
724       "sshr v6.4s, v6.4s, #0x1f\n"
725       "sshr v8.4s, v8.4s, #0x1f\n"
726       "sshr v9.4s, v9.4s, #0x1f\n"
727       "sshr v10.4s, v10.4s, #0x1f\n"
728       "sshr v7.4s, v7.4s, #0x1f\n"
729       "sqadd v16.4s, v16.4s, v4.4s\n"
730       "sqadd v17.4s, v17.4s, v5.4s\n"
731       "sqadd v18.4s, v18.4s, v6.4s\n"
732       "sqadd v20.4s, v20.4s, v8.4s\n"
733       "sqadd v21.4s, v21.4s, v9.4s\n"
734       "sqadd v22.4s, v22.4s, v10.4s\n"
735       "sqadd v19.4s, v19.4s, v7.4s\n"
736       "and v4.16b, v23.16b, v0.16b\n"
737       "sshr v4.4s, v4.4s, #0x1f\n"
738       "sqadd v23.4s, v23.4s, v4.4s\n"
739       "50:"  // Height 2: no shift correction
740       "srshl v16.4s, v16.4s, v0.4s\n"
741       "srshl v17.4s, v17.4s, v0.4s\n"
742       "srshl v18.4s, v18.4s, v0.4s\n"
743       "srshl v19.4s, v19.4s, v0.4s\n"
744       "srshl v20.4s, v20.4s, v0.4s\n"
745       "srshl v21.4s, v21.4s, v0.4s\n"
746       "srshl v22.4s, v22.4s, v0.4s\n"
747       "srshl v23.4s, v23.4s, v0.4s\n"
748       "add x22, %x[qp], %[c_offset]\n"
749       "add x23, %x[qp], %[minval]\n"
750       "ld1r { v4.4s }, [x22]\n"
751       "add x22, %x[qp], %[maxval]\n"
752       "ld1r { v5.4s }, [x23]\n"
753       "cmp x11, #0x10\n"
754       "ld1r { v6.4s }, [x22]\n"
755       "add v16.4s, v16.4s, v4.4s\n"
756       "add v17.4s, v17.4s, v4.4s\n"
757       "add v18.4s, v18.4s, v4.4s\n"
758       "add v19.4s, v19.4s, v4.4s\n"
759       "add v20.4s, v20.4s, v4.4s\n"
760       "add v21.4s, v21.4s, v4.4s\n"
761       "add v22.4s, v22.4s, v4.4s\n"
762       "add v23.4s, v23.4s, v4.4s\n"
763       "smin v16.4s, v16.4s, v6.4s\n"
764       "smin v17.4s, v17.4s, v6.4s\n"
765       "smin v18.4s, v18.4s, v6.4s\n"
766       "smin v19.4s, v19.4s, v6.4s\n"
767       "smin v20.4s, v20.4s, v6.4s\n"
768       "smin v21.4s, v21.4s, v6.4s\n"
769       "smin v22.4s, v22.4s, v6.4s\n"
770       "smin v23.4s, v23.4s, v6.4s\n"
771       "smax v16.4s, v16.4s, v5.4s\n"
772       "smax v17.4s, v17.4s, v5.4s\n"
773       "smax v18.4s, v18.4s, v5.4s\n"
774       "smax v19.4s, v19.4s, v5.4s\n"
775       "smax v20.4s, v20.4s, v5.4s\n"
776       "smax v21.4s, v21.4s, v5.4s\n"
777       "smax v22.4s, v22.4s, v5.4s\n"
778       "smax v23.4s, v23.4s, v5.4s\n"
779       "uzp1 v16.8h, v16.8h, v17.8h\n"
780       "uzp1 v17.8h, v18.8h, v19.8h\n"
781       "uzp1 v20.8h, v20.8h, v21.8h\n"
782       "uzp1 v21.8h, v22.8h, v23.8h\n"
783       "uzp1 v16.16b, v16.16b, v17.16b\n"
784       "uzp1 v20.16b, v20.16b, v21.16b\n"
785       "bge 59f\n"
786       "tbz x11, #3, 54f\n"
787       "str d16, [x28], #0x8\n"
788       "str d20, [x21], #0x8\n"
789       "tbz x11, #2, 52f\n"
790       "st1 { v16.s }[2], [x28], #0x4\n"
791       "st1 { v20.s }[2], [x21], #0x4\n"
792       "tbz x11, #1, 51f\n"
793       "st1 { v16.h }[6], [x28], #0x2\n"
794       "st1 { v20.h }[6], [x21], #0x2\n"
795       "tbz x11, #0, 58f\n"
796       "st1 { v16.b }[14], [x28]\n"
797       "st1 { v20.b }[14], [x21]\n"
798       "b 58f\n"
799       "51:"  // Height 2: Partial direct writeback: partial_1_12
800       "tbz x11, #0, 58f\n"
801       "st1 { v16.b }[12], [x28]\n"
802       "st1 { v20.b }[12], [x21]\n"
803       "b 58f\n"
804       "52:"  // Height 2: Partial direct writeback: partial_2_8
805       "tbz x11, #1, 53f\n"
806       "st1 { v16.h }[4], [x28], #0x2\n"
807       "st1 { v20.h }[4], [x21], #0x2\n"
808       "tbz x11, #0, 58f\n"
809       "st1 { v16.b }[10], [x28]\n"
810       "st1 { v20.b }[10], [x21]\n"
811       "b 58f\n"
812       "53:"  // Height 2: Partial direct writeback: partial_1_8
813       "tbz x11, #0, 58f\n"
814       "st1 { v16.b }[8], [x28]\n"
815       "st1 { v20.b }[8], [x21]\n"
816       "b 58f\n"
817       "54:"  // Height 2: Partial direct writeback: partial_4_0
818       "tbz x11, #2, 56f\n"
819       "str s16, [x28], #0x4\n"
820       "str s20, [x21], #0x4\n"
821       "tbz x11, #1, 55f\n"
822       "st1 { v16.h }[2], [x28], #0x2\n"
823       "st1 { v20.h }[2], [x21], #0x2\n"
824       "tbz x11, #0, 58f\n"
825       "st1 { v16.b }[6], [x28]\n"
826       "st1 { v20.b }[6], [x21]\n"
827       "b 58f\n"
828       "55:"  // Height 2: Partial direct writeback: partial_1_4
829       "tbz x11, #0, 58f\n"
830       "st1 { v16.b }[4], [x28]\n"
831       "st1 { v20.b }[4], [x21]\n"
832       "b 58f\n"
833       "56:"  // Height 2: Partial direct writeback: partial_2_0
834       "tbz x11, #1, 57f\n"
835       "str h16, [x28], #0x2\n"
836       "str h20, [x21], #0x2\n"
837       "tbz x11, #0, 58f\n"
838       "st1 { v16.b }[2], [x28]\n"
839       "st1 { v20.b }[2], [x21]\n"
840       "b 58f\n"
841       "57:"  // Height 2: Partial direct writeback: partial_1_0
842       "str b16, [x28, #0x0]\n"
843       "str b20, [x21, #0x0]\n"
844       "58:"  // Height 2: Partial direct writeback: Done
845       "b 60f\n"
846       "59:"  // Height 2: Full writeback
847       "str q16, [x28, #0x0]\n"
848       "add x28, x28, #0x10\n"
849       "str q20, [x21, #0x0]\n"
850       "60:"  // Height 2: Writeback done
851       "subs x11, x11, #0x10\n"
852       "bgt 32b\n"
853       "b 122f\n"
854       "61:"  // Height 3
855       "movi v11.4s, #0x0\n"
856       "ldr x11, [%x[args_ptr], %[offsetof_N]]\n"
857       "movi v12.4s, #0x0\n"
858       "ldr x10, [%x[args_ptr], %[offsetof_B_ptr]]\n"
859       "movi v13.4s, #0x0\n"
860       "mov x9, %x[col_bias]\n"
861       "movi v15.16b, #0x1\n"
862       "bic %x[flags], %x[flags], #0x80000000\n"
863       "mov x28, %x[output_ptr]\n"
864       "62:"  // Height 3: Column loop
865       "movi v16.4s, #0x0\n"
866       "movi v17.4s, #0x0\n"
867       "movi v18.4s, #0x0\n"
868       "movi v19.4s, #0x0\n"
869       "movi v20.4s, #0x0\n"
870       "movi v21.4s, #0x0\n"
871       "movi v22.4s, #0x0\n"
872       "movi v23.4s, #0x0\n"
873       "movi v24.4s, #0x0\n"
874       "movi v25.4s, #0x0\n"
875       "movi v26.4s, #0x0\n"
876       "movi v27.4s, #0x0\n"
877       "63:"  // Height 3: setup done
878       "mov x27, #0x0\n"
879       "64:"  // Height 3: String loop
880       "ldr x20, [%x[args_ptr], %[offsetof_string_lengths]]\n"
881       "ldr x19, [%x[args_ptr], %[offsetof_input_offset]]\n"
882       "ldr w26, [x20, x27, LSL #0x2]\n"
883       "tbz %x[flags], #3, 65f\n"
884       "ldr x20, [%x[input_ptr], x27, LSL #0x3]\n"
885       "add x20, x20, x19, LSL #3\n"
886       "ldr x25, [x20, #0x0]\n"
887       "ldr x22, [x20, #0x8]\n"
888       "ldr x21, [x20, #0x10]\n"
889       "cbnz x27, 66f\n"
890       "ldr x19, [%x[args_ptr], %[offsetof_input_initial_col]]\n"
891       "add x25, x25, x19\n"
892       "add x22, x22, x19\n"
893       "add x21, x21, x19\n"
894       "b 66f\n"
895       "65:"  // Height 3: setup direct input
896       "mov x25, %x[input_ptr]\n"
897       "add x22, x25, x19\n"
898       "add x21, x22, x19\n"
899       "66:"  // Height 3: input setup done
900       "cmp x26, #0x10\n"
901       "blt 71f\n"
902       "ldr q0, [x25, #0x0]\n"
903       "ldr q1, [x22, #0x0]\n"
904       "cmp x26, #0x20\n"
905       "ldr q2, [x21, #0x0]\n"
906       "ldr q4, [x10, #0x0]\n"
907       "blt 69f\n"
908       "67:"  // Height 3: Multiply loop: Main loop head
909       ".inst 0x6f80e090  // udot v16.4s, v4.16b, v0.4b[0]\n"
910       "ldr d5, [x10, #0x10]\n"
911       ".inst 0x6f81e094  // udot v20.4s, v4.16b, v1.4b[0]\n"
912       "ldr x24, [x10, #0x18]\n"
913       ".inst 0x6f82e098  // udot v24.4s, v4.16b, v2.4b[0]\n"
914       "ldr d6, [x10, #0x20]\n"
915       "ldr x23, [x10, #0x28]\n"
916       "add x25, x25, #0x10\n"
917       "mov v5.d[1], x24\n"
918       "ldr d7, [x10, #0x30]\n"
919       "ldr x19, [x10, #0x38]\n"
920       "add x22, x22, #0x10\n"
921       ".inst 0x6f80e0b1  // udot v17.4s, v5.16b, v0.4b[0]\n"
922       "mov v6.d[1], x23\n"
923       ".inst 0x6f81e0b5  // udot v21.4s, v5.16b, v1.4b[0]\n"
924       "ldr d8, [x10, #0x40]\n"
925       ".inst 0x6f82e0b9  // udot v25.4s, v5.16b, v2.4b[0]\n"
926       "mov v7.d[1], x19\n"
927       ".inst 0x6f80e0d2  // udot v18.4s, v6.16b, v0.4b[0]\n"
928       "ldr x23, [x10, #0x48]\n"
929       ".inst 0x6f81e0d6  // udot v22.4s, v6.16b, v1.4b[0]\n"
930       "ldr d9, [x10, #0x50]\n"
931       ".inst 0x6f82e0da  // udot v26.4s, v6.16b, v2.4b[0]\n"
932       "ldr x19, [x10, #0x58]\n"
933       ".inst 0x6f80e0f3  // udot v19.4s, v7.16b, v0.4b[0]\n"
934       "mov v8.d[1], x23\n"
935       ".inst 0x6f81e0f7  // udot v23.4s, v7.16b, v1.4b[0]\n"
936       "ldr d10, [x10, #0x60]\n"
937       ".inst 0x6f82e0fb  // udot v27.4s, v7.16b, v2.4b[0]\n"
938       "mov v9.d[1], x19\n"
939       ".inst 0x6fa0e110  // udot v16.4s, v8.16b, v0.4b[1]\n"
940       "ldr x23, [x10, #0x68]\n"
941       ".inst 0x6fa1e114  // udot v20.4s, v8.16b, v1.4b[1]\n"
942       "ldr d4, [x10, #0x70]\n"
943       ".inst 0x6fa2e118  // udot v24.4s, v8.16b, v2.4b[1]\n"
944       "ldr x19, [x10, #0x78]\n"
945       ".inst 0x6fa0e131  // udot v17.4s, v9.16b, v0.4b[1]\n"
946       "mov v10.d[1], x23\n"
947       ".inst 0x6fa1e135  // udot v21.4s, v9.16b, v1.4b[1]\n"
948       "ldr d5, [x10, #0x80]\n"
949       ".inst 0x6fa2e139  // udot v25.4s, v9.16b, v2.4b[1]\n"
950       "mov v4.d[1], x19\n"
951       ".inst 0x6fa0e152  // udot v18.4s, v10.16b, v0.4b[1]\n"
952       "ldr x24, [x10, #0x88]\n"
953       ".inst 0x6fa1e156  // udot v22.4s, v10.16b, v1.4b[1]\n"
954       "ldr d6, [x10, #0x90]\n"
955       ".inst 0x6fa2e15a  // udot v26.4s, v10.16b, v2.4b[1]\n"
956       "ldr x23, [x10, #0x98]\n"
957       ".inst 0x6fa0e093  // udot v19.4s, v4.16b, v0.4b[1]\n"
958       "mov v5.d[1], x24\n"
959       ".inst 0x6fa1e097  // udot v23.4s, v4.16b, v1.4b[1]\n"
960       "ldr d7, [x10, #0xa0]\n"
961       ".inst 0x6fa2e09b  // udot v27.4s, v4.16b, v2.4b[1]\n"
962       "mov v6.d[1], x23\n"
963       ".inst 0x6f80e8b0  // udot v16.4s, v5.16b, v0.4b[2]\n"
964       "ldr x19, [x10, #0xa8]\n"
965       ".inst 0x6f81e8b4  // udot v20.4s, v5.16b, v1.4b[2]\n"
966       "ldr d8, [x10, #0xb0]\n"
967       ".inst 0x6f82e8b8  // udot v24.4s, v5.16b, v2.4b[2]\n"
968       "ldr x23, [x10, #0xb8]\n"
969       ".inst 0x6f80e8d1  // udot v17.4s, v6.16b, v0.4b[2]\n"
970       "mov v7.d[1], x19\n"
971       ".inst 0x6f81e8d5  // udot v21.4s, v6.16b, v1.4b[2]\n"
972       "ldr d9, [x10, #0xc0]\n"
973       ".inst 0x6f82e8d9  // udot v25.4s, v6.16b, v2.4b[2]\n"
974       "mov v8.d[1], x23\n"
975       ".inst 0x6f80e8f2  // udot v18.4s, v7.16b, v0.4b[2]\n"
976       "ldr x19, [x10, #0xc8]\n"
977       ".inst 0x6f81e8f6  // udot v22.4s, v7.16b, v1.4b[2]\n"
978       "ldr d10, [x10, #0xd0]\n"
979       ".inst 0x6f82e8fa  // udot v26.4s, v7.16b, v2.4b[2]\n"
980       "ldr x23, [x10, #0xd8]\n"
981       ".inst 0x6f80e913  // udot v19.4s, v8.16b, v0.4b[2]\n"
982       "mov v9.d[1], x19\n"
983       ".inst 0x6f81e917  // udot v23.4s, v8.16b, v1.4b[2]\n"
984       "ldr d4, [x10, #0xe0]\n"
985       ".inst 0x6f82e91b  // udot v27.4s, v8.16b, v2.4b[2]\n"
986       "mov v10.d[1], x23\n"
987       ".inst 0x6fa0e930  // udot v16.4s, v9.16b, v0.4b[3]\n"
988       "ldr x19, [x10, #0xe8]\n"
989       ".inst 0x6fa1e934  // udot v20.4s, v9.16b, v1.4b[3]\n"
990       "ldr d5, [x10, #0xf0]\n"
991       ".inst 0x6fa2e938  // udot v24.4s, v9.16b, v2.4b[3]\n"
992       "ldr x24, [x10, #0xf8]\n"
993       ".inst 0x6fa0e951  // udot v17.4s, v10.16b, v0.4b[3]\n"
994       "mov v4.d[1], x19\n"
995       ".inst 0x6fa1e955  // udot v21.4s, v10.16b, v1.4b[3]\n"
996       "add x21, x21, #0x10\n"
997       ".inst 0x6fa2e959  // udot v25.4s, v10.16b, v2.4b[3]\n"
998       "mov v5.d[1], x24\n"
999       ".inst 0x6fa0e892  // udot v18.4s, v4.16b, v0.4b[3]\n"
1000       "add x10, x10, #0x100\n"
1001       ".inst 0x6fa1e896  // udot v22.4s, v4.16b, v1.4b[3]\n"
1002       ".inst 0x6fa2e89a  // udot v26.4s, v4.16b, v2.4b[3]\n"
1003       ".inst 0x6fa0e8b3  // udot v19.4s, v5.16b, v0.4b[3]\n"
1004       ".inst 0x6fa1e8b7  // udot v23.4s, v5.16b, v1.4b[3]\n"
1005       ".inst 0x6fa2e8bb  // udot v27.4s, v5.16b, v2.4b[3]\n"
1006       "tbnz %x[flags], #31, 68f\n"
1007       ".inst 0x6e8f940b  // udot v11.4s, v0.16b, v15.16b\n"
1008       ".inst 0x6e8f942c  // udot v12.4s, v1.16b, v15.16b\n"
1009       ".inst 0x6e8f944d  // udot v13.4s, v2.16b, v15.16b\n"
1010       "68:"  // Height 3: Multiply loop: unique 9: skip row sum
1011       "prfm pldl1keep, [x25, #0x80]\n"
1012       "sub x26, x26, #0x10\n"
1013       "prfm pldl1keep, [x22, #0x80]\n"
1014       "cmp x26, #0x20\n"
1015       "prfm pldl1keep, [x21, #0x80]\n"
1016       "ldr q0, [x25, #0x0]\n"
1017       "ldr q1, [x22, #0x0]\n"
1018       "ldr q2, [x21, #0x0]\n"
1019       "ldr q4, [x10, #0x0]\n"
1020       "bge 67b\n"
1021       "69:"  // Height 3: Multiply loop: Single iteration only
1022       ".inst 0x6f80e090  // udot v16.4s, v4.16b, v0.4b[0]\n"
1023       "ldr q5, [x10, #0x10]\n"
1024       ".inst 0x6f81e094  // udot v20.4s, v4.16b, v1.4b[0]\n"
1025       "ldr q6, [x10, #0x20]\n"
1026       ".inst 0x6f82e098  // udot v24.4s, v4.16b, v2.4b[0]\n"
1027       "ldr q7, [x10, #0x30]\n"
1028       ".inst 0x6f80e0b1  // udot v17.4s, v5.16b, v0.4b[0]\n"
1029       "ldr q8, [x10, #0x40]\n"
1030       ".inst 0x6f81e0b5  // udot v21.4s, v5.16b, v1.4b[0]\n"
1031       "ldr q9, [x10, #0x50]\n"
1032       ".inst 0x6f82e0b9  // udot v25.4s, v5.16b, v2.4b[0]\n"
1033       "ldr q10, [x10, #0x60]\n"
1034       ".inst 0x6f80e0d2  // udot v18.4s, v6.16b, v0.4b[0]\n"
1035       "ldr q4, [x10, #0x70]\n"
1036       ".inst 0x6f81e0d6  // udot v22.4s, v6.16b, v1.4b[0]\n"
1037       "ldr q5, [x10, #0x80]\n"
1038       ".inst 0x6f82e0da  // udot v26.4s, v6.16b, v2.4b[0]\n"
1039       "ldr q6, [x10, #0x90]\n"
1040       ".inst 0x6f80e0f3  // udot v19.4s, v7.16b, v0.4b[0]\n"
1041       "sub x26, x26, #0x10\n"
1042       ".inst 0x6f81e0f7  // udot v23.4s, v7.16b, v1.4b[0]\n"
1043       "add x25, x25, #0x10\n"
1044       ".inst 0x6f82e0fb  // udot v27.4s, v7.16b, v2.4b[0]\n"
1045       "ldr q7, [x10, #0xa0]\n"
1046       ".inst 0x6fa0e110  // udot v16.4s, v8.16b, v0.4b[1]\n"
1047       "add x22, x22, #0x10\n"
1048       ".inst 0x6fa1e114  // udot v20.4s, v8.16b, v1.4b[1]\n"
1049       "add x21, x21, #0x10\n"
1050       ".inst 0x6fa2e118  // udot v24.4s, v8.16b, v2.4b[1]\n"
1051       "ldr q8, [x10, #0xb0]\n"
1052       ".inst 0x6fa0e131  // udot v17.4s, v9.16b, v0.4b[1]\n"
1053       ".inst 0x6fa1e135  // udot v21.4s, v9.16b, v1.4b[1]\n"
1054       ".inst 0x6fa2e139  // udot v25.4s, v9.16b, v2.4b[1]\n"
1055       "ldr q9, [x10, #0xc0]\n"
1056       ".inst 0x6fa0e152  // udot v18.4s, v10.16b, v0.4b[1]\n"
1057       ".inst 0x6fa1e156  // udot v22.4s, v10.16b, v1.4b[1]\n"
1058       ".inst 0x6fa2e15a  // udot v26.4s, v10.16b, v2.4b[1]\n"
1059       "ldr q10, [x10, #0xd0]\n"
1060       ".inst 0x6fa0e093  // udot v19.4s, v4.16b, v0.4b[1]\n"
1061       ".inst 0x6fa1e097  // udot v23.4s, v4.16b, v1.4b[1]\n"
1062       ".inst 0x6fa2e09b  // udot v27.4s, v4.16b, v2.4b[1]\n"
1063       "ldr q4, [x10, #0xe0]\n"
1064       ".inst 0x6f80e8b0  // udot v16.4s, v5.16b, v0.4b[2]\n"
1065       ".inst 0x6f81e8b4  // udot v20.4s, v5.16b, v1.4b[2]\n"
1066       ".inst 0x6f82e8b8  // udot v24.4s, v5.16b, v2.4b[2]\n"
1067       "ldr q5, [x10, #0xf0]\n"
1068       ".inst 0x6f80e8d1  // udot v17.4s, v6.16b, v0.4b[2]\n"
1069       "add x10, x10, #0x100\n"
1070       ".inst 0x6f81e8d5  // udot v21.4s, v6.16b, v1.4b[2]\n"
1071       ".inst 0x6f82e8d9  // udot v25.4s, v6.16b, v2.4b[2]\n"
1072       ".inst 0x6f80e8f2  // udot v18.4s, v7.16b, v0.4b[2]\n"
1073       ".inst 0x6f81e8f6  // udot v22.4s, v7.16b, v1.4b[2]\n"
1074       ".inst 0x6f82e8fa  // udot v26.4s, v7.16b, v2.4b[2]\n"
1075       ".inst 0x6f80e913  // udot v19.4s, v8.16b, v0.4b[2]\n"
1076       ".inst 0x6f81e917  // udot v23.4s, v8.16b, v1.4b[2]\n"
1077       ".inst 0x6f82e91b  // udot v27.4s, v8.16b, v2.4b[2]\n"
1078       ".inst 0x6fa0e930  // udot v16.4s, v9.16b, v0.4b[3]\n"
1079       ".inst 0x6fa1e934  // udot v20.4s, v9.16b, v1.4b[3]\n"
1080       ".inst 0x6fa2e938  // udot v24.4s, v9.16b, v2.4b[3]\n"
1081       ".inst 0x6fa0e951  // udot v17.4s, v10.16b, v0.4b[3]\n"
1082       ".inst 0x6fa1e955  // udot v21.4s, v10.16b, v1.4b[3]\n"
1083       ".inst 0x6fa2e959  // udot v25.4s, v10.16b, v2.4b[3]\n"
1084       ".inst 0x6fa0e892  // udot v18.4s, v4.16b, v0.4b[3]\n"
1085       ".inst 0x6fa1e896  // udot v22.4s, v4.16b, v1.4b[3]\n"
1086       ".inst 0x6fa2e89a  // udot v26.4s, v4.16b, v2.4b[3]\n"
1087       ".inst 0x6fa0e8b3  // udot v19.4s, v5.16b, v0.4b[3]\n"
1088       ".inst 0x6fa1e8b7  // udot v23.4s, v5.16b, v1.4b[3]\n"
1089       ".inst 0x6fa2e8bb  // udot v27.4s, v5.16b, v2.4b[3]\n"
1090       "tbnz %x[flags], #31, 70f\n"
1091       ".inst 0x6e8f940b  // udot v11.4s, v0.16b, v15.16b\n"
1092       ".inst 0x6e8f942c  // udot v12.4s, v1.16b, v15.16b\n"
1093       ".inst 0x6e8f944d  // udot v13.4s, v2.16b, v15.16b\n"
1094       "70:"  // Height 3: Multiply loop: unique 10: skip row sum
1095       "prfm pldl1keep, [x25, #0x80]\n"
1096       "prfm pldl1keep, [x22, #0x80]\n"
1097       "prfm pldl1keep, [x21, #0x80]\n"
1098       "71:"  // Height 3: Multiply loop: Main loop skip
1099       "cbz x26, 78f\n"
1100       "cmp x26, #0x4\n"
1101       "blt 74f\n"
1102       "72:"  // Height 3: Multiply loop: Odd block loop
1103       "ldr s0, [x25], #0x4\n"
1104       "ldr s1, [x22], #0x4\n"
1105       "ldr s2, [x21], #0x4\n"
1106       "tbnz %x[flags], #31, 73f\n"
1107       ".inst 0x6e8f940b  // udot v11.4s, v0.16b, v15.16b\n"
1108       ".inst 0x6e8f942c  // udot v12.4s, v1.16b, v15.16b\n"
1109       ".inst 0x6e8f944d  // udot v13.4s, v2.16b, v15.16b\n"
1110       "73:"  // Height 3: Multiply loop: unique 11: skip row sum
1111       "ldr q6, [x10, #0x0]\n"
1112       "sub x26, x26, #0x4\n"
1113       "ldr q7, [x10, #0x10]\n"
1114       "cmp x26, #0x4\n"
1115       "ldr q8, [x10, #0x20]\n"
1116       ".inst 0x6f80e0d0  // udot v16.4s, v6.16b, v0.4b[0]\n"
1117       "ldr q9, [x10, #0x30]\n"
1118       ".inst 0x6f81e0d4  // udot v20.4s, v6.16b, v1.4b[0]\n"
1119       "add x10, x10, #0x40\n"
1120       ".inst 0x6f82e0d8  // udot v24.4s, v6.16b, v2.4b[0]\n"
1121       ".inst 0x6f80e0f1  // udot v17.4s, v7.16b, v0.4b[0]\n"
1122       ".inst 0x6f81e0f5  // udot v21.4s, v7.16b, v1.4b[0]\n"
1123       ".inst 0x6f82e0f9  // udot v25.4s, v7.16b, v2.4b[0]\n"
1124       ".inst 0x6f80e112  // udot v18.4s, v8.16b, v0.4b[0]\n"
1125       ".inst 0x6f81e116  // udot v22.4s, v8.16b, v1.4b[0]\n"
1126       ".inst 0x6f82e11a  // udot v26.4s, v8.16b, v2.4b[0]\n"
1127       ".inst 0x6f80e133  // udot v19.4s, v9.16b, v0.4b[0]\n"
1128       ".inst 0x6f81e137  // udot v23.4s, v9.16b, v1.4b[0]\n"
1129       ".inst 0x6f82e13b  // udot v27.4s, v9.16b, v2.4b[0]\n"
1130       "bge 72b\n"
1131       "cbz x26, 78f\n"
1132       "74:"  // Height 3: Multiply loop: Skip odd blocks
1133       "tbz x26, #1, 75f\n"
1134       "ldr h0, [x25], #0x2\n"
1135       "ldr h1, [x22], #0x2\n"
1136       "ldr h2, [x21], #0x2\n"
1137       "tbz x26, #0, 76f\n"
1138       "ld1 { v0.b }[2], [x25]\n"
1139       "ld1 { v1.b }[2], [x22]\n"
1140       "ld1 { v2.b }[2], [x21]\n"
1141       "b 76f\n"
1142       "75:"  // Height 3: Multiply loop: Ragged operand read: partial_1_0
1143       "ldr b0, [x25, #0x0]\n"
1144       "ldr b1, [x22, #0x0]\n"
1145       "ldr b2, [x21, #0x0]\n"
1146       "76:"  // Height 3: Multiply loop: Ragged operand read: Done
1147       "tbnz %x[flags], #31, 77f\n"
1148       ".inst 0x6e8f940b  // udot v11.4s, v0.16b, v15.16b\n"
1149       ".inst 0x6e8f942c  // udot v12.4s, v1.16b, v15.16b\n"
1150       ".inst 0x6e8f944d  // udot v13.4s, v2.16b, v15.16b\n"
1151       "77:"  // Height 3: Multiply loop: unique 12: skip row sum
1152       "ldr q10, [x10, #0x0]\n"
1153       "ldr q4, [x10, #0x10]\n"
1154       "ldr q5, [x10, #0x20]\n"
1155       ".inst 0x6f80e150  // udot v16.4s, v10.16b, v0.4b[0]\n"
1156       "ldr q6, [x10, #0x30]\n"
1157       ".inst 0x6f81e154  // udot v20.4s, v10.16b, v1.4b[0]\n"
1158       "add x10, x10, #0x40\n"
1159       ".inst 0x6f82e158  // udot v24.4s, v10.16b, v2.4b[0]\n"
1160       ".inst 0x6f80e091  // udot v17.4s, v4.16b, v0.4b[0]\n"
1161       ".inst 0x6f81e095  // udot v21.4s, v4.16b, v1.4b[0]\n"
1162       ".inst 0x6f82e099  // udot v25.4s, v4.16b, v2.4b[0]\n"
1163       ".inst 0x6f80e0b2  // udot v18.4s, v5.16b, v0.4b[0]\n"
1164       ".inst 0x6f81e0b6  // udot v22.4s, v5.16b, v1.4b[0]\n"
1165       ".inst 0x6f82e0ba  // udot v26.4s, v5.16b, v2.4b[0]\n"
1166       ".inst 0x6f80e0d3  // udot v19.4s, v6.16b, v0.4b[0]\n"
1167       ".inst 0x6f81e0d7  // udot v23.4s, v6.16b, v1.4b[0]\n"
1168       ".inst 0x6f82e0db  // udot v27.4s, v6.16b, v2.4b[0]\n"
1169       "78:"  // Height 3: Multiply loop: No odd multiplies
1170       "ldr w19, [%x[args_ptr], %[offsetof_num_strings]]\n"
1171       "add x27, x27, #0x1\n"
1172       "cmp x27, x19\n"
1173       "bne 64b\n"
1174       "ldr x19, [%x[args_ptr], %[offsetof_output_offset]]\n"
1175       "prfm pstl1keep, [x28, #0x0]\n"
1176       "add x21, x28, x19\n"
1177       "prfm pstl1keep, [x21, #0x0]\n"
1178       "add x20, x21, x19\n"
1179       "prfm pstl1keep, [x20, #0x0]\n"
1180       "tbnz %x[flags], #31, 79f\n"
1181       "addp v11.4s, v11.4s, v11.4s\n"
1182       "addp v12.4s, v12.4s, v12.4s\n"
1183       "addp v13.4s, v13.4s, v13.4s\n"
1184       "add x22, %x[qp], %[b_offset]\n"
1185       "ld1r { v3.4s }, [x22]\n"
1186       "neg v3.4s, v3.4s\n"
1187       "addp v11.4s, v11.4s, v11.4s\n"
1188       "addp v12.4s, v12.4s, v12.4s\n"
1189       "addp v13.4s, v13.4s, v13.4s\n"
1190       "mul v11.4s, v11.4s, v3.4s\n"
1191       "mul v12.4s, v12.4s, v3.4s\n"
1192       "mul v13.4s, v13.4s, v3.4s\n"
1193       "79:"  // Height 3: skip row sum fixup
1194       "add v16.4s, v16.4s, v11.4s\n"
1195       "add v17.4s, v17.4s, v11.4s\n"
1196       "add v18.4s, v18.4s, v11.4s\n"
1197       "add v19.4s, v19.4s, v11.4s\n"
1198       "add v20.4s, v20.4s, v12.4s\n"
1199       "add v21.4s, v21.4s, v12.4s\n"
1200       "add v22.4s, v22.4s, v12.4s\n"
1201       "add v23.4s, v23.4s, v12.4s\n"
1202       "add v24.4s, v24.4s, v13.4s\n"
1203       "add v25.4s, v25.4s, v13.4s\n"
1204       "add v26.4s, v26.4s, v13.4s\n"
1205       "add v27.4s, v27.4s, v13.4s\n"
1206       "ldr q0, [x9, #0x0]\n"
1207       "orr %x[flags], %x[flags], #0x80000000\n"
1208       "ldr q1, [x9, #0x10]\n"
1209       "add x23, %x[qp], %[per_layer_right_shift]\n"
1210       "ldr q2, [x9, #0x20]\n"
1211       "add x22, %x[qp], %[per_layer_mul]\n"
1212       "add v16.4s, v16.4s, v0.4s\n"
1213       "add v20.4s, v20.4s, v0.4s\n"
1214       "add v17.4s, v17.4s, v1.4s\n"
1215       "add v21.4s, v21.4s, v1.4s\n"
1216       "add v18.4s, v18.4s, v2.4s\n"
1217       "add v22.4s, v22.4s, v2.4s\n"
1218       "add v24.4s, v24.4s, v0.4s\n"
1219       "add v25.4s, v25.4s, v1.4s\n"
1220       "add v26.4s, v26.4s, v2.4s\n"
1221       "ldr q3, [x9, #0x30]\n"
1222       "ld1r { v0.4s }, [x23]\n"
1223       "add x9, x9, #0x40\n"
1224       "ld1r { v4.4s }, [x22]\n"
1225       "add v19.4s, v19.4s, v3.4s\n"
1226       "add v23.4s, v23.4s, v3.4s\n"
1227       "add v27.4s, v27.4s, v3.4s\n"
1228       "sqrdmulh v16.4s, v16.4s, v4.4s\n"
1229       "sqrdmulh v17.4s, v17.4s, v4.4s\n"
1230       "sqrdmulh v18.4s, v18.4s, v4.4s\n"
1231       "sqrdmulh v20.4s, v20.4s, v4.4s\n"
1232       "sqrdmulh v21.4s, v21.4s, v4.4s\n"
1233       "sqrdmulh v22.4s, v22.4s, v4.4s\n"
1234       "sqrdmulh v19.4s, v19.4s, v4.4s\n"
1235       "sqrdmulh v23.4s, v23.4s, v4.4s\n"
1236       "sqrdmulh v24.4s, v24.4s, v4.4s\n"
1237       "sqrdmulh v25.4s, v25.4s, v4.4s\n"
1238       "sqrdmulh v26.4s, v26.4s, v4.4s\n"
1239       "sqrdmulh v27.4s, v27.4s, v4.4s\n"
1240       "tbz %x[flags], #5, 80f\n"
1241       "and v4.16b, v16.16b, v0.16b\n"
1242       "and v5.16b, v17.16b, v0.16b\n"
1243       "and v6.16b, v18.16b, v0.16b\n"
1244       "and v7.16b, v19.16b, v0.16b\n"
1245       "and v8.16b, v20.16b, v0.16b\n"
1246       "and v9.16b, v21.16b, v0.16b\n"
1247       "and v10.16b, v22.16b, v0.16b\n"
1248       "sshr v4.4s, v4.4s, #0x1f\n"
1249       "sshr v5.4s, v5.4s, #0x1f\n"
1250       "sshr v6.4s, v6.4s, #0x1f\n"
1251       "sshr v7.4s, v7.4s, #0x1f\n"
1252       "sshr v8.4s, v8.4s, #0x1f\n"
1253       "sshr v9.4s, v9.4s, #0x1f\n"
1254       "sshr v10.4s, v10.4s, #0x1f\n"
1255       "sqadd v16.4s, v16.4s, v4.4s\n"
1256       "and v4.16b, v23.16b, v0.16b\n"
1257       "sqadd v17.4s, v17.4s, v5.4s\n"
1258       "sqadd v18.4s, v18.4s, v6.4s\n"
1259       "sqadd v19.4s, v19.4s, v7.4s\n"
1260       "sqadd v20.4s, v20.4s, v8.4s\n"
1261       "sqadd v21.4s, v21.4s, v9.4s\n"
1262       "sqadd v22.4s, v22.4s, v10.4s\n"
1263       "and v5.16b, v24.16b, v0.16b\n"
1264       "and v6.16b, v25.16b, v0.16b\n"
1265       "sshr v4.4s, v4.4s, #0x1f\n"
1266       "and v7.16b, v26.16b, v0.16b\n"
1267       "and v8.16b, v27.16b, v0.16b\n"
1268       "sshr v5.4s, v5.4s, #0x1f\n"
1269       "sshr v6.4s, v6.4s, #0x1f\n"
1270       "sqadd v23.4s, v23.4s, v4.4s\n"
1271       "sshr v7.4s, v7.4s, #0x1f\n"
1272       "sshr v8.4s, v8.4s, #0x1f\n"
1273       "sqadd v24.4s, v24.4s, v5.4s\n"
1274       "sqadd v25.4s, v25.4s, v6.4s\n"
1275       "sqadd v26.4s, v26.4s, v7.4s\n"
1276       "sqadd v27.4s, v27.4s, v8.4s\n"
1277       "80:"  // Height 3: no shift correction
1278       "srshl v16.4s, v16.4s, v0.4s\n"
1279       "srshl v17.4s, v17.4s, v0.4s\n"
1280       "srshl v18.4s, v18.4s, v0.4s\n"
1281       "srshl v19.4s, v19.4s, v0.4s\n"
1282       "srshl v20.4s, v20.4s, v0.4s\n"
1283       "srshl v21.4s, v21.4s, v0.4s\n"
1284       "srshl v22.4s, v22.4s, v0.4s\n"
1285       "srshl v23.4s, v23.4s, v0.4s\n"
1286       "srshl v24.4s, v24.4s, v0.4s\n"
1287       "srshl v25.4s, v25.4s, v0.4s\n"
1288       "srshl v26.4s, v26.4s, v0.4s\n"
1289       "srshl v27.4s, v27.4s, v0.4s\n"
1290       "add x22, %x[qp], %[c_offset]\n"
1291       "add x23, %x[qp], %[minval]\n"
1292       "ld1r { v4.4s }, [x22]\n"
1293       "add x22, %x[qp], %[maxval]\n"
1294       "ld1r { v5.4s }, [x23]\n"
1295       "cmp x11, #0x10\n"
1296       "ld1r { v6.4s }, [x22]\n"
1297       "add v16.4s, v16.4s, v4.4s\n"
1298       "add v17.4s, v17.4s, v4.4s\n"
1299       "add v18.4s, v18.4s, v4.4s\n"
1300       "add v19.4s, v19.4s, v4.4s\n"
1301       "add v20.4s, v20.4s, v4.4s\n"
1302       "add v21.4s, v21.4s, v4.4s\n"
1303       "add v22.4s, v22.4s, v4.4s\n"
1304       "add v23.4s, v23.4s, v4.4s\n"
1305       "add v24.4s, v24.4s, v4.4s\n"
1306       "add v25.4s, v25.4s, v4.4s\n"
1307       "smin v16.4s, v16.4s, v6.4s\n"
1308       "smin v17.4s, v17.4s, v6.4s\n"
1309       "smin v18.4s, v18.4s, v6.4s\n"
1310       "smin v19.4s, v19.4s, v6.4s\n"
1311       "smin v20.4s, v20.4s, v6.4s\n"
1312       "smin v21.4s, v21.4s, v6.4s\n"
1313       "smin v22.4s, v22.4s, v6.4s\n"
1314       "smin v23.4s, v23.4s, v6.4s\n"
1315       "smin v24.4s, v24.4s, v6.4s\n"
1316       "smin v25.4s, v25.4s, v6.4s\n"
1317       "smax v16.4s, v16.4s, v5.4s\n"
1318       "smax v17.4s, v17.4s, v5.4s\n"
1319       "smax v18.4s, v18.4s, v5.4s\n"
1320       "smax v19.4s, v19.4s, v5.4s\n"
1321       "smax v20.4s, v20.4s, v5.4s\n"
1322       "smax v21.4s, v21.4s, v5.4s\n"
1323       "smax v22.4s, v22.4s, v5.4s\n"
1324       "smax v23.4s, v23.4s, v5.4s\n"
1325       "smax v24.4s, v24.4s, v5.4s\n"
1326       "smax v25.4s, v25.4s, v5.4s\n"
1327       "add v26.4s, v26.4s, v4.4s\n"
1328       "add v27.4s, v27.4s, v4.4s\n"
1329       "uzp1 v16.8h, v16.8h, v17.8h\n"
1330       "uzp1 v17.8h, v18.8h, v19.8h\n"
1331       "uzp1 v20.8h, v20.8h, v21.8h\n"
1332       "uzp1 v21.8h, v22.8h, v23.8h\n"
1333       "uzp1 v24.8h, v24.8h, v25.8h\n"
1334       "smin v26.4s, v26.4s, v6.4s\n"
1335       "smin v27.4s, v27.4s, v6.4s\n"
1336       "uzp1 v16.16b, v16.16b, v17.16b\n"
1337       "uzp1 v20.16b, v20.16b, v21.16b\n"
1338       "smax v26.4s, v26.4s, v5.4s\n"
1339       "smax v27.4s, v27.4s, v5.4s\n"
1340       "uzp1 v25.8h, v26.8h, v27.8h\n"
1341       "uzp1 v24.16b, v24.16b, v25.16b\n"
1342       "bge 89f\n"
1343       "tbz x11, #3, 84f\n"
1344       "str d16, [x28], #0x8\n"
1345       "str d20, [x21], #0x8\n"
1346       "str d24, [x20], #0x8\n"
1347       "tbz x11, #2, 82f\n"
1348       "st1 { v16.s }[2], [x28], #0x4\n"
1349       "st1 { v20.s }[2], [x21], #0x4\n"
1350       "st1 { v24.s }[2], [x20], #0x4\n"
1351       "tbz x11, #1, 81f\n"
1352       "st1 { v16.h }[6], [x28], #0x2\n"
1353       "st1 { v20.h }[6], [x21], #0x2\n"
1354       "st1 { v24.h }[6], [x20], #0x2\n"
1355       "tbz x11, #0, 88f\n"
1356       "st1 { v16.b }[14], [x28]\n"
1357       "st1 { v20.b }[14], [x21]\n"
1358       "st1 { v24.b }[14], [x20]\n"
1359       "b 88f\n"
1360       "81:"  // Height 3: Partial direct writeback: partial_1_12
1361       "tbz x11, #0, 88f\n"
1362       "st1 { v16.b }[12], [x28]\n"
1363       "st1 { v20.b }[12], [x21]\n"
1364       "st1 { v24.b }[12], [x20]\n"
1365       "b 88f\n"
1366       "82:"  // Height 3: Partial direct writeback: partial_2_8
1367       "tbz x11, #1, 83f\n"
1368       "st1 { v16.h }[4], [x28], #0x2\n"
1369       "st1 { v20.h }[4], [x21], #0x2\n"
1370       "st1 { v24.h }[4], [x20], #0x2\n"
1371       "tbz x11, #0, 88f\n"
1372       "st1 { v16.b }[10], [x28]\n"
1373       "st1 { v20.b }[10], [x21]\n"
1374       "st1 { v24.b }[10], [x20]\n"
1375       "b 88f\n"
1376       "83:"  // Height 3: Partial direct writeback: partial_1_8
1377       "tbz x11, #0, 88f\n"
1378       "st1 { v16.b }[8], [x28]\n"
1379       "st1 { v20.b }[8], [x21]\n"
1380       "st1 { v24.b }[8], [x20]\n"
1381       "b 88f\n"
1382       "84:"  // Height 3: Partial direct writeback: partial_4_0
1383       "tbz x11, #2, 86f\n"
1384       "str s16, [x28], #0x4\n"
1385       "str s20, [x21], #0x4\n"
1386       "str s24, [x20], #0x4\n"
1387       "tbz x11, #1, 85f\n"
1388       "st1 { v16.h }[2], [x28], #0x2\n"
1389       "st1 { v20.h }[2], [x21], #0x2\n"
1390       "st1 { v24.h }[2], [x20], #0x2\n"
1391       "tbz x11, #0, 88f\n"
1392       "st1 { v16.b }[6], [x28]\n"
1393       "st1 { v20.b }[6], [x21]\n"
1394       "st1 { v24.b }[6], [x20]\n"
1395       "b 88f\n"
1396       "85:"  // Height 3: Partial direct writeback: partial_1_4
1397       "tbz x11, #0, 88f\n"
1398       "st1 { v16.b }[4], [x28]\n"
1399       "st1 { v20.b }[4], [x21]\n"
1400       "st1 { v24.b }[4], [x20]\n"
1401       "b 88f\n"
1402       "86:"  // Height 3: Partial direct writeback: partial_2_0
1403       "tbz x11, #1, 87f\n"
1404       "str h16, [x28], #0x2\n"
1405       "str h20, [x21], #0x2\n"
1406       "str h24, [x20], #0x2\n"
1407       "tbz x11, #0, 88f\n"
1408       "st1 { v16.b }[2], [x28]\n"
1409       "st1 { v20.b }[2], [x21]\n"
1410       "st1 { v24.b }[2], [x20]\n"
1411       "b 88f\n"
1412       "87:"  // Height 3: Partial direct writeback: partial_1_0
1413       "str b16, [x28, #0x0]\n"
1414       "str b20, [x21, #0x0]\n"
1415       "str b24, [x20, #0x0]\n"
1416       "88:"  // Height 3: Partial direct writeback: Done
1417       "b 90f\n"
1418       "89:"  // Height 3: Full writeback
1419       "str q16, [x28, #0x0]\n"
1420       "add x28, x28, #0x10\n"
1421       "str q20, [x21, #0x0]\n"
1422       "str q24, [x20, #0x0]\n"
1423       "90:"  // Height 3: Writeback done
1424       "subs x11, x11, #0x10\n"
1425       "bgt 62b\n"
1426       "b 122f\n"
1427       "91:"  // Height 4
1428       "movi v11.4s, #0x0\n"
1429       "ldr x11, [%x[args_ptr], %[offsetof_N]]\n"
1430       "movi v12.4s, #0x0\n"
1431       "ldr x10, [%x[args_ptr], %[offsetof_B_ptr]]\n"
1432       "movi v13.4s, #0x0\n"
1433       "ldr x20, [%x[args_ptr], %[offsetof_output_offset]]\n"
1434       "movi v14.4s, #0x0\n"
1435       "mov x9, %x[col_bias]\n"
1436       "movi v15.16b, #0x1\n"
1437       "bic %x[flags], %x[flags], #0x80000000\n"
1438       "mov x28, %x[output_ptr]\n"
1439       "mov x19, #0x4\n"
1440       "madd %x[output_ptr], x20, x19, %x[output_ptr]\n"
1441       "92:"  // Height 4: Column loop
1442       "movi v16.4s, #0x0\n"
1443       "movi v17.4s, #0x0\n"
1444       "movi v18.4s, #0x0\n"
1445       "movi v19.4s, #0x0\n"
1446       "movi v20.4s, #0x0\n"
1447       "movi v21.4s, #0x0\n"
1448       "movi v22.4s, #0x0\n"
1449       "movi v23.4s, #0x0\n"
1450       "movi v24.4s, #0x0\n"
1451       "movi v25.4s, #0x0\n"
1452       "movi v26.4s, #0x0\n"
1453       "movi v27.4s, #0x0\n"
1454       "movi v28.4s, #0x0\n"
1455       "movi v29.4s, #0x0\n"
1456       "movi v30.4s, #0x0\n"
1457       "movi v31.4s, #0x0\n"
1458       "93:"  // Height 4: setup done
1459       "mov x27, #0x0\n"
1460       "94:"  // Height 4: String loop
1461       "ldr x20, [%x[args_ptr], %[offsetof_string_lengths]]\n"
1462       "ldr x19, [%x[args_ptr], %[offsetof_input_offset]]\n"
1463       "ldr w26, [x20, x27, LSL #0x2]\n"
1464       "tbz %x[flags], #3, 95f\n"
1465       "ldr x20, [%x[input_ptr], x27, LSL #0x3]\n"
1466       "add x20, x20, x19, LSL #3\n"
1467       "ldr x25, [x20, #0x0]\n"
1468       "ldr x22, [x20, #0x8]\n"
1469       "ldr x21, [x20, #0x10]\n"
1470       "ldr x20, [x20, #0x18]\n"
1471       "cbnz x27, 96f\n"
1472       "ldr x19, [%x[args_ptr], %[offsetof_input_initial_col]]\n"
1473       "add x25, x25, x19\n"
1474       "add x22, x22, x19\n"
1475       "add x21, x21, x19\n"
1476       "add x20, x20, x19\n"
1477       "b 96f\n"
1478       "95:"  // Height 4: setup direct input
1479       "mov x25, %x[input_ptr]\n"
1480       "add x22, x25, x19\n"
1481       "add x21, x22, x19\n"
1482       "add x20, x21, x19\n"
1483       "96:"  // Height 4: input setup done
1484       "cmp x26, #0x10\n"
1485       "blt 101f\n"
1486       "ldr q0, [x25, #0x0]\n"
1487       "ldr q1, [x22, #0x0]\n"
1488       "cmp x26, #0x20\n"
1489       "ldr q2, [x21, #0x0]\n"
1490       "ldr q3, [x20, #0x0]\n"
1491       "ldr q4, [x10, #0x0]\n"
1492       "blt 99f\n"
1493       "97:"  // Height 4: Multiply loop: Main loop head
1494       ".inst 0x6f80e090  // udot v16.4s, v4.16b, v0.4b[0]\n"
1495       "ldr d5, [x10, #0x10]\n"
1496       ".inst 0x6f81e094  // udot v20.4s, v4.16b, v1.4b[0]\n"
1497       "ldr x24, [x10, #0x18]\n"
1498       ".inst 0x6f82e098  // udot v24.4s, v4.16b, v2.4b[0]\n"
1499       "ldr d6, [x10, #0x20]\n"
1500       ".inst 0x6f83e09c  // udot v28.4s, v4.16b, v3.4b[0]\n"
1501       "ldr x23, [x10, #0x28]\n"
1502       "mov v5.d[1], x24\n"
1503       "ldr d7, [x10, #0x30]\n"
1504       "ldr x19, [x10, #0x38]\n"
1505       "add x25, x25, #0x10\n"
1506       ".inst 0x6f80e0b1  // udot v17.4s, v5.16b, v0.4b[0]\n"
1507       "mov v6.d[1], x23\n"
1508       ".inst 0x6f81e0b5  // udot v21.4s, v5.16b, v1.4b[0]\n"
1509       "ldr d8, [x10, #0x40]\n"
1510       ".inst 0x6f82e0b9  // udot v25.4s, v5.16b, v2.4b[0]\n"
1511       "mov v7.d[1], x19\n"
1512       ".inst 0x6f83e0bd  // udot v29.4s, v5.16b, v3.4b[0]\n"
1513       "ldr x23, [x10, #0x48]\n"
1514       ".inst 0x6f80e0d2  // udot v18.4s, v6.16b, v0.4b[0]\n"
1515       "ldr d9, [x10, #0x50]\n"
1516       ".inst 0x6f81e0d6  // udot v22.4s, v6.16b, v1.4b[0]\n"
1517       "ldr x19, [x10, #0x58]\n"
1518       ".inst 0x6f82e0da  // udot v26.4s, v6.16b, v2.4b[0]\n"
1519       "mov v8.d[1], x23\n"
1520       ".inst 0x6f83e0de  // udot v30.4s, v6.16b, v3.4b[0]\n"
1521       "ldr d10, [x10, #0x60]\n"
1522       ".inst 0x6f80e0f3  // udot v19.4s, v7.16b, v0.4b[0]\n"
1523       "mov v9.d[1], x19\n"
1524       ".inst 0x6f81e0f7  // udot v23.4s, v7.16b, v1.4b[0]\n"
1525       "ldr x23, [x10, #0x68]\n"
1526       ".inst 0x6f82e0fb  // udot v27.4s, v7.16b, v2.4b[0]\n"
1527       "ldr d4, [x10, #0x70]\n"
1528       ".inst 0x6f83e0ff  // udot v31.4s, v7.16b, v3.4b[0]\n"
1529       "ldr x19, [x10, #0x78]\n"
1530       ".inst 0x6fa0e110  // udot v16.4s, v8.16b, v0.4b[1]\n"
1531       "mov v10.d[1], x23\n"
1532       ".inst 0x6fa1e114  // udot v20.4s, v8.16b, v1.4b[1]\n"
1533       "ldr d5, [x10, #0x80]\n"
1534       ".inst 0x6fa2e118  // udot v24.4s, v8.16b, v2.4b[1]\n"
1535       "mov v4.d[1], x19\n"
1536       ".inst 0x6fa3e11c  // udot v28.4s, v8.16b, v3.4b[1]\n"
1537       "ldr x24, [x10, #0x88]\n"
1538       ".inst 0x6fa0e131  // udot v17.4s, v9.16b, v0.4b[1]\n"
1539       "ldr d6, [x10, #0x90]\n"
1540       ".inst 0x6fa1e135  // udot v21.4s, v9.16b, v1.4b[1]\n"
1541       "ldr x23, [x10, #0x98]\n"
1542       ".inst 0x6fa2e139  // udot v25.4s, v9.16b, v2.4b[1]\n"
1543       "mov v5.d[1], x24\n"
1544       ".inst 0x6fa3e13d  // udot v29.4s, v9.16b, v3.4b[1]\n"
1545       "ldr d7, [x10, #0xa0]\n"
1546       ".inst 0x6fa0e152  // udot v18.4s, v10.16b, v0.4b[1]\n"
1547       "mov v6.d[1], x23\n"
1548       ".inst 0x6fa1e156  // udot v22.4s, v10.16b, v1.4b[1]\n"
1549       "ldr x19, [x10, #0xa8]\n"
1550       ".inst 0x6fa2e15a  // udot v26.4s, v10.16b, v2.4b[1]\n"
1551       "ldr d8, [x10, #0xb0]\n"
1552       ".inst 0x6fa3e15e  // udot v30.4s, v10.16b, v3.4b[1]\n"
1553       "ldr x23, [x10, #0xb8]\n"
1554       ".inst 0x6fa0e093  // udot v19.4s, v4.16b, v0.4b[1]\n"
1555       "mov v7.d[1], x19\n"
1556       ".inst 0x6fa1e097  // udot v23.4s, v4.16b, v1.4b[1]\n"
1557       "ldr d9, [x10, #0xc0]\n"
1558       ".inst 0x6fa2e09b  // udot v27.4s, v4.16b, v2.4b[1]\n"
1559       "mov v8.d[1], x23\n"
1560       ".inst 0x6fa3e09f  // udot v31.4s, v4.16b, v3.4b[1]\n"
1561       "ldr x19, [x10, #0xc8]\n"
1562       ".inst 0x6f80e8b0  // udot v16.4s, v5.16b, v0.4b[2]\n"
1563       "ldr d10, [x10, #0xd0]\n"
1564       ".inst 0x6f81e8b4  // udot v20.4s, v5.16b, v1.4b[2]\n"
1565       "ldr x23, [x10, #0xd8]\n"
1566       ".inst 0x6f82e8b8  // udot v24.4s, v5.16b, v2.4b[2]\n"
1567       "mov v9.d[1], x19\n"
1568       ".inst 0x6f83e8bc  // udot v28.4s, v5.16b, v3.4b[2]\n"
1569       "ldr d4, [x10, #0xe0]\n"
1570       ".inst 0x6f80e8d1  // udot v17.4s, v6.16b, v0.4b[2]\n"
1571       "mov v10.d[1], x23\n"
1572       ".inst 0x6f81e8d5  // udot v21.4s, v6.16b, v1.4b[2]\n"
1573       "ldr x19, [x10, #0xe8]\n"
1574       ".inst 0x6f82e8d9  // udot v25.4s, v6.16b, v2.4b[2]\n"
1575       "ldr d5, [x10, #0xf0]\n"
1576       ".inst 0x6f83e8dd  // udot v29.4s, v6.16b, v3.4b[2]\n"
1577       "ldr x24, [x10, #0xf8]\n"
1578       ".inst 0x6f80e8f2  // udot v18.4s, v7.16b, v0.4b[2]\n"
1579       "mov v4.d[1], x19\n"
1580       ".inst 0x6f81e8f6  // udot v22.4s, v7.16b, v1.4b[2]\n"
1581       "add x22, x22, #0x10\n"
1582       ".inst 0x6f82e8fa  // udot v26.4s, v7.16b, v2.4b[2]\n"
1583       "mov v5.d[1], x24\n"
1584       ".inst 0x6f83e8fe  // udot v30.4s, v7.16b, v3.4b[2]\n"
1585       "add x21, x21, #0x10\n"
1586       ".inst 0x6f80e913  // udot v19.4s, v8.16b, v0.4b[2]\n"
1587       "add x20, x20, #0x10\n"
1588       ".inst 0x6f81e917  // udot v23.4s, v8.16b, v1.4b[2]\n"
1589       "add x10, x10, #0x100\n"
1590       ".inst 0x6f82e91b  // udot v27.4s, v8.16b, v2.4b[2]\n"
1591       ".inst 0x6f83e91f  // udot v31.4s, v8.16b, v3.4b[2]\n"
1592       ".inst 0x6fa0e930  // udot v16.4s, v9.16b, v0.4b[3]\n"
1593       ".inst 0x6fa1e934  // udot v20.4s, v9.16b, v1.4b[3]\n"
1594       ".inst 0x6fa2e938  // udot v24.4s, v9.16b, v2.4b[3]\n"
1595       ".inst 0x6fa3e93c  // udot v28.4s, v9.16b, v3.4b[3]\n"
1596       ".inst 0x6fa0e951  // udot v17.4s, v10.16b, v0.4b[3]\n"
1597       ".inst 0x6fa1e955  // udot v21.4s, v10.16b, v1.4b[3]\n"
1598       ".inst 0x6fa2e959  // udot v25.4s, v10.16b, v2.4b[3]\n"
1599       ".inst 0x6fa3e95d  // udot v29.4s, v10.16b, v3.4b[3]\n"
1600       ".inst 0x6fa0e892  // udot v18.4s, v4.16b, v0.4b[3]\n"
1601       ".inst 0x6fa1e896  // udot v22.4s, v4.16b, v1.4b[3]\n"
1602       ".inst 0x6fa2e89a  // udot v26.4s, v4.16b, v2.4b[3]\n"
1603       ".inst 0x6fa3e89e  // udot v30.4s, v4.16b, v3.4b[3]\n"
1604       ".inst 0x6fa0e8b3  // udot v19.4s, v5.16b, v0.4b[3]\n"
1605       ".inst 0x6fa1e8b7  // udot v23.4s, v5.16b, v1.4b[3]\n"
1606       ".inst 0x6fa2e8bb  // udot v27.4s, v5.16b, v2.4b[3]\n"
1607       ".inst 0x6fa3e8bf  // udot v31.4s, v5.16b, v3.4b[3]\n"
1608       "tbnz %x[flags], #31, 98f\n"
1609       ".inst 0x6e8f940b  // udot v11.4s, v0.16b, v15.16b\n"
1610       ".inst 0x6e8f942c  // udot v12.4s, v1.16b, v15.16b\n"
1611       ".inst 0x6e8f944d  // udot v13.4s, v2.16b, v15.16b\n"
1612       ".inst 0x6e8f946e  // udot v14.4s, v3.16b, v15.16b\n"
1613       "98:"  // Height 4: Multiply loop: unique 13: skip row sum
1614       "prfm pldl1keep, [x25, #0x80]\n"
1615       "sub x26, x26, #0x10\n"
1616       "prfm pldl1keep, [x22, #0x80]\n"
1617       "cmp x26, #0x20\n"
1618       "prfm pldl1keep, [x21, #0x80]\n"
1619       "prfm pldl1keep, [x20, #0x80]\n"
1620       "ldr q0, [x25, #0x0]\n"
1621       "ldr q1, [x22, #0x0]\n"
1622       "ldr q2, [x21, #0x0]\n"
1623       "ldr q3, [x20, #0x0]\n"
1624       "ldr q4, [x10, #0x0]\n"
1625       "bge 97b\n"
1626       "99:"  // Height 4: Multiply loop: Single iteration only
1627       ".inst 0x6f80e090  // udot v16.4s, v4.16b, v0.4b[0]\n"
1628       "ldr q5, [x10, #0x10]\n"
1629       ".inst 0x6f81e094  // udot v20.4s, v4.16b, v1.4b[0]\n"
1630       "ldr q6, [x10, #0x20]\n"
1631       ".inst 0x6f82e098  // udot v24.4s, v4.16b, v2.4b[0]\n"
1632       "ldr q7, [x10, #0x30]\n"
1633       ".inst 0x6f83e09c  // udot v28.4s, v4.16b, v3.4b[0]\n"
1634       "ldr q8, [x10, #0x40]\n"
1635       ".inst 0x6f80e0b1  // udot v17.4s, v5.16b, v0.4b[0]\n"
1636       "ldr q9, [x10, #0x50]\n"
1637       ".inst 0x6f81e0b5  // udot v21.4s, v5.16b, v1.4b[0]\n"
1638       "ldr q10, [x10, #0x60]\n"
1639       ".inst 0x6f82e0b9  // udot v25.4s, v5.16b, v2.4b[0]\n"
1640       "ldr q4, [x10, #0x70]\n"
1641       ".inst 0x6f83e0bd  // udot v29.4s, v5.16b, v3.4b[0]\n"
1642       "ldr q5, [x10, #0x80]\n"
1643       ".inst 0x6f80e0d2  // udot v18.4s, v6.16b, v0.4b[0]\n"
1644       "sub x26, x26, #0x10\n"
1645       ".inst 0x6f81e0d6  // udot v22.4s, v6.16b, v1.4b[0]\n"
1646       "add x25, x25, #0x10\n"
1647       ".inst 0x6f82e0da  // udot v26.4s, v6.16b, v2.4b[0]\n"
1648       "add x22, x22, #0x10\n"
1649       ".inst 0x6f83e0de  // udot v30.4s, v6.16b, v3.4b[0]\n"
1650       "ldr q6, [x10, #0x90]\n"
1651       ".inst 0x6f80e0f3  // udot v19.4s, v7.16b, v0.4b[0]\n"
1652       "add x21, x21, #0x10\n"
1653       ".inst 0x6f81e0f7  // udot v23.4s, v7.16b, v1.4b[0]\n"
1654       "add x20, x20, #0x10\n"
1655       ".inst 0x6f82e0fb  // udot v27.4s, v7.16b, v2.4b[0]\n"
1656       ".inst 0x6f83e0ff  // udot v31.4s, v7.16b, v3.4b[0]\n"
1657       "ldr q7, [x10, #0xa0]\n"
1658       ".inst 0x6fa0e110  // udot v16.4s, v8.16b, v0.4b[1]\n"
1659       ".inst 0x6fa1e114  // udot v20.4s, v8.16b, v1.4b[1]\n"
1660       ".inst 0x6fa2e118  // udot v24.4s, v8.16b, v2.4b[1]\n"
1661       ".inst 0x6fa3e11c  // udot v28.4s, v8.16b, v3.4b[1]\n"
1662       "ldr q8, [x10, #0xb0]\n"
1663       ".inst 0x6fa0e131  // udot v17.4s, v9.16b, v0.4b[1]\n"
1664       ".inst 0x6fa1e135  // udot v21.4s, v9.16b, v1.4b[1]\n"
1665       ".inst 0x6fa2e139  // udot v25.4s, v9.16b, v2.4b[1]\n"
1666       ".inst 0x6fa3e13d  // udot v29.4s, v9.16b, v3.4b[1]\n"
1667       "ldr q9, [x10, #0xc0]\n"
1668       ".inst 0x6fa0e152  // udot v18.4s, v10.16b, v0.4b[1]\n"
1669       ".inst 0x6fa1e156  // udot v22.4s, v10.16b, v1.4b[1]\n"
1670       ".inst 0x6fa2e15a  // udot v26.4s, v10.16b, v2.4b[1]\n"
1671       ".inst 0x6fa3e15e  // udot v30.4s, v10.16b, v3.4b[1]\n"
1672       "ldr q10, [x10, #0xd0]\n"
1673       ".inst 0x6fa0e093  // udot v19.4s, v4.16b, v0.4b[1]\n"
1674       ".inst 0x6fa1e097  // udot v23.4s, v4.16b, v1.4b[1]\n"
1675       ".inst 0x6fa2e09b  // udot v27.4s, v4.16b, v2.4b[1]\n"
1676       ".inst 0x6fa3e09f  // udot v31.4s, v4.16b, v3.4b[1]\n"
1677       "ldr q4, [x10, #0xe0]\n"
1678       ".inst 0x6f80e8b0  // udot v16.4s, v5.16b, v0.4b[2]\n"
1679       ".inst 0x6f81e8b4  // udot v20.4s, v5.16b, v1.4b[2]\n"
1680       ".inst 0x6f82e8b8  // udot v24.4s, v5.16b, v2.4b[2]\n"
1681       ".inst 0x6f83e8bc  // udot v28.4s, v5.16b, v3.4b[2]\n"
1682       "ldr q5, [x10, #0xf0]\n"
1683       ".inst 0x6f80e8d1  // udot v17.4s, v6.16b, v0.4b[2]\n"
1684       "add x10, x10, #0x100\n"
1685       ".inst 0x6f81e8d5  // udot v21.4s, v6.16b, v1.4b[2]\n"
1686       ".inst 0x6f82e8d9  // udot v25.4s, v6.16b, v2.4b[2]\n"
1687       ".inst 0x6f83e8dd  // udot v29.4s, v6.16b, v3.4b[2]\n"
1688       ".inst 0x6f80e8f2  // udot v18.4s, v7.16b, v0.4b[2]\n"
1689       ".inst 0x6f81e8f6  // udot v22.4s, v7.16b, v1.4b[2]\n"
1690       ".inst 0x6f82e8fa  // udot v26.4s, v7.16b, v2.4b[2]\n"
1691       ".inst 0x6f83e8fe  // udot v30.4s, v7.16b, v3.4b[2]\n"
1692       ".inst 0x6f80e913  // udot v19.4s, v8.16b, v0.4b[2]\n"
1693       ".inst 0x6f81e917  // udot v23.4s, v8.16b, v1.4b[2]\n"
1694       ".inst 0x6f82e91b  // udot v27.4s, v8.16b, v2.4b[2]\n"
1695       ".inst 0x6f83e91f  // udot v31.4s, v8.16b, v3.4b[2]\n"
1696       ".inst 0x6fa0e930  // udot v16.4s, v9.16b, v0.4b[3]\n"
1697       ".inst 0x6fa1e934  // udot v20.4s, v9.16b, v1.4b[3]\n"
1698       ".inst 0x6fa2e938  // udot v24.4s, v9.16b, v2.4b[3]\n"
1699       ".inst 0x6fa3e93c  // udot v28.4s, v9.16b, v3.4b[3]\n"
1700       ".inst 0x6fa0e951  // udot v17.4s, v10.16b, v0.4b[3]\n"
1701       ".inst 0x6fa1e955  // udot v21.4s, v10.16b, v1.4b[3]\n"
1702       ".inst 0x6fa2e959  // udot v25.4s, v10.16b, v2.4b[3]\n"
1703       ".inst 0x6fa3e95d  // udot v29.4s, v10.16b, v3.4b[3]\n"
1704       ".inst 0x6fa0e892  // udot v18.4s, v4.16b, v0.4b[3]\n"
1705       ".inst 0x6fa1e896  // udot v22.4s, v4.16b, v1.4b[3]\n"
1706       ".inst 0x6fa2e89a  // udot v26.4s, v4.16b, v2.4b[3]\n"
1707       ".inst 0x6fa3e89e  // udot v30.4s, v4.16b, v3.4b[3]\n"
1708       ".inst 0x6fa0e8b3  // udot v19.4s, v5.16b, v0.4b[3]\n"
1709       ".inst 0x6fa1e8b7  // udot v23.4s, v5.16b, v1.4b[3]\n"
1710       ".inst 0x6fa2e8bb  // udot v27.4s, v5.16b, v2.4b[3]\n"
1711       ".inst 0x6fa3e8bf  // udot v31.4s, v5.16b, v3.4b[3]\n"
1712       "tbnz %x[flags], #31, 100f\n"
1713       ".inst 0x6e8f940b  // udot v11.4s, v0.16b, v15.16b\n"
1714       ".inst 0x6e8f942c  // udot v12.4s, v1.16b, v15.16b\n"
1715       ".inst 0x6e8f944d  // udot v13.4s, v2.16b, v15.16b\n"
1716       ".inst 0x6e8f946e  // udot v14.4s, v3.16b, v15.16b\n"
1717       "100:"  // Height 4: Multiply loop: unique 14: skip row sum
1718       "prfm pldl1keep, [x25, #0x80]\n"
1719       "prfm pldl1keep, [x22, #0x80]\n"
1720       "prfm pldl1keep, [x21, #0x80]\n"
1721       "prfm pldl1keep, [x20, #0x80]\n"
1722       "101:"  // Height 4: Multiply loop: Main loop skip
1723       "cbz x26, 108f\n"
1724       "cmp x26, #0x4\n"
1725       "blt 104f\n"
1726       "102:"  // Height 4: Multiply loop: Odd block loop
1727       "ldr s0, [x25], #0x4\n"
1728       "ldr s1, [x22], #0x4\n"
1729       "ldr s2, [x21], #0x4\n"
1730       "ldr s3, [x20], #0x4\n"
1731       "tbnz %x[flags], #31, 103f\n"
1732       ".inst 0x6e8f940b  // udot v11.4s, v0.16b, v15.16b\n"
1733       ".inst 0x6e8f942c  // udot v12.4s, v1.16b, v15.16b\n"
1734       ".inst 0x6e8f944d  // udot v13.4s, v2.16b, v15.16b\n"
1735       ".inst 0x6e8f946e  // udot v14.4s, v3.16b, v15.16b\n"
1736       "103:"  // Height 4: Multiply loop: unique 15: skip row sum
1737       "ldr q6, [x10, #0x0]\n"
1738       "sub x26, x26, #0x4\n"
1739       "ldr q7, [x10, #0x10]\n"
1740       "cmp x26, #0x4\n"
1741       "ldr q8, [x10, #0x20]\n"
1742       ".inst 0x6f80e0d0  // udot v16.4s, v6.16b, v0.4b[0]\n"
1743       "ldr q9, [x10, #0x30]\n"
1744       ".inst 0x6f81e0d4  // udot v20.4s, v6.16b, v1.4b[0]\n"
1745       "add x10, x10, #0x40\n"
1746       ".inst 0x6f82e0d8  // udot v24.4s, v6.16b, v2.4b[0]\n"
1747       ".inst 0x6f83e0dc  // udot v28.4s, v6.16b, v3.4b[0]\n"
1748       ".inst 0x6f80e0f1  // udot v17.4s, v7.16b, v0.4b[0]\n"
1749       ".inst 0x6f81e0f5  // udot v21.4s, v7.16b, v1.4b[0]\n"
1750       ".inst 0x6f82e0f9  // udot v25.4s, v7.16b, v2.4b[0]\n"
1751       ".inst 0x6f83e0fd  // udot v29.4s, v7.16b, v3.4b[0]\n"
1752       ".inst 0x6f80e112  // udot v18.4s, v8.16b, v0.4b[0]\n"
1753       ".inst 0x6f81e116  // udot v22.4s, v8.16b, v1.4b[0]\n"
1754       ".inst 0x6f82e11a  // udot v26.4s, v8.16b, v2.4b[0]\n"
1755       ".inst 0x6f83e11e  // udot v30.4s, v8.16b, v3.4b[0]\n"
1756       ".inst 0x6f80e133  // udot v19.4s, v9.16b, v0.4b[0]\n"
1757       ".inst 0x6f81e137  // udot v23.4s, v9.16b, v1.4b[0]\n"
1758       ".inst 0x6f82e13b  // udot v27.4s, v9.16b, v2.4b[0]\n"
1759       ".inst 0x6f83e13f  // udot v31.4s, v9.16b, v3.4b[0]\n"
1760       "bge 102b\n"
1761       "cbz x26, 108f\n"
1762       "104:"  // Height 4: Multiply loop: Skip odd blocks
1763       "tbz x26, #1, 105f\n"
1764       "ldr h0, [x25], #0x2\n"
1765       "ldr h1, [x22], #0x2\n"
1766       "ldr h2, [x21], #0x2\n"
1767       "ldr h3, [x20], #0x2\n"
1768       "tbz x26, #0, 106f\n"
1769       "ld1 { v0.b }[2], [x25]\n"
1770       "ld1 { v1.b }[2], [x22]\n"
1771       "ld1 { v2.b }[2], [x21]\n"
1772       "ld1 { v3.b }[2], [x20]\n"
1773       "b 106f\n"
1774       "105:"  // Height 4: Multiply loop: Ragged operand read: partial_1_0
1775       "ldr b0, [x25, #0x0]\n"
1776       "ldr b1, [x22, #0x0]\n"
1777       "ldr b2, [x21, #0x0]\n"
1778       "ldr b3, [x20, #0x0]\n"
1779       "106:"  // Height 4: Multiply loop: Ragged operand read: Done
1780       "tbnz %x[flags], #31, 107f\n"
1781       ".inst 0x6e8f940b  // udot v11.4s, v0.16b, v15.16b\n"
1782       ".inst 0x6e8f942c  // udot v12.4s, v1.16b, v15.16b\n"
1783       ".inst 0x6e8f944d  // udot v13.4s, v2.16b, v15.16b\n"
1784       ".inst 0x6e8f946e  // udot v14.4s, v3.16b, v15.16b\n"
1785       "107:"  // Height 4: Multiply loop: unique 16: skip row sum
1786       "ldr q10, [x10, #0x0]\n"
1787       "ldr q4, [x10, #0x10]\n"
1788       "ldr q5, [x10, #0x20]\n"
1789       ".inst 0x6f80e150  // udot v16.4s, v10.16b, v0.4b[0]\n"
1790       "ldr q6, [x10, #0x30]\n"
1791       ".inst 0x6f81e154  // udot v20.4s, v10.16b, v1.4b[0]\n"
1792       "add x10, x10, #0x40\n"
1793       ".inst 0x6f82e158  // udot v24.4s, v10.16b, v2.4b[0]\n"
1794       ".inst 0x6f83e15c  // udot v28.4s, v10.16b, v3.4b[0]\n"
1795       ".inst 0x6f80e091  // udot v17.4s, v4.16b, v0.4b[0]\n"
1796       ".inst 0x6f81e095  // udot v21.4s, v4.16b, v1.4b[0]\n"
1797       ".inst 0x6f82e099  // udot v25.4s, v4.16b, v2.4b[0]\n"
1798       ".inst 0x6f83e09d  // udot v29.4s, v4.16b, v3.4b[0]\n"
1799       ".inst 0x6f80e0b2  // udot v18.4s, v5.16b, v0.4b[0]\n"
1800       ".inst 0x6f81e0b6  // udot v22.4s, v5.16b, v1.4b[0]\n"
1801       ".inst 0x6f82e0ba  // udot v26.4s, v5.16b, v2.4b[0]\n"
1802       ".inst 0x6f83e0be  // udot v30.4s, v5.16b, v3.4b[0]\n"
1803       ".inst 0x6f80e0d3  // udot v19.4s, v6.16b, v0.4b[0]\n"
1804       ".inst 0x6f81e0d7  // udot v23.4s, v6.16b, v1.4b[0]\n"
1805       ".inst 0x6f82e0db  // udot v27.4s, v6.16b, v2.4b[0]\n"
1806       ".inst 0x6f83e0df  // udot v31.4s, v6.16b, v3.4b[0]\n"
1807       "108:"  // Height 4: Multiply loop: No odd multiplies
1808       "ldr w19, [%x[args_ptr], %[offsetof_num_strings]]\n"
1809       "add x27, x27, #0x1\n"
1810       "cmp x27, x19\n"
1811       "bne 94b\n"
1812       "ldr x19, [%x[args_ptr], %[offsetof_output_offset]]\n"
1813       "prfm pstl1keep, [x28, #0x0]\n"
1814       "add x21, x28, x19\n"
1815       "prfm pstl1keep, [x21, #0x0]\n"
1816       "add x20, x21, x19\n"
1817       "prfm pstl1keep, [x20, #0x0]\n"
1818       "add x19, x20, x19\n"
1819       "prfm pstl1keep, [x19, #0x0]\n"
1820       "tbnz %x[flags], #31, 109f\n"
1821       "addp v11.4s, v11.4s, v11.4s\n"
1822       "addp v12.4s, v12.4s, v12.4s\n"
1823       "addp v13.4s, v13.4s, v13.4s\n"
1824       "addp v14.4s, v14.4s, v14.4s\n"
1825       "add x22, %x[qp], %[b_offset]\n"
1826       "ld1r { v4.4s }, [x22]\n"
1827       "addp v11.4s, v11.4s, v11.4s\n"
1828       "addp v12.4s, v12.4s, v12.4s\n"
1829       "neg v4.4s, v4.4s\n"
1830       "addp v13.4s, v13.4s, v13.4s\n"
1831       "addp v14.4s, v14.4s, v14.4s\n"
1832       "mul v11.4s, v11.4s, v4.4s\n"
1833       "mul v12.4s, v12.4s, v4.4s\n"
1834       "mul v13.4s, v13.4s, v4.4s\n"
1835       "mul v14.4s, v14.4s, v4.4s\n"
1836       "109:"  // Height 4: skip row sum fixup
1837       "add v16.4s, v16.4s, v11.4s\n"
1838       "add v17.4s, v17.4s, v11.4s\n"
1839       "add v18.4s, v18.4s, v11.4s\n"
1840       "add v19.4s, v19.4s, v11.4s\n"
1841       "add v20.4s, v20.4s, v12.4s\n"
1842       "add v21.4s, v21.4s, v12.4s\n"
1843       "add v22.4s, v22.4s, v12.4s\n"
1844       "add v23.4s, v23.4s, v12.4s\n"
1845       "add v24.4s, v24.4s, v13.4s\n"
1846       "add v25.4s, v25.4s, v13.4s\n"
1847       "add v26.4s, v26.4s, v13.4s\n"
1848       "add v27.4s, v27.4s, v13.4s\n"
1849       "add v28.4s, v28.4s, v14.4s\n"
1850       "add v29.4s, v29.4s, v14.4s\n"
1851       "add v30.4s, v30.4s, v14.4s\n"
1852       "add v31.4s, v31.4s, v14.4s\n"
1853       "ldr q0, [x9, #0x0]\n"
1854       "orr %x[flags], %x[flags], #0x80000000\n"
1855       "ldr q1, [x9, #0x10]\n"
1856       "add x23, %x[qp], %[per_layer_right_shift]\n"
1857       "ldr q2, [x9, #0x20]\n"
1858       "add x22, %x[qp], %[per_layer_mul]\n"
1859       "add v16.4s, v16.4s, v0.4s\n"
1860       "add v20.4s, v20.4s, v0.4s\n"
1861       "add v17.4s, v17.4s, v1.4s\n"
1862       "add v21.4s, v21.4s, v1.4s\n"
1863       "add v18.4s, v18.4s, v2.4s\n"
1864       "add v22.4s, v22.4s, v2.4s\n"
1865       "add v24.4s, v24.4s, v0.4s\n"
1866       "add v25.4s, v25.4s, v1.4s\n"
1867       "add v26.4s, v26.4s, v2.4s\n"
1868       "add v28.4s, v28.4s, v0.4s\n"
1869       "add v29.4s, v29.4s, v1.4s\n"
1870       "add v30.4s, v30.4s, v2.4s\n"
1871       "ldr q3, [x9, #0x30]\n"
1872       "add x9, x9, #0x40\n"
1873       "ld1r { v0.4s }, [x23]\n"
1874       "ld1r { v4.4s }, [x22]\n"
1875       "add v19.4s, v19.4s, v3.4s\n"
1876       "add v23.4s, v23.4s, v3.4s\n"
1877       "add v27.4s, v27.4s, v3.4s\n"
1878       "add v31.4s, v31.4s, v3.4s\n"
1879       "sqrdmulh v16.4s, v16.4s, v4.4s\n"
1880       "sqrdmulh v17.4s, v17.4s, v4.4s\n"
1881       "sqrdmulh v18.4s, v18.4s, v4.4s\n"
1882       "sqrdmulh v20.4s, v20.4s, v4.4s\n"
1883       "sqrdmulh v21.4s, v21.4s, v4.4s\n"
1884       "sqrdmulh v22.4s, v22.4s, v4.4s\n"
1885       "sqrdmulh v19.4s, v19.4s, v4.4s\n"
1886       "sqrdmulh v23.4s, v23.4s, v4.4s\n"
1887       "sqrdmulh v24.4s, v24.4s, v4.4s\n"
1888       "sqrdmulh v25.4s, v25.4s, v4.4s\n"
1889       "sqrdmulh v26.4s, v26.4s, v4.4s\n"
1890       "sqrdmulh v27.4s, v27.4s, v4.4s\n"
1891       "sqrdmulh v28.4s, v28.4s, v4.4s\n"
1892       "sqrdmulh v29.4s, v29.4s, v4.4s\n"
1893       "sqrdmulh v30.4s, v30.4s, v4.4s\n"
1894       "sqrdmulh v31.4s, v31.4s, v4.4s\n"
1895       "tbz %x[flags], #5, 110f\n"
1896       "and v4.16b, v16.16b, v0.16b\n"
1897       "and v5.16b, v17.16b, v0.16b\n"
1898       "and v6.16b, v18.16b, v0.16b\n"
1899       "and v7.16b, v19.16b, v0.16b\n"
1900       "and v8.16b, v20.16b, v0.16b\n"
1901       "and v9.16b, v21.16b, v0.16b\n"
1902       "and v10.16b, v22.16b, v0.16b\n"
1903       "sshr v4.4s, v4.4s, #0x1f\n"
1904       "sshr v5.4s, v5.4s, #0x1f\n"
1905       "sshr v6.4s, v6.4s, #0x1f\n"
1906       "sshr v7.4s, v7.4s, #0x1f\n"
1907       "sshr v8.4s, v8.4s, #0x1f\n"
1908       "sshr v9.4s, v9.4s, #0x1f\n"
1909       "sshr v10.4s, v10.4s, #0x1f\n"
1910       "sqadd v16.4s, v16.4s, v4.4s\n"
1911       "and v4.16b, v23.16b, v0.16b\n"
1912       "sqadd v17.4s, v17.4s, v5.4s\n"
1913       "sqadd v18.4s, v18.4s, v6.4s\n"
1914       "sqadd v19.4s, v19.4s, v7.4s\n"
1915       "sqadd v20.4s, v20.4s, v8.4s\n"
1916       "sqadd v21.4s, v21.4s, v9.4s\n"
1917       "sqadd v22.4s, v22.4s, v10.4s\n"
1918       "and v5.16b, v24.16b, v0.16b\n"
1919       "and v6.16b, v25.16b, v0.16b\n"
1920       "sshr v4.4s, v4.4s, #0x1f\n"
1921       "and v7.16b, v26.16b, v0.16b\n"
1922       "and v8.16b, v27.16b, v0.16b\n"
1923       "and v9.16b, v28.16b, v0.16b\n"
1924       "and v10.16b, v29.16b, v0.16b\n"
1925       "sshr v5.4s, v5.4s, #0x1f\n"
1926       "sshr v6.4s, v6.4s, #0x1f\n"
1927       "sqadd v23.4s, v23.4s, v4.4s\n"
1928       "sshr v7.4s, v7.4s, #0x1f\n"
1929       "sshr v8.4s, v8.4s, #0x1f\n"
1930       "sshr v9.4s, v9.4s, #0x1f\n"
1931       "sshr v10.4s, v10.4s, #0x1f\n"
1932       "and v4.16b, v30.16b, v0.16b\n"
1933       "sqadd v24.4s, v24.4s, v5.4s\n"
1934       "sqadd v25.4s, v25.4s, v6.4s\n"
1935       "sqadd v26.4s, v26.4s, v7.4s\n"
1936       "and v5.16b, v31.16b, v0.16b\n"
1937       "sqadd v27.4s, v27.4s, v8.4s\n"
1938       "sqadd v28.4s, v28.4s, v9.4s\n"
1939       "sqadd v29.4s, v29.4s, v10.4s\n"
1940       "sshr v4.4s, v4.4s, #0x1f\n"
1941       "sshr v5.4s, v5.4s, #0x1f\n"
1942       "sqadd v30.4s, v30.4s, v4.4s\n"
1943       "sqadd v31.4s, v31.4s, v5.4s\n"
1944       "110:"  // Height 4: no shift correction
1945       "srshl v16.4s, v16.4s, v0.4s\n"
1946       "srshl v17.4s, v17.4s, v0.4s\n"
1947       "srshl v18.4s, v18.4s, v0.4s\n"
1948       "srshl v19.4s, v19.4s, v0.4s\n"
1949       "srshl v20.4s, v20.4s, v0.4s\n"
1950       "srshl v21.4s, v21.4s, v0.4s\n"
1951       "srshl v22.4s, v22.4s, v0.4s\n"
1952       "srshl v23.4s, v23.4s, v0.4s\n"
1953       "srshl v24.4s, v24.4s, v0.4s\n"
1954       "srshl v25.4s, v25.4s, v0.4s\n"
1955       "srshl v26.4s, v26.4s, v0.4s\n"
1956       "srshl v27.4s, v27.4s, v0.4s\n"
1957       "srshl v28.4s, v28.4s, v0.4s\n"
1958       "srshl v29.4s, v29.4s, v0.4s\n"
1959       "srshl v30.4s, v30.4s, v0.4s\n"
1960       "srshl v31.4s, v31.4s, v0.4s\n"
1961       "add x22, %x[qp], %[c_offset]\n"
1962       "add x23, %x[qp], %[minval]\n"
1963       "ld1r { v4.4s }, [x22]\n"
1964       "add x22, %x[qp], %[maxval]\n"
1965       "ld1r { v5.4s }, [x23]\n"
1966       "cmp x11, #0x10\n"
1967       "ld1r { v6.4s }, [x22]\n"
1968       "add v16.4s, v16.4s, v4.4s\n"
1969       "add v17.4s, v17.4s, v4.4s\n"
1970       "add v18.4s, v18.4s, v4.4s\n"
1971       "add v19.4s, v19.4s, v4.4s\n"
1972       "add v20.4s, v20.4s, v4.4s\n"
1973       "add v21.4s, v21.4s, v4.4s\n"
1974       "add v22.4s, v22.4s, v4.4s\n"
1975       "add v23.4s, v23.4s, v4.4s\n"
1976       "add v24.4s, v24.4s, v4.4s\n"
1977       "add v25.4s, v25.4s, v4.4s\n"
1978       "smin v16.4s, v16.4s, v6.4s\n"
1979       "smin v17.4s, v17.4s, v6.4s\n"
1980       "smin v18.4s, v18.4s, v6.4s\n"
1981       "smin v19.4s, v19.4s, v6.4s\n"
1982       "smin v20.4s, v20.4s, v6.4s\n"
1983       "smin v21.4s, v21.4s, v6.4s\n"
1984       "smin v22.4s, v22.4s, v6.4s\n"
1985       "smin v23.4s, v23.4s, v6.4s\n"
1986       "smin v24.4s, v24.4s, v6.4s\n"
1987       "smin v25.4s, v25.4s, v6.4s\n"
1988       "smax v16.4s, v16.4s, v5.4s\n"
1989       "smax v17.4s, v17.4s, v5.4s\n"
1990       "smax v18.4s, v18.4s, v5.4s\n"
1991       "smax v19.4s, v19.4s, v5.4s\n"
1992       "smax v20.4s, v20.4s, v5.4s\n"
1993       "smax v21.4s, v21.4s, v5.4s\n"
1994       "smax v22.4s, v22.4s, v5.4s\n"
1995       "smax v23.4s, v23.4s, v5.4s\n"
1996       "smax v24.4s, v24.4s, v5.4s\n"
1997       "smax v25.4s, v25.4s, v5.4s\n"
1998       "add v26.4s, v26.4s, v4.4s\n"
1999       "add v27.4s, v27.4s, v4.4s\n"
2000       "add v28.4s, v28.4s, v4.4s\n"
2001       "add v29.4s, v29.4s, v4.4s\n"
2002       "add v30.4s, v30.4s, v4.4s\n"
2003       "add v31.4s, v31.4s, v4.4s\n"
2004       "uzp1 v16.8h, v16.8h, v17.8h\n"
2005       "uzp1 v17.8h, v18.8h, v19.8h\n"
2006       "uzp1 v20.8h, v20.8h, v21.8h\n"
2007       "uzp1 v21.8h, v22.8h, v23.8h\n"
2008       "smin v26.4s, v26.4s, v6.4s\n"
2009       "smin v27.4s, v27.4s, v6.4s\n"
2010       "smin v28.4s, v28.4s, v6.4s\n"
2011       "smin v29.4s, v29.4s, v6.4s\n"
2012       "smin v30.4s, v30.4s, v6.4s\n"
2013       "smin v31.4s, v31.4s, v6.4s\n"
2014       "uzp1 v24.8h, v24.8h, v25.8h\n"
2015       "uzp1 v16.16b, v16.16b, v17.16b\n"
2016       "uzp1 v20.16b, v20.16b, v21.16b\n"
2017       "smax v26.4s, v26.4s, v5.4s\n"
2018       "smax v27.4s, v27.4s, v5.4s\n"
2019       "smax v28.4s, v28.4s, v5.4s\n"
2020       "smax v29.4s, v29.4s, v5.4s\n"
2021       "smax v30.4s, v30.4s, v5.4s\n"
2022       "smax v31.4s, v31.4s, v5.4s\n"
2023       "uzp1 v25.8h, v26.8h, v27.8h\n"
2024       "uzp1 v28.8h, v28.8h, v29.8h\n"
2025       "uzp1 v29.8h, v30.8h, v31.8h\n"
2026       "uzp1 v24.16b, v24.16b, v25.16b\n"
2027       "uzp1 v28.16b, v28.16b, v29.16b\n"
2028       "bge 119f\n"
2029       "tbz x11, #3, 114f\n"
2030       "str d16, [x28], #0x8\n"
2031       "str d20, [x21], #0x8\n"
2032       "str d24, [x20], #0x8\n"
2033       "str d28, [x19], #0x8\n"
2034       "tbz x11, #2, 112f\n"
2035       "st1 { v16.s }[2], [x28], #0x4\n"
2036       "st1 { v20.s }[2], [x21], #0x4\n"
2037       "st1 { v24.s }[2], [x20], #0x4\n"
2038       "st1 { v28.s }[2], [x19], #0x4\n"
2039       "tbz x11, #1, 111f\n"
2040       "st1 { v16.h }[6], [x28], #0x2\n"
2041       "st1 { v20.h }[6], [x21], #0x2\n"
2042       "st1 { v24.h }[6], [x20], #0x2\n"
2043       "st1 { v28.h }[6], [x19], #0x2\n"
2044       "tbz x11, #0, 118f\n"
2045       "st1 { v16.b }[14], [x28]\n"
2046       "st1 { v20.b }[14], [x21]\n"
2047       "st1 { v24.b }[14], [x20]\n"
2048       "st1 { v28.b }[14], [x19]\n"
2049       "b 118f\n"
2050       "111:"  // Height 4: Partial direct writeback: partial_1_12
2051       "tbz x11, #0, 118f\n"
2052       "st1 { v16.b }[12], [x28]\n"
2053       "st1 { v20.b }[12], [x21]\n"
2054       "st1 { v24.b }[12], [x20]\n"
2055       "st1 { v28.b }[12], [x19]\n"
2056       "b 118f\n"
2057       "112:"  // Height 4: Partial direct writeback: partial_2_8
2058       "tbz x11, #1, 113f\n"
2059       "st1 { v16.h }[4], [x28], #0x2\n"
2060       "st1 { v20.h }[4], [x21], #0x2\n"
2061       "st1 { v24.h }[4], [x20], #0x2\n"
2062       "st1 { v28.h }[4], [x19], #0x2\n"
2063       "tbz x11, #0, 118f\n"
2064       "st1 { v16.b }[10], [x28]\n"
2065       "st1 { v20.b }[10], [x21]\n"
2066       "st1 { v24.b }[10], [x20]\n"
2067       "st1 { v28.b }[10], [x19]\n"
2068       "b 118f\n"
2069       "113:"  // Height 4: Partial direct writeback: partial_1_8
2070       "tbz x11, #0, 118f\n"
2071       "st1 { v16.b }[8], [x28]\n"
2072       "st1 { v20.b }[8], [x21]\n"
2073       "st1 { v24.b }[8], [x20]\n"
2074       "st1 { v28.b }[8], [x19]\n"
2075       "b 118f\n"
2076       "114:"  // Height 4: Partial direct writeback: partial_4_0
2077       "tbz x11, #2, 116f\n"
2078       "str s16, [x28], #0x4\n"
2079       "str s20, [x21], #0x4\n"
2080       "str s24, [x20], #0x4\n"
2081       "str s28, [x19], #0x4\n"
2082       "tbz x11, #1, 115f\n"
2083       "st1 { v16.h }[2], [x28], #0x2\n"
2084       "st1 { v20.h }[2], [x21], #0x2\n"
2085       "st1 { v24.h }[2], [x20], #0x2\n"
2086       "st1 { v28.h }[2], [x19], #0x2\n"
2087       "tbz x11, #0, 118f\n"
2088       "st1 { v16.b }[6], [x28]\n"
2089       "st1 { v20.b }[6], [x21]\n"
2090       "st1 { v24.b }[6], [x20]\n"
2091       "st1 { v28.b }[6], [x19]\n"
2092       "b 118f\n"
2093       "115:"  // Height 4: Partial direct writeback: partial_1_4
2094       "tbz x11, #0, 118f\n"
2095       "st1 { v16.b }[4], [x28]\n"
2096       "st1 { v20.b }[4], [x21]\n"
2097       "st1 { v24.b }[4], [x20]\n"
2098       "st1 { v28.b }[4], [x19]\n"
2099       "b 118f\n"
2100       "116:"  // Height 4: Partial direct writeback: partial_2_0
2101       "tbz x11, #1, 117f\n"
2102       "str h16, [x28], #0x2\n"
2103       "str h20, [x21], #0x2\n"
2104       "str h24, [x20], #0x2\n"
2105       "str h28, [x19], #0x2\n"
2106       "tbz x11, #0, 118f\n"
2107       "st1 { v16.b }[2], [x28]\n"
2108       "st1 { v20.b }[2], [x21]\n"
2109       "st1 { v24.b }[2], [x20]\n"
2110       "st1 { v28.b }[2], [x19]\n"
2111       "b 118f\n"
2112       "117:"  // Height 4: Partial direct writeback: partial_1_0
2113       "str b16, [x28, #0x0]\n"
2114       "str b20, [x21, #0x0]\n"
2115       "str b24, [x20, #0x0]\n"
2116       "str b28, [x19, #0x0]\n"
2117       "118:"  // Height 4: Partial direct writeback: Done
2118       "b 120f\n"
2119       "119:"  // Height 4: Full writeback
2120       "str q16, [x28, #0x0]\n"
2121       "add x28, x28, #0x10\n"
2122       "str q20, [x21, #0x0]\n"
2123       "str q24, [x20, #0x0]\n"
2124       "str q28, [x19, #0x0]\n"
2125       "120:"  // Height 4: Writeback done
2126       "subs x11, x11, #0x10\n"
2127       "bgt 92b\n"
2128       "subs %x[M], %x[M], #0x4\n"
2129       "beq 122f\n"
2130       "ldr x20, [%x[args_ptr], %[offsetof_input_offset]]\n"
2131       "tbz %x[flags], #3, 121f\n"
2132       "add x20, x20, #0x4\n"
2133       "str x20, [%x[args_ptr], %[offsetof_input_offset]]\n"
2134       "b 1b\n"
2135       "121:"  // Update direct input
2136       "mov x19, #0x4\n"
2137       "madd %x[input_ptr], x19, x20, %x[input_ptr]\n"
2138       "b 1b\n"
2139       "122:"  // Exit
2140 
2141       : [M] "+&r" (M), [flags] "+&r" (flags), [input_ptr] "+&r" (input_ptr), [output_ptr] "+&r" (output_ptr)
2142       : [args_ptr] "r" (&ka), [b_offset] "I" (offsetof(Requantize32, b_offset)), [c_offset] "I" (offsetof(Requantize32, c_offset)), [col_bias] "r" (col_bias), [maxval] "I" (offsetof(Requantize32, maxval)), [minval] "I" (offsetof(Requantize32, minval)), [offsetof_B_ptr] "I" (offsetof(KernelArgs, B_ptr)), [offsetof_N] "I" (offsetof(KernelArgs, N)), [offsetof_input_initial_col] "I" (offsetof(KernelArgs, input_initial_col)), [offsetof_input_offset] "I" (offsetof(KernelArgs, input_offset)), [offsetof_num_strings] "I" (offsetof(KernelArgs, num_strings)), [offsetof_output_offset] "I" (offsetof(KernelArgs, output_offset)), [offsetof_string_lengths] "I" (offsetof(KernelArgs, string_lengths)), [per_layer_mul] "I" (offsetof(Requantize32, per_layer_mul)), [per_layer_right_shift] "I" (offsetof(Requantize32, per_layer_right_shift)), [qp] "r" (qp)
2143       : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31", "x9", "x10", "x11", "x19", "x20", "x21", "x22", "x23", "x24", "x25", "x26", "x27", "x28"
2144     );
2145 }
2146 
2147 } // namespace arm_gemm
2148 #endif // __aarch64__
2149