aboutsummaryrefslogtreecommitdiff
path: root/src/core/NEON/kernels/arm_gemm/kernels/sve_hybrid_s8qa_mmla_4x4VL/generic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/NEON/kernels/arm_gemm/kernels/sve_hybrid_s8qa_mmla_4x4VL/generic.cpp')
-rw-r--r--src/core/NEON/kernels/arm_gemm/kernels/sve_hybrid_s8qa_mmla_4x4VL/generic.cpp705
1 files changed, 352 insertions, 353 deletions
diff --git a/src/core/NEON/kernels/arm_gemm/kernels/sve_hybrid_s8qa_mmla_4x4VL/generic.cpp b/src/core/NEON/kernels/arm_gemm/kernels/sve_hybrid_s8qa_mmla_4x4VL/generic.cpp
index b8e65e6999..0d5ea54cb7 100644
--- a/src/core/NEON/kernels/arm_gemm/kernels/sve_hybrid_s8qa_mmla_4x4VL/generic.cpp
+++ b/src/core/NEON/kernels/arm_gemm/kernels/sve_hybrid_s8qa_mmla_4x4VL/generic.cpp
@@ -45,18 +45,18 @@ void sve_hybrid_s8qa_mmla_4x4VL (
size_t output_offset = {};
size_t input_initial_col = {};
size_t input_offset = {};
- void *output_ptr = {};
} ka;
unsigned long flags=0;
+ void *output_ptr;
void *input_ptr;
if (output_arg.is_indirect) {
- ka.output_ptr=(void *)(output_arg.indirect.ptr);
+ output_ptr=(void *)(output_arg.indirect.ptr);
ka.output_offset=output_arg.indirect.offset;
flags |= 0x4;
} else {
- ka.output_ptr=(void *)(output_arg.direct.base);
+ output_ptr=(void *)(output_arg.direct.base);
ka.output_offset=output_arg.direct.stride;
}
@@ -91,24 +91,24 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"bic %x[flags], %x[flags], #0x80000000\n"
"ldr x9, [%x[args_ptr], %[offsetof_N]]\n"
"ldr x28, [%x[args_ptr], %[offsetof_B_ptr]]\n"
- "ldr x27, [%x[args_ptr], %[offsetof_output_ptr]]\n"
+ "mov x27, %x[output_ptr]\n"
"2:" // Height 1: Column loop
"mov x20, #0x0\n"
+ "whilelt p1.b, x20, x9\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"
- "whilelt p1.b, x20, x9\n"
"mov z22.s, #0x0\n"
"mov z23.s, #0x0\n"
"3:" // Height 1: setup done
"mov x26, #0x0\n"
"4:" // Height 1: String loop
"ldr x20, [%x[args_ptr], %[offsetof_string_lengths]]\n"
- "ldr x21, [%x[args_ptr], %[offsetof_input_offset]]\n"
"ldr w25, [x20, x26, LSL #0x2]\n"
+ "ldr x21, [%x[args_ptr], %[offsetof_input_offset]]\n"
"tbz %x[flags], #3, 5f\n"
"ldr x20, [%x[input_ptr], x26, LSL #0x3]\n"
"add x20, x20, x21, LSL #3\n"
@@ -124,43 +124,43 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"ble 9f\n"
"7:" // Height 1: Multiply loop: Main loop head
"whilelt p0.b, XZR, x25\n"
- "ld1b { z30.b }, p2/Z, [x28]\n"
- "ld1b { z29.b }, p2/Z, [x28, #1, MUL VL]\n"
- "ld1b { z28.b }, p2/Z, [x28, #2, MUL VL]\n"
- "ld1b { z27.b }, p2/Z, [x28, #3, MUL VL]\n"
- "ld1b { z26.b }, p2/Z, [x28, #4, MUL VL]\n"
- "ld1b { z25.b }, p2/Z, [x28, #5, MUL VL]\n"
"ld1rqb { z1.b }, p0/Z, [x24]\n"
- "ld1b { z24.b }, p2/Z, [x28, #6, MUL VL]\n"
- "add x24, x24, #0x10\n"
- "trn1 z0.d, z1.d, z31.d\n"
- ".inst 0x451e9810 // smmla z16.s, z0.b, z30.b\n"
- "ld1b { z8.b }, p2/Z, [x28, #7, MUL VL]\n"
+ "trn1 z0.d, z1.d, z26.d\n"
+ "ld1b { z24.b }, p2/Z, [x28]\n"
+ ".inst 0x45189810 // smmla z16.s, z0.b, z24.b\n"
+ "ld1b { z25.b }, p2/Z, [x28, #1, MUL VL]\n"
+ "trn2 z1.d, z1.d, z26.d\n"
+ "ld1b { z24.b }, p2/Z, [x28, #2, MUL VL]\n"
+ "ld1b { z26.b }, p2/Z, [x28, #3, MUL VL]\n"
+ ".inst 0x45199814 // smmla z20.s, z0.b, z25.b\n"
+ ".inst 0x45189811 // smmla z17.s, z0.b, z24.b\n"
+ "ld1b { z25.b }, p2/Z, [x28, #4, MUL VL]\n"
+ "ld1b { z24.b }, p2/Z, [x28, #5, MUL VL]\n"
+ ".inst 0x451a9815 // smmla z21.s, z0.b, z26.b\n"
+ ".inst 0x45199812 // smmla z18.s, z0.b, z25.b\n"
+ "ld1b { z26.b }, p2/Z, [x28, #6, MUL VL]\n"
+ "ld1b { z25.b }, p2/Z, [x28, #7, MUL VL]\n"
"addvl x28, x28, #16\n"
- "trn2 z1.d, z1.d, z31.d\n"
- ".inst 0x451d9814 // smmla z20.s, z0.b, z29.b\n"
- ".inst 0x451c9811 // smmla z17.s, z0.b, z28.b\n"
- ".inst 0x451b9815 // smmla z21.s, z0.b, z27.b\n"
- ".inst 0x451a9812 // smmla z18.s, z0.b, z26.b\n"
- "ld1b { z31.b }, p2/Z, [x28, #-8, MUL VL]\n"
- ".inst 0x45199816 // smmla z22.s, z0.b, z25.b\n"
- ".inst 0x45189813 // smmla z19.s, z0.b, z24.b\n"
- "ld1b { z30.b }, p2/Z, [x28, #-7, MUL VL]\n"
- "ld1b { z29.b }, p2/Z, [x28, #-6, MUL VL]\n"
- ".inst 0x45089817 // smmla z23.s, z0.b, z8.b\n"
- "ld1b { z28.b }, p2/Z, [x28, #-5, MUL VL]\n"
+ ".inst 0x45189816 // smmla z22.s, z0.b, z24.b\n"
+ "ld1b { z24.b }, p2/Z, [x28, #-8, MUL VL]\n"
+ ".inst 0x451a9813 // smmla z19.s, z0.b, z26.b\n"
+ ".inst 0x45199817 // smmla z23.s, z0.b, z25.b\n"
+ "ld1b { z26.b }, p2/Z, [x28, #-7, MUL VL]\n"
+ ".inst 0x45189830 // smmla z16.s, z1.b, z24.b\n"
+ "ld1b { z25.b }, p2/Z, [x28, #-6, MUL VL]\n"
+ "ld1b { z24.b }, p2/Z, [x28, #-5, MUL VL]\n"
+ ".inst 0x451a9834 // smmla z20.s, z1.b, z26.b\n"
"ld1b { z27.b }, p2/Z, [x28, #-4, MUL VL]\n"
- ".inst 0x451f9830 // smmla z16.s, z1.b, z31.b\n"
"ld1b { z26.b }, p2/Z, [x28, #-3, MUL VL]\n"
+ ".inst 0x45199831 // smmla z17.s, z1.b, z25.b\n"
+ ".inst 0x45189835 // smmla z21.s, z1.b, z24.b\n"
"ld1b { z25.b }, p2/Z, [x28, #-2, MUL VL]\n"
"ld1b { z24.b }, p2/Z, [x28, #-1, MUL VL]\n"
- ".inst 0x451e9834 // smmla z20.s, z1.b, z30.b\n"
- ".inst 0x451d9831 // smmla z17.s, z1.b, z29.b\n"
- ".inst 0x451c9835 // smmla z21.s, z1.b, z28.b\n"
".inst 0x451b9832 // smmla z18.s, z1.b, z27.b\n"
".inst 0x451a9836 // smmla z22.s, z1.b, z26.b\n"
".inst 0x45199833 // smmla z19.s, z1.b, z25.b\n"
".inst 0x45189837 // smmla z23.s, z1.b, z24.b\n"
+ "add x24, x24, #0x10\n"
"tbnz %x[flags], #31, 8f\n"
"sdot z11.s, z0.b, z15.b\n"
"sdot z11.s, z1.b, z15.b\n"
@@ -170,45 +170,45 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"bgt 7b\n"
"9:" // Height 1: Multiply loop: Single iteration only
"whilelt p0.b, XZR, x25\n"
+ "ld1rqb { z1.b }, p0/Z, [x24]\n"
+ "trn1 z0.d, z1.d, z27.d\n"
"ld1b { z24.b }, p2/Z, [x28]\n"
- "ld1b { z30.b }, p2/Z, [x28, #1, MUL VL]\n"
- "ld1b { z29.b }, p2/Z, [x28, #2, MUL VL]\n"
- "ld1b { z28.b }, p2/Z, [x28, #3, MUL VL]\n"
+ ".inst 0x45189810 // smmla z16.s, z0.b, z24.b\n"
+ "ld1b { z26.b }, p2/Z, [x28, #1, MUL VL]\n"
"subs x25, x25, #0x8\n"
+ "ld1b { z25.b }, p2/Z, [x28, #2, MUL VL]\n"
+ "ld1b { z24.b }, p2/Z, [x28, #3, MUL VL]\n"
+ "trn2 z1.d, z1.d, z27.d\n"
+ ".inst 0x451a9814 // smmla z20.s, z0.b, z26.b\n"
"ld1b { z27.b }, p2/Z, [x28, #4, MUL VL]\n"
"ld1b { z26.b }, p2/Z, [x28, #5, MUL VL]\n"
- "ld1rqb { z1.b }, p0/Z, [x24]\n"
+ ".inst 0x45199811 // smmla z17.s, z0.b, z25.b\n"
+ ".inst 0x45189815 // smmla z21.s, z0.b, z24.b\n"
"ld1b { z25.b }, p2/Z, [x28, #6, MUL VL]\n"
- "trn1 z0.d, z1.d, z31.d\n"
- ".inst 0x45189810 // smmla z16.s, z0.b, z24.b\n"
"ld1b { z24.b }, p2/Z, [x28, #7, MUL VL]\n"
- "addvl x28, x28, #8\n"
- "trn2 z1.d, z1.d, z31.d\n"
- ".inst 0x451e9814 // smmla z20.s, z0.b, z30.b\n"
- ".inst 0x451d9811 // smmla z17.s, z0.b, z29.b\n"
- ".inst 0x451c9815 // smmla z21.s, z0.b, z28.b\n"
".inst 0x451b9812 // smmla z18.s, z0.b, z27.b\n"
".inst 0x451a9816 // smmla z22.s, z0.b, z26.b\n"
".inst 0x45199813 // smmla z19.s, z0.b, z25.b\n"
".inst 0x45189817 // smmla z23.s, z0.b, z24.b\n"
+ "addvl x28, x28, #8\n"
"ble 10f\n"
"ld1b { z24.b }, p2/Z, [x28]\n"
- "ld1b { z30.b }, p2/Z, [x28, #1, MUL VL]\n"
- "ld1b { z29.b }, p2/Z, [x28, #2, MUL VL]\n"
- "ld1b { z28.b }, p2/Z, [x28, #3, MUL VL]\n"
- "ld1b { z27.b }, p2/Z, [x28, #4, MUL VL]\n"
- "ld1b { z26.b }, p2/Z, [x28, #5, MUL VL]\n"
".inst 0x45189830 // smmla z16.s, z1.b, z24.b\n"
+ "ld1b { z24.b }, p2/Z, [x28, #1, MUL VL]\n"
+ ".inst 0x45189834 // smmla z20.s, z1.b, z24.b\n"
+ "ld1b { z25.b }, p2/Z, [x28, #2, MUL VL]\n"
+ "ld1b { z24.b }, p2/Z, [x28, #3, MUL VL]\n"
+ ".inst 0x45199831 // smmla z17.s, z1.b, z25.b\n"
+ ".inst 0x45189835 // smmla z21.s, z1.b, z24.b\n"
+ "ld1b { z25.b }, p2/Z, [x28, #4, MUL VL]\n"
+ "ld1b { z24.b }, p2/Z, [x28, #5, MUL VL]\n"
+ ".inst 0x45199832 // smmla z18.s, z1.b, z25.b\n"
+ ".inst 0x45189836 // smmla z22.s, z1.b, z24.b\n"
"ld1b { z25.b }, p2/Z, [x28, #6, MUL VL]\n"
"ld1b { z24.b }, p2/Z, [x28, #7, MUL VL]\n"
- ".inst 0x451e9834 // smmla z20.s, z1.b, z30.b\n"
- "addvl x28, x28, #8\n"
- ".inst 0x451d9831 // smmla z17.s, z1.b, z29.b\n"
- ".inst 0x451c9835 // smmla z21.s, z1.b, z28.b\n"
- ".inst 0x451b9832 // smmla z18.s, z1.b, z27.b\n"
- ".inst 0x451a9836 // smmla z22.s, z1.b, z26.b\n"
".inst 0x45199833 // smmla z19.s, z1.b, z25.b\n"
".inst 0x45189837 // smmla z23.s, z1.b, z24.b\n"
+ "addvl x28, x28, #8\n"
"10:" // Height 1: Multiply loop: multiply skip
"tbnz %x[flags], #31, 11f\n"
"sdot z11.s, z0.b, z15.b\n"
@@ -225,32 +225,32 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"mov z23.d, z16.d\n"
"tbnz %x[flags], #31, 12f\n"
"add x20, %x[qp], %[b_offset]\n"
+ "ld1rw { z16.s }, p2/Z, [x20]\n"
".inst 0x4491a96b // addp z11.s, p2/m, z11.s, z11.s\n"
- "ld1rw { z9.s }, p2/Z, [x20]\n"
- "neg z9.s, p2/M, z9.s\n"
+ "neg z16.s, p2/M, z16.s\n"
"mov z11.s, z11.s[0]\n"
- "mul z11.s, p2/M, z11.s, z9.s\n"
+ "mul z11.s, p2/M, z11.s, z16.s\n"
"12:" // Height 1: skip row sum fixup
"add z23.s, z23.s, z11.s\n"
"add z17.s, z17.s, z11.s\n"
"ld1w { z22.s }, p2/Z, [x10]\n"
- "ld1w { z24.s }, p2/Z, [x10, #1, MUL VL]\n"
+ "ld1w { z21.s }, p2/Z, [x10, #1, MUL VL]\n"
"add z18.s, z18.s, z11.s\n"
"add z19.s, z19.s, z11.s\n"
- "ld1w { z21.s }, p2/Z, [x10, #2, MUL VL]\n"
- "ld1w { z20.s }, p2/Z, [x10, #3, MUL VL]\n"
+ "ld1w { z20.s }, p2/Z, [x10, #2, MUL VL]\n"
+ "ld1w { z16.s }, p2/Z, [x10, #3, MUL VL]\n"
"add x20, %x[qp], %[per_layer_mul]\n"
"orr %x[flags], %x[flags], #0x80000000\n"
"add z23.s, z23.s, z22.s\n"
- "add z17.s, z17.s, z24.s\n"
+ "add z17.s, z17.s, z21.s\n"
+ "add z18.s, z18.s, z20.s\n"
+ "add z19.s, z19.s, z16.s\n"
"ld1rw { z16.s }, p2/Z, [x20]\n"
"add x20, %x[qp], %[per_layer_right_shift]\n"
- "addvl x10, x10, #4\n"
- "add z18.s, z18.s, z21.s\n"
- "add z19.s, z19.s, z20.s\n"
"ld1rw { z0.s }, p2/Z, [x20]\n"
".inst 0x04b076f7 // sqrdmulh z23.s, z23.s, z16.s\n"
".inst 0x04b07631 // sqrdmulh z17.s, z17.s, z16.s\n"
+ "addvl x10, x10, #4\n"
".inst 0x04b07652 // sqrdmulh z18.s, z18.s, z16.s\n"
".inst 0x04b07673 // sqrdmulh z19.s, z19.s, z16.s\n"
"tbz %x[flags], #5, 13f\n"
@@ -268,19 +268,19 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"sqadd z19.s, z19.s, z16.s\n"
"13:" // Height 1: no shift correction
"add x20, %x[qp], %[c_offset]\n"
+ "ld1rw { z16.s }, p2/Z, [x20]\n"
".inst 0x44828817 // srshl z23.s, p2/M, z23.s, z0.s\n"
- "ld1rw { z21.s }, p2/Z, [x20]\n"
+ "add z23.s, z23.s, z16.s\n"
".inst 0x44828811 // srshl z17.s, p2/M, z17.s, z0.s\n"
".inst 0x44828812 // srshl z18.s, p2/M, z18.s, z0.s\n"
+ "add z17.s, z17.s, z16.s\n"
+ "add z18.s, z18.s, z16.s\n"
".inst 0x44828813 // srshl z19.s, p2/M, z19.s, z0.s\n"
"add x20, %x[qp], %[maxval]\n"
"ld1rw { z20.s }, p2/Z, [x20]\n"
- "add z23.s, z23.s, z21.s\n"
+ "add z19.s, z19.s, z16.s\n"
"add x20, %x[qp], %[minval]\n"
- "add z17.s, z17.s, z21.s\n"
- "add z18.s, z18.s, z21.s\n"
"ld1rw { z16.s }, p2/Z, [x20]\n"
- "add z19.s, z19.s, z21.s\n"
"smin z23.s, p2/M, z23.s, z20.s\n"
"smin z17.s, p2/M, z17.s, z20.s\n"
"smin z18.s, p2/M, z18.s, z20.s\n"
@@ -288,8 +288,8 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"smax z23.s, p2/M, z23.s, z16.s\n"
"smax z17.s, p2/M, z17.s, z16.s\n"
"smax z18.s, p2/M, z18.s, z16.s\n"
- "smax z19.s, p2/M, z19.s, z16.s\n"
"uzp1 z23.h, z23.h, z17.h\n"
+ "smax z19.s, p2/M, z19.s, z16.s\n"
"uzp1 z16.h, z18.h, z19.h\n"
"uzp1 z23.b, z23.b, z16.b\n"
"st1b { z23.b }, p1, [x27]\n"
@@ -307,24 +307,24 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"mov z15.b, #0x1\n"
"ldr x9, [%x[args_ptr], %[offsetof_N]]\n"
"ldr x28, [%x[args_ptr], %[offsetof_B_ptr]]\n"
- "ldr x27, [%x[args_ptr], %[offsetof_output_ptr]]\n"
+ "mov x27, %x[output_ptr]\n"
"16:" // Height 2: Column loop
"mov x20, #0x0\n"
+ "whilelt p1.b, x20, x9\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"
- "whilelt p1.b, x20, x9\n"
"mov z22.s, #0x0\n"
"mov z23.s, #0x0\n"
"17:" // Height 2: setup done
"mov x26, #0x0\n"
"18:" // Height 2: String loop
"ldr x20, [%x[args_ptr], %[offsetof_string_lengths]]\n"
- "ldr x21, [%x[args_ptr], %[offsetof_input_offset]]\n"
"ldr w25, [x20, x26, LSL #0x2]\n"
+ "ldr x21, [%x[args_ptr], %[offsetof_input_offset]]\n"
"tbz %x[flags], #3, 19f\n"
"ldr x20, [%x[input_ptr], x26, LSL #0x3]\n"
"add x20, x20, x21, LSL #3\n"
@@ -343,45 +343,45 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"ble 23f\n"
"21:" // Height 2: Multiply loop: Main loop head
"whilelt p0.b, XZR, x25\n"
- "ld1b { z31.b }, p2/Z, [x28]\n"
- "ld1b { z30.b }, p2/Z, [x28, #1, MUL VL]\n"
- "ld1b { z29.b }, p2/Z, [x28, #2, MUL VL]\n"
- "ld1b { z28.b }, p2/Z, [x28, #3, MUL VL]\n"
- "ld1b { z27.b }, p2/Z, [x28, #4, MUL VL]\n"
- "ld1b { z26.b }, p2/Z, [x28, #5, MUL VL]\n"
"ld1rqb { z1.b }, p0/Z, [x24]\n"
- "ld1rqb { z25.b }, p0/Z, [x23]\n"
- "add x24, x24, #0x10\n"
- "add x23, x23, #0x10\n"
- "ld1b { z24.b }, p2/Z, [x28, #6, MUL VL]\n"
- "trn1 z0.d, z1.d, z25.d\n"
- "trn2 z1.d, z1.d, z25.d\n"
- ".inst 0x451f9810 // smmla z16.s, z0.b, z31.b\n"
+ "ld1rqb { z26.b }, p0/Z, [x23]\n"
+ "trn1 z0.d, z1.d, z26.d\n"
+ "ld1b { z24.b }, p2/Z, [x28]\n"
+ ".inst 0x45189810 // smmla z16.s, z0.b, z24.b\n"
+ "ld1b { z25.b }, p2/Z, [x28, #1, MUL VL]\n"
+ "trn2 z1.d, z1.d, z26.d\n"
+ "ld1b { z24.b }, p2/Z, [x28, #2, MUL VL]\n"
+ "ld1b { z26.b }, p2/Z, [x28, #3, MUL VL]\n"
+ ".inst 0x45199814 // smmla z20.s, z0.b, z25.b\n"
+ ".inst 0x45189811 // smmla z17.s, z0.b, z24.b\n"
+ "ld1b { z25.b }, p2/Z, [x28, #4, MUL VL]\n"
+ "ld1b { z24.b }, p2/Z, [x28, #5, MUL VL]\n"
+ ".inst 0x451a9815 // smmla z21.s, z0.b, z26.b\n"
+ ".inst 0x45199812 // smmla z18.s, z0.b, z25.b\n"
+ "ld1b { z26.b }, p2/Z, [x28, #6, MUL VL]\n"
"ld1b { z25.b }, p2/Z, [x28, #7, MUL VL]\n"
"addvl x28, x28, #16\n"
- ".inst 0x451e9814 // smmla z20.s, z0.b, z30.b\n"
- ".inst 0x451d9811 // smmla z17.s, z0.b, z29.b\n"
- ".inst 0x451c9815 // smmla z21.s, z0.b, z28.b\n"
- ".inst 0x451b9812 // smmla z18.s, z0.b, z27.b\n"
- ".inst 0x451a9816 // smmla z22.s, z0.b, z26.b\n"
- ".inst 0x45189813 // smmla z19.s, z0.b, z24.b\n"
+ ".inst 0x45189816 // smmla z22.s, z0.b, z24.b\n"
"ld1b { z24.b }, p2/Z, [x28, #-8, MUL VL]\n"
+ ".inst 0x451a9813 // smmla z19.s, z0.b, z26.b\n"
".inst 0x45199817 // smmla z23.s, z0.b, z25.b\n"
- "ld1b { z30.b }, p2/Z, [x28, #-7, MUL VL]\n"
- "ld1b { z29.b }, p2/Z, [x28, #-6, MUL VL]\n"
- "ld1b { z28.b }, p2/Z, [x28, #-5, MUL VL]\n"
- "ld1b { z27.b }, p2/Z, [x28, #-4, MUL VL]\n"
+ "ld1b { z26.b }, p2/Z, [x28, #-7, MUL VL]\n"
".inst 0x45189830 // smmla z16.s, z1.b, z24.b\n"
+ "ld1b { z25.b }, p2/Z, [x28, #-6, MUL VL]\n"
+ "ld1b { z24.b }, p2/Z, [x28, #-5, MUL VL]\n"
+ ".inst 0x451a9834 // smmla z20.s, z1.b, z26.b\n"
+ "ld1b { z27.b }, p2/Z, [x28, #-4, MUL VL]\n"
"ld1b { z26.b }, p2/Z, [x28, #-3, MUL VL]\n"
+ ".inst 0x45199831 // smmla z17.s, z1.b, z25.b\n"
+ ".inst 0x45189835 // smmla z21.s, z1.b, z24.b\n"
"ld1b { z25.b }, p2/Z, [x28, #-2, MUL VL]\n"
"ld1b { z24.b }, p2/Z, [x28, #-1, MUL VL]\n"
- ".inst 0x451e9834 // smmla z20.s, z1.b, z30.b\n"
- ".inst 0x451d9831 // smmla z17.s, z1.b, z29.b\n"
- ".inst 0x451c9835 // smmla z21.s, z1.b, z28.b\n"
".inst 0x451b9832 // smmla z18.s, z1.b, z27.b\n"
".inst 0x451a9836 // smmla z22.s, z1.b, z26.b\n"
".inst 0x45199833 // smmla z19.s, z1.b, z25.b\n"
".inst 0x45189837 // smmla z23.s, z1.b, z24.b\n"
+ "add x24, x24, #0x10\n"
+ "add x23, x23, #0x10\n"
"tbnz %x[flags], #31, 22f\n"
"sdot z11.s, z0.b, z15.b\n"
"sdot z11.s, z1.b, z15.b\n"
@@ -391,46 +391,46 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"bgt 21b\n"
"23:" // Height 2: Multiply loop: Single iteration only
"whilelt p0.b, XZR, x25\n"
- "ld1b { z29.b }, p2/Z, [x28]\n"
- "ld1b { z28.b }, p2/Z, [x28, #1, MUL VL]\n"
- "subs x25, x25, #0x8\n"
- "ld1b { z4.b }, p2/Z, [x28, #2, MUL VL]\n"
- "ld1b { z27.b }, p2/Z, [x28, #3, MUL VL]\n"
- "ld1b { z26.b }, p2/Z, [x28, #4, MUL VL]\n"
- "ld1b { z6.b }, p2/Z, [x28, #5, MUL VL]\n"
"ld1rqb { z1.b }, p0/Z, [x24]\n"
- "ld1rqb { z24.b }, p0/Z, [x23]\n"
+ "ld1rqb { z27.b }, p0/Z, [x23]\n"
+ "trn1 z0.d, z1.d, z27.d\n"
+ "ld1b { z24.b }, p2/Z, [x28]\n"
+ ".inst 0x45189810 // smmla z16.s, z0.b, z24.b\n"
+ "ld1b { z26.b }, p2/Z, [x28, #1, MUL VL]\n"
+ "subs x25, x25, #0x8\n"
+ "ld1b { z25.b }, p2/Z, [x28, #2, MUL VL]\n"
+ "ld1b { z24.b }, p2/Z, [x28, #3, MUL VL]\n"
+ "trn2 z1.d, z1.d, z27.d\n"
+ ".inst 0x451a9814 // smmla z20.s, z0.b, z26.b\n"
+ "ld1b { z27.b }, p2/Z, [x28, #4, MUL VL]\n"
+ "ld1b { z26.b }, p2/Z, [x28, #5, MUL VL]\n"
+ ".inst 0x45199811 // smmla z17.s, z0.b, z25.b\n"
+ ".inst 0x45189815 // smmla z21.s, z0.b, z24.b\n"
"ld1b { z25.b }, p2/Z, [x28, #6, MUL VL]\n"
- "trn1 z0.d, z1.d, z24.d\n"
- "trn2 z1.d, z1.d, z24.d\n"
- ".inst 0x451d9810 // smmla z16.s, z0.b, z29.b\n"
"ld1b { z24.b }, p2/Z, [x28, #7, MUL VL]\n"
- "addvl x28, x28, #8\n"
- ".inst 0x451c9814 // smmla z20.s, z0.b, z28.b\n"
- ".inst 0x45049811 // smmla z17.s, z0.b, z4.b\n"
- ".inst 0x451b9815 // smmla z21.s, z0.b, z27.b\n"
- ".inst 0x451a9812 // smmla z18.s, z0.b, z26.b\n"
- ".inst 0x45069816 // smmla z22.s, z0.b, z6.b\n"
+ ".inst 0x451b9812 // smmla z18.s, z0.b, z27.b\n"
+ ".inst 0x451a9816 // smmla z22.s, z0.b, z26.b\n"
".inst 0x45199813 // smmla z19.s, z0.b, z25.b\n"
".inst 0x45189817 // smmla z23.s, z0.b, z24.b\n"
+ "addvl x28, x28, #8\n"
"ble 24f\n"
"ld1b { z24.b }, p2/Z, [x28]\n"
- "ld1b { z30.b }, p2/Z, [x28, #1, MUL VL]\n"
- "ld1b { z29.b }, p2/Z, [x28, #2, MUL VL]\n"
- "ld1b { z28.b }, p2/Z, [x28, #3, MUL VL]\n"
- "ld1b { z27.b }, p2/Z, [x28, #4, MUL VL]\n"
- "ld1b { z26.b }, p2/Z, [x28, #5, MUL VL]\n"
".inst 0x45189830 // smmla z16.s, z1.b, z24.b\n"
+ "ld1b { z24.b }, p2/Z, [x28, #1, MUL VL]\n"
+ ".inst 0x45189834 // smmla z20.s, z1.b, z24.b\n"
+ "ld1b { z25.b }, p2/Z, [x28, #2, MUL VL]\n"
+ "ld1b { z24.b }, p2/Z, [x28, #3, MUL VL]\n"
+ ".inst 0x45199831 // smmla z17.s, z1.b, z25.b\n"
+ ".inst 0x45189835 // smmla z21.s, z1.b, z24.b\n"
+ "ld1b { z25.b }, p2/Z, [x28, #4, MUL VL]\n"
+ "ld1b { z24.b }, p2/Z, [x28, #5, MUL VL]\n"
+ ".inst 0x45199832 // smmla z18.s, z1.b, z25.b\n"
+ ".inst 0x45189836 // smmla z22.s, z1.b, z24.b\n"
"ld1b { z25.b }, p2/Z, [x28, #6, MUL VL]\n"
"ld1b { z24.b }, p2/Z, [x28, #7, MUL VL]\n"
- ".inst 0x451e9834 // smmla z20.s, z1.b, z30.b\n"
- "addvl x28, x28, #8\n"
- ".inst 0x451d9831 // smmla z17.s, z1.b, z29.b\n"
- ".inst 0x451c9835 // smmla z21.s, z1.b, z28.b\n"
- ".inst 0x451b9832 // smmla z18.s, z1.b, z27.b\n"
- ".inst 0x451a9836 // smmla z22.s, z1.b, z26.b\n"
".inst 0x45199833 // smmla z19.s, z1.b, z25.b\n"
".inst 0x45189837 // smmla z23.s, z1.b, z24.b\n"
+ "addvl x28, x28, #8\n"
"24:" // Height 2: Multiply loop: multiply skip
"tbnz %x[flags], #31, 25f\n"
"sdot z11.s, z0.b, z15.b\n"
@@ -443,18 +443,18 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"uzp1 z24.d, z16.d, z20.d\n"
"ldr x20, [%x[args_ptr], %[offsetof_output_offset]]\n"
"uzp2 z16.d, z16.d, z20.d\n"
+ "add x23, x27, x20\n"
"uzp1 z20.d, z17.d, z21.d\n"
"uzp2 z17.d, z17.d, z21.d\n"
"uzp1 z21.d, z18.d, z22.d\n"
"uzp2 z18.d, z18.d, z22.d\n"
"uzp1 z22.d, z19.d, z23.d\n"
"uzp2 z19.d, z19.d, z23.d\n"
- "add x23, x27, x20\n"
"mov z23.d, z24.d\n"
"tbnz %x[flags], #31, 26f\n"
"add x20, %x[qp], %[b_offset]\n"
- ".inst 0x4491a96b // addp z11.s, p2/m, z11.s, z11.s\n"
"ld1rw { z24.s }, p2/Z, [x20]\n"
+ ".inst 0x4491a96b // addp z11.s, p2/m, z11.s, z11.s\n"
"neg z24.s, p2/M, z24.s\n"
"mov z12.s, z11.s[3]\n"
"mov z11.s, z11.s[0]\n"
@@ -497,24 +497,24 @@ void sve_hybrid_s8qa_mmla_4x4VL (
".inst 0x04b87673 // sqrdmulh z19.s, z19.s, z24.s\n"
"tbz %x[flags], #5, 27f\n"
"and z24.d, z23.d, z0.d\n"
+ "asr z24.s, z24.s, #0x1f\n"
+ "sqadd z23.s, z23.s, z24.s\n"
"and z30.d, z20.d, z0.d\n"
"and z29.d, z21.d, z0.d\n"
"and z28.d, z22.d, z0.d\n"
"and z27.d, z16.d, z0.d\n"
"and z26.d, z17.d, z0.d\n"
- "asr z24.s, z24.s, #0x1f\n"
"and z25.d, z18.d, z0.d\n"
+ "and z24.d, z19.d, z0.d\n"
"asr z30.s, z30.s, #0x1f\n"
"asr z29.s, z29.s, #0x1f\n"
"asr z28.s, z28.s, #0x1f\n"
"asr z27.s, z27.s, #0x1f\n"
- "sqadd z23.s, z23.s, z24.s\n"
- "and z24.d, z19.d, z0.d\n"
"asr z26.s, z26.s, #0x1f\n"
"asr z25.s, z25.s, #0x1f\n"
+ "asr z24.s, z24.s, #0x1f\n"
"sqadd z20.s, z20.s, z30.s\n"
"sqadd z21.s, z21.s, z29.s\n"
- "asr z24.s, z24.s, #0x1f\n"
"sqadd z22.s, z22.s, z28.s\n"
"sqadd z16.s, z16.s, z27.s\n"
"sqadd z17.s, z17.s, z26.s\n"
@@ -522,27 +522,27 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"sqadd z19.s, z19.s, z24.s\n"
"27:" // Height 2: no shift correction
"add x20, %x[qp], %[c_offset]\n"
+ "ld1rw { z24.s }, p2/Z, [x20]\n"
".inst 0x44828817 // srshl z23.s, p2/M, z23.s, z0.s\n"
- "ld1rw { z26.s }, p2/Z, [x20]\n"
+ "add z23.s, z23.s, z24.s\n"
".inst 0x44828814 // srshl z20.s, p2/M, z20.s, z0.s\n"
".inst 0x44828815 // srshl z21.s, p2/M, z21.s, z0.s\n"
+ "add z20.s, z20.s, z24.s\n"
+ "add z21.s, z21.s, z24.s\n"
".inst 0x44828816 // srshl z22.s, p2/M, z22.s, z0.s\n"
".inst 0x44828810 // srshl z16.s, p2/M, z16.s, z0.s\n"
+ "add z22.s, z22.s, z24.s\n"
+ "add z16.s, z16.s, z24.s\n"
".inst 0x44828811 // srshl z17.s, p2/M, z17.s, z0.s\n"
".inst 0x44828812 // srshl z18.s, p2/M, z18.s, z0.s\n"
- "add z23.s, z23.s, z26.s\n"
+ "add z17.s, z17.s, z24.s\n"
+ "add z18.s, z18.s, z24.s\n"
".inst 0x44828813 // srshl z19.s, p2/M, z19.s, z0.s\n"
"add x20, %x[qp], %[maxval]\n"
- "add z20.s, z20.s, z26.s\n"
- "add z21.s, z21.s, z26.s\n"
"ld1rw { z25.s }, p2/Z, [x20]\n"
- "add z22.s, z22.s, z26.s\n"
- "add z16.s, z16.s, z26.s\n"
+ "add z19.s, z19.s, z24.s\n"
"add x20, %x[qp], %[minval]\n"
- "add z17.s, z17.s, z26.s\n"
- "add z18.s, z18.s, z26.s\n"
"ld1rw { z24.s }, p2/Z, [x20]\n"
- "add z19.s, z19.s, z26.s\n"
"smin z23.s, p2/M, z23.s, z25.s\n"
"smin z20.s, p2/M, z20.s, z25.s\n"
"smin z21.s, p2/M, z21.s, z25.s\n"
@@ -554,20 +554,20 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"smax z23.s, p2/M, z23.s, z24.s\n"
"smax z20.s, p2/M, z20.s, z24.s\n"
"smax z21.s, p2/M, z21.s, z24.s\n"
+ "uzp1 z23.h, z23.h, z20.h\n"
"smax z22.s, p2/M, z22.s, z24.s\n"
"smax z16.s, p2/M, z16.s, z24.s\n"
+ "uzp1 z20.h, z21.h, z22.h\n"
+ "uzp1 z23.b, z23.b, z20.b\n"
"smax z17.s, p2/M, z17.s, z24.s\n"
"smax z18.s, p2/M, z18.s, z24.s\n"
- "smax z19.s, p2/M, z19.s, z24.s\n"
- "uzp1 z23.h, z23.h, z20.h\n"
- "uzp1 z20.h, z21.h, z22.h\n"
"uzp1 z16.h, z16.h, z17.h\n"
+ "st1b { z23.b }, p1, [x27]\n"
+ "smax z19.s, p2/M, z19.s, z24.s\n"
"uzp1 z17.h, z18.h, z19.h\n"
- "uzp1 z23.b, z23.b, z20.b\n"
"uzp1 z16.b, z16.b, z17.b\n"
- "st1b { z23.b }, p1, [x27]\n"
- "addvl x27, x27, #1\n"
"st1b { z16.b }, p1, [x23]\n"
+ "addvl x27, x27, #1\n"
"28:" // Height 2: Writeback done
"decw x9, ALL, MUL #4\n"
"cmp x9, XZR\n"
@@ -582,16 +582,16 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"mov z15.b, #0x1\n"
"ldr x9, [%x[args_ptr], %[offsetof_N]]\n"
"ldr x28, [%x[args_ptr], %[offsetof_B_ptr]]\n"
- "ldr x27, [%x[args_ptr], %[offsetof_output_ptr]]\n"
+ "mov x27, %x[output_ptr]\n"
"30:" // Height 3: Column loop
"mov x20, #0x0\n"
+ "whilelt p1.b, x20, x9\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"
- "whilelt p1.b, x20, x9\n"
"mov z22.s, #0x0\n"
"mov z23.s, #0x0\n"
"mov z24.s, #0x0\n"
@@ -606,8 +606,8 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"mov x26, #0x0\n"
"32:" // Height 3: String loop
"ldr x20, [%x[args_ptr], %[offsetof_string_lengths]]\n"
- "ldr x21, [%x[args_ptr], %[offsetof_input_offset]]\n"
"ldr w25, [x20, x26, LSL #0x2]\n"
+ "ldr x21, [%x[args_ptr], %[offsetof_input_offset]]\n"
"tbz %x[flags], #3, 33f\n"
"ldr x20, [%x[input_ptr], x26, LSL #0x3]\n"
"add x20, x20, x21, LSL #3\n"
@@ -629,49 +629,49 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"ble 37f\n"
"35:" // Height 3: Multiply loop: Main loop head
"whilelt p0.b, XZR, x25\n"
- "ld1b { z5.b }, p2/Z, [x28]\n"
- "ld1b { z10.b }, p2/Z, [x28, #1, MUL VL]\n"
- "ld1b { z9.b }, p2/Z, [x28, #2, MUL VL]\n"
- "ld1b { z8.b }, p2/Z, [x28, #3, MUL VL]\n"
- "ld1b { z4.b }, p2/Z, [x28, #4, MUL VL]\n"
- "ld1b { z7.b }, p2/Z, [x28, #5, MUL VL]\n"
"ld1rqb { z1.b }, p0/Z, [x24]\n"
"ld1rqb { z2.b }, p0/Z, [x23]\n"
- "add x24, x24, #0x10\n"
- "add x23, x23, #0x10\n"
"ld1rqb { z3.b }, p0/Z, [x22]\n"
- "add x22, x22, #0x10\n"
"trn1 z0.d, z1.d, z2.d\n"
"trn2 z1.d, z1.d, z2.d\n"
- "trn1 z2.d, z3.d, z6.d\n"
- "trn2 z3.d, z3.d, z6.d\n"
+ "ld1b { z4.b }, p2/Z, [x28]\n"
+ "trn1 z2.d, z3.d, z5.d\n"
+ "trn2 z3.d, z3.d, z5.d\n"
+ ".inst 0x45049810 // smmla z16.s, z0.b, z4.b\n"
+ "ld1b { z5.b }, p2/Z, [x28, #1, MUL VL]\n"
+ ".inst 0x45049858 // smmla z24.s, z2.b, z4.b\n"
+ "ld1b { z4.b }, p2/Z, [x28, #2, MUL VL]\n"
+ "ld1b { z9.b }, p2/Z, [x28, #3, MUL VL]\n"
+ ".inst 0x45059814 // smmla z20.s, z0.b, z5.b\n"
+ "ld1b { z8.b }, p2/Z, [x28, #4, MUL VL]\n"
+ "ld1b { z7.b }, p2/Z, [x28, #5, MUL VL]\n"
+ ".inst 0x4505985c // smmla z28.s, z2.b, z5.b\n"
+ ".inst 0x45049811 // smmla z17.s, z0.b, z4.b\n"
"ld1b { z6.b }, p2/Z, [x28, #6, MUL VL]\n"
- ".inst 0x45059810 // smmla z16.s, z0.b, z5.b\n"
- ".inst 0x450a9814 // smmla z20.s, z0.b, z10.b\n"
- ".inst 0x45099811 // smmla z17.s, z0.b, z9.b\n"
- ".inst 0x45089815 // smmla z21.s, z0.b, z8.b\n"
- ".inst 0x45049812 // smmla z18.s, z0.b, z4.b\n"
- ".inst 0x45059858 // smmla z24.s, z2.b, z5.b\n"
"ld1b { z5.b }, p2/Z, [x28, #7, MUL VL]\n"
"addvl x28, x28, #16\n"
- ".inst 0x450a985c // smmla z28.s, z2.b, z10.b\n"
- ".inst 0x45099859 // smmla z25.s, z2.b, z9.b\n"
- ".inst 0x4508985d // smmla z29.s, z2.b, z8.b\n"
- ".inst 0x4504985a // smmla z26.s, z2.b, z4.b\n"
- ".inst 0x45079816 // smmla z22.s, z0.b, z7.b\n"
+ ".inst 0x45049859 // smmla z25.s, z2.b, z4.b\n"
"ld1b { z4.b }, p2/Z, [x28, #-8, MUL VL]\n"
- ".inst 0x4507985e // smmla z30.s, z2.b, z7.b\n"
- ".inst 0x45069813 // smmla z19.s, z0.b, z6.b\n"
+ ".inst 0x45099815 // smmla z21.s, z0.b, z9.b\n"
+ ".inst 0x4509985d // smmla z29.s, z2.b, z9.b\n"
"ld1b { z10.b }, p2/Z, [x28, #-7, MUL VL]\n"
+ ".inst 0x45089812 // smmla z18.s, z0.b, z8.b\n"
+ ".inst 0x4508985a // smmla z26.s, z2.b, z8.b\n"
"ld1b { z9.b }, p2/Z, [x28, #-6, MUL VL]\n"
- ".inst 0x4506985b // smmla z27.s, z2.b, z6.b\n"
- ".inst 0x45059817 // smmla z23.s, z0.b, z5.b\n"
"ld1b { z8.b }, p2/Z, [x28, #-5, MUL VL]\n"
+ ".inst 0x45079816 // smmla z22.s, z0.b, z7.b\n"
+ ".inst 0x4507985e // smmla z30.s, z2.b, z7.b\n"
"ld1b { z7.b }, p2/Z, [x28, #-4, MUL VL]\n"
- ".inst 0x4505985f // smmla z31.s, z2.b, z5.b\n"
- ".inst 0x45049830 // smmla z16.s, z1.b, z4.b\n"
+ "add x24, x24, #0x10\n"
+ ".inst 0x45069813 // smmla z19.s, z0.b, z6.b\n"
+ ".inst 0x4506985b // smmla z27.s, z2.b, z6.b\n"
"ld1b { z6.b }, p2/Z, [x28, #-3, MUL VL]\n"
+ "add x23, x23, #0x10\n"
+ ".inst 0x45059817 // smmla z23.s, z0.b, z5.b\n"
+ ".inst 0x4505985f // smmla z31.s, z2.b, z5.b\n"
"ld1b { z5.b }, p2/Z, [x28, #-2, MUL VL]\n"
+ "add x22, x22, #0x10\n"
+ ".inst 0x45049830 // smmla z16.s, z1.b, z4.b\n"
".inst 0x45049878 // smmla z24.s, z3.b, z4.b\n"
"ld1b { z4.b }, p2/Z, [x28, #-1, MUL VL]\n"
".inst 0x450a9834 // smmla z20.s, z1.b, z10.b\n"
@@ -699,32 +699,32 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"bgt 35b\n"
"37:" // Height 3: Multiply loop: Single iteration only
"whilelt p0.b, XZR, x25\n"
- "ld1b { z4.b }, p2/Z, [x28]\n"
- "ld1b { z10.b }, p2/Z, [x28, #1, MUL VL]\n"
- "ld1b { z9.b }, p2/Z, [x28, #2, MUL VL]\n"
- "ld1b { z8.b }, p2/Z, [x28, #3, MUL VL]\n"
- "subs x25, x25, #0x8\n"
- "ld1b { z7.b }, p2/Z, [x28, #4, MUL VL]\n"
- "ld1b { z6.b }, p2/Z, [x28, #5, MUL VL]\n"
"ld1rqb { z1.b }, p0/Z, [x24]\n"
"ld1rqb { z2.b }, p0/Z, [x23]\n"
"ld1rqb { z3.b }, p0/Z, [x22]\n"
"trn1 z0.d, z1.d, z2.d\n"
"trn2 z1.d, z1.d, z2.d\n"
- "trn1 z2.d, z3.d, z5.d\n"
- "trn2 z3.d, z3.d, z5.d\n"
+ "ld1b { z5.b }, p2/Z, [x28]\n"
+ "trn1 z2.d, z3.d, z4.d\n"
+ "trn2 z3.d, z3.d, z4.d\n"
+ ".inst 0x45059810 // smmla z16.s, z0.b, z5.b\n"
+ "ld1b { z4.b }, p2/Z, [x28, #1, MUL VL]\n"
+ ".inst 0x45059858 // smmla z24.s, z2.b, z5.b\n"
+ "ld1b { z9.b }, p2/Z, [x28, #2, MUL VL]\n"
+ "ld1b { z8.b }, p2/Z, [x28, #3, MUL VL]\n"
+ "subs x25, x25, #0x8\n"
+ "ld1b { z7.b }, p2/Z, [x28, #4, MUL VL]\n"
+ "ld1b { z6.b }, p2/Z, [x28, #5, MUL VL]\n"
+ ".inst 0x45049814 // smmla z20.s, z0.b, z4.b\n"
+ ".inst 0x4504985c // smmla z28.s, z2.b, z4.b\n"
"ld1b { z5.b }, p2/Z, [x28, #6, MUL VL]\n"
- ".inst 0x45049810 // smmla z16.s, z0.b, z4.b\n"
- ".inst 0x450a9814 // smmla z20.s, z0.b, z10.b\n"
- ".inst 0x45099811 // smmla z17.s, z0.b, z9.b\n"
- ".inst 0x45089815 // smmla z21.s, z0.b, z8.b\n"
- ".inst 0x45079812 // smmla z18.s, z0.b, z7.b\n"
- ".inst 0x45049858 // smmla z24.s, z2.b, z4.b\n"
"ld1b { z4.b }, p2/Z, [x28, #7, MUL VL]\n"
- ".inst 0x450a985c // smmla z28.s, z2.b, z10.b\n"
- "addvl x28, x28, #8\n"
+ ".inst 0x45099811 // smmla z17.s, z0.b, z9.b\n"
".inst 0x45099859 // smmla z25.s, z2.b, z9.b\n"
+ ".inst 0x45089815 // smmla z21.s, z0.b, z8.b\n"
".inst 0x4508985d // smmla z29.s, z2.b, z8.b\n"
+ "addvl x28, x28, #8\n"
+ ".inst 0x45079812 // smmla z18.s, z0.b, z7.b\n"
".inst 0x4507985a // smmla z26.s, z2.b, z7.b\n"
".inst 0x45069816 // smmla z22.s, z0.b, z6.b\n"
".inst 0x4506985e // smmla z30.s, z2.b, z6.b\n"
@@ -734,24 +734,24 @@ void sve_hybrid_s8qa_mmla_4x4VL (
".inst 0x4504985f // smmla z31.s, z2.b, z4.b\n"
"ble 38f\n"
"ld1b { z4.b }, p2/Z, [x28]\n"
- "ld1b { z10.b }, p2/Z, [x28, #1, MUL VL]\n"
- "ld1b { z9.b }, p2/Z, [x28, #2, MUL VL]\n"
+ ".inst 0x45049830 // smmla z16.s, z1.b, z4.b\n"
+ ".inst 0x45049878 // smmla z24.s, z3.b, z4.b\n"
+ "ld1b { z5.b }, p2/Z, [x28, #1, MUL VL]\n"
+ "ld1b { z4.b }, p2/Z, [x28, #2, MUL VL]\n"
"ld1b { z8.b }, p2/Z, [x28, #3, MUL VL]\n"
+ ".inst 0x45059834 // smmla z20.s, z1.b, z5.b\n"
+ ".inst 0x4505987c // smmla z28.s, z3.b, z5.b\n"
"ld1b { z7.b }, p2/Z, [x28, #4, MUL VL]\n"
"ld1b { z6.b }, p2/Z, [x28, #5, MUL VL]\n"
- ".inst 0x45049830 // smmla z16.s, z1.b, z4.b\n"
- ".inst 0x45049878 // smmla z24.s, z3.b, z4.b\n"
+ ".inst 0x45049831 // smmla z17.s, z1.b, z4.b\n"
+ ".inst 0x45049879 // smmla z25.s, z3.b, z4.b\n"
"ld1b { z5.b }, p2/Z, [x28, #6, MUL VL]\n"
"ld1b { z4.b }, p2/Z, [x28, #7, MUL VL]\n"
- ".inst 0x450a9834 // smmla z20.s, z1.b, z10.b\n"
- ".inst 0x450a987c // smmla z28.s, z3.b, z10.b\n"
- ".inst 0x45099831 // smmla z17.s, z1.b, z9.b\n"
- ".inst 0x45099879 // smmla z25.s, z3.b, z9.b\n"
- "addvl x28, x28, #8\n"
".inst 0x45089835 // smmla z21.s, z1.b, z8.b\n"
".inst 0x4508987d // smmla z29.s, z3.b, z8.b\n"
".inst 0x45079832 // smmla z18.s, z1.b, z7.b\n"
".inst 0x4507987a // smmla z26.s, z3.b, z7.b\n"
+ "addvl x28, x28, #8\n"
".inst 0x45069836 // smmla z22.s, z1.b, z6.b\n"
".inst 0x4506987e // smmla z30.s, z3.b, z6.b\n"
".inst 0x45059833 // smmla z19.s, z1.b, z5.b\n"
@@ -771,15 +771,15 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"bne 32b\n"
"ldr x20, [%x[args_ptr], %[offsetof_output_offset]]\n"
"uzp1 z0.d, z16.d, z20.d\n"
+ "add x23, x27, x20\n"
"uzp2 z16.d, z16.d, z20.d\n"
"uzp1 z20.d, z17.d, z21.d\n"
"uzp2 z17.d, z17.d, z21.d\n"
+ "add x22, x23, x20\n"
"uzp1 z21.d, z18.d, z22.d\n"
"uzp2 z18.d, z18.d, z22.d\n"
- "add x23, x27, x20\n"
"uzp1 z22.d, z19.d, z23.d\n"
"uzp2 z19.d, z19.d, z23.d\n"
- "add x22, x23, x20\n"
"uzp1 z24.d, z24.d, z28.d\n"
"uzp1 z25.d, z25.d, z29.d\n"
"uzp1 z26.d, z26.d, z30.d\n"
@@ -787,14 +787,14 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"mov z31.d, z0.d\n"
"tbnz %x[flags], #31, 40f\n"
"add x20, %x[qp], %[b_offset]\n"
+ "ld1rw { z23.s }, p2/Z, [x20]\n"
".inst 0x4491a96b // addp z11.s, p2/m, z11.s, z11.s\n"
".inst 0x4491a9ad // addp z13.s, p2/m, z13.s, z13.s\n"
- "ld1rw { z23.s }, p2/Z, [x20]\n"
"neg z23.s, p2/M, z23.s\n"
"mov z12.s, z11.s[3]\n"
"mov z11.s, z11.s[0]\n"
- "mov z13.s, z13.s[0]\n"
"mul z11.s, p2/M, z11.s, z23.s\n"
+ "mov z13.s, z13.s[0]\n"
"mul z12.s, p2/M, z12.s, z23.s\n"
"mul z13.s, p2/M, z13.s, z23.s\n"
"40:" // Height 3: skip row sum fixup
@@ -850,18 +850,18 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"and z29.d, z21.d, z0.d\n"
"and z28.d, z22.d, z0.d\n"
"and z23.d, z16.d, z0.d\n"
- "and z3.d, z17.d, z0.d\n"
"asr z1.s, z1.s, #0x1f\n"
"asr z30.s, z30.s, #0x1f\n"
"asr z29.s, z29.s, #0x1f\n"
"asr z28.s, z28.s, #0x1f\n"
"asr z23.s, z23.s, #0x1f\n"
- "and z2.d, z18.d, z0.d\n"
"sqadd z31.s, z31.s, z1.s\n"
"sqadd z20.s, z20.s, z30.s\n"
"sqadd z21.s, z21.s, z29.s\n"
"sqadd z22.s, z22.s, z28.s\n"
"sqadd z16.s, z16.s, z23.s\n"
+ "and z3.d, z17.d, z0.d\n"
+ "and z2.d, z18.d, z0.d\n"
"and z1.d, z19.d, z0.d\n"
"and z30.d, z24.d, z0.d\n"
"and z29.d, z25.d, z0.d\n"
@@ -883,35 +883,35 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"sqadd z27.s, z27.s, z23.s\n"
"41:" // Height 3: no shift correction
"add x20, %x[qp], %[c_offset]\n"
+ "ld1rw { z23.s }, p2/Z, [x20]\n"
".inst 0x4482881f // srshl z31.s, p2/M, z31.s, z0.s\n"
- "ld1rw { z29.s }, p2/Z, [x20]\n"
+ "add z31.s, z31.s, z23.s\n"
".inst 0x44828814 // srshl z20.s, p2/M, z20.s, z0.s\n"
".inst 0x44828815 // srshl z21.s, p2/M, z21.s, z0.s\n"
+ "add z20.s, z20.s, z23.s\n"
+ "add z21.s, z21.s, z23.s\n"
".inst 0x44828816 // srshl z22.s, p2/M, z22.s, z0.s\n"
".inst 0x44828810 // srshl z16.s, p2/M, z16.s, z0.s\n"
+ "add z22.s, z22.s, z23.s\n"
+ "add z16.s, z16.s, z23.s\n"
".inst 0x44828811 // srshl z17.s, p2/M, z17.s, z0.s\n"
".inst 0x44828812 // srshl z18.s, p2/M, z18.s, z0.s\n"
- "add z31.s, z31.s, z29.s\n"
+ "add z17.s, z17.s, z23.s\n"
+ "add z18.s, z18.s, z23.s\n"
".inst 0x44828813 // srshl z19.s, p2/M, z19.s, z0.s\n"
".inst 0x44828818 // srshl z24.s, p2/M, z24.s, z0.s\n"
- "add z20.s, z20.s, z29.s\n"
- "add z21.s, z21.s, z29.s\n"
+ "add z19.s, z19.s, z23.s\n"
+ "add z24.s, z24.s, z23.s\n"
".inst 0x44828819 // srshl z25.s, p2/M, z25.s, z0.s\n"
".inst 0x4482881a // srshl z26.s, p2/M, z26.s, z0.s\n"
- "add z22.s, z22.s, z29.s\n"
- "add z16.s, z16.s, z29.s\n"
+ "add z25.s, z25.s, z23.s\n"
+ "add z26.s, z26.s, z23.s\n"
".inst 0x4482881b // srshl z27.s, p2/M, z27.s, z0.s\n"
"add x20, %x[qp], %[maxval]\n"
- "add z17.s, z17.s, z29.s\n"
- "add z18.s, z18.s, z29.s\n"
"ld1rw { z28.s }, p2/Z, [x20]\n"
- "add z19.s, z19.s, z29.s\n"
- "add z24.s, z24.s, z29.s\n"
+ "add z27.s, z27.s, z23.s\n"
"add x20, %x[qp], %[minval]\n"
- "add z25.s, z25.s, z29.s\n"
- "add z26.s, z26.s, z29.s\n"
"ld1rw { z23.s }, p2/Z, [x20]\n"
- "add z27.s, z27.s, z29.s\n"
"smin z31.s, p2/M, z31.s, z28.s\n"
"smin z20.s, p2/M, z20.s, z28.s\n"
"smin z21.s, p2/M, z21.s, z28.s\n"
@@ -927,28 +927,28 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"smax z31.s, p2/M, z31.s, z23.s\n"
"smax z20.s, p2/M, z20.s, z23.s\n"
"smax z21.s, p2/M, z21.s, z23.s\n"
+ "uzp1 z31.h, z31.h, z20.h\n"
"smax z22.s, p2/M, z22.s, z23.s\n"
"smax z16.s, p2/M, z16.s, z23.s\n"
+ "uzp1 z20.h, z21.h, z22.h\n"
+ "uzp1 z31.b, z31.b, z20.b\n"
"smax z17.s, p2/M, z17.s, z23.s\n"
"smax z18.s, p2/M, z18.s, z23.s\n"
+ "uzp1 z16.h, z16.h, z17.h\n"
+ "st1b { z31.b }, p1, [x27]\n"
"smax z19.s, p2/M, z19.s, z23.s\n"
- "uzp1 z31.h, z31.h, z20.h\n"
"smax z24.s, p2/M, z24.s, z23.s\n"
+ "uzp1 z17.h, z18.h, z19.h\n"
+ "uzp1 z16.b, z16.b, z17.b\n"
"smax z25.s, p2/M, z25.s, z23.s\n"
- "uzp1 z20.h, z21.h, z22.h\n"
"smax z26.s, p2/M, z26.s, z23.s\n"
- "smax z27.s, p2/M, z27.s, z23.s\n"
- "uzp1 z16.h, z16.h, z17.h\n"
- "uzp1 z18.h, z18.h, z19.h\n"
"uzp1 z24.h, z24.h, z25.h\n"
- "uzp1 z31.b, z31.b, z20.b\n"
- "uzp1 z17.h, z26.h, z27.h\n"
- "uzp1 z16.b, z16.b, z18.b\n"
- "st1b { z31.b }, p1, [x27]\n"
- "addvl x27, x27, #1\n"
- "uzp1 z24.b, z24.b, z17.b\n"
"st1b { z16.b }, p1, [x23]\n"
+ "smax z27.s, p2/M, z27.s, z23.s\n"
+ "uzp1 z16.h, z26.h, z27.h\n"
+ "uzp1 z24.b, z24.b, z16.b\n"
"st1b { z24.b }, p1, [x22]\n"
+ "addvl x27, x27, #1\n"
"42:" // Height 3: Writeback done
"decw x9, ALL, MUL #4\n"
"cmp x9, XZR\n"
@@ -956,28 +956,27 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"b 58f\n"
"43:" // Height 4
"ldr x21, [%x[args_ptr], %[offsetof_output_offset]]\n"
- "ldr x27, [%x[args_ptr], %[offsetof_output_ptr]]\n"
"mov x20, #0x4\n"
"mov x10, %x[col_bias]\n"
"mov z11.s, #0x0\n"
"mov z12.s, #0x0\n"
+ "mov z13.s, #0x0\n"
"bic %x[flags], %x[flags], #0x80000000\n"
"ldr x9, [%x[args_ptr], %[offsetof_N]]\n"
- "mov z13.s, #0x0\n"
"mov z14.s, #0x0\n"
- "ldr x28, [%x[args_ptr], %[offsetof_B_ptr]]\n"
- "madd x20, x21, x20, x27\n"
"mov z15.b, #0x1\n"
- "str x20, [%x[args_ptr], %[offsetof_output_ptr]]\n"
+ "ldr x28, [%x[args_ptr], %[offsetof_B_ptr]]\n"
+ "mov x27, %x[output_ptr]\n"
+ "madd %x[output_ptr], x21, x20, %x[output_ptr]\n"
"44:" // Height 4: Column loop
"mov x20, #0x0\n"
+ "whilelt p1.b, x20, x9\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"
- "whilelt p1.b, x20, x9\n"
"mov z22.s, #0x0\n"
"mov z23.s, #0x0\n"
"mov z24.s, #0x0\n"
@@ -992,8 +991,8 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"mov x26, #0x0\n"
"46:" // Height 4: String loop
"ldr x20, [%x[args_ptr], %[offsetof_string_lengths]]\n"
- "ldr x21, [%x[args_ptr], %[offsetof_input_offset]]\n"
"ldr w25, [x20, x26, LSL #0x2]\n"
+ "ldr x21, [%x[args_ptr], %[offsetof_input_offset]]\n"
"tbz %x[flags], #3, 47f\n"
"ldr x20, [%x[input_ptr], x26, LSL #0x3]\n"
"add x20, x20, x21, LSL #3\n"
@@ -1018,56 +1017,56 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"ble 51f\n"
"49:" // Height 4: Multiply loop: Main loop head
"whilelt p0.b, XZR, x25\n"
- "ld1b { z5.b }, p2/Z, [x28]\n"
- "ld1b { z4.b }, p2/Z, [x28, #1, MUL VL]\n"
- "ld1b { z7.b }, p2/Z, [x28, #2, MUL VL]\n"
- "ld1b { z9.b }, p2/Z, [x28, #3, MUL VL]\n"
- "ld1b { z8.b }, p2/Z, [x28, #4, MUL VL]\n"
- "ld1b { z10.b }, p2/Z, [x28, #5, MUL VL]\n"
"ld1rqb { z1.b }, p0/Z, [x24]\n"
"ld1rqb { z2.b }, p0/Z, [x23]\n"
- "add x24, x24, #0x10\n"
- "add x23, x23, #0x10\n"
- "ld1rqb { z3.b }, p0/Z, [x22]\n"
- "ld1rqb { z6.b }, p0/Z, [x21]\n"
- "add x22, x22, #0x10\n"
- "add x21, x21, #0x10\n"
"trn1 z0.d, z1.d, z2.d\n"
+ "ld1rqb { z3.b }, p0/Z, [x22]\n"
+ "ld1rqb { z5.b }, p0/Z, [x21]\n"
"trn2 z1.d, z1.d, z2.d\n"
- "trn1 z2.d, z3.d, z6.d\n"
- "trn2 z3.d, z3.d, z6.d\n"
- "ld1b { z6.b }, p2/Z, [x28, #6, MUL VL]\n"
- ".inst 0x45059810 // smmla z16.s, z0.b, z5.b\n"
+ "trn1 z2.d, z3.d, z5.d\n"
+ "ld1b { z4.b }, p2/Z, [x28]\n"
+ "trn2 z3.d, z3.d, z5.d\n"
+ ".inst 0x45049810 // smmla z16.s, z0.b, z4.b\n"
+ ".inst 0x45049858 // smmla z24.s, z2.b, z4.b\n"
+ "ld1b { z4.b }, p2/Z, [x28, #1, MUL VL]\n"
+ "ld1b { z5.b }, p2/Z, [x28, #2, MUL VL]\n"
".inst 0x45049814 // smmla z20.s, z0.b, z4.b\n"
- ".inst 0x45079811 // smmla z17.s, z0.b, z7.b\n"
- ".inst 0x45099815 // smmla z21.s, z0.b, z9.b\n"
- ".inst 0x45089812 // smmla z18.s, z0.b, z8.b\n"
- ".inst 0x45059858 // smmla z24.s, z2.b, z5.b\n"
+ ".inst 0x4504985c // smmla z28.s, z2.b, z4.b\n"
+ "ld1b { z4.b }, p2/Z, [x28, #3, MUL VL]\n"
+ "ld1b { z8.b }, p2/Z, [x28, #4, MUL VL]\n"
+ ".inst 0x45059811 // smmla z17.s, z0.b, z5.b\n"
+ ".inst 0x45059859 // smmla z25.s, z2.b, z5.b\n"
+ "ld1b { z7.b }, p2/Z, [x28, #5, MUL VL]\n"
+ "ld1b { z6.b }, p2/Z, [x28, #6, MUL VL]\n"
+ ".inst 0x45049815 // smmla z21.s, z0.b, z4.b\n"
+ ".inst 0x4504985d // smmla z29.s, z2.b, z4.b\n"
"ld1b { z5.b }, p2/Z, [x28, #7, MUL VL]\n"
"addvl x28, x28, #16\n"
- ".inst 0x4504985c // smmla z28.s, z2.b, z4.b\n"
- ".inst 0x45079859 // smmla z25.s, z2.b, z7.b\n"
- ".inst 0x4509985d // smmla z29.s, z2.b, z9.b\n"
- ".inst 0x4508985a // smmla z26.s, z2.b, z8.b\n"
- ".inst 0x450a9816 // smmla z22.s, z0.b, z10.b\n"
"ld1b { z4.b }, p2/Z, [x28, #-8, MUL VL]\n"
- ".inst 0x450a985e // smmla z30.s, z2.b, z10.b\n"
- ".inst 0x45069813 // smmla z19.s, z0.b, z6.b\n"
+ ".inst 0x45089812 // smmla z18.s, z0.b, z8.b\n"
+ ".inst 0x4508985a // smmla z26.s, z2.b, z8.b\n"
+ ".inst 0x45079816 // smmla z22.s, z0.b, z7.b\n"
"ld1b { z10.b }, p2/Z, [x28, #-7, MUL VL]\n"
"ld1b { z9.b }, p2/Z, [x28, #-6, MUL VL]\n"
- ".inst 0x4506985b // smmla z27.s, z2.b, z6.b\n"
- ".inst 0x45059817 // smmla z23.s, z0.b, z5.b\n"
+ ".inst 0x4507985e // smmla z30.s, z2.b, z7.b\n"
+ ".inst 0x45069813 // smmla z19.s, z0.b, z6.b\n"
"ld1b { z8.b }, p2/Z, [x28, #-5, MUL VL]\n"
"ld1b { z7.b }, p2/Z, [x28, #-4, MUL VL]\n"
+ ".inst 0x4506985b // smmla z27.s, z2.b, z6.b\n"
+ ".inst 0x45059817 // smmla z23.s, z0.b, z5.b\n"
+ "ld1b { z6.b }, p2/Z, [x28, #-3, MUL VL]\n"
+ "add x24, x24, #0x10\n"
".inst 0x4505985f // smmla z31.s, z2.b, z5.b\n"
".inst 0x45049830 // smmla z16.s, z1.b, z4.b\n"
- "ld1b { z6.b }, p2/Z, [x28, #-3, MUL VL]\n"
"ld1b { z5.b }, p2/Z, [x28, #-2, MUL VL]\n"
+ "add x23, x23, #0x10\n"
".inst 0x45049878 // smmla z24.s, z3.b, z4.b\n"
"ld1b { z4.b }, p2/Z, [x28, #-1, MUL VL]\n"
".inst 0x450a9834 // smmla z20.s, z1.b, z10.b\n"
+ "add x22, x22, #0x10\n"
".inst 0x450a987c // smmla z28.s, z3.b, z10.b\n"
".inst 0x45099831 // smmla z17.s, z1.b, z9.b\n"
+ "add x21, x21, #0x10\n"
".inst 0x45099879 // smmla z25.s, z3.b, z9.b\n"
".inst 0x45089835 // smmla z21.s, z1.b, z8.b\n"
".inst 0x4508987d // smmla z29.s, z3.b, z8.b\n"
@@ -1090,60 +1089,60 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"bgt 49b\n"
"51:" // Height 4: Multiply loop: Single iteration only
"whilelt p0.b, XZR, x25\n"
- "ld1b { z6.b }, p2/Z, [x28]\n"
- "ld1b { z4.b }, p2/Z, [x28, #1, MUL VL]\n"
- "subs x25, x25, #0x8\n"
- "ld1b { z7.b }, p2/Z, [x28, #2, MUL VL]\n"
- "ld1b { z9.b }, p2/Z, [x28, #3, MUL VL]\n"
- "ld1b { z8.b }, p2/Z, [x28, #4, MUL VL]\n"
- "ld1b { z10.b }, p2/Z, [x28, #5, MUL VL]\n"
"ld1rqb { z1.b }, p0/Z, [x24]\n"
"ld1rqb { z2.b }, p0/Z, [x23]\n"
+ "trn1 z0.d, z1.d, z2.d\n"
"ld1rqb { z3.b }, p0/Z, [x22]\n"
"ld1rqb { z5.b }, p0/Z, [x21]\n"
- "trn1 z0.d, z1.d, z2.d\n"
"trn2 z1.d, z1.d, z2.d\n"
"trn1 z2.d, z3.d, z5.d\n"
+ "ld1b { z4.b }, p2/Z, [x28]\n"
"trn2 z3.d, z3.d, z5.d\n"
+ ".inst 0x45049810 // smmla z16.s, z0.b, z4.b\n"
+ ".inst 0x45049858 // smmla z24.s, z2.b, z4.b\n"
+ "ld1b { z5.b }, p2/Z, [x28, #1, MUL VL]\n"
+ "ld1b { z4.b }, p2/Z, [x28, #2, MUL VL]\n"
+ "subs x25, x25, #0x8\n"
+ ".inst 0x45059814 // smmla z20.s, z0.b, z5.b\n"
+ "ld1b { z8.b }, p2/Z, [x28, #3, MUL VL]\n"
+ "ld1b { z7.b }, p2/Z, [x28, #4, MUL VL]\n"
+ ".inst 0x4505985c // smmla z28.s, z2.b, z5.b\n"
+ ".inst 0x45049811 // smmla z17.s, z0.b, z4.b\n"
+ "ld1b { z6.b }, p2/Z, [x28, #5, MUL VL]\n"
"ld1b { z5.b }, p2/Z, [x28, #6, MUL VL]\n"
- ".inst 0x45069810 // smmla z16.s, z0.b, z6.b\n"
- ".inst 0x45049814 // smmla z20.s, z0.b, z4.b\n"
- ".inst 0x45079811 // smmla z17.s, z0.b, z7.b\n"
- ".inst 0x45099815 // smmla z21.s, z0.b, z9.b\n"
- ".inst 0x45089812 // smmla z18.s, z0.b, z8.b\n"
- ".inst 0x45069858 // smmla z24.s, z2.b, z6.b\n"
- "ld1b { z6.b }, p2/Z, [x28, #7, MUL VL]\n"
- ".inst 0x4504985c // smmla z28.s, z2.b, z4.b\n"
+ ".inst 0x45049859 // smmla z25.s, z2.b, z4.b\n"
+ ".inst 0x45089815 // smmla z21.s, z0.b, z8.b\n"
+ "ld1b { z4.b }, p2/Z, [x28, #7, MUL VL]\n"
+ ".inst 0x4508985d // smmla z29.s, z2.b, z8.b\n"
+ ".inst 0x45079812 // smmla z18.s, z0.b, z7.b\n"
"addvl x28, x28, #8\n"
- ".inst 0x45079859 // smmla z25.s, z2.b, z7.b\n"
- ".inst 0x4509985d // smmla z29.s, z2.b, z9.b\n"
- ".inst 0x4508985a // smmla z26.s, z2.b, z8.b\n"
- ".inst 0x450a9816 // smmla z22.s, z0.b, z10.b\n"
- ".inst 0x450a985e // smmla z30.s, z2.b, z10.b\n"
+ ".inst 0x4507985a // smmla z26.s, z2.b, z7.b\n"
+ ".inst 0x45069816 // smmla z22.s, z0.b, z6.b\n"
+ ".inst 0x4506985e // smmla z30.s, z2.b, z6.b\n"
".inst 0x45059813 // smmla z19.s, z0.b, z5.b\n"
".inst 0x4505985b // smmla z27.s, z2.b, z5.b\n"
- ".inst 0x45069817 // smmla z23.s, z0.b, z6.b\n"
- ".inst 0x4506985f // smmla z31.s, z2.b, z6.b\n"
+ ".inst 0x45049817 // smmla z23.s, z0.b, z4.b\n"
+ ".inst 0x4504985f // smmla z31.s, z2.b, z4.b\n"
"ble 52f\n"
"ld1b { z4.b }, p2/Z, [x28]\n"
- "ld1b { z10.b }, p2/Z, [x28, #1, MUL VL]\n"
- "ld1b { z9.b }, p2/Z, [x28, #2, MUL VL]\n"
+ ".inst 0x45049830 // smmla z16.s, z1.b, z4.b\n"
+ ".inst 0x45049878 // smmla z24.s, z3.b, z4.b\n"
+ "ld1b { z5.b }, p2/Z, [x28, #1, MUL VL]\n"
+ "ld1b { z4.b }, p2/Z, [x28, #2, MUL VL]\n"
"ld1b { z8.b }, p2/Z, [x28, #3, MUL VL]\n"
+ ".inst 0x45059834 // smmla z20.s, z1.b, z5.b\n"
+ ".inst 0x4505987c // smmla z28.s, z3.b, z5.b\n"
"ld1b { z7.b }, p2/Z, [x28, #4, MUL VL]\n"
"ld1b { z6.b }, p2/Z, [x28, #5, MUL VL]\n"
- ".inst 0x45049830 // smmla z16.s, z1.b, z4.b\n"
- ".inst 0x45049878 // smmla z24.s, z3.b, z4.b\n"
+ ".inst 0x45049831 // smmla z17.s, z1.b, z4.b\n"
+ ".inst 0x45049879 // smmla z25.s, z3.b, z4.b\n"
"ld1b { z5.b }, p2/Z, [x28, #6, MUL VL]\n"
"ld1b { z4.b }, p2/Z, [x28, #7, MUL VL]\n"
- ".inst 0x450a9834 // smmla z20.s, z1.b, z10.b\n"
- ".inst 0x450a987c // smmla z28.s, z3.b, z10.b\n"
- ".inst 0x45099831 // smmla z17.s, z1.b, z9.b\n"
- ".inst 0x45099879 // smmla z25.s, z3.b, z9.b\n"
- "addvl x28, x28, #8\n"
".inst 0x45089835 // smmla z21.s, z1.b, z8.b\n"
".inst 0x4508987d // smmla z29.s, z3.b, z8.b\n"
".inst 0x45079832 // smmla z18.s, z1.b, z7.b\n"
".inst 0x4507987a // smmla z26.s, z3.b, z7.b\n"
+ "addvl x28, x28, #8\n"
".inst 0x45069836 // smmla z22.s, z1.b, z6.b\n"
".inst 0x4506987e // smmla z30.s, z3.b, z6.b\n"
".inst 0x45059833 // smmla z19.s, z1.b, z5.b\n"
@@ -1163,16 +1162,16 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"bne 46b\n"
"ldr x20, [%x[args_ptr], %[offsetof_output_offset]]\n"
"uzp1 z0.d, z16.d, z20.d\n"
+ "add x23, x27, x20\n"
+ "add x22, x23, x20\n"
"uzp2 z16.d, z16.d, z20.d\n"
"uzp1 z20.d, z17.d, z21.d\n"
+ "add x21, x22, x20\n"
"uzp2 z17.d, z17.d, z21.d\n"
"uzp1 z21.d, z18.d, z22.d\n"
"uzp2 z18.d, z18.d, z22.d\n"
- "add x23, x27, x20\n"
- "add x22, x23, x20\n"
"uzp1 z22.d, z19.d, z23.d\n"
"uzp2 z19.d, z19.d, z23.d\n"
- "add x21, x22, x20\n"
"uzp1 z23.d, z24.d, z28.d\n"
"uzp2 z24.d, z24.d, z28.d\n"
"uzp1 z28.d, z25.d, z29.d\n"
@@ -1184,15 +1183,15 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"mov z31.d, z0.d\n"
"tbnz %x[flags], #31, 54f\n"
"add x20, %x[qp], %[b_offset]\n"
+ "ld1rw { z0.s }, p2/Z, [x20]\n"
".inst 0x4491a96b // addp z11.s, p2/m, z11.s, z11.s\n"
".inst 0x4491a9ad // addp z13.s, p2/m, z13.s, z13.s\n"
- "ld1rw { z0.s }, p2/Z, [x20]\n"
"neg z0.s, p2/M, z0.s\n"
"mov z12.s, z11.s[3]\n"
"mov z11.s, z11.s[0]\n"
+ "mul z11.s, p2/M, z11.s, z0.s\n"
"mov z14.s, z13.s[3]\n"
"mov z13.s, z13.s[0]\n"
- "mul z11.s, p2/M, z11.s, z0.s\n"
"mul z12.s, p2/M, z12.s, z0.s\n"
"mul z13.s, p2/M, z13.s, z0.s\n"
"mul z14.s, p2/M, z14.s, z0.s\n"
@@ -1258,32 +1257,32 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"tbz %x[flags], #5, 55f\n"
"and z2.d, z31.d, z0.d\n"
"and z1.d, z20.d, z0.d\n"
+ "asr z2.s, z2.s, #0x1f\n"
+ "asr z1.s, z1.s, #0x1f\n"
+ "sqadd z31.s, z31.s, z2.s\n"
+ "sqadd z20.s, z20.s, z1.s\n"
"and z7.d, z21.d, z0.d\n"
"and z6.d, z22.d, z0.d\n"
"and z5.d, z16.d, z0.d\n"
"and z4.d, z17.d, z0.d\n"
- "asr z2.s, z2.s, #0x1f\n"
- "asr z1.s, z1.s, #0x1f\n"
"and z3.d, z18.d, z0.d\n"
+ "and z2.d, z19.d, z0.d\n"
+ "and z1.d, z23.d, z0.d\n"
"asr z7.s, z7.s, #0x1f\n"
"asr z6.s, z6.s, #0x1f\n"
"asr z5.s, z5.s, #0x1f\n"
- "sqadd z31.s, z31.s, z2.s\n"
- "sqadd z20.s, z20.s, z1.s\n"
- "and z2.d, z19.d, z0.d\n"
- "and z1.d, z23.d, z0.d\n"
"asr z4.s, z4.s, #0x1f\n"
"asr z3.s, z3.s, #0x1f\n"
- "sqadd z21.s, z21.s, z7.s\n"
- "sqadd z22.s, z22.s, z6.s\n"
"asr z2.s, z2.s, #0x1f\n"
"asr z1.s, z1.s, #0x1f\n"
+ "sqadd z21.s, z21.s, z7.s\n"
+ "sqadd z22.s, z22.s, z6.s\n"
"sqadd z16.s, z16.s, z5.s\n"
"sqadd z17.s, z17.s, z4.s\n"
"sqadd z18.s, z18.s, z3.s\n"
- "and z7.d, z28.d, z0.d\n"
"sqadd z19.s, z19.s, z2.s\n"
"sqadd z23.s, z23.s, z1.s\n"
+ "and z7.d, z28.d, z0.d\n"
"and z6.d, z29.d, z0.d\n"
"and z5.d, z30.d, z0.d\n"
"and z4.d, z24.d, z0.d\n"
@@ -1306,43 +1305,43 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"sqadd z27.s, z27.s, z1.s\n"
"55:" // Height 4: no shift correction
"add x20, %x[qp], %[c_offset]\n"
- ".inst 0x4482881f // srshl z31.s, p2/M, z31.s, z0.s\n"
"ld1rw { z2.s }, p2/Z, [x20]\n"
+ ".inst 0x4482881f // srshl z31.s, p2/M, z31.s, z0.s\n"
+ "add z31.s, z31.s, z2.s\n"
".inst 0x44828814 // srshl z20.s, p2/M, z20.s, z0.s\n"
".inst 0x44828815 // srshl z21.s, p2/M, z21.s, z0.s\n"
+ "add z20.s, z20.s, z2.s\n"
+ "add z21.s, z21.s, z2.s\n"
".inst 0x44828816 // srshl z22.s, p2/M, z22.s, z0.s\n"
".inst 0x44828810 // srshl z16.s, p2/M, z16.s, z0.s\n"
+ "add z22.s, z22.s, z2.s\n"
+ "add z16.s, z16.s, z2.s\n"
".inst 0x44828811 // srshl z17.s, p2/M, z17.s, z0.s\n"
".inst 0x44828812 // srshl z18.s, p2/M, z18.s, z0.s\n"
- "add z31.s, z31.s, z2.s\n"
+ "add z17.s, z17.s, z2.s\n"
+ "add z18.s, z18.s, z2.s\n"
".inst 0x44828813 // srshl z19.s, p2/M, z19.s, z0.s\n"
".inst 0x44828817 // srshl z23.s, p2/M, z23.s, z0.s\n"
- "add z20.s, z20.s, z2.s\n"
- "add z21.s, z21.s, z2.s\n"
+ "add z19.s, z19.s, z2.s\n"
+ "add z23.s, z23.s, z2.s\n"
".inst 0x4482881c // srshl z28.s, p2/M, z28.s, z0.s\n"
".inst 0x4482881d // srshl z29.s, p2/M, z29.s, z0.s\n"
- "add z22.s, z22.s, z2.s\n"
- "add z16.s, z16.s, z2.s\n"
+ "add z28.s, z28.s, z2.s\n"
+ "add z29.s, z29.s, z2.s\n"
".inst 0x4482881e // srshl z30.s, p2/M, z30.s, z0.s\n"
".inst 0x44828818 // srshl z24.s, p2/M, z24.s, z0.s\n"
- "add z17.s, z17.s, z2.s\n"
- "add z18.s, z18.s, z2.s\n"
+ "add z30.s, z30.s, z2.s\n"
+ "add z24.s, z24.s, z2.s\n"
".inst 0x44828819 // srshl z25.s, p2/M, z25.s, z0.s\n"
".inst 0x4482881a // srshl z26.s, p2/M, z26.s, z0.s\n"
- "add z19.s, z19.s, z2.s\n"
- "add z23.s, z23.s, z2.s\n"
+ "add z25.s, z25.s, z2.s\n"
+ "add z26.s, z26.s, z2.s\n"
".inst 0x4482881b // srshl z27.s, p2/M, z27.s, z0.s\n"
"add x20, %x[qp], %[maxval]\n"
- "add z28.s, z28.s, z2.s\n"
- "add z29.s, z29.s, z2.s\n"
"ld1rw { z1.s }, p2/Z, [x20]\n"
- "add z30.s, z30.s, z2.s\n"
- "add z24.s, z24.s, z2.s\n"
+ "add z27.s, z27.s, z2.s\n"
"add x20, %x[qp], %[minval]\n"
- "add z25.s, z25.s, z2.s\n"
- "add z26.s, z26.s, z2.s\n"
"ld1rw { z0.s }, p2/Z, [x20]\n"
- "add z27.s, z27.s, z2.s\n"
"smin z31.s, p2/M, z31.s, z1.s\n"
"smin z20.s, p2/M, z20.s, z1.s\n"
"smin z21.s, p2/M, z21.s, z1.s\n"
@@ -1362,36 +1361,36 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"smax z31.s, p2/M, z31.s, z0.s\n"
"smax z20.s, p2/M, z20.s, z0.s\n"
"smax z21.s, p2/M, z21.s, z0.s\n"
+ "uzp1 z31.h, z31.h, z20.h\n"
"smax z22.s, p2/M, z22.s, z0.s\n"
"smax z16.s, p2/M, z16.s, z0.s\n"
+ "uzp1 z20.h, z21.h, z22.h\n"
+ "uzp1 z31.b, z31.b, z20.b\n"
"smax z17.s, p2/M, z17.s, z0.s\n"
"smax z18.s, p2/M, z18.s, z0.s\n"
+ "uzp1 z16.h, z16.h, z17.h\n"
+ "st1b { z31.b }, p1, [x27]\n"
"smax z19.s, p2/M, z19.s, z0.s\n"
- "uzp1 z31.h, z31.h, z20.h\n"
"smax z23.s, p2/M, z23.s, z0.s\n"
+ "uzp1 z17.h, z18.h, z19.h\n"
+ "uzp1 z16.b, z16.b, z17.b\n"
"smax z28.s, p2/M, z28.s, z0.s\n"
- "uzp1 z20.h, z21.h, z22.h\n"
"smax z29.s, p2/M, z29.s, z0.s\n"
+ "uzp1 z23.h, z23.h, z28.h\n"
+ "st1b { z16.b }, p1, [x23]\n"
"smax z30.s, p2/M, z30.s, z0.s\n"
- "uzp1 z16.h, z16.h, z17.h\n"
"smax z24.s, p2/M, z24.s, z0.s\n"
+ "uzp1 z16.h, z29.h, z30.h\n"
+ "uzp1 z23.b, z23.b, z16.b\n"
"smax z25.s, p2/M, z25.s, z0.s\n"
- "uzp1 z17.h, z18.h, z19.h\n"
"smax z26.s, p2/M, z26.s, z0.s\n"
- "smax z27.s, p2/M, z27.s, z0.s\n"
- "uzp1 z23.h, z23.h, z28.h\n"
- "uzp1 z31.b, z31.b, z20.b\n"
- "uzp1 z18.h, z29.h, z30.h\n"
"uzp1 z24.h, z24.h, z25.h\n"
- "uzp1 z16.b, z16.b, z17.b\n"
- "uzp1 z17.h, z26.h, z27.h\n"
- "st1b { z31.b }, p1, [x27]\n"
- "addvl x27, x27, #1\n"
- "uzp1 z23.b, z23.b, z18.b\n"
- "uzp1 z24.b, z24.b, z17.b\n"
- "st1b { z16.b }, p1, [x23]\n"
"st1b { z23.b }, p1, [x22]\n"
+ "smax z27.s, p2/M, z27.s, z0.s\n"
+ "uzp1 z16.h, z26.h, z27.h\n"
+ "uzp1 z24.b, z24.b, z16.b\n"
"st1b { z24.b }, p1, [x21]\n"
+ "addvl x27, x27, #1\n"
"56:" // Height 4: Writeback done
"decw x9, ALL, MUL #4\n"
"cmp x9, XZR\n"
@@ -1408,8 +1407,8 @@ void sve_hybrid_s8qa_mmla_4x4VL (
"madd %x[input_ptr], x20, x21, %x[input_ptr]\n"
"b 1b\n"
"58:" // Exit
- : [M] "+&r" (M), [flags] "+&r" (flags), [input_ptr] "+&r" (input_ptr)
- : [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_output_ptr] "I" (offsetof(KernelArgs, output_ptr)), [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)
+ : [M] "+&r" (M), [flags] "+&r" (flags), [input_ptr] "+&r" (input_ptr), [output_ptr] "+&r" (output_ptr)
+ : [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)
: "cc", "memory", "p0", "p1", "p2", "x9", "x10", "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"
);
}