aboutsummaryrefslogtreecommitdiff
path: root/src/core/NEON/kernels/arm_gemm/kernels/sve_hybrid_u8u32_dot_6x4VL/a64fx.cpp
blob: 4d0f44982a8281af41d7d5a373dbafa2242b0387 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
/*
 * Copyright (c) 2021, 2023 Arm Limited.
 *
 * SPDX-License-Identifier: MIT
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to
 * deal in the Software without restriction, including without limitation the
 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 * sell copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
#ifdef ARM_COMPUTE_ENABLE_SVE

#include "arm_gemm.hpp"
#include "../../utils.hpp"

#include <cassert>

namespace arm_gemm {

void sve_hybrid_u8u32_dot_6x4VL_a64fx (
    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<uint32_t> output_arg,
    const uint32_t *, Activation, bool accumulate
)
{
    struct KernelArgs {
        unsigned int num_strings = {};
        const unsigned int *string_lengths = {};
        size_t N = {};
        const uint8_t *B_ptr = {};
        size_t output_offset = {};
        size_t input_initial_col = {};
        size_t input_offset = {};
    } ka;

    unsigned long flags=0;
    void *output_ptr;
    void *input_ptr;

    if (output_arg.is_indirect) {
        output_ptr=(void *)(output_arg.indirect.ptr);
        ka.output_offset=output_arg.indirect.offset;
        flags |= 0x4;
    } else {
        output_ptr=(void *)(output_arg.direct.base);
        ka.output_offset=output_arg.direct.stride;
    }

    if (A_arg.is_indirect) {
        input_ptr=(void *)(A_arg.indirect.ptr);
        ka.input_offset=A_arg.indirect.start_row;
        ka.input_initial_col=A_arg.indirect.start_col;
        flags |= 0x8;
    } else {
        assert(num_strings==1);
        input_ptr=(void *)(A_arg.direct.base);
        ka.input_offset=A_arg.direct.stride;
    }
    if (accumulate) {
        flags |= 0x1;
    }
    ka.num_strings = num_strings;
    ka.string_lengths = string_lengths;
    ka.N = N;
    ka.B_ptr = B_ptr;
    __asm__ __volatile__(
      "ptrue p4.b\n"
      "1:"  // Row loop
      "cmp %x[M], #0x6\n"
      "bge 51f\n"
      "cmp %x[M], #0x4\n"
      "bgt 41f\n"
      "beq 31f\n"
      "cmp %x[M], #0x2\n"
      "bgt 21f\n"
      "beq 11f\n"
      "ldr x11, [%x[args_ptr], %[offsetof_N]]\n"
      "ldr x10, [%x[args_ptr], %[offsetof_B_ptr]]\n"
      "mov x9, %x[output_ptr]\n"
      "2:"  // Height 1: Column loop
      "mov x20, #0x0\n"
      "whilelt p3.s, x20, x11\n"
      "incw x20\n"
      "whilelt p2.s, x20, x11\n"
      "incw x20\n"
      "whilelt p1.s, x20, x11\n"
      "incw x20\n"
      "whilelt p0.s, x20, x11\n"
      "tbz %x[flags], #0, 3f\n"
      "ld1w { z8.s }, p3/Z, [x9]\n"
      "ld1w { z9.s }, p2/Z, [x9, #1, MUL VL]\n"
      "ld1w { z10.s }, p1/Z, [x9, #2, MUL VL]\n"
      "ld1w { z11.s }, p0/Z, [x9, #3, MUL VL]\n"
      "b 4f\n"
      "3:"  // Height 1: no accumulate
      "mov z8.s, #0x0\n"
      "mov z9.s, #0x0\n"
      "mov z10.s, #0x0\n"
      "mov z11.s, #0x0\n"
      "4:"  // Height 1: setup done
      "mov x28, #0x0\n"
      "5:"  // Height 1: String loop
      "ldr x20, [%x[args_ptr], %[offsetof_string_lengths]]\n"
      "ldr w27, [x20, x28, LSL #0x2]\n"
      "ldr x21, [%x[args_ptr], %[offsetof_input_offset]]\n"
      "tbz %x[flags], #3, 6f\n"
      "ldr x20, [%x[input_ptr], x28, LSL #0x3]\n"
      "add x20, x20, x21, LSL #3\n"
      "ldr x26, [x20, #0x0]\n"
      "cbnz x28, 7f\n"
      "ldr x20, [%x[args_ptr], %[offsetof_input_initial_col]]\n"
      "add x26, x26, x20\n"
      "b 7f\n"
      "6:"  // Height 1: setup direct input
      "mov x26, %x[input_ptr]\n"
      "7:"  // Height 1: input setup done
      "subs x27, x27, #0x4\n"
      "ld1rw { z0.s }, p4/Z, [x26]\n"
      "ld1b { z6.b }, p4/Z, [x10]\n"
      "ld1b { z7.b }, p4/Z, [x10, #1, MUL VL]\n"
      "ble 9f\n"
      "8:"  // Height 1: Multiply loop: Main loop
      "udot z8.s, z6.b, z0.b\n"
      "udot z9.s, z7.b, z0.b\n"
      "ld1b { z17.b }, p4/Z, [x10, #2, MUL VL]\n"
      "ld1b { z16.b }, p4/Z, [x10, #3, MUL VL]\n"
      "addvl x10, x10, #4\n"
      "add x26, x26, #0x4\n"
      "udot z10.s, z17.b, z0.b\n"
      "udot z11.s, z16.b, z0.b\n"
      "subs x27, x27, #0x4\n"
      "ld1rw { z0.s }, p4/Z, [x26]\n"
      "ld1b { z6.b }, p4/Z, [x10]\n"
      "ld1b { z7.b }, p4/Z, [x10, #1, MUL VL]\n"
      "bgt 8b\n"
      "9:"  // Height 1: Multiply loop: Main loop skip
      "ldr w20, [%x[args_ptr], %[offsetof_num_strings]]\n"
      "udot z8.s, z6.b, z0.b\n"
      "udot z9.s, z7.b, z0.b\n"
      "ld1b { z17.b }, p4/Z, [x10, #2, MUL VL]\n"
      "ld1b { z16.b }, p4/Z, [x10, #3, MUL VL]\n"
      "add x28, x28, #0x1\n"
      "cmp x28, x20\n"
      "udot z10.s, z17.b, z0.b\n"
      "udot z11.s, z16.b, z0.b\n"
      "addvl x10, x10, #4\n"
      "bne 5b\n"
      "st1w { z8.s }, p3, [x9]\n"
      "st1w { z9.s }, p2, [x9, #1, MUL VL]\n"
      "st1w { z10.s }, p1, [x9, #2, MUL VL]\n"
      "st1w { z11.s }, p0, [x9, #3, MUL VL]\n"
      "addvl x9, x9, #4\n"
      "10:"  // Height 1: Writeback done
      "decw x11, ALL, MUL #4\n"
      "cmp x11, XZR\n"
      "bgt 2b\n"
      "b 62f\n"
      "11:"  // Height 2
      "ldr x11, [%x[args_ptr], %[offsetof_N]]\n"
      "ldr x10, [%x[args_ptr], %[offsetof_B_ptr]]\n"
      "mov x9, %x[output_ptr]\n"
      "12:"  // Height 2: Column loop
      "mov x20, #0x0\n"
      "whilelt p3.s, x20, x11\n"
      "incw x20\n"
      "whilelt p2.s, x20, x11\n"
      "incw x20\n"
      "whilelt p1.s, x20, x11\n"
      "incw x20\n"
      "whilelt p0.s, x20, x11\n"
      "tbz %x[flags], #0, 13f\n"
      "ldr x20, [%x[args_ptr], %[offsetof_output_offset]]\n"
      "add x20, x9, x20, LSL #2\n"
      "ld1w { z8.s }, p3/Z, [x9]\n"
      "ld1w { z9.s }, p2/Z, [x9, #1, MUL VL]\n"
      "ld1w { z10.s }, p1/Z, [x9, #2, MUL VL]\n"
      "ld1w { z11.s }, p0/Z, [x9, #3, MUL VL]\n"
      "ld1w { z12.s }, p3/Z, [x20]\n"
      "ld1w { z13.s }, p2/Z, [x20, #1, MUL VL]\n"
      "ld1w { z14.s }, p1/Z, [x20, #2, MUL VL]\n"
      "ld1w { z15.s }, p0/Z, [x20, #3, MUL VL]\n"
      "b 14f\n"
      "13:"  // Height 2: no accumulate
      "mov z8.s, #0x0\n"
      "mov z9.s, #0x0\n"
      "mov z10.s, #0x0\n"
      "mov z11.s, #0x0\n"
      "mov z12.s, #0x0\n"
      "mov z13.s, #0x0\n"
      "mov z14.s, #0x0\n"
      "mov z15.s, #0x0\n"
      "14:"  // Height 2: setup done
      "mov x28, #0x0\n"
      "15:"  // Height 2: String loop
      "ldr x20, [%x[args_ptr], %[offsetof_string_lengths]]\n"
      "ldr w27, [x20, x28, LSL #0x2]\n"
      "ldr x21, [%x[args_ptr], %[offsetof_input_offset]]\n"
      "tbz %x[flags], #3, 16f\n"
      "ldr x20, [%x[input_ptr], x28, LSL #0x3]\n"
      "add x20, x20, x21, LSL #3\n"
      "ldr x26, [x20, #0x0]\n"
      "ldr x25, [x20, #0x8]\n"
      "cbnz x28, 17f\n"
      "ldr x20, [%x[args_ptr], %[offsetof_input_initial_col]]\n"
      "add x26, x26, x20\n"
      "add x25, x25, x20\n"
      "b 17f\n"
      "16:"  // Height 2: setup direct input
      "mov x26, %x[input_ptr]\n"
      "add x25, x26, x21\n"
      "17:"  // Height 2: input setup done
      "subs x27, x27, #0x4\n"
      "ld1rw { z0.s }, p4/Z, [x26]\n"
      "ld1rw { z1.s }, p4/Z, [x25]\n"
      "ld1b { z6.b }, p4/Z, [x10]\n"
      "ld1b { z7.b }, p4/Z, [x10, #1, MUL VL]\n"
      "ble 19f\n"
      "18:"  // Height 2: Multiply loop: Main loop
      "udot z8.s, z6.b, z0.b\n"
      "udot z12.s, z6.b, z1.b\n"
      "ld1b { z17.b }, p4/Z, [x10, #2, MUL VL]\n"
      "add x26, x26, #0x4\n"
      "udot z9.s, z7.b, z0.b\n"
      "udot z13.s, z7.b, z1.b\n"
      "ld1b { z16.b }, p4/Z, [x10, #3, MUL VL]\n"
      "addvl x10, x10, #4\n"
      "subs x27, x27, #0x4\n"
      "add x25, x25, #0x4\n"
      "udot z10.s, z17.b, z0.b\n"
      "udot z14.s, z17.b, z1.b\n"
      "udot z11.s, z16.b, z0.b\n"
      "udot z15.s, z16.b, z1.b\n"
      "ld1rw { z0.s }, p4/Z, [x26]\n"
      "ld1rw { z1.s }, p4/Z, [x25]\n"
      "ld1b { z6.b }, p4/Z, [x10]\n"
      "ld1b { z7.b }, p4/Z, [x10, #1, MUL VL]\n"
      "bgt 18b\n"
      "19:"  // Height 2: Multiply loop: Main loop skip
      "ldr w20, [%x[args_ptr], %[offsetof_num_strings]]\n"
      "udot z8.s, z6.b, z0.b\n"
      "udot z12.s, z6.b, z1.b\n"
      "ld1b { z17.b }, p4/Z, [x10, #2, MUL VL]\n"
      "udot z9.s, z7.b, z0.b\n"
      "udot z13.s, z7.b, z1.b\n"
      "ld1b { z16.b }, p4/Z, [x10, #3, MUL VL]\n"
      "add x28, x28, #0x1\n"
      "cmp x28, x20\n"
      "udot z10.s, z17.b, z0.b\n"
      "udot z14.s, z17.b, z1.b\n"
      "addvl x10, x10, #4\n"
      "udot z11.s, z16.b, z0.b\n"
      "udot z15.s, z16.b, z1.b\n"
      "bne 15b\n"
      "ldr x20, [%x[args_ptr], %[offsetof_output_offset]]\n"
      "add x20, x9, x20, LSL #2\n"
      "st1w { z8.s }, p3, [x9]\n"
      "st1w { z9.s }, p2, [x9, #1, MUL VL]\n"
      "st1w { z10.s }, p1, [x9, #2, MUL VL]\n"
      "st1w { z11.s }, p0, [x9, #3, MUL VL]\n"
      "addvl x9, x9, #4\n"
      "st1w { z12.s }, p3, [x20]\n"
      "st1w { z13.s }, p2, [x20, #1, MUL VL]\n"
      "st1w { z14.s }, p1, [x20, #2, MUL VL]\n"
      "st1w { z15.s }, p0, [x20, #3, MUL VL]\n"
      "20:"  // Height 2: Writeback done
      "decw x11, ALL, MUL #4\n"
      "cmp x11, XZR\n"
      "bgt 12b\n"
      "b 62f\n"
      "21:"  // Height 3
      "ldr x11, [%x[args_ptr], %[offsetof_N]]\n"
      "ldr x10, [%x[args_ptr], %[offsetof_B_ptr]]\n"
      "mov x9, %x[output_ptr]\n"
      "22:"  // Height 3: Column loop
      "mov x20, #0x0\n"
      "whilelt p3.s, x20, x11\n"
      "incw x20\n"
      "whilelt p2.s, x20, x11\n"
      "incw x20\n"
      "whilelt p1.s, x20, x11\n"
      "incw x20\n"
      "whilelt p0.s, x20, x11\n"
      "tbz %x[flags], #0, 23f\n"
      "ldr x20, [%x[args_ptr], %[offsetof_output_offset]]\n"
      "add x21, x9, x20, LSL #2\n"
      "add x20, x21, x20, LSL #2\n"
      "ld1w { z8.s }, p3/Z, [x9]\n"
      "ld1w { z9.s }, p2/Z, [x9, #1, MUL VL]\n"
      "ld1w { z10.s }, p1/Z, [x9, #2, MUL VL]\n"
      "ld1w { z11.s }, p0/Z, [x9, #3, MUL VL]\n"
      "ld1w { z12.s }, p3/Z, [x21]\n"
      "ld1w { z13.s }, p2/Z, [x21, #1, MUL VL]\n"
      "ld1w { z14.s }, p1/Z, [x21, #2, MUL VL]\n"
      "ld1w { z15.s }, p0/Z, [x21, #3, MUL VL]\n"
      "ld1w { z16.s }, p3/Z, [x20]\n"
      "ld1w { z17.s }, p2/Z, [x20, #1, MUL VL]\n"
      "ld1w { z18.s }, p1/Z, [x20, #2, MUL VL]\n"
      "ld1w { z19.s }, p0/Z, [x20, #3, MUL VL]\n"
      "b 24f\n"
      "23:"  // Height 3: no accumulate
      "mov z8.s, #0x0\n"
      "mov z9.s, #0x0\n"
      "mov z10.s, #0x0\n"
      "mov z11.s, #0x0\n"
      "mov z12.s, #0x0\n"
      "mov z13.s, #0x0\n"
      "mov z14.s, #0x0\n"
      "mov z15.s, #0x0\n"
      "mov z16.s, #0x0\n"
      "mov z17.s, #0x0\n"
      "mov z18.s, #0x0\n"
      "mov z19.s, #0x0\n"
      "24:"  // Height 3: setup done
      "mov x28, #0x0\n"
      "25:"  // Height 3: String loop
      "ldr x20, [%x[args_ptr], %[offsetof_string_lengths]]\n"
      "ldr w27, [x20, x28, LSL #0x2]\n"
      "ldr x21, [%x[args_ptr], %[offsetof_input_offset]]\n"
      "tbz %x[flags], #3, 26f\n"
      "ldr x20, [%x[input_ptr], x28, LSL #0x3]\n"
      "add x20, x20, x21, LSL #3\n"
      "ldr x26, [x20, #0x0]\n"
      "ldr x25, [x20, #0x8]\n"
      "ldr x24, [x20, #0x10]\n"
      "cbnz x28, 27f\n"
      "ldr x20, [%x[args_ptr], %[offsetof_input_initial_col]]\n"
      "add x26, x26, x20\n"
      "add x25, x25, x20\n"
      "add x24, x24, x20\n"
      "b 27f\n"
      "26:"  // Height 3: setup direct input
      "mov x26, %x[input_ptr]\n"
      "add x25, x26, x21\n"
      "add x24, x25, x21\n"
      "27:"  // Height 3: input setup done
      "subs x27, x27, #0x4\n"
      "ld1rw { z0.s }, p4/Z, [x26]\n"
      "ld1rw { z1.s }, p4/Z, [x25]\n"
      "ld1rw { z2.s }, p4/Z, [x24]\n"
      "ld1b { z6.b }, p4/Z, [x10]\n"
      "ld1b { z7.b }, p4/Z, [x10, #1, MUL VL]\n"
      "ble 29f\n"
      "28:"  // Height 3: Multiply loop: Main loop
      "udot z8.s, z6.b, z0.b\n"
      "udot z12.s, z6.b, z1.b\n"
      "add x26, x26, #0x4\n"
      "subs x27, x27, #0x4\n"
      "udot z16.s, z6.b, z2.b\n"
      "udot z9.s, z7.b, z0.b\n"
      "ld1b { z21.b }, p4/Z, [x10, #2, MUL VL]\n"
      "add x25, x25, #0x4\n"
      "udot z13.s, z7.b, z1.b\n"
      "udot z17.s, z7.b, z2.b\n"
      "ld1b { z20.b }, p4/Z, [x10, #3, MUL VL]\n"
      "addvl x10, x10, #4\n"
      "add x24, x24, #0x4\n"
      "udot z10.s, z21.b, z0.b\n"
      "udot z14.s, z21.b, z1.b\n"
      "udot z18.s, z21.b, z2.b\n"
      "udot z11.s, z20.b, z0.b\n"
      "ld1rw { z0.s }, p4/Z, [x26]\n"
      "ld1b { z6.b }, p4/Z, [x10]\n"
      "udot z15.s, z20.b, z1.b\n"
      "udot z19.s, z20.b, z2.b\n"
      "ld1rw { z1.s }, p4/Z, [x25]\n"
      "ld1rw { z2.s }, p4/Z, [x24]\n"
      "ld1b { z7.b }, p4/Z, [x10, #1, MUL VL]\n"
      "bgt 28b\n"
      "29:"  // Height 3: Multiply loop: Main loop skip
      "ldr w20, [%x[args_ptr], %[offsetof_num_strings]]\n"
      "udot z8.s, z6.b, z0.b\n"
      "udot z12.s, z6.b, z1.b\n"
      "add x28, x28, #0x1\n"
      "udot z16.s, z6.b, z2.b\n"
      "udot z9.s, z7.b, z0.b\n"
      "ld1b { z21.b }, p4/Z, [x10, #2, MUL VL]\n"
      "cmp x28, x20\n"
      "udot z13.s, z7.b, z1.b\n"
      "udot z17.s, z7.b, z2.b\n"
      "ld1b { z20.b }, p4/Z, [x10, #3, MUL VL]\n"
      "addvl x10, x10, #4\n"
      "udot z10.s, z21.b, z0.b\n"
      "udot z14.s, z21.b, z1.b\n"
      "udot z18.s, z21.b, z2.b\n"
      "udot z11.s, z20.b, z0.b\n"
      "udot z15.s, z20.b, z1.b\n"
      "udot z19.s, z20.b, z2.b\n"
      "bne 25b\n"
      "ldr x20, [%x[args_ptr], %[offsetof_output_offset]]\n"
      "add x21, x9, x20, LSL #2\n"
      "add x20, x21, x20, LSL #2\n"
      "st1w { z8.s }, p3, [x9]\n"
      "st1w { z9.s }, p2, [x9, #1, MUL VL]\n"
      "st1w { z10.s }, p1, [x9, #2, MUL VL]\n"
      "st1w { z11.s }, p0, [x9, #3, MUL VL]\n"
      "addvl x9, x9, #4\n"
      "st1w { z12.s }, p3, [x21]\n"
      "st1w { z13.s }, p2, [x21, #1, MUL VL]\n"
      "st1w { z14.s }, p1, [x21, #2, MUL VL]\n"
      "st1w { z15.s }, p0, [x21, #3, MUL VL]\n"
      "st1w { z16.s }, p3, [x20]\n"
      "st1w { z17.s }, p2, [x20, #1, MUL VL]\n"
      "st1w { z18.s }, p1, [x20, #2, MUL VL]\n"
      "st1w { z19.s }, p0, [x20, #3, MUL VL]\n"
      "30:"  // Height 3: Writeback done
      "decw x11, ALL, MUL #4\n"
      "cmp x11, XZR\n"
      "bgt 22b\n"
      "b 62f\n"
      "31:"  // Height 4
      "ldr x11, [%x[args_ptr], %[offsetof_N]]\n"
      "ldr x10, [%x[args_ptr], %[offsetof_B_ptr]]\n"
      "mov x9, %x[output_ptr]\n"
      "32:"  // Height 4: Column loop
      "mov x20, #0x0\n"
      "whilelt p3.s, x20, x11\n"
      "incw x20\n"
      "whilelt p2.s, x20, x11\n"
      "incw x20\n"
      "whilelt p1.s, x20, x11\n"
      "incw x20\n"
      "whilelt p0.s, x20, x11\n"
      "tbz %x[flags], #0, 33f\n"
      "ldr x20, [%x[args_ptr], %[offsetof_output_offset]]\n"
      "add x22, x9, x20, LSL #2\n"
      "add x21, x22, x20, LSL #2\n"
      "ld1w { z8.s }, p3/Z, [x9]\n"
      "add x20, x21, x20, LSL #2\n"
      "ld1w { z9.s }, p2/Z, [x9, #1, MUL VL]\n"
      "ld1w { z10.s }, p1/Z, [x9, #2, MUL VL]\n"
      "ld1w { z11.s }, p0/Z, [x9, #3, MUL VL]\n"
      "ld1w { z12.s }, p3/Z, [x22]\n"
      "ld1w { z13.s }, p2/Z, [x22, #1, MUL VL]\n"
      "ld1w { z14.s }, p1/Z, [x22, #2, MUL VL]\n"
      "ld1w { z15.s }, p0/Z, [x22, #3, MUL VL]\n"
      "ld1w { z16.s }, p3/Z, [x21]\n"
      "ld1w { z17.s }, p2/Z, [x21, #1, MUL VL]\n"
      "ld1w { z18.s }, p1/Z, [x21, #2, MUL VL]\n"
      "ld1w { z19.s }, p0/Z, [x21, #3, MUL VL]\n"
      "ld1w { z20.s }, p3/Z, [x20]\n"
      "ld1w { z21.s }, p2/Z, [x20, #1, MUL VL]\n"
      "ld1w { z22.s }, p1/Z, [x20, #2, MUL VL]\n"
      "ld1w { z23.s }, p0/Z, [x20, #3, MUL VL]\n"
      "b 34f\n"
      "33:"  // Height 4: no accumulate
      "mov z8.s, #0x0\n"
      "mov z9.s, #0x0\n"
      "mov z10.s, #0x0\n"
      "mov z11.s, #0x0\n"
      "mov z12.s, #0x0\n"
      "mov z13.s, #0x0\n"
      "mov z14.s, #0x0\n"
      "mov z15.s, #0x0\n"
      "mov z16.s, #0x0\n"
      "mov z17.s, #0x0\n"
      "mov z18.s, #0x0\n"
      "mov z19.s, #0x0\n"
      "mov z20.s, #0x0\n"
      "mov z21.s, #0x0\n"
      "mov z22.s, #0x0\n"
      "mov z23.s, #0x0\n"
      "34:"  // Height 4: setup done
      "mov x28, #0x0\n"
      "35:"  // Height 4: String loop
      "ldr x20, [%x[args_ptr], %[offsetof_string_lengths]]\n"
      "ldr w27, [x20, x28, LSL #0x2]\n"
      "ldr x21, [%x[args_ptr], %[offsetof_input_offset]]\n"
      "tbz %x[flags], #3, 36f\n"
      "ldr x20, [%x[input_ptr], x28, LSL #0x3]\n"
      "add x20, x20, x21, LSL #3\n"
      "ldr x26, [x20, #0x0]\n"
      "ldr x25, [x20, #0x8]\n"
      "ldr x24, [x20, #0x10]\n"
      "ldr x23, [x20, #0x18]\n"
      "cbnz x28, 37f\n"
      "ldr x20, [%x[args_ptr], %[offsetof_input_initial_col]]\n"
      "add x26, x26, x20\n"
      "add x25, x25, x20\n"
      "add x24, x24, x20\n"
      "add x23, x23, x20\n"
      "b 37f\n"
      "36:"  // Height 4: setup direct input
      "mov x26, %x[input_ptr]\n"
      "add x25, x26, x21\n"
      "add x24, x25, x21\n"
      "add x23, x24, x21\n"
      "37:"  // Height 4: input setup done
      "subs x27, x27, #0x4\n"
      "ld1rw { z0.s }, p4/Z, [x26]\n"
      "ld1rw { z1.s }, p4/Z, [x25]\n"
      "ld1rw { z2.s }, p4/Z, [x24]\n"
      "ld1rw { z3.s }, p4/Z, [x23]\n"
      "ld1b { z6.b }, p4/Z, [x10]\n"
      "ld1b { z7.b }, p4/Z, [x10, #1, MUL VL]\n"
      "ble 39f\n"
      "38:"  // Height 4: Multiply loop: Main loop
      "udot z8.s, z6.b, z0.b\n"
      "udot z12.s, z6.b, z1.b\n"
      "add x26, x26, #0x4\n"
      "subs x27, x27, #0x4\n"
      "udot z16.s, z6.b, z2.b\n"
      "udot z20.s, z6.b, z3.b\n"
      "ld1b { z25.b }, p4/Z, [x10, #2, MUL VL]\n"
      "add x25, x25, #0x4\n"
      "udot z9.s, z7.b, z0.b\n"
      "udot z13.s, z7.b, z1.b\n"
      "add x24, x24, #0x4\n"
      "add x23, x23, #0x4\n"
      "udot z17.s, z7.b, z2.b\n"
      "udot z21.s, z7.b, z3.b\n"
      "ld1b { z24.b }, p4/Z, [x10, #3, MUL VL]\n"
      "addvl x10, x10, #4\n"
      "udot z10.s, z25.b, z0.b\n"
      "udot z14.s, z25.b, z1.b\n"
      "udot z18.s, z25.b, z2.b\n"
      "udot z22.s, z25.b, z3.b\n"
      "ld1b { z6.b }, p4/Z, [x10]\n"
      "udot z11.s, z24.b, z0.b\n"
      "udot z15.s, z24.b, z1.b\n"
      "ld1rw { z0.s }, p4/Z, [x26]\n"
      "ld1rw { z1.s }, p4/Z, [x25]\n"
      "udot z19.s, z24.b, z2.b\n"
      "udot z23.s, z24.b, z3.b\n"
      "ld1rw { z2.s }, p4/Z, [x24]\n"
      "ld1rw { z3.s }, p4/Z, [x23]\n"
      "ld1b { z7.b }, p4/Z, [x10, #1, MUL VL]\n"
      "bgt 38b\n"
      "39:"  // Height 4: Multiply loop: Main loop skip
      "ldr w20, [%x[args_ptr], %[offsetof_num_strings]]\n"
      "udot z8.s, z6.b, z0.b\n"
      "udot z12.s, z6.b, z1.b\n"
      "add x28, x28, #0x1\n"
      "udot z16.s, z6.b, z2.b\n"
      "udot z20.s, z6.b, z3.b\n"
      "ld1b { z25.b }, p4/Z, [x10, #2, MUL VL]\n"
      "cmp x28, x20\n"
      "udot z9.s, z7.b, z0.b\n"
      "udot z13.s, z7.b, z1.b\n"
      "udot z17.s, z7.b, z2.b\n"
      "udot z21.s, z7.b, z3.b\n"
      "ld1b { z24.b }, p4/Z, [x10, #3, MUL VL]\n"
      "addvl x10, x10, #4\n"
      "udot z10.s, z25.b, z0.b\n"
      "udot z14.s, z25.b, z1.b\n"
      "udot z18.s, z25.b, z2.b\n"
      "udot z22.s, z25.b, z3.b\n"
      "udot z11.s, z24.b, z0.b\n"
      "udot z15.s, z24.b, z1.b\n"
      "udot z19.s, z24.b, z2.b\n"
      "udot z23.s, z24.b, z3.b\n"
      "bne 35b\n"
      "ldr x20, [%x[args_ptr], %[offsetof_output_offset]]\n"
      "add x22, x9, x20, LSL #2\n"
      "add x21, x22, x20, LSL #2\n"
      "st1w { z8.s }, p3, [x9]\n"
      "add x20, x21, x20, LSL #2\n"
      "st1w { z9.s }, p2, [x9, #1, MUL VL]\n"
      "st1w { z10.s }, p1, [x9, #2, MUL VL]\n"
      "st1w { z11.s }, p0, [x9, #3, MUL VL]\n"
      "addvl x9, x9, #4\n"
      "st1w { z12.s }, p3, [x22]\n"
      "st1w { z13.s }, p2, [x22, #1, MUL VL]\n"
      "st1w { z14.s }, p1, [x22, #2, MUL VL]\n"
      "st1w { z15.s }, p0, [x22, #3, MUL VL]\n"
      "st1w { z16.s }, p3, [x21]\n"
      "st1w { z17.s }, p2, [x21, #1, MUL VL]\n"
      "st1w { z18.s }, p1, [x21, #2, MUL VL]\n"
      "st1w { z19.s }, p0, [x21, #3, MUL VL]\n"
      "st1w { z20.s }, p3, [x20]\n"
      "st1w { z21.s }, p2, [x20, #1, MUL VL]\n"
      "st1w { z22.s }, p1, [x20, #2, MUL VL]\n"
      "st1w { z23.s }, p0, [x20, #3, MUL VL]\n"
      "40:"  // Height 4: Writeback done
      "decw x11, ALL, MUL #4\n"
      "cmp x11, XZR\n"
      "bgt 32b\n"
      "b 62f\n"
      "41:"  // Height 5
      "ldr x11, [%x[args_ptr], %[offsetof_N]]\n"
      "ldr x10, [%x[args_ptr], %[offsetof_B_ptr]]\n"
      "mov x9, %x[output_ptr]\n"
      "42:"  // Height 5: Column loop
      "mov x20, #0x0\n"
      "whilelt p3.s, x20, x11\n"
      "incw x20\n"
      "whilelt p2.s, x20, x11\n"
      "incw x20\n"
      "whilelt p1.s, x20, x11\n"
      "incw x20\n"
      "whilelt p0.s, x20, x11\n"
      "tbz %x[flags], #0, 43f\n"
      "ldr x20, [%x[args_ptr], %[offsetof_output_offset]]\n"
      "add x23, x9, x20, LSL #2\n"
      "add x22, x23, x20, LSL #2\n"
      "ld1w { z8.s }, p3/Z, [x9]\n"
      "add x21, x22, x20, LSL #2\n"
      "add x20, x21, x20, LSL #2\n"
      "ld1w { z9.s }, p2/Z, [x9, #1, MUL VL]\n"
      "ld1w { z10.s }, p1/Z, [x9, #2, MUL VL]\n"
      "ld1w { z11.s }, p0/Z, [x9, #3, MUL VL]\n"
      "ld1w { z12.s }, p3/Z, [x23]\n"
      "ld1w { z13.s }, p2/Z, [x23, #1, MUL VL]\n"
      "ld1w { z14.s }, p1/Z, [x23, #2, MUL VL]\n"
      "ld1w { z15.s }, p0/Z, [x23, #3, MUL VL]\n"
      "ld1w { z16.s }, p3/Z, [x22]\n"
      "ld1w { z17.s }, p2/Z, [x22, #1, MUL VL]\n"
      "ld1w { z18.s }, p1/Z, [x22, #2, MUL VL]\n"
      "ld1w { z19.s }, p0/Z, [x22, #3, MUL VL]\n"
      "ld1w { z20.s }, p3/Z, [x21]\n"
      "ld1w { z21.s }, p2/Z, [x21, #1, MUL VL]\n"
      "ld1w { z22.s }, p1/Z, [x21, #2, MUL VL]\n"
      "ld1w { z23.s }, p0/Z, [x21, #3, MUL VL]\n"
      "ld1w { z24.s }, p3/Z, [x20]\n"
      "ld1w { z25.s }, p2/Z, [x20, #1, MUL VL]\n"
      "ld1w { z26.s }, p1/Z, [x20, #2, MUL VL]\n"
      "ld1w { z27.s }, p0/Z, [x20, #3, MUL VL]\n"
      "b 44f\n"
      "43:"  // Height 5: no accumulate
      "mov z8.s, #0x0\n"
      "mov z9.s, #0x0\n"
      "mov z10.s, #0x0\n"
      "mov z11.s, #0x0\n"
      "mov z12.s, #0x0\n"
      "mov z13.s, #0x0\n"
      "mov z14.s, #0x0\n"
      "mov z15.s, #0x0\n"
      "mov z16.s, #0x0\n"
      "mov z17.s, #0x0\n"
      "mov z18.s, #0x0\n"
      "mov z19.s, #0x0\n"
      "mov z20.s, #0x0\n"
      "mov z21.s, #0x0\n"
      "mov z22.s, #0x0\n"
      "mov z23.s, #0x0\n"
      "mov z24.s, #0x0\n"
      "mov z25.s, #0x0\n"
      "mov z26.s, #0x0\n"
      "mov z27.s, #0x0\n"
      "44:"  // Height 5: setup done
      "mov x28, #0x0\n"
      "45:"  // Height 5: String loop
      "ldr x20, [%x[args_ptr], %[offsetof_string_lengths]]\n"
      "ldr w27, [x20, x28, LSL #0x2]\n"
      "ldr x21, [%x[args_ptr], %[offsetof_input_offset]]\n"
      "tbz %x[flags], #3, 46f\n"
      "ldr x20, [%x[input_ptr], x28, LSL #0x3]\n"
      "add x20, x20, x21, LSL #3\n"
      "ldr x26, [x20, #0x0]\n"
      "ldr x25, [x20, #0x8]\n"
      "ldr x24, [x20, #0x10]\n"
      "ldr x23, [x20, #0x18]\n"
      "ldr x22, [x20, #0x20]\n"
      "cbnz x28, 47f\n"
      "ldr x20, [%x[args_ptr], %[offsetof_input_initial_col]]\n"
      "add x26, x26, x20\n"
      "add x25, x25, x20\n"
      "add x24, x24, x20\n"
      "add x23, x23, x20\n"
      "add x22, x22, x20\n"
      "b 47f\n"
      "46:"  // Height 5: setup direct input
      "mov x26, %x[input_ptr]\n"
      "add x25, x26, x21\n"
      "add x24, x25, x21\n"
      "add x23, x24, x21\n"
      "add x22, x23, x21\n"
      "47:"  // Height 5: input setup done
      "subs x27, x27, #0x4\n"
      "ld1rw { z0.s }, p4/Z, [x26]\n"
      "ld1rw { z1.s }, p4/Z, [x25]\n"
      "ld1rw { z2.s }, p4/Z, [x24]\n"
      "ld1rw { z3.s }, p4/Z, [x23]\n"
      "ld1rw { z4.s }, p4/Z, [x22]\n"
      "ld1b { z6.b }, p4/Z, [x10]\n"
      "ld1b { z7.b }, p4/Z, [x10, #1, MUL VL]\n"
      "ble 49f\n"
      "48:"  // Height 5: Multiply loop: Main loop
      "udot z8.s, z6.b, z0.b\n"
      "udot z12.s, z6.b, z1.b\n"
      "add x26, x26, #0x4\n"
      "subs x27, x27, #0x4\n"
      "udot z16.s, z6.b, z2.b\n"
      "udot z20.s, z6.b, z3.b\n"
      "add x25, x25, #0x4\n"
      "add x24, x24, #0x4\n"
      "udot z24.s, z6.b, z4.b\n"
      "udot z9.s, z7.b, z0.b\n"
      "ld1b { z29.b }, p4/Z, [x10, #2, MUL VL]\n"
      "add x23, x23, #0x4\n"
      "udot z13.s, z7.b, z1.b\n"
      "udot z17.s, z7.b, z2.b\n"
      "add x22, x22, #0x4\n"
      "udot z21.s, z7.b, z3.b\n"
      "udot z25.s, z7.b, z4.b\n"
      "ld1b { z28.b }, p4/Z, [x10, #3, MUL VL]\n"
      "addvl x10, x10, #4\n"
      "udot z10.s, z29.b, z0.b\n"
      "udot z14.s, z29.b, z1.b\n"
      "udot z18.s, z29.b, z2.b\n"
      "udot z22.s, z29.b, z3.b\n"
      "udot z26.s, z29.b, z4.b\n"
      "udot z11.s, z28.b, z0.b\n"
      "ld1rw { z0.s }, p4/Z, [x26]\n"
      "ld1b { z6.b }, p4/Z, [x10]\n"
      "udot z15.s, z28.b, z1.b\n"
      "udot z19.s, z28.b, z2.b\n"
      "ld1rw { z1.s }, p4/Z, [x25]\n"
      "ld1rw { z2.s }, p4/Z, [x24]\n"
      "udot z23.s, z28.b, z3.b\n"
      "udot z27.s, z28.b, z4.b\n"
      "ld1rw { z3.s }, p4/Z, [x23]\n"
      "ld1rw { z4.s }, p4/Z, [x22]\n"
      "ld1b { z7.b }, p4/Z, [x10, #1, MUL VL]\n"
      "bgt 48b\n"
      "49:"  // Height 5: Multiply loop: Main loop skip
      "ldr w20, [%x[args_ptr], %[offsetof_num_strings]]\n"
      "udot z8.s, z6.b, z0.b\n"
      "udot z12.s, z6.b, z1.b\n"
      "add x28, x28, #0x1\n"
      "udot z16.s, z6.b, z2.b\n"
      "udot z20.s, z6.b, z3.b\n"
      "cmp x28, x20\n"
      "udot z24.s, z6.b, z4.b\n"
      "udot z9.s, z7.b, z0.b\n"
      "ld1b { z29.b }, p4/Z, [x10, #2, MUL VL]\n"
      "udot z13.s, z7.b, z1.b\n"
      "udot z17.s, z7.b, z2.b\n"
      "udot z21.s, z7.b, z3.b\n"
      "udot z25.s, z7.b, z4.b\n"
      "ld1b { z28.b }, p4/Z, [x10, #3, MUL VL]\n"
      "addvl x10, x10, #4\n"
      "udot z10.s, z29.b, z0.b\n"
      "udot z14.s, z29.b, z1.b\n"
      "udot z18.s, z29.b, z2.b\n"
      "udot z22.s, z29.b, z3.b\n"
      "udot z26.s, z29.b, z4.b\n"
      "udot z11.s, z28.b, z0.b\n"
      "udot z15.s, z28.b, z1.b\n"
      "udot z19.s, z28.b, z2.b\n"
      "udot z23.s, z28.b, z3.b\n"
      "udot z27.s, z28.b, z4.b\n"
      "bne 45b\n"
      "ldr x20, [%x[args_ptr], %[offsetof_output_offset]]\n"
      "add x23, x9, x20, LSL #2\n"
      "add x22, x23, x20, LSL #2\n"
      "st1w { z8.s }, p3, [x9]\n"
      "add x21, x22, x20, LSL #2\n"
      "add x20, x21, x20, LSL #2\n"
      "st1w { z9.s }, p2, [x9, #1, MUL VL]\n"
      "st1w { z10.s }, p1, [x9, #2, MUL VL]\n"
      "st1w { z11.s }, p0, [x9, #3, MUL VL]\n"
      "addvl x9, x9, #4\n"
      "st1w { z12.s }, p3, [x23]\n"
      "st1w { z13.s }, p2, [x23, #1, MUL VL]\n"
      "st1w { z14.s }, p1, [x23, #2, MUL VL]\n"
      "st1w { z15.s }, p0, [x23, #3, MUL VL]\n"
      "st1w { z16.s }, p3, [x22]\n"
      "st1w { z17.s }, p2, [x22, #1, MUL VL]\n"
      "st1w { z18.s }, p1, [x22, #2, MUL VL]\n"
      "st1w { z19.s }, p0, [x22, #3, MUL VL]\n"
      "st1w { z20.s }, p3, [x21]\n"
      "st1w { z21.s }, p2, [x21, #1, MUL VL]\n"
      "st1w { z22.s }, p1, [x21, #2, MUL VL]\n"
      "st1w { z23.s }, p0, [x21, #3, MUL VL]\n"
      "st1w { z24.s }, p3, [x20]\n"
      "st1w { z25.s }, p2, [x20, #1, MUL VL]\n"
      "st1w { z26.s }, p1, [x20, #2, MUL VL]\n"
      "st1w { z27.s }, p0, [x20, #3, MUL VL]\n"
      "50:"  // Height 5: Writeback done
      "decw x11, ALL, MUL #4\n"
      "cmp x11, XZR\n"
      "bgt 42b\n"
      "b 62f\n"
      "51:"  // Height 6
      "ldr x21, [%x[args_ptr], %[offsetof_output_offset]]\n"
      "mov x20, #0x18\n"
      "ldr x11, [%x[args_ptr], %[offsetof_N]]\n"
      "mov x9, %x[output_ptr]\n"
      "ldr x10, [%x[args_ptr], %[offsetof_B_ptr]]\n"
      "madd %x[output_ptr], x21, x20, %x[output_ptr]\n"
      "52:"  // Height 6: Column loop
      "mov x20, #0x0\n"
      "whilelt p3.s, x20, x11\n"
      "incw x20\n"
      "whilelt p2.s, x20, x11\n"
      "incw x20\n"
      "whilelt p1.s, x20, x11\n"
      "incw x20\n"
      "whilelt p0.s, x20, x11\n"
      "tbz %x[flags], #0, 53f\n"
      "ldr x20, [%x[args_ptr], %[offsetof_output_offset]]\n"
      "add x24, x9, x20, LSL #2\n"
      "add x23, x24, x20, LSL #2\n"
      "ld1w { z8.s }, p3/Z, [x9]\n"
      "add x22, x23, x20, LSL #2\n"
      "add x21, x22, x20, LSL #2\n"
      "ld1w { z9.s }, p2/Z, [x9, #1, MUL VL]\n"
      "ld1w { z10.s }, p1/Z, [x9, #2, MUL VL]\n"
      "add x20, x21, x20, LSL #2\n"
      "ld1w { z11.s }, p0/Z, [x9, #3, MUL VL]\n"
      "ld1w { z12.s }, p3/Z, [x24]\n"
      "ld1w { z13.s }, p2/Z, [x24, #1, MUL VL]\n"
      "ld1w { z14.s }, p1/Z, [x24, #2, MUL VL]\n"
      "ld1w { z15.s }, p0/Z, [x24, #3, MUL VL]\n"
      "ld1w { z16.s }, p3/Z, [x23]\n"
      "ld1w { z17.s }, p2/Z, [x23, #1, MUL VL]\n"
      "ld1w { z18.s }, p1/Z, [x23, #2, MUL VL]\n"
      "ld1w { z19.s }, p0/Z, [x23, #3, MUL VL]\n"
      "ld1w { z20.s }, p3/Z, [x22]\n"
      "ld1w { z21.s }, p2/Z, [x22, #1, MUL VL]\n"
      "ld1w { z22.s }, p1/Z, [x22, #2, MUL VL]\n"
      "ld1w { z23.s }, p0/Z, [x22, #3, MUL VL]\n"
      "ld1w { z24.s }, p3/Z, [x21]\n"
      "ld1w { z25.s }, p2/Z, [x21, #1, MUL VL]\n"
      "ld1w { z26.s }, p1/Z, [x21, #2, MUL VL]\n"
      "ld1w { z27.s }, p0/Z, [x21, #3, MUL VL]\n"
      "ld1w { z28.s }, p3/Z, [x20]\n"
      "ld1w { z29.s }, p2/Z, [x20, #1, MUL VL]\n"
      "ld1w { z30.s }, p1/Z, [x20, #2, MUL VL]\n"
      "ld1w { z31.s }, p0/Z, [x20, #3, MUL VL]\n"
      "b 54f\n"
      "53:"  // Height 6: no accumulate
      "mov z8.s, #0x0\n"
      "mov z9.s, #0x0\n"
      "mov z10.s, #0x0\n"
      "mov z11.s, #0x0\n"
      "mov z12.s, #0x0\n"
      "mov z13.s, #0x0\n"
      "mov z14.s, #0x0\n"
      "mov z15.s, #0x0\n"
      "mov z16.s, #0x0\n"
      "mov z17.s, #0x0\n"
      "mov z18.s, #0x0\n"
      "mov z19.s, #0x0\n"
      "mov z20.s, #0x0\n"
      "mov z21.s, #0x0\n"
      "mov z22.s, #0x0\n"
      "mov z23.s, #0x0\n"
      "mov z24.s, #0x0\n"
      "mov z25.s, #0x0\n"
      "mov z26.s, #0x0\n"
      "mov z27.s, #0x0\n"
      "mov z28.s, #0x0\n"
      "mov z29.s, #0x0\n"
      "mov z30.s, #0x0\n"
      "mov z31.s, #0x0\n"
      "54:"  // Height 6: setup done
      "mov x28, #0x0\n"
      "55:"  // Height 6: String loop
      "ldr x20, [%x[args_ptr], %[offsetof_string_lengths]]\n"
      "ldr w27, [x20, x28, LSL #0x2]\n"
      "ldr x21, [%x[args_ptr], %[offsetof_input_offset]]\n"
      "tbz %x[flags], #3, 56f\n"
      "ldr x20, [%x[input_ptr], x28, LSL #0x3]\n"
      "add x20, x20, x21, LSL #3\n"
      "ldr x26, [x20, #0x0]\n"
      "ldr x25, [x20, #0x8]\n"
      "ldr x24, [x20, #0x10]\n"
      "ldr x23, [x20, #0x18]\n"
      "ldr x22, [x20, #0x20]\n"
      "ldr x21, [x20, #0x28]\n"
      "cbnz x28, 57f\n"
      "ldr x20, [%x[args_ptr], %[offsetof_input_initial_col]]\n"
      "add x26, x26, x20\n"
      "add x25, x25, x20\n"
      "add x24, x24, x20\n"
      "add x23, x23, x20\n"
      "add x22, x22, x20\n"
      "add x21, x21, x20\n"
      "b 57f\n"
      "56:"  // Height 6: setup direct input
      "mov x26, %x[input_ptr]\n"
      "add x25, x26, x21\n"
      "add x24, x25, x21\n"
      "add x23, x24, x21\n"
      "add x22, x23, x21\n"
      "add x21, x22, x21\n"
      "57:"  // Height 6: input setup done
      "subs x27, x27, #0x4\n"
      "ld1rw { z0.s }, p4/Z, [x26]\n"
      "ld1rw { z1.s }, p4/Z, [x25]\n"
      "ld1rw { z2.s }, p4/Z, [x24]\n"
      "ld1rw { z3.s }, p4/Z, [x23]\n"
      "ld1rw { z4.s }, p4/Z, [x22]\n"
      "ld1rw { z5.s }, p4/Z, [x21]\n"
      "ld1b { z6.b }, p4/Z, [x10]\n"
      "ld1b { z7.b }, p4/Z, [x10, #1, MUL VL]\n"
      "ble 59f\n"
      "58:"  // Height 6: Multiply loop: Main loop
      "udot z8.s, z6.b, z0.b\n"
      "udot z12.s, z6.b, z1.b\n"
      "add x26, x26, #0x4\n"
      "subs x27, x27, #0x4\n"
      "udot z16.s, z6.b, z2.b\n"
      "udot z20.s, z6.b, z3.b\n"
      "add x25, x25, #0x4\n"
      "add x24, x24, #0x4\n"
      "udot z24.s, z6.b, z4.b\n"
      "udot z28.s, z6.b, z5.b\n"
      "ld1b { z6.b }, p4/Z, [x10, #2, MUL VL]\n"
      "add x23, x23, #0x4\n"
      "udot z9.s, z7.b, z0.b\n"
      "udot z13.s, z7.b, z1.b\n"
      "add x22, x22, #0x4\n"
      "add x21, x21, #0x4\n"
      "udot z17.s, z7.b, z2.b\n"
      "udot z21.s, z7.b, z3.b\n"
      "udot z25.s, z7.b, z4.b\n"
      "udot z29.s, z7.b, z5.b\n"
      "ld1b { z7.b }, p4/Z, [x10, #3, MUL VL]\n"
      "addvl x10, x10, #4\n"
      "udot z10.s, z6.b, z0.b\n"
      "udot z14.s, z6.b, z1.b\n"
      "udot z18.s, z6.b, z2.b\n"
      "udot z22.s, z6.b, z3.b\n"
      "udot z26.s, z6.b, z4.b\n"
      "udot z30.s, z6.b, z5.b\n"
      "ld1b { z6.b }, p4/Z, [x10]\n"
      "udot z11.s, z7.b, z0.b\n"
      "udot z15.s, z7.b, z1.b\n"
      "ld1rw { z0.s }, p4/Z, [x26]\n"
      "ld1rw { z1.s }, p4/Z, [x25]\n"
      "udot z19.s, z7.b, z2.b\n"
      "udot z23.s, z7.b, z3.b\n"
      "ld1rw { z2.s }, p4/Z, [x24]\n"
      "ld1rw { z3.s }, p4/Z, [x23]\n"
      "udot z27.s, z7.b, z4.b\n"
      "udot z31.s, z7.b, z5.b\n"
      "ld1rw { z4.s }, p4/Z, [x22]\n"
      "ld1rw { z5.s }, p4/Z, [x21]\n"
      "ld1b { z7.b }, p4/Z, [x10, #1, MUL VL]\n"
      "bgt 58b\n"
      "59:"  // Height 6: Multiply loop: Main loop skip
      "ldr w20, [%x[args_ptr], %[offsetof_num_strings]]\n"
      "udot z8.s, z6.b, z0.b\n"
      "udot z12.s, z6.b, z1.b\n"
      "add x28, x28, #0x1\n"
      "udot z16.s, z6.b, z2.b\n"
      "udot z20.s, z6.b, z3.b\n"
      "cmp x28, x20\n"
      "udot z24.s, z6.b, z4.b\n"
      "udot z28.s, z6.b, z5.b\n"
      "ld1b { z6.b }, p4/Z, [x10, #2, MUL VL]\n"
      "udot z9.s, z7.b, z0.b\n"
      "udot z13.s, z7.b, z1.b\n"
      "udot z17.s, z7.b, z2.b\n"
      "udot z21.s, z7.b, z3.b\n"
      "udot z25.s, z7.b, z4.b\n"
      "udot z29.s, z7.b, z5.b\n"
      "ld1b { z7.b }, p4/Z, [x10, #3, MUL VL]\n"
      "addvl x10, x10, #4\n"
      "udot z10.s, z6.b, z0.b\n"
      "udot z14.s, z6.b, z1.b\n"
      "udot z18.s, z6.b, z2.b\n"
      "udot z22.s, z6.b, z3.b\n"
      "udot z26.s, z6.b, z4.b\n"
      "udot z30.s, z6.b, z5.b\n"
      "udot z11.s, z7.b, z0.b\n"
      "udot z15.s, z7.b, z1.b\n"
      "udot z19.s, z7.b, z2.b\n"
      "udot z23.s, z7.b, z3.b\n"
      "udot z27.s, z7.b, z4.b\n"
      "udot z31.s, z7.b, z5.b\n"
      "bne 55b\n"
      "ldr x20, [%x[args_ptr], %[offsetof_output_offset]]\n"
      "add x24, x9, x20, LSL #2\n"
      "add x23, x24, x20, LSL #2\n"
      "st1w { z8.s }, p3, [x9]\n"
      "add x22, x23, x20, LSL #2\n"
      "add x21, x22, x20, LSL #2\n"
      "st1w { z9.s }, p2, [x9, #1, MUL VL]\n"
      "add x20, x21, x20, LSL #2\n"
      "st1w { z10.s }, p1, [x9, #2, MUL VL]\n"
      "st1w { z11.s }, p0, [x9, #3, MUL VL]\n"
      "addvl x9, x9, #4\n"
      "st1w { z12.s }, p3, [x24]\n"
      "st1w { z13.s }, p2, [x24, #1, MUL VL]\n"
      "st1w { z14.s }, p1, [x24, #2, MUL VL]\n"
      "st1w { z15.s }, p0, [x24, #3, MUL VL]\n"
      "st1w { z16.s }, p3, [x23]\n"
      "st1w { z17.s }, p2, [x23, #1, MUL VL]\n"
      "st1w { z18.s }, p1, [x23, #2, MUL VL]\n"
      "st1w { z19.s }, p0, [x23, #3, MUL VL]\n"
      "st1w { z20.s }, p3, [x22]\n"
      "st1w { z21.s }, p2, [x22, #1, MUL VL]\n"
      "st1w { z22.s }, p1, [x22, #2, MUL VL]\n"
      "st1w { z23.s }, p0, [x22, #3, MUL VL]\n"
      "st1w { z24.s }, p3, [x21]\n"
      "st1w { z25.s }, p2, [x21, #1, MUL VL]\n"
      "st1w { z26.s }, p1, [x21, #2, MUL VL]\n"
      "st1w { z27.s }, p0, [x21, #3, MUL VL]\n"
      "st1w { z28.s }, p3, [x20]\n"
      "st1w { z29.s }, p2, [x20, #1, MUL VL]\n"
      "st1w { z30.s }, p1, [x20, #2, MUL VL]\n"
      "st1w { z31.s }, p0, [x20, #3, MUL VL]\n"
      "60:"  // Height 6: Writeback done
      "decw x11, ALL, MUL #4\n"
      "cmp x11, XZR\n"
      "bgt 52b\n"
      "subs %x[M], %x[M], #0x6\n"
      "beq 62f\n"
      "ldr x21, [%x[args_ptr], %[offsetof_input_offset]]\n"
      "tbz %x[flags], #3, 61f\n"
      "add x21, x21, #0x6\n"
      "str x21, [%x[args_ptr], %[offsetof_input_offset]]\n"
      "b 1b\n"
      "61:"  // Update direct input
      "mov x20, #0x6\n"
      "madd %x[input_ptr], x20, x21, %x[input_ptr]\n"
      "b 1b\n"
      "62:"  // Exit
      : [M] "+&r" (M), [input_ptr] "+&r" (input_ptr), [output_ptr] "+&r" (output_ptr)
      : [args_ptr] "r" (&ka), [flags] "r" (flags), [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))
      : "cc", "memory", "p0", "p1", "p2", "p3", "p4", "x9", "x10", "x11", "x20", "x21", "x22", "x23", "x24", "x25", "x26", "x27", "x28", "z0", "z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8", "z9", "z10", "z11", "z12", "z13", "z14", "z15", "z16", "z17", "z18", "z19", "z20", "z21", "z22", "z23", "z24", "z25", "z26", "z27", "z28", "z29", "z30", "z31"
    );
}

} // namespace arm_gemm
#endif  // ARM_COMPUTE_ENABLE_SVE