diff options
Diffstat (limited to 'src/core/NEON/kernels/arm_gemm/kernels/sve_hybrid_s8qa_dot_4x4VL/generic.cpp')
-rw-r--r-- | src/core/NEON/kernels/arm_gemm/kernels/sve_hybrid_s8qa_dot_4x4VL/generic.cpp | 1338 |
1 files changed, 647 insertions, 691 deletions
diff --git a/src/core/NEON/kernels/arm_gemm/kernels/sve_hybrid_s8qa_dot_4x4VL/generic.cpp b/src/core/NEON/kernels/arm_gemm/kernels/sve_hybrid_s8qa_dot_4x4VL/generic.cpp index 3c778bfe94..50b9ba524d 100644 --- a/src/core/NEON/kernels/arm_gemm/kernels/sve_hybrid_s8qa_dot_4x4VL/generic.cpp +++ b/src/core/NEON/kernels/arm_gemm/kernels/sve_hybrid_s8qa_dot_4x4VL/generic.cpp @@ -81,152 +81,143 @@ void sve_hybrid_s8qa_dot_4x4VL ( "ptrue p2.b\n" "1:" // Row loop "cmp %x[M], #0x4\n" - "bge 46f\n" + "bge 43f\n" "cmp %x[M], #0x2\n" - "bgt 31f\n" - "beq 16f\n" + "bgt 29f\n" + "beq 15f\n" "mov z11.s, #0x0\n" - "ldr x12, [%x[args_ptr], %[offsetof_N]]\n" - "mov z12.s, #0x0\n" - "ldr x11, [%x[args_ptr], %[offsetof_B_ptr]]\n" - "mov x10, %x[col_bias]\n" - "mov z13.s, #0x0\n" - "ldr x19, [%x[args_ptr], %[offsetof_output_offset]]\n" - "bic %x[flags], %x[flags], #0x80000000\n" - "mov z14.s, #0x0\n" + "ldr x9, [%x[args_ptr], %[offsetof_N]]\n" "mov z15.b, #0x1\n" - "tbz %x[flags], #2, 2f\n" - "ldr x9, [%x[output_ptr], #0x0]\n" - "add x9, x9, x19\n" - "b 3f\n" - "2:" // Height 1: setup direct output - "mov x9, %x[output_ptr]\n" - "3:" // Height 1: Column loop + "ldr x28, [%x[args_ptr], %[offsetof_B_ptr]]\n" + "mov x27, %x[col_bias]\n" + "bic %x[flags], %x[flags], #0x80000000\n" + "mov x26, %x[output_ptr]\n" + "2:" // Height 1: Column loop "mov z16.s, #0x0\n" "mov x19, #0x0\n" "mov z17.s, #0x0\n" - "whilelt p1.b, x19, x12\n" + "whilelt p1.b, x19, x9\n" "mov z18.s, #0x0\n" "mov z19.s, #0x0\n" - "4:" // Height 1: setup done - "mov x28, #0x0\n" - "5:" // Height 1: String loop + "3:" // Height 1: setup done + "mov x25, #0x0\n" + "4:" // Height 1: String loop "ldr x20, [%x[args_ptr], %[offsetof_string_lengths]]\n" "ldr x19, [%x[args_ptr], %[offsetof_input_offset]]\n" - "ldr w27, [x20, x28, LSL #0x2]\n" - "tbz %x[flags], #3, 6f\n" - "ldr x20, [%x[input_ptr], x28, LSL #0x3]\n" + "ldr w24, [x20, x25, LSL #0x2]\n" + "tbz %x[flags], #3, 5f\n" + "ldr x20, [%x[input_ptr], x25, LSL #0x3]\n" "add x20, x20, x19, LSL #3\n" - "ldr x26, [x20, #0x0]\n" - "cbnz x28, 7f\n" + "ldr x23, [x20, #0x0]\n" + "cbnz x25, 6f\n" "ldr x19, [%x[args_ptr], %[offsetof_input_initial_col]]\n" - "add x26, x26, x19\n" - "b 7f\n" - "6:" // Height 1: setup direct input - "mov x26, %x[input_ptr]\n" - "7:" // Height 1: input setup done - "cmp x27, #0x10\n" - "ble 10f\n" - "8:" // Height 1: Multiply loop: Main loop head - "ld1b { z4.b }, p2/Z, [x11]\n" - "whilelt p0.b, XZR, x27\n" - "ld1b { z5.b }, p2/Z, [x11, #1, MUL VL]\n" - "ld1rqb { z0.b }, p0/Z, [x26]\n" + "add x23, x23, x19\n" + "b 6f\n" + "5:" // Height 1: setup direct input + "mov x23, %x[input_ptr]\n" + "6:" // Height 1: input setup done + "cmp x24, #0x10\n" + "ble 9f\n" + "7:" // Height 1: Multiply loop: Main loop head + "ld1b { z4.b }, p2/Z, [x28]\n" + "whilelt p0.b, XZR, x24\n" + "ld1b { z5.b }, p2/Z, [x28, #1, MUL VL]\n" + "ld1rqb { z0.b }, p0/Z, [x23]\n" "sdot z16.s, z4.b, z0.b[0]\n" - "ld1b { z6.b }, p2/Z, [x11, #2, MUL VL]\n" - "add x26, x26, #0x10\n" + "ld1b { z6.b }, p2/Z, [x28, #2, MUL VL]\n" + "add x23, x23, #0x10\n" "sdot z17.s, z5.b, z0.b[0]\n" - "ld1b { z7.b }, p2/Z, [x11, #3, MUL VL]\n" - "ld1b { z8.b }, p2/Z, [x11, #4, MUL VL]\n" + "ld1b { z7.b }, p2/Z, [x28, #3, MUL VL]\n" + "ld1b { z8.b }, p2/Z, [x28, #4, MUL VL]\n" "sdot z18.s, z6.b, z0.b[0]\n" - "ld1b { z9.b }, p2/Z, [x11, #5, MUL VL]\n" - "ld1b { z10.b }, p2/Z, [x11, #6, MUL VL]\n" + "ld1b { z9.b }, p2/Z, [x28, #5, MUL VL]\n" + "ld1b { z10.b }, p2/Z, [x28, #6, MUL VL]\n" "sdot z19.s, z7.b, z0.b[0]\n" "sdot z16.s, z8.b, z0.b[1]\n" - "ld1b { z4.b }, p2/Z, [x11, #7, MUL VL]\n" - "addvl x11, x11, #16\n" + "ld1b { z4.b }, p2/Z, [x28, #7, MUL VL]\n" + "addvl x28, x28, #16\n" "sdot z17.s, z9.b, z0.b[1]\n" - "ld1b { z5.b }, p2/Z, [x11, #-8, MUL VL]\n" - "ld1b { z6.b }, p2/Z, [x11, #-7, MUL VL]\n" + "ld1b { z5.b }, p2/Z, [x28, #-8, MUL VL]\n" + "ld1b { z6.b }, p2/Z, [x28, #-7, MUL VL]\n" "sdot z18.s, z10.b, z0.b[1]\n" - "ld1b { z7.b }, p2/Z, [x11, #-6, MUL VL]\n" + "ld1b { z7.b }, p2/Z, [x28, #-6, MUL VL]\n" "sdot z19.s, z4.b, z0.b[1]\n" - "ld1b { z8.b }, p2/Z, [x11, #-5, MUL VL]\n" + "ld1b { z8.b }, p2/Z, [x28, #-5, MUL VL]\n" "sdot z16.s, z5.b, z0.b[2]\n" - "ld1b { z9.b }, p2/Z, [x11, #-4, MUL VL]\n" + "ld1b { z9.b }, p2/Z, [x28, #-4, MUL VL]\n" "sdot z17.s, z6.b, z0.b[2]\n" - "ld1b { z10.b }, p2/Z, [x11, #-3, MUL VL]\n" + "ld1b { z10.b }, p2/Z, [x28, #-3, MUL VL]\n" "sdot z18.s, z7.b, z0.b[2]\n" - "ld1b { z4.b }, p2/Z, [x11, #-2, MUL VL]\n" + "ld1b { z4.b }, p2/Z, [x28, #-2, MUL VL]\n" "sdot z19.s, z8.b, z0.b[2]\n" - "ld1b { z5.b }, p2/Z, [x11, #-1, MUL VL]\n" + "ld1b { z5.b }, p2/Z, [x28, #-1, MUL VL]\n" "sdot z16.s, z9.b, z0.b[3]\n" "sdot z17.s, z10.b, z0.b[3]\n" "sdot z18.s, z4.b, z0.b[3]\n" "sdot z19.s, z5.b, z0.b[3]\n" - "tbnz %x[flags], #31, 9f\n" + "tbnz %x[flags], #31, 8f\n" "sdot z11.s, z0.b, z15.b\n" - "9:" // Height 1: Multiply loop: unique 1: skip row sum - "prfm pldl1keep, [x26, #0x80]\n" - "sub x27, x27, #0x10\n" - "cmp x27, #0x10\n" - "bgt 8b\n" - "10:" // Height 1: Multiply loop: Single iteration only - "ld1b { z6.b }, p2/Z, [x11]\n" - "whilelt p0.b, XZR, x27\n" - "ld1b { z7.b }, p2/Z, [x11, #1, MUL VL]\n" - "subs x27, x27, #0x4\n" - "ld1rqb { z0.b }, p0/Z, [x26]\n" - "sdot z16.s, z6.b, z0.b[0]\n" - "ld1b { z8.b }, p2/Z, [x11, #2, MUL VL]\n" - "add x26, x26, #0x10\n" - "sdot z17.s, z7.b, z0.b[0]\n" - "ld1b { z9.b }, p2/Z, [x11, #3, MUL VL]\n" - "addvl x11, x11, #4\n" - "sdot z18.s, z8.b, z0.b[0]\n" - "sdot z19.s, z9.b, z0.b[0]\n" - "ble 11f\n" - "ld1b { z10.b }, p2/Z, [x11]\n" - "sdot z16.s, z10.b, z0.b[1]\n" - "ld1b { z4.b }, p2/Z, [x11, #1, MUL VL]\n" - "subs x27, x27, #0x4\n" - "sdot z17.s, z4.b, z0.b[1]\n" - "ld1b { z5.b }, p2/Z, [x11, #2, MUL VL]\n" - "ld1b { z6.b }, p2/Z, [x11, #3, MUL VL]\n" - "sdot z18.s, z5.b, z0.b[1]\n" - "addvl x11, x11, #4\n" - "sdot z19.s, z6.b, z0.b[1]\n" - "ble 11f\n" - "ld1b { z7.b }, p2/Z, [x11]\n" - "sdot z16.s, z7.b, z0.b[2]\n" - "ld1b { z8.b }, p2/Z, [x11, #1, MUL VL]\n" - "subs x27, x27, #0x4\n" - "sdot z17.s, z8.b, z0.b[2]\n" - "ld1b { z9.b }, p2/Z, [x11, #2, MUL VL]\n" - "ld1b { z10.b }, p2/Z, [x11, #3, MUL VL]\n" - "sdot z18.s, z9.b, z0.b[2]\n" - "addvl x11, x11, #4\n" - "sdot z19.s, z10.b, z0.b[2]\n" - "ble 11f\n" - "ld1b { z4.b }, p2/Z, [x11]\n" - "sdot z16.s, z4.b, z0.b[3]\n" - "ld1b { z5.b }, p2/Z, [x11, #1, MUL VL]\n" - "ld1b { z6.b }, p2/Z, [x11, #2, MUL VL]\n" - "sdot z17.s, z5.b, z0.b[3]\n" - "ld1b { z7.b }, p2/Z, [x11, #3, MUL VL]\n" - "addvl x11, x11, #4\n" - "sdot z18.s, z6.b, z0.b[3]\n" - "sdot z19.s, z7.b, z0.b[3]\n" - "11:" // Height 1: Multiply loop: multiply skip - "tbnz %x[flags], #31, 12f\n" + "8:" // Height 1: Multiply loop: unique 1: skip row sum + "prfm pldl1keep, [x23, #0x80]\n" + "sub x24, x24, #0x10\n" + "cmp x24, #0x10\n" + "bgt 7b\n" + "9:" // Height 1: Multiply loop: Single iteration only + "ld1b { z4.b }, p2/Z, [x28]\n" + "whilelt p0.b, XZR, x24\n" + "ld1b { z5.b }, p2/Z, [x28, #1, MUL VL]\n" + "subs x24, x24, #0x4\n" + "ld1rqb { z0.b }, p0/Z, [x23]\n" + "sdot z16.s, z4.b, z0.b[0]\n" + "ld1b { z6.b }, p2/Z, [x28, #2, MUL VL]\n" + "add x23, x23, #0x10\n" + "sdot z17.s, z5.b, z0.b[0]\n" + "ld1b { z7.b }, p2/Z, [x28, #3, MUL VL]\n" + "addvl x28, x28, #4\n" + "sdot z18.s, z6.b, z0.b[0]\n" + "sdot z19.s, z7.b, z0.b[0]\n" + "ble 10f\n" + "ld1b { z8.b }, p2/Z, [x28]\n" + "sdot z16.s, z8.b, z0.b[1]\n" + "ld1b { z9.b }, p2/Z, [x28, #1, MUL VL]\n" + "subs x24, x24, #0x4\n" + "sdot z17.s, z9.b, z0.b[1]\n" + "ld1b { z10.b }, p2/Z, [x28, #2, MUL VL]\n" + "ld1b { z4.b }, p2/Z, [x28, #3, MUL VL]\n" + "sdot z18.s, z10.b, z0.b[1]\n" + "addvl x28, x28, #4\n" + "sdot z19.s, z4.b, z0.b[1]\n" + "ble 10f\n" + "ld1b { z5.b }, p2/Z, [x28]\n" + "sdot z16.s, z5.b, z0.b[2]\n" + "ld1b { z6.b }, p2/Z, [x28, #1, MUL VL]\n" + "subs x24, x24, #0x4\n" + "sdot z17.s, z6.b, z0.b[2]\n" + "ld1b { z7.b }, p2/Z, [x28, #2, MUL VL]\n" + "ld1b { z8.b }, p2/Z, [x28, #3, MUL VL]\n" + "sdot z18.s, z7.b, z0.b[2]\n" + "addvl x28, x28, #4\n" + "sdot z19.s, z8.b, z0.b[2]\n" + "ble 10f\n" + "ld1b { z9.b }, p2/Z, [x28]\n" + "sdot z16.s, z9.b, z0.b[3]\n" + "ld1b { z10.b }, p2/Z, [x28, #1, MUL VL]\n" + "ld1b { z4.b }, p2/Z, [x28, #2, MUL VL]\n" + "sdot z17.s, z10.b, z0.b[3]\n" + "ld1b { z5.b }, p2/Z, [x28, #3, MUL VL]\n" + "addvl x28, x28, #4\n" + "sdot z18.s, z4.b, z0.b[3]\n" + "sdot z19.s, z5.b, z0.b[3]\n" + "10:" // Height 1: Multiply loop: multiply skip + "tbnz %x[flags], #31, 11f\n" "sdot z11.s, z0.b, z15.b\n" - "12:" // Height 1: Multiply loop: unique 2: skip row sum - "prfm pldl1keep, [x26, #0x80]\n" - "add x28, x28, #0x1\n" + "11:" // Height 1: Multiply loop: unique 2: skip row sum + "prfm pldl1keep, [x23, #0x80]\n" + "add x25, x25, #0x1\n" "ldr w19, [%x[args_ptr], %[offsetof_num_strings]]\n" - "cmp x28, x19\n" - "bne 5b\n" - "tbnz %x[flags], #31, 13f\n" + "cmp x25, x19\n" + "bne 4b\n" + "tbnz %x[flags], #31, 12f\n" "add x19, %x[qp], %[b_offset]\n" "ld1rw { z1.s }, p2/Z, [x19]\n" "neg z1.s, p2/M, z1.s\n" @@ -235,21 +226,21 @@ void sve_hybrid_s8qa_dot_4x4VL ( "saddv d11, p0, z11.s\n" "mov z11.s, z11.s[0]\n" "mul z11.s, p2/M, z11.s, z1.s\n" - "13:" // Height 1: skip row sum fixup + "12:" // Height 1: skip row sum fixup "add z16.s, z16.s, z11.s\n" - "ld1w { z0.s }, p2/Z, [x10]\n" + "ld1w { z0.s }, p2/Z, [x27]\n" "orr %x[flags], %x[flags], #0x80000000\n" "add z17.s, z17.s, z11.s\n" - "ld1w { z1.s }, p2/Z, [x10, #1, MUL VL]\n" - "add x20, %x[qp], %[per_layer_right_shift]\n" + "ld1w { z1.s }, p2/Z, [x27, #1, MUL VL]\n" + "add x23, %x[qp], %[per_layer_right_shift]\n" "add z18.s, z18.s, z11.s\n" - "ld1w { z2.s }, p2/Z, [x10, #2, MUL VL]\n" + "ld1w { z2.s }, p2/Z, [x27, #2, MUL VL]\n" "add x19, %x[qp], %[per_layer_mul]\n" "add z19.s, z19.s, z11.s\n" - "ld1w { z3.s }, p2/Z, [x10, #3, MUL VL]\n" - "addvl x10, x10, #4\n" + "ld1w { z3.s }, p2/Z, [x27, #3, MUL VL]\n" + "addvl x27, x27, #4\n" "add z16.s, z16.s, z0.s\n" - "ld1rw { z0.s }, p2/Z, [x20]\n" + "ld1rw { z0.s }, p2/Z, [x23]\n" "add z17.s, z17.s, z1.s\n" "ld1rw { z4.s }, p2/Z, [x19]\n" "add z18.s, z18.s, z2.s\n" @@ -258,7 +249,7 @@ void sve_hybrid_s8qa_dot_4x4VL ( ".inst 0x04a47631 // sqrdmulh z17.s, z17.s, z4.s\n" ".inst 0x04a47652 // sqrdmulh z18.s, z18.s, z4.s\n" ".inst 0x04a47673 // sqrdmulh z19.s, z19.s, z4.s\n" - "tbz %x[flags], #5, 14f\n" + "tbz %x[flags], #5, 13f\n" "and z4.d, z16.d, z0.d\n" "asr z4.s, z4.s, #0x1f\n" "and z5.d, z17.d, z0.d\n" @@ -271,7 +262,7 @@ void sve_hybrid_s8qa_dot_4x4VL ( "sqadd z17.s, z17.s, z5.s\n" "sqadd z18.s, z18.s, z6.s\n" "sqadd z19.s, z19.s, z7.s\n" - "14:" // Height 1: no shift correction + "13:" // Height 1: no shift correction ".inst 0x44828810 // srshl z16.s, p2/M, z16.s, z0.s\n" "add x19, %x[qp], %[c_offset]\n" "ld1rw { z4.s }, p2/Z, [x19]\n" @@ -297,107 +288,96 @@ void sve_hybrid_s8qa_dot_4x4VL ( "uzp1 z16.h, z16.h, z17.h\n" "uzp1 z17.h, z18.h, z19.h\n" "uzp1 z16.b, z16.b, z17.b\n" - "st1b { z16.b }, p1, [x9]\n" - "addvl x9, x9, #1\n" - "15:" // Height 1: Writeback done - "decw x12, ALL, MUL #4\n" - "cmp x12, XZR\n" - "bgt 3b\n" - "b 62f\n" - "16:" // Height 2 + "st1b { z16.b }, p1, [x26]\n" + "addvl x26, x26, #1\n" + "14:" // Height 1: Writeback done + "decw x9, ALL, MUL #4\n" + "cmp x9, XZR\n" + "bgt 2b\n" + "b 58f\n" + "15:" // Height 2 "mov z11.s, #0x0\n" - "ldr x12, [%x[args_ptr], %[offsetof_N]]\n" - "mov x10, %x[col_bias]\n" + "ldr x9, [%x[args_ptr], %[offsetof_N]]\n" + "mov x27, %x[col_bias]\n" "mov z12.s, #0x0\n" - "ldr x11, [%x[args_ptr], %[offsetof_B_ptr]]\n" + "ldr x28, [%x[args_ptr], %[offsetof_B_ptr]]\n" "bic %x[flags], %x[flags], #0x80000000\n" - "mov z13.s, #0x0\n" - "ldr x19, [%x[args_ptr], %[offsetof_output_offset]]\n" - "mov z14.s, #0x0\n" "mov z15.b, #0x1\n" - "tbz %x[flags], #2, 17f\n" - "ldr x9, [%x[output_ptr], #0x0]\n" - "ldr x25, [%x[output_ptr], #0x8]\n" - "add x9, x9, x19\n" - "add x25, x25, x19\n" - "b 18f\n" - "17:" // Height 2: setup direct output - "mov x9, %x[output_ptr]\n" - "add x25, x9, x19\n" - "18:" // Height 2: Column loop + "mov x26, %x[output_ptr]\n" + "16:" // Height 2: Column loop "mov z16.s, #0x0\n" "mov x19, #0x0\n" "mov z17.s, #0x0\n" - "whilelt p1.b, x19, x12\n" + "whilelt p1.b, x19, x9\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" - "19:" // Height 2: setup done - "mov x28, #0x0\n" - "20:" // Height 2: String loop + "17:" // Height 2: setup done + "mov x25, #0x0\n" + "18:" // Height 2: String loop "ldr x20, [%x[args_ptr], %[offsetof_string_lengths]]\n" "ldr x19, [%x[args_ptr], %[offsetof_input_offset]]\n" - "ldr w27, [x20, x28, LSL #0x2]\n" - "tbz %x[flags], #3, 21f\n" - "ldr x20, [%x[input_ptr], x28, LSL #0x3]\n" + "ldr w24, [x20, x25, LSL #0x2]\n" + "tbz %x[flags], #3, 19f\n" + "ldr x20, [%x[input_ptr], x25, LSL #0x3]\n" "add x20, x20, x19, LSL #3\n" - "ldr x26, [x20, #0x0]\n" - "ldr x24, [x20, #0x8]\n" - "cbnz x28, 22f\n" + "ldr x23, [x20, #0x0]\n" + "ldr x22, [x20, #0x8]\n" + "cbnz x25, 20f\n" "ldr x19, [%x[args_ptr], %[offsetof_input_initial_col]]\n" - "add x26, x26, x19\n" - "add x24, x24, x19\n" - "b 22f\n" - "21:" // Height 2: setup direct input - "mov x26, %x[input_ptr]\n" - "add x24, x26, x19\n" - "22:" // Height 2: input setup done - "cmp x27, #0x10\n" - "ble 25f\n" - "23:" // Height 2: Multiply loop: Main loop head - "ld1b { z4.b }, p2/Z, [x11]\n" - "whilelt p0.b, XZR, x27\n" - "ld1b { z5.b }, p2/Z, [x11, #1, MUL VL]\n" - "ld1rqb { z0.b }, p0/Z, [x26]\n" + "add x23, x23, x19\n" + "add x22, x22, x19\n" + "b 20f\n" + "19:" // Height 2: setup direct input + "mov x23, %x[input_ptr]\n" + "add x22, x23, x19\n" + "20:" // Height 2: input setup done + "cmp x24, #0x10\n" + "ble 23f\n" + "21:" // Height 2: Multiply loop: Main loop head + "ld1b { z4.b }, p2/Z, [x28]\n" + "whilelt p0.b, XZR, x24\n" + "ld1b { z5.b }, p2/Z, [x28, #1, MUL VL]\n" + "ld1rqb { z0.b }, p0/Z, [x23]\n" "sdot z16.s, z4.b, z0.b[0]\n" - "ld1rqb { z1.b }, p0/Z, [x24]\n" - "add x26, x26, #0x10\n" + "ld1rqb { z1.b }, p0/Z, [x22]\n" + "add x23, x23, #0x10\n" "sdot z17.s, z5.b, z0.b[0]\n" - "ld1b { z6.b }, p2/Z, [x11, #2, MUL VL]\n" - "add x24, x24, #0x10\n" + "ld1b { z6.b }, p2/Z, [x28, #2, MUL VL]\n" + "add x22, x22, #0x10\n" "sdot z20.s, z4.b, z1.b[0]\n" - "ld1b { z7.b }, p2/Z, [x11, #3, MUL VL]\n" + "ld1b { z7.b }, p2/Z, [x28, #3, MUL VL]\n" "sdot z21.s, z5.b, z1.b[0]\n" - "ld1b { z8.b }, p2/Z, [x11, #4, MUL VL]\n" + "ld1b { z8.b }, p2/Z, [x28, #4, MUL VL]\n" "sdot z18.s, z6.b, z0.b[0]\n" - "ld1b { z9.b }, p2/Z, [x11, #5, MUL VL]\n" + "ld1b { z9.b }, p2/Z, [x28, #5, MUL VL]\n" "sdot z22.s, z6.b, z1.b[0]\n" - "ld1b { z10.b }, p2/Z, [x11, #6, MUL VL]\n" + "ld1b { z10.b }, p2/Z, [x28, #6, MUL VL]\n" "sdot z19.s, z7.b, z0.b[0]\n" - "ld1b { z4.b }, p2/Z, [x11, #7, MUL VL]\n" - "addvl x11, x11, #16\n" + "ld1b { z4.b }, p2/Z, [x28, #7, MUL VL]\n" + "addvl x28, x28, #16\n" "sdot z23.s, z7.b, z1.b[0]\n" - "ld1b { z5.b }, p2/Z, [x11, #-8, MUL VL]\n" + "ld1b { z5.b }, p2/Z, [x28, #-8, MUL VL]\n" "sdot z16.s, z8.b, z0.b[1]\n" - "ld1b { z6.b }, p2/Z, [x11, #-7, MUL VL]\n" + "ld1b { z6.b }, p2/Z, [x28, #-7, MUL VL]\n" "sdot z20.s, z8.b, z1.b[1]\n" - "ld1b { z7.b }, p2/Z, [x11, #-6, MUL VL]\n" + "ld1b { z7.b }, p2/Z, [x28, #-6, MUL VL]\n" "sdot z17.s, z9.b, z0.b[1]\n" - "ld1b { z8.b }, p2/Z, [x11, #-5, MUL VL]\n" + "ld1b { z8.b }, p2/Z, [x28, #-5, MUL VL]\n" "sdot z21.s, z9.b, z1.b[1]\n" - "ld1b { z9.b }, p2/Z, [x11, #-4, MUL VL]\n" + "ld1b { z9.b }, p2/Z, [x28, #-4, MUL VL]\n" "sdot z18.s, z10.b, z0.b[1]\n" "sdot z22.s, z10.b, z1.b[1]\n" - "ld1b { z10.b }, p2/Z, [x11, #-3, MUL VL]\n" + "ld1b { z10.b }, p2/Z, [x28, #-3, MUL VL]\n" "sdot z19.s, z4.b, z0.b[1]\n" "sdot z23.s, z4.b, z1.b[1]\n" - "ld1b { z4.b }, p2/Z, [x11, #-2, MUL VL]\n" + "ld1b { z4.b }, p2/Z, [x28, #-2, MUL VL]\n" "sdot z16.s, z5.b, z0.b[2]\n" "sdot z20.s, z5.b, z1.b[2]\n" - "ld1b { z5.b }, p2/Z, [x11, #-1, MUL VL]\n" + "ld1b { z5.b }, p2/Z, [x28, #-1, MUL VL]\n" "sdot z17.s, z6.b, z0.b[2]\n" "sdot z21.s, z6.b, z1.b[2]\n" "sdot z18.s, z7.b, z0.b[2]\n" @@ -412,91 +392,93 @@ void sve_hybrid_s8qa_dot_4x4VL ( "sdot z22.s, z4.b, z1.b[3]\n" "sdot z19.s, z5.b, z0.b[3]\n" "sdot z23.s, z5.b, z1.b[3]\n" - "tbnz %x[flags], #31, 24f\n" + "tbnz %x[flags], #31, 22f\n" "sdot z11.s, z0.b, z15.b\n" "sdot z12.s, z1.b, z15.b\n" - "24:" // Height 2: Multiply loop: unique 3: skip row sum - "prfm pldl1keep, [x26, #0x80]\n" - "sub x27, x27, #0x10\n" - "prfm pldl1keep, [x24, #0x80]\n" - "cmp x27, #0x10\n" - "bgt 23b\n" - "25:" // Height 2: Multiply loop: Single iteration only - "ld1b { z6.b }, p2/Z, [x11]\n" - "whilelt p0.b, XZR, x27\n" - "ld1b { z7.b }, p2/Z, [x11, #1, MUL VL]\n" - "subs x27, x27, #0x4\n" - "ld1rqb { z0.b }, p0/Z, [x26]\n" - "sdot z16.s, z6.b, z0.b[0]\n" - "ld1rqb { z1.b }, p0/Z, [x24]\n" - "add x26, x26, #0x10\n" - "sdot z17.s, z7.b, z0.b[0]\n" - "ld1b { z8.b }, p2/Z, [x11, #2, MUL VL]\n" - "add x24, x24, #0x10\n" - "sdot z20.s, z6.b, z1.b[0]\n" - "ld1b { z9.b }, p2/Z, [x11, #3, MUL VL]\n" - "addvl x11, x11, #4\n" - "sdot z21.s, z7.b, z1.b[0]\n" - "sdot z18.s, z8.b, z0.b[0]\n" - "sdot z22.s, z8.b, z1.b[0]\n" - "sdot z19.s, z9.b, z0.b[0]\n" - "sdot z23.s, z9.b, z1.b[0]\n" - "ble 26f\n" - "ld1b { z10.b }, p2/Z, [x11]\n" - "sdot z16.s, z10.b, z0.b[1]\n" - "ld1b { z4.b }, p2/Z, [x11, #1, MUL VL]\n" - "subs x27, x27, #0x4\n" - "sdot z20.s, z10.b, z1.b[1]\n" - "ld1b { z5.b }, p2/Z, [x11, #2, MUL VL]\n" - "ld1b { z6.b }, p2/Z, [x11, #3, MUL VL]\n" - "sdot z17.s, z4.b, z0.b[1]\n" - "addvl x11, x11, #4\n" - "sdot z21.s, z4.b, z1.b[1]\n" - "sdot z18.s, z5.b, z0.b[1]\n" - "sdot z22.s, z5.b, z1.b[1]\n" - "sdot z19.s, z6.b, z0.b[1]\n" - "sdot z23.s, z6.b, z1.b[1]\n" - "ble 26f\n" - "ld1b { z7.b }, p2/Z, [x11]\n" - "sdot z16.s, z7.b, z0.b[2]\n" - "ld1b { z8.b }, p2/Z, [x11, #1, MUL VL]\n" - "subs x27, x27, #0x4\n" - "sdot z20.s, z7.b, z1.b[2]\n" - "ld1b { z9.b }, p2/Z, [x11, #2, MUL VL]\n" - "ld1b { z10.b }, p2/Z, [x11, #3, MUL VL]\n" - "sdot z17.s, z8.b, z0.b[2]\n" - "addvl x11, x11, #4\n" - "sdot z21.s, z8.b, z1.b[2]\n" - "sdot z18.s, z9.b, z0.b[2]\n" - "sdot z22.s, z9.b, z1.b[2]\n" - "sdot z19.s, z10.b, z0.b[2]\n" - "sdot z23.s, z10.b, z1.b[2]\n" - "ble 26f\n" - "ld1b { z4.b }, p2/Z, [x11]\n" - "sdot z16.s, z4.b, z0.b[3]\n" - "ld1b { z5.b }, p2/Z, [x11, #1, MUL VL]\n" - "sdot z20.s, z4.b, z1.b[3]\n" - "ld1b { z6.b }, p2/Z, [x11, #2, MUL VL]\n" - "ld1b { z7.b }, p2/Z, [x11, #3, MUL VL]\n" - "sdot z17.s, z5.b, z0.b[3]\n" - "addvl x11, x11, #4\n" - "sdot z21.s, z5.b, z1.b[3]\n" - "sdot z18.s, z6.b, z0.b[3]\n" - "sdot z22.s, z6.b, z1.b[3]\n" - "sdot z19.s, z7.b, z0.b[3]\n" - "sdot z23.s, z7.b, z1.b[3]\n" - "26:" // Height 2: Multiply loop: multiply skip - "tbnz %x[flags], #31, 27f\n" + "22:" // Height 2: Multiply loop: unique 3: skip row sum + "prfm pldl1keep, [x23, #0x80]\n" + "sub x24, x24, #0x10\n" + "prfm pldl1keep, [x22, #0x80]\n" + "cmp x24, #0x10\n" + "bgt 21b\n" + "23:" // Height 2: Multiply loop: Single iteration only + "ld1b { z4.b }, p2/Z, [x28]\n" + "whilelt p0.b, XZR, x24\n" + "ld1b { z5.b }, p2/Z, [x28, #1, MUL VL]\n" + "subs x24, x24, #0x4\n" + "ld1rqb { z0.b }, p0/Z, [x23]\n" + "sdot z16.s, z4.b, z0.b[0]\n" + "ld1rqb { z1.b }, p0/Z, [x22]\n" + "add x23, x23, #0x10\n" + "sdot z17.s, z5.b, z0.b[0]\n" + "ld1b { z6.b }, p2/Z, [x28, #2, MUL VL]\n" + "add x22, x22, #0x10\n" + "sdot z20.s, z4.b, z1.b[0]\n" + "ld1b { z7.b }, p2/Z, [x28, #3, MUL VL]\n" + "addvl x28, x28, #4\n" + "sdot z21.s, z5.b, z1.b[0]\n" + "sdot z18.s, z6.b, z0.b[0]\n" + "sdot z22.s, z6.b, z1.b[0]\n" + "sdot z19.s, z7.b, z0.b[0]\n" + "sdot z23.s, z7.b, z1.b[0]\n" + "ble 24f\n" + "ld1b { z8.b }, p2/Z, [x28]\n" + "sdot z16.s, z8.b, z0.b[1]\n" + "ld1b { z9.b }, p2/Z, [x28, #1, MUL VL]\n" + "subs x24, x24, #0x4\n" + "sdot z20.s, z8.b, z1.b[1]\n" + "ld1b { z10.b }, p2/Z, [x28, #2, MUL VL]\n" + "ld1b { z4.b }, p2/Z, [x28, #3, MUL VL]\n" + "sdot z17.s, z9.b, z0.b[1]\n" + "addvl x28, x28, #4\n" + "sdot z21.s, z9.b, z1.b[1]\n" + "sdot z18.s, z10.b, z0.b[1]\n" + "sdot z22.s, z10.b, z1.b[1]\n" + "sdot z19.s, z4.b, z0.b[1]\n" + "sdot z23.s, z4.b, z1.b[1]\n" + "ble 24f\n" + "ld1b { z5.b }, p2/Z, [x28]\n" + "sdot z16.s, z5.b, z0.b[2]\n" + "ld1b { z6.b }, p2/Z, [x28, #1, MUL VL]\n" + "subs x24, x24, #0x4\n" + "sdot z20.s, z5.b, z1.b[2]\n" + "ld1b { z7.b }, p2/Z, [x28, #2, MUL VL]\n" + "ld1b { z8.b }, p2/Z, [x28, #3, MUL VL]\n" + "sdot z17.s, z6.b, z0.b[2]\n" + "addvl x28, x28, #4\n" + "sdot z21.s, z6.b, z1.b[2]\n" + "sdot z18.s, z7.b, z0.b[2]\n" + "sdot z22.s, z7.b, z1.b[2]\n" + "sdot z19.s, z8.b, z0.b[2]\n" + "sdot z23.s, z8.b, z1.b[2]\n" + "ble 24f\n" + "ld1b { z9.b }, p2/Z, [x28]\n" + "sdot z16.s, z9.b, z0.b[3]\n" + "ld1b { z10.b }, p2/Z, [x28, #1, MUL VL]\n" + "sdot z20.s, z9.b, z1.b[3]\n" + "ld1b { z4.b }, p2/Z, [x28, #2, MUL VL]\n" + "ld1b { z5.b }, p2/Z, [x28, #3, MUL VL]\n" + "sdot z17.s, z10.b, z0.b[3]\n" + "addvl x28, x28, #4\n" + "sdot z21.s, z10.b, z1.b[3]\n" + "sdot z18.s, z4.b, z0.b[3]\n" + "sdot z22.s, z4.b, z1.b[3]\n" + "sdot z19.s, z5.b, z0.b[3]\n" + "sdot z23.s, z5.b, z1.b[3]\n" + "24:" // Height 2: Multiply loop: multiply skip + "tbnz %x[flags], #31, 25f\n" "sdot z11.s, z0.b, z15.b\n" "sdot z12.s, z1.b, z15.b\n" - "27:" // Height 2: Multiply loop: unique 4: skip row sum - "prfm pldl1keep, [x26, #0x80]\n" - "add x28, x28, #0x1\n" - "prfm pldl1keep, [x24, #0x80]\n" + "25:" // Height 2: Multiply loop: unique 4: skip row sum + "prfm pldl1keep, [x23, #0x80]\n" + "add x25, x25, #0x1\n" + "prfm pldl1keep, [x22, #0x80]\n" "ldr w19, [%x[args_ptr], %[offsetof_num_strings]]\n" - "cmp x28, x19\n" - "bne 20b\n" - "tbnz %x[flags], #31, 28f\n" + "cmp x25, x19\n" + "bne 18b\n" + "ldr x19, [%x[args_ptr], %[offsetof_output_offset]]\n" + "add x22, x26, x19\n" + "tbnz %x[flags], #31, 26f\n" "add x19, %x[qp], %[b_offset]\n" "ld1rw { z2.s }, p2/Z, [x19]\n" "neg z2.s, p2/M, z2.s\n" @@ -508,19 +490,19 @@ void sve_hybrid_s8qa_dot_4x4VL ( "mov z12.s, z12.s[0]\n" "mul z11.s, p2/M, z11.s, z2.s\n" "mul z12.s, p2/M, z12.s, z2.s\n" - "28:" // Height 2: skip row sum fixup + "26:" // Height 2: skip row sum fixup "add z16.s, z16.s, z11.s\n" - "ld1w { z0.s }, p2/Z, [x10]\n" + "ld1w { z0.s }, p2/Z, [x27]\n" "orr %x[flags], %x[flags], #0x80000000\n" "add z17.s, z17.s, z11.s\n" - "ld1w { z1.s }, p2/Z, [x10, #1, MUL VL]\n" - "add x20, %x[qp], %[per_layer_right_shift]\n" + "ld1w { z1.s }, p2/Z, [x27, #1, MUL VL]\n" + "add x23, %x[qp], %[per_layer_right_shift]\n" "add z18.s, z18.s, z11.s\n" - "ld1w { z2.s }, p2/Z, [x10, #2, MUL VL]\n" + "ld1w { z2.s }, p2/Z, [x27, #2, MUL VL]\n" "add x19, %x[qp], %[per_layer_mul]\n" "add z19.s, z19.s, z11.s\n" - "ld1w { z3.s }, p2/Z, [x10, #3, MUL VL]\n" - "addvl x10, x10, #4\n" + "ld1w { z3.s }, p2/Z, [x27, #3, MUL VL]\n" + "addvl x27, x27, #4\n" "add z20.s, z20.s, z12.s\n" "ld1rw { z4.s }, p2/Z, [x19]\n" "add z21.s, z21.s, z12.s\n" @@ -531,7 +513,7 @@ void sve_hybrid_s8qa_dot_4x4VL ( "add z18.s, z18.s, z2.s\n" "add z19.s, z19.s, z3.s\n" "add z20.s, z20.s, z0.s\n" - "ld1rw { z0.s }, p2/Z, [x20]\n" + "ld1rw { z0.s }, p2/Z, [x23]\n" "add z21.s, z21.s, z1.s\n" "add z22.s, z22.s, z2.s\n" "add z23.s, z23.s, z3.s\n" @@ -543,7 +525,7 @@ void sve_hybrid_s8qa_dot_4x4VL ( ".inst 0x04a476b5 // sqrdmulh z21.s, z21.s, z4.s\n" ".inst 0x04a476d6 // sqrdmulh z22.s, z22.s, z4.s\n" ".inst 0x04a476f7 // sqrdmulh z23.s, z23.s, z4.s\n" - "tbz %x[flags], #5, 29f\n" + "tbz %x[flags], #5, 27f\n" "and z4.d, z16.d, z0.d\n" "asr z4.s, z4.s, #0x1f\n" "and z5.d, z17.d, z0.d\n" @@ -568,7 +550,7 @@ void sve_hybrid_s8qa_dot_4x4VL ( "sqadd z21.s, z21.s, z9.s\n" "sqadd z22.s, z22.s, z10.s\n" "sqadd z23.s, z23.s, z4.s\n" - "29:" // Height 2: no shift correction + "27:" // Height 2: no shift correction ".inst 0x44828810 // srshl z16.s, p2/M, z16.s, z0.s\n" "add x19, %x[qp], %[c_offset]\n" "ld1rw { z4.s }, p2/Z, [x19]\n" @@ -599,9 +581,9 @@ void sve_hybrid_s8qa_dot_4x4VL ( "uzp1 z17.h, z18.h, z19.h\n" "smax z20.s, p2/M, z20.s, z5.s\n" "uzp1 z16.b, z16.b, z17.b\n" - "st1b { z16.b }, p1, [x9]\n" + "st1b { z16.b }, p1, [x26]\n" "add z21.s, z21.s, z4.s\n" - "addvl x9, x9, #1\n" + "addvl x26, x26, #1\n" ".inst 0x44828816 // srshl z22.s, p2/M, z22.s, z0.s\n" ".inst 0x44828817 // srshl z23.s, p2/M, z23.s, z0.s\n" "smin z21.s, p2/M, z21.s, z6.s\n" @@ -615,41 +597,27 @@ void sve_hybrid_s8qa_dot_4x4VL ( "smax z23.s, p2/M, z23.s, z5.s\n" "uzp1 z21.h, z22.h, z23.h\n" "uzp1 z20.b, z20.b, z21.b\n" - "st1b { z20.b }, p1, [x25]\n" - "addvl x25, x25, #1\n" - "30:" // Height 2: Writeback done - "decw x12, ALL, MUL #4\n" - "cmp x12, XZR\n" - "bgt 18b\n" - "b 62f\n" - "31:" // Height 3 + "st1b { z20.b }, p1, [x22]\n" + "28:" // Height 2: Writeback done + "decw x9, ALL, MUL #4\n" + "cmp x9, XZR\n" + "bgt 16b\n" + "b 58f\n" + "29:" // Height 3 "mov z11.s, #0x0\n" - "ldr x12, [%x[args_ptr], %[offsetof_N]]\n" - "mov x10, %x[col_bias]\n" + "ldr x9, [%x[args_ptr], %[offsetof_N]]\n" + "mov x27, %x[col_bias]\n" "mov z12.s, #0x0\n" - "ldr x11, [%x[args_ptr], %[offsetof_B_ptr]]\n" + "ldr x28, [%x[args_ptr], %[offsetof_B_ptr]]\n" "bic %x[flags], %x[flags], #0x80000000\n" "mov z13.s, #0x0\n" - "ldr x19, [%x[args_ptr], %[offsetof_output_offset]]\n" - "mov z14.s, #0x0\n" + "mov x26, %x[output_ptr]\n" "mov z15.b, #0x1\n" - "tbz %x[flags], #2, 32f\n" - "ldr x9, [%x[output_ptr], #0x0]\n" - "ldr x25, [%x[output_ptr], #0x8]\n" - "add x9, x9, x19\n" - "ldr x23, [%x[output_ptr], #0x10]\n" - "add x25, x25, x19\n" - "add x23, x23, x19\n" - "b 33f\n" - "32:" // Height 3: setup direct output - "mov x9, %x[output_ptr]\n" - "add x25, x9, x19\n" - "add x23, x25, x19\n" - "33:" // Height 3: Column loop + "30:" // Height 3: Column loop "mov z16.s, #0x0\n" "mov x19, #0x0\n" "mov z17.s, #0x0\n" - "whilelt p1.b, x19, x12\n" + "whilelt p1.b, x19, x9\n" "mov z18.s, #0x0\n" "mov z19.s, #0x0\n" "mov z20.s, #0x0\n" @@ -660,83 +628,83 @@ void sve_hybrid_s8qa_dot_4x4VL ( "mov z25.s, #0x0\n" "mov z26.s, #0x0\n" "mov z27.s, #0x0\n" - "34:" // Height 3: setup done - "mov x28, #0x0\n" - "35:" // Height 3: String loop + "31:" // Height 3: setup done + "mov x25, #0x0\n" + "32:" // Height 3: String loop "ldr x20, [%x[args_ptr], %[offsetof_string_lengths]]\n" "ldr x19, [%x[args_ptr], %[offsetof_input_offset]]\n" - "ldr w27, [x20, x28, LSL #0x2]\n" - "tbz %x[flags], #3, 36f\n" - "ldr x20, [%x[input_ptr], x28, LSL #0x3]\n" + "ldr w24, [x20, x25, LSL #0x2]\n" + "tbz %x[flags], #3, 33f\n" + "ldr x20, [%x[input_ptr], x25, LSL #0x3]\n" "add x20, x20, x19, LSL #3\n" - "ldr x26, [x20, #0x0]\n" - "ldr x24, [x20, #0x8]\n" - "ldr x22, [x20, #0x10]\n" - "cbnz x28, 37f\n" + "ldr x23, [x20, #0x0]\n" + "ldr x22, [x20, #0x8]\n" + "ldr x21, [x20, #0x10]\n" + "cbnz x25, 34f\n" "ldr x19, [%x[args_ptr], %[offsetof_input_initial_col]]\n" - "add x26, x26, x19\n" - "add x24, x24, x19\n" + "add x23, x23, x19\n" "add x22, x22, x19\n" - "b 37f\n" - "36:" // Height 3: setup direct input - "mov x26, %x[input_ptr]\n" - "add x24, x26, x19\n" - "add x22, x24, x19\n" - "37:" // Height 3: input setup done - "cmp x27, #0x10\n" - "ble 40f\n" - "38:" // Height 3: Multiply loop: Main loop head - "ld1b { z4.b }, p2/Z, [x11]\n" - "whilelt p0.b, XZR, x27\n" - "ld1b { z5.b }, p2/Z, [x11, #1, MUL VL]\n" - "ld1rqb { z0.b }, p0/Z, [x26]\n" + "add x21, x21, x19\n" + "b 34f\n" + "33:" // Height 3: setup direct input + "mov x23, %x[input_ptr]\n" + "add x22, x23, x19\n" + "add x21, x22, x19\n" + "34:" // Height 3: input setup done + "cmp x24, #0x10\n" + "ble 37f\n" + "35:" // Height 3: Multiply loop: Main loop head + "ld1b { z4.b }, p2/Z, [x28]\n" + "whilelt p0.b, XZR, x24\n" + "ld1b { z5.b }, p2/Z, [x28, #1, MUL VL]\n" + "ld1rqb { z0.b }, p0/Z, [x23]\n" "sdot z16.s, z4.b, z0.b[0]\n" - "ld1rqb { z1.b }, p0/Z, [x24]\n" - "add x26, x26, #0x10\n" + "ld1rqb { z1.b }, p0/Z, [x22]\n" + "add x23, x23, #0x10\n" "sdot z17.s, z5.b, z0.b[0]\n" - "ld1rqb { z2.b }, p0/Z, [x22]\n" - "add x24, x24, #0x10\n" - "sdot z20.s, z4.b, z1.b[0]\n" - "ld1b { z6.b }, p2/Z, [x11, #2, MUL VL]\n" + "ld1rqb { z2.b }, p0/Z, [x21]\n" "add x22, x22, #0x10\n" + "sdot z20.s, z4.b, z1.b[0]\n" + "ld1b { z6.b }, p2/Z, [x28, #2, MUL VL]\n" + "add x21, x21, #0x10\n" "sdot z24.s, z4.b, z2.b[0]\n" - "ld1b { z7.b }, p2/Z, [x11, #3, MUL VL]\n" + "ld1b { z7.b }, p2/Z, [x28, #3, MUL VL]\n" "sdot z21.s, z5.b, z1.b[0]\n" - "ld1b { z8.b }, p2/Z, [x11, #4, MUL VL]\n" + "ld1b { z8.b }, p2/Z, [x28, #4, MUL VL]\n" "sdot z25.s, z5.b, z2.b[0]\n" - "ld1b { z9.b }, p2/Z, [x11, #5, MUL VL]\n" + "ld1b { z9.b }, p2/Z, [x28, #5, MUL VL]\n" "sdot z18.s, z6.b, z0.b[0]\n" - "ld1b { z10.b }, p2/Z, [x11, #6, MUL VL]\n" + "ld1b { z10.b }, p2/Z, [x28, #6, MUL VL]\n" "sdot z22.s, z6.b, z1.b[0]\n" - "ld1b { z4.b }, p2/Z, [x11, #7, MUL VL]\n" - "addvl x11, x11, #16\n" + "ld1b { z4.b }, p2/Z, [x28, #7, MUL VL]\n" + "addvl x28, x28, #16\n" "sdot z26.s, z6.b, z2.b[0]\n" - "ld1b { z5.b }, p2/Z, [x11, #-8, MUL VL]\n" + "ld1b { z5.b }, p2/Z, [x28, #-8, MUL VL]\n" "sdot z19.s, z7.b, z0.b[0]\n" - "ld1b { z6.b }, p2/Z, [x11, #-7, MUL VL]\n" + "ld1b { z6.b }, p2/Z, [x28, #-7, MUL VL]\n" "sdot z23.s, z7.b, z1.b[0]\n" "sdot z27.s, z7.b, z2.b[0]\n" - "ld1b { z7.b }, p2/Z, [x11, #-6, MUL VL]\n" + "ld1b { z7.b }, p2/Z, [x28, #-6, MUL VL]\n" "sdot z16.s, z8.b, z0.b[1]\n" "sdot z20.s, z8.b, z1.b[1]\n" "sdot z24.s, z8.b, z2.b[1]\n" - "ld1b { z8.b }, p2/Z, [x11, #-5, MUL VL]\n" + "ld1b { z8.b }, p2/Z, [x28, #-5, MUL VL]\n" "sdot z17.s, z9.b, z0.b[1]\n" "sdot z21.s, z9.b, z1.b[1]\n" "sdot z25.s, z9.b, z2.b[1]\n" - "ld1b { z9.b }, p2/Z, [x11, #-4, MUL VL]\n" + "ld1b { z9.b }, p2/Z, [x28, #-4, MUL VL]\n" "sdot z18.s, z10.b, z0.b[1]\n" "sdot z22.s, z10.b, z1.b[1]\n" "sdot z26.s, z10.b, z2.b[1]\n" - "ld1b { z10.b }, p2/Z, [x11, #-3, MUL VL]\n" + "ld1b { z10.b }, p2/Z, [x28, #-3, MUL VL]\n" "sdot z19.s, z4.b, z0.b[1]\n" "sdot z23.s, z4.b, z1.b[1]\n" "sdot z27.s, z4.b, z2.b[1]\n" - "ld1b { z4.b }, p2/Z, [x11, #-2, MUL VL]\n" + "ld1b { z4.b }, p2/Z, [x28, #-2, MUL VL]\n" "sdot z16.s, z5.b, z0.b[2]\n" "sdot z20.s, z5.b, z1.b[2]\n" "sdot z24.s, z5.b, z2.b[2]\n" - "ld1b { z5.b }, p2/Z, [x11, #-1, MUL VL]\n" + "ld1b { z5.b }, p2/Z, [x28, #-1, MUL VL]\n" "sdot z17.s, z6.b, z0.b[2]\n" "sdot z21.s, z6.b, z1.b[2]\n" "sdot z25.s, z6.b, z2.b[2]\n" @@ -758,113 +726,116 @@ void sve_hybrid_s8qa_dot_4x4VL ( "sdot z19.s, z5.b, z0.b[3]\n" "sdot z23.s, z5.b, z1.b[3]\n" "sdot z27.s, z5.b, z2.b[3]\n" - "tbnz %x[flags], #31, 39f\n" + "tbnz %x[flags], #31, 36f\n" "sdot z11.s, z0.b, z15.b\n" "sdot z12.s, z1.b, z15.b\n" "sdot z13.s, z2.b, z15.b\n" - "39:" // Height 3: Multiply loop: unique 5: skip row sum - "prfm pldl1keep, [x26, #0x80]\n" - "sub x27, x27, #0x10\n" - "prfm pldl1keep, [x24, #0x80]\n" - "cmp x27, #0x10\n" + "36:" // Height 3: Multiply loop: unique 5: skip row sum + "prfm pldl1keep, [x23, #0x80]\n" + "sub x24, x24, #0x10\n" "prfm pldl1keep, [x22, #0x80]\n" - "bgt 38b\n" - "40:" // Height 3: Multiply loop: Single iteration only - "ld1b { z6.b }, p2/Z, [x11]\n" - "whilelt p0.b, XZR, x27\n" - "ld1b { z7.b }, p2/Z, [x11, #1, MUL VL]\n" - "subs x27, x27, #0x4\n" - "ld1rqb { z0.b }, p0/Z, [x26]\n" - "sdot z16.s, z6.b, z0.b[0]\n" - "ld1rqb { z1.b }, p0/Z, [x24]\n" - "add x26, x26, #0x10\n" - "sdot z17.s, z7.b, z0.b[0]\n" - "ld1rqb { z2.b }, p0/Z, [x22]\n" - "add x24, x24, #0x10\n" - "sdot z20.s, z6.b, z1.b[0]\n" - "ld1b { z8.b }, p2/Z, [x11, #2, MUL VL]\n" + "cmp x24, #0x10\n" + "prfm pldl1keep, [x21, #0x80]\n" + "bgt 35b\n" + "37:" // Height 3: Multiply loop: Single iteration only + "ld1b { z4.b }, p2/Z, [x28]\n" + "whilelt p0.b, XZR, x24\n" + "ld1b { z5.b }, p2/Z, [x28, #1, MUL VL]\n" + "subs x24, x24, #0x4\n" + "ld1rqb { z0.b }, p0/Z, [x23]\n" + "sdot z16.s, z4.b, z0.b[0]\n" + "ld1rqb { z1.b }, p0/Z, [x22]\n" + "add x23, x23, #0x10\n" + "sdot z17.s, z5.b, z0.b[0]\n" + "ld1rqb { z2.b }, p0/Z, [x21]\n" "add x22, x22, #0x10\n" - "sdot z24.s, z6.b, z2.b[0]\n" - "ld1b { z9.b }, p2/Z, [x11, #3, MUL VL]\n" - "addvl x11, x11, #4\n" - "sdot z21.s, z7.b, z1.b[0]\n" - "sdot z25.s, z7.b, z2.b[0]\n" - "sdot z18.s, z8.b, z0.b[0]\n" - "sdot z22.s, z8.b, z1.b[0]\n" - "sdot z26.s, z8.b, z2.b[0]\n" - "sdot z19.s, z9.b, z0.b[0]\n" - "sdot z23.s, z9.b, z1.b[0]\n" - "sdot z27.s, z9.b, z2.b[0]\n" - "ble 41f\n" - "ld1b { z10.b }, p2/Z, [x11]\n" - "sdot z16.s, z10.b, z0.b[1]\n" - "ld1b { z4.b }, p2/Z, [x11, #1, MUL VL]\n" - "subs x27, x27, #0x4\n" - "sdot z20.s, z10.b, z1.b[1]\n" - "ld1b { z5.b }, p2/Z, [x11, #2, MUL VL]\n" - "sdot z24.s, z10.b, z2.b[1]\n" - "ld1b { z6.b }, p2/Z, [x11, #3, MUL VL]\n" - "addvl x11, x11, #4\n" - "sdot z17.s, z4.b, z0.b[1]\n" - "sdot z21.s, z4.b, z1.b[1]\n" - "sdot z25.s, z4.b, z2.b[1]\n" - "sdot z18.s, z5.b, z0.b[1]\n" - "sdot z22.s, z5.b, z1.b[1]\n" - "sdot z26.s, z5.b, z2.b[1]\n" - "sdot z19.s, z6.b, z0.b[1]\n" - "sdot z23.s, z6.b, z1.b[1]\n" - "sdot z27.s, z6.b, z2.b[1]\n" - "ble 41f\n" - "ld1b { z7.b }, p2/Z, [x11]\n" - "sdot z16.s, z7.b, z0.b[2]\n" - "ld1b { z8.b }, p2/Z, [x11, #1, MUL VL]\n" - "subs x27, x27, #0x4\n" - "sdot z20.s, z7.b, z1.b[2]\n" - "ld1b { z9.b }, p2/Z, [x11, #2, MUL VL]\n" - "sdot z24.s, z7.b, z2.b[2]\n" - "ld1b { z10.b }, p2/Z, [x11, #3, MUL VL]\n" - "addvl x11, x11, #4\n" - "sdot z17.s, z8.b, z0.b[2]\n" - "sdot z21.s, z8.b, z1.b[2]\n" - "sdot z25.s, z8.b, z2.b[2]\n" - "sdot z18.s, z9.b, z0.b[2]\n" - "sdot z22.s, z9.b, z1.b[2]\n" - "sdot z26.s, z9.b, z2.b[2]\n" - "sdot z19.s, z10.b, z0.b[2]\n" - "sdot z23.s, z10.b, z1.b[2]\n" - "sdot z27.s, z10.b, z2.b[2]\n" - "ble 41f\n" - "ld1b { z4.b }, p2/Z, [x11]\n" - "sdot z16.s, z4.b, z0.b[3]\n" - "ld1b { z5.b }, p2/Z, [x11, #1, MUL VL]\n" - "sdot z20.s, z4.b, z1.b[3]\n" - "ld1b { z6.b }, p2/Z, [x11, #2, MUL VL]\n" - "sdot z24.s, z4.b, z2.b[3]\n" - "ld1b { z7.b }, p2/Z, [x11, #3, MUL VL]\n" - "addvl x11, x11, #4\n" - "sdot z17.s, z5.b, z0.b[3]\n" - "sdot z21.s, z5.b, z1.b[3]\n" - "sdot z25.s, z5.b, z2.b[3]\n" - "sdot z18.s, z6.b, z0.b[3]\n" - "sdot z22.s, z6.b, z1.b[3]\n" - "sdot z26.s, z6.b, z2.b[3]\n" - "sdot z19.s, z7.b, z0.b[3]\n" - "sdot z23.s, z7.b, z1.b[3]\n" - "sdot z27.s, z7.b, z2.b[3]\n" - "41:" // Height 3: Multiply loop: multiply skip - "tbnz %x[flags], #31, 42f\n" + "sdot z20.s, z4.b, z1.b[0]\n" + "ld1b { z6.b }, p2/Z, [x28, #2, MUL VL]\n" + "add x21, x21, #0x10\n" + "sdot z24.s, z4.b, z2.b[0]\n" + "ld1b { z7.b }, p2/Z, [x28, #3, MUL VL]\n" + "addvl x28, x28, #4\n" + "sdot z21.s, z5.b, z1.b[0]\n" + "sdot z25.s, z5.b, z2.b[0]\n" + "sdot z18.s, z6.b, z0.b[0]\n" + "sdot z22.s, z6.b, z1.b[0]\n" + "sdot z26.s, z6.b, z2.b[0]\n" + "sdot z19.s, z7.b, z0.b[0]\n" + "sdot z23.s, z7.b, z1.b[0]\n" + "sdot z27.s, z7.b, z2.b[0]\n" + "ble 38f\n" + "ld1b { z8.b }, p2/Z, [x28]\n" + "sdot z16.s, z8.b, z0.b[1]\n" + "ld1b { z9.b }, p2/Z, [x28, #1, MUL VL]\n" + "subs x24, x24, #0x4\n" + "sdot z20.s, z8.b, z1.b[1]\n" + "ld1b { z10.b }, p2/Z, [x28, #2, MUL VL]\n" + "sdot z24.s, z8.b, z2.b[1]\n" + "ld1b { z4.b }, p2/Z, [x28, #3, MUL VL]\n" + "addvl x28, x28, #4\n" + "sdot z17.s, z9.b, z0.b[1]\n" + "sdot z21.s, z9.b, z1.b[1]\n" + "sdot z25.s, z9.b, z2.b[1]\n" + "sdot z18.s, z10.b, z0.b[1]\n" + "sdot z22.s, z10.b, z1.b[1]\n" + "sdot z26.s, z10.b, z2.b[1]\n" + "sdot z19.s, z4.b, z0.b[1]\n" + "sdot z23.s, z4.b, z1.b[1]\n" + "sdot z27.s, z4.b, z2.b[1]\n" + "ble 38f\n" + "ld1b { z5.b }, p2/Z, [x28]\n" + "sdot z16.s, z5.b, z0.b[2]\n" + "ld1b { z6.b }, p2/Z, [x28, #1, MUL VL]\n" + "subs x24, x24, #0x4\n" + "sdot z20.s, z5.b, z1.b[2]\n" + "ld1b { z7.b }, p2/Z, [x28, #2, MUL VL]\n" + "sdot z24.s, z5.b, z2.b[2]\n" + "ld1b { z8.b }, p2/Z, [x28, #3, MUL VL]\n" + "addvl x28, x28, #4\n" + "sdot z17.s, z6.b, z0.b[2]\n" + "sdot z21.s, z6.b, z1.b[2]\n" + "sdot z25.s, z6.b, z2.b[2]\n" + "sdot z18.s, z7.b, z0.b[2]\n" + "sdot z22.s, z7.b, z1.b[2]\n" + "sdot z26.s, z7.b, z2.b[2]\n" + "sdot z19.s, z8.b, z0.b[2]\n" + "sdot z23.s, z8.b, z1.b[2]\n" + "sdot z27.s, z8.b, z2.b[2]\n" + "ble 38f\n" + "ld1b { z9.b }, p2/Z, [x28]\n" + "sdot z16.s, z9.b, z0.b[3]\n" + "ld1b { z10.b }, p2/Z, [x28, #1, MUL VL]\n" + "sdot z20.s, z9.b, z1.b[3]\n" + "ld1b { z4.b }, p2/Z, [x28, #2, MUL VL]\n" + "sdot z24.s, z9.b, z2.b[3]\n" + "ld1b { z5.b }, p2/Z, [x28, #3, MUL VL]\n" + "addvl x28, x28, #4\n" + "sdot z17.s, z10.b, z0.b[3]\n" + "sdot z21.s, z10.b, z1.b[3]\n" + "sdot z25.s, z10.b, z2.b[3]\n" + "sdot z18.s, z4.b, z0.b[3]\n" + "sdot z22.s, z4.b, z1.b[3]\n" + "sdot z26.s, z4.b, z2.b[3]\n" + "sdot z19.s, z5.b, z0.b[3]\n" + "sdot z23.s, z5.b, z1.b[3]\n" + "sdot z27.s, z5.b, z2.b[3]\n" + "38:" // Height 3: Multiply loop: multiply skip + "tbnz %x[flags], #31, 39f\n" "sdot z11.s, z0.b, z15.b\n" "sdot z12.s, z1.b, z15.b\n" "sdot z13.s, z2.b, z15.b\n" - "42:" // Height 3: Multiply loop: unique 6: skip row sum - "prfm pldl1keep, [x26, #0x80]\n" - "add x28, x28, #0x1\n" - "prfm pldl1keep, [x24, #0x80]\n" + "39:" // Height 3: Multiply loop: unique 6: skip row sum + "prfm pldl1keep, [x23, #0x80]\n" + "add x25, x25, #0x1\n" "prfm pldl1keep, [x22, #0x80]\n" + "prfm pldl1keep, [x21, #0x80]\n" "ldr w19, [%x[args_ptr], %[offsetof_num_strings]]\n" - "cmp x28, x19\n" - "bne 35b\n" - "tbnz %x[flags], #31, 43f\n" + "cmp x25, x19\n" + "bne 32b\n" + "ldr x19, [%x[args_ptr], %[offsetof_output_offset]]\n" + "add x22, x26, x19\n" + "add x21, x22, x19\n" + "tbnz %x[flags], #31, 40f\n" "add x19, %x[qp], %[b_offset]\n" "ld1rw { z3.s }, p2/Z, [x19]\n" "neg z3.s, p2/M, z3.s\n" @@ -879,19 +850,19 @@ void sve_hybrid_s8qa_dot_4x4VL ( "mul z11.s, p2/M, z11.s, z3.s\n" "mul z12.s, p2/M, z12.s, z3.s\n" "mul z13.s, p2/M, z13.s, z3.s\n" - "43:" // Height 3: skip row sum fixup + "40:" // Height 3: skip row sum fixup "add z16.s, z16.s, z11.s\n" - "ld1w { z0.s }, p2/Z, [x10]\n" + "ld1w { z0.s }, p2/Z, [x27]\n" "orr %x[flags], %x[flags], #0x80000000\n" "add z17.s, z17.s, z11.s\n" - "ld1w { z1.s }, p2/Z, [x10, #1, MUL VL]\n" - "add x20, %x[qp], %[per_layer_right_shift]\n" + "ld1w { z1.s }, p2/Z, [x27, #1, MUL VL]\n" + "add x23, %x[qp], %[per_layer_right_shift]\n" "add z18.s, z18.s, z11.s\n" - "ld1w { z2.s }, p2/Z, [x10, #2, MUL VL]\n" + "ld1w { z2.s }, p2/Z, [x27, #2, MUL VL]\n" "add x19, %x[qp], %[per_layer_mul]\n" "add z19.s, z19.s, z11.s\n" - "ld1w { z3.s }, p2/Z, [x10, #3, MUL VL]\n" - "addvl x10, x10, #4\n" + "ld1w { z3.s }, p2/Z, [x27, #3, MUL VL]\n" + "addvl x27, x27, #4\n" "add z20.s, z20.s, z12.s\n" "ld1rw { z4.s }, p2/Z, [x19]\n" "add z21.s, z21.s, z12.s\n" @@ -910,7 +881,7 @@ void sve_hybrid_s8qa_dot_4x4VL ( "add z22.s, z22.s, z2.s\n" "add z23.s, z23.s, z3.s\n" "add z24.s, z24.s, z0.s\n" - "ld1rw { z0.s }, p2/Z, [x20]\n" + "ld1rw { z0.s }, p2/Z, [x23]\n" "add z25.s, z25.s, z1.s\n" "add z26.s, z26.s, z2.s\n" "add z27.s, z27.s, z3.s\n" @@ -926,7 +897,7 @@ void sve_hybrid_s8qa_dot_4x4VL ( ".inst 0x04a47739 // sqrdmulh z25.s, z25.s, z4.s\n" ".inst 0x04a4775a // sqrdmulh z26.s, z26.s, z4.s\n" ".inst 0x04a4777b // sqrdmulh z27.s, z27.s, z4.s\n" - "tbz %x[flags], #5, 44f\n" + "tbz %x[flags], #5, 41f\n" "and z4.d, z16.d, z0.d\n" "asr z4.s, z4.s, #0x1f\n" "and z5.d, z17.d, z0.d\n" @@ -963,7 +934,7 @@ void sve_hybrid_s8qa_dot_4x4VL ( "asr z8.s, z8.s, #0x1f\n" "sqadd z26.s, z26.s, z7.s\n" "sqadd z27.s, z27.s, z8.s\n" - "44:" // Height 3: no shift correction + "41:" // Height 3: no shift correction ".inst 0x44828810 // srshl z16.s, p2/M, z16.s, z0.s\n" "add x19, %x[qp], %[c_offset]\n" "ld1rw { z4.s }, p2/Z, [x19]\n" @@ -994,9 +965,9 @@ void sve_hybrid_s8qa_dot_4x4VL ( "uzp1 z17.h, z18.h, z19.h\n" "smax z20.s, p2/M, z20.s, z5.s\n" "uzp1 z16.b, z16.b, z17.b\n" - "st1b { z16.b }, p1, [x9]\n" + "st1b { z16.b }, p1, [x26]\n" "add z21.s, z21.s, z4.s\n" - "addvl x9, x9, #1\n" + "addvl x26, x26, #1\n" ".inst 0x44828816 // srshl z22.s, p2/M, z22.s, z0.s\n" ".inst 0x44828817 // srshl z23.s, p2/M, z23.s, z0.s\n" ".inst 0x44828818 // srshl z24.s, p2/M, z24.s, z0.s\n" @@ -1019,58 +990,42 @@ void sve_hybrid_s8qa_dot_4x4VL ( "uzp1 z21.h, z22.h, z23.h\n" ".inst 0x4482881b // srshl z27.s, p2/M, z27.s, z0.s\n" "uzp1 z20.b, z20.b, z21.b\n" - "st1b { z20.b }, p1, [x25]\n" + "st1b { z20.b }, p1, [x22]\n" "add z26.s, z26.s, z4.s\n" - "addvl x25, x25, #1\n" - "add z27.s, z27.s, z4.s\n" "smax z25.s, p2/M, z25.s, z5.s\n" + "add z27.s, z27.s, z4.s\n" "smin z26.s, p2/M, z26.s, z6.s\n" - "smin z27.s, p2/M, z27.s, z6.s\n" "uzp1 z24.h, z24.h, z25.h\n" + "smin z27.s, p2/M, z27.s, z6.s\n" "smax z26.s, p2/M, z26.s, z5.s\n" "smax z27.s, p2/M, z27.s, z5.s\n" "uzp1 z25.h, z26.h, z27.h\n" "uzp1 z24.b, z24.b, z25.b\n" - "st1b { z24.b }, p1, [x23]\n" - "addvl x23, x23, #1\n" - "45:" // Height 3: Writeback done - "decw x12, ALL, MUL #4\n" - "cmp x12, XZR\n" - "bgt 33b\n" - "b 62f\n" - "46:" // Height 4 + "st1b { z24.b }, p1, [x21]\n" + "42:" // Height 3: Writeback done + "decw x9, ALL, MUL #4\n" + "cmp x9, XZR\n" + "bgt 30b\n" + "b 58f\n" + "43:" // Height 4 "mov z11.s, #0x0\n" - "ldr x12, [%x[args_ptr], %[offsetof_N]]\n" - "mov x10, %x[col_bias]\n" + "ldr x9, [%x[args_ptr], %[offsetof_N]]\n" + "mov x27, %x[col_bias]\n" "mov z12.s, #0x0\n" - "ldr x11, [%x[args_ptr], %[offsetof_B_ptr]]\n" + "ldr x28, [%x[args_ptr], %[offsetof_B_ptr]]\n" "bic %x[flags], %x[flags], #0x80000000\n" "mov z13.s, #0x0\n" - "ldr x19, [%x[args_ptr], %[offsetof_output_offset]]\n" + "ldr x20, [%x[args_ptr], %[offsetof_output_offset]]\n" + "mov x26, %x[output_ptr]\n" "mov z14.s, #0x0\n" + "mov x19, #0x4\n" "mov z15.b, #0x1\n" - "tbz %x[flags], #2, 47f\n" - "ldr x9, [%x[output_ptr], #0x0]\n" - "ldr x25, [%x[output_ptr], #0x8]\n" - "add x9, x9, x19\n" - "ldr x23, [%x[output_ptr], #0x10]\n" - "ldr x21, [%x[output_ptr], #0x18]\n" - "add x25, x25, x19\n" - "add %x[output_ptr], %x[output_ptr], #0x20\n" - "add x23, x23, x19\n" - "add x21, x21, x19\n" - "b 48f\n" - "47:" // Height 4: setup direct output - "mov x9, %x[output_ptr]\n" - "add x25, x9, x19\n" - "add x23, x25, x19\n" - "add x21, x23, x19\n" - "add %x[output_ptr], x21, x19\n" - "48:" // Height 4: Column loop + "madd %x[output_ptr], x20, x19, %x[output_ptr]\n" + "44:" // Height 4: Column loop "mov z16.s, #0x0\n" "mov x19, #0x0\n" "mov z17.s, #0x0\n" - "whilelt p1.b, x19, x12\n" + "whilelt p1.b, x19, x9\n" "mov z18.s, #0x0\n" "mov z19.s, #0x0\n" "mov z20.s, #0x0\n" @@ -1085,97 +1040,97 @@ void sve_hybrid_s8qa_dot_4x4VL ( "mov z29.s, #0x0\n" "mov z30.s, #0x0\n" "mov z31.s, #0x0\n" - "49:" // Height 4: setup done - "mov x28, #0x0\n" - "50:" // Height 4: String loop + "45:" // Height 4: setup done + "mov x25, #0x0\n" + "46:" // Height 4: String loop "ldr x20, [%x[args_ptr], %[offsetof_string_lengths]]\n" "ldr x19, [%x[args_ptr], %[offsetof_input_offset]]\n" - "ldr w27, [x20, x28, LSL #0x2]\n" - "tbz %x[flags], #3, 51f\n" - "ldr x20, [%x[input_ptr], x28, LSL #0x3]\n" + "ldr w24, [x20, x25, LSL #0x2]\n" + "tbz %x[flags], #3, 47f\n" + "ldr x20, [%x[input_ptr], x25, LSL #0x3]\n" "add x20, x20, x19, LSL #3\n" - "ldr x26, [x20, #0x0]\n" - "ldr x24, [x20, #0x8]\n" - "ldr x22, [x20, #0x10]\n" + "ldr x23, [x20, #0x0]\n" + "ldr x22, [x20, #0x8]\n" + "ldr x21, [x20, #0x10]\n" "ldr x20, [x20, #0x18]\n" - "cbnz x28, 52f\n" + "cbnz x25, 48f\n" "ldr x19, [%x[args_ptr], %[offsetof_input_initial_col]]\n" - "add x26, x26, x19\n" - "add x24, x24, x19\n" + "add x23, x23, x19\n" "add x22, x22, x19\n" + "add x21, x21, x19\n" "add x20, x20, x19\n" - "b 52f\n" - "51:" // Height 4: setup direct input - "mov x26, %x[input_ptr]\n" - "add x24, x26, x19\n" - "add x22, x24, x19\n" - "add x20, x22, x19\n" - "52:" // Height 4: input setup done - "cmp x27, #0x10\n" - "ble 55f\n" - "53:" // Height 4: Multiply loop: Main loop head - "ld1b { z4.b }, p2/Z, [x11]\n" - "whilelt p0.b, XZR, x27\n" - "ld1b { z5.b }, p2/Z, [x11, #1, MUL VL]\n" - "ld1rqb { z0.b }, p0/Z, [x26]\n" + "b 48f\n" + "47:" // Height 4: setup direct input + "mov x23, %x[input_ptr]\n" + "add x22, x23, x19\n" + "add x21, x22, x19\n" + "add x20, x21, x19\n" + "48:" // Height 4: input setup done + "cmp x24, #0x10\n" + "ble 51f\n" + "49:" // Height 4: Multiply loop: Main loop head + "ld1b { z4.b }, p2/Z, [x28]\n" + "whilelt p0.b, XZR, x24\n" + "ld1b { z5.b }, p2/Z, [x28, #1, MUL VL]\n" + "ld1rqb { z0.b }, p0/Z, [x23]\n" "sdot z16.s, z4.b, z0.b[0]\n" - "ld1rqb { z1.b }, p0/Z, [x24]\n" - "add x26, x26, #0x10\n" + "ld1rqb { z1.b }, p0/Z, [x22]\n" + "add x23, x23, #0x10\n" "sdot z17.s, z5.b, z0.b[0]\n" - "ld1rqb { z2.b }, p0/Z, [x22]\n" - "add x24, x24, #0x10\n" + "ld1rqb { z2.b }, p0/Z, [x21]\n" + "add x22, x22, #0x10\n" "sdot z20.s, z4.b, z1.b[0]\n" "ld1rqb { z3.b }, p0/Z, [x20]\n" - "add x22, x22, #0x10\n" + "add x21, x21, #0x10\n" "sdot z24.s, z4.b, z2.b[0]\n" - "ld1b { z6.b }, p2/Z, [x11, #2, MUL VL]\n" + "ld1b { z6.b }, p2/Z, [x28, #2, MUL VL]\n" "add x20, x20, #0x10\n" "sdot z21.s, z5.b, z1.b[0]\n" - "ld1b { z7.b }, p2/Z, [x11, #3, MUL VL]\n" + "ld1b { z7.b }, p2/Z, [x28, #3, MUL VL]\n" "sdot z25.s, z5.b, z2.b[0]\n" - "ld1b { z8.b }, p2/Z, [x11, #4, MUL VL]\n" + "ld1b { z8.b }, p2/Z, [x28, #4, MUL VL]\n" "sdot z28.s, z4.b, z3.b[0]\n" - "ld1b { z9.b }, p2/Z, [x11, #5, MUL VL]\n" + "ld1b { z9.b }, p2/Z, [x28, #5, MUL VL]\n" "sdot z29.s, z5.b, z3.b[0]\n" - "ld1b { z10.b }, p2/Z, [x11, #6, MUL VL]\n" + "ld1b { z10.b }, p2/Z, [x28, #6, MUL VL]\n" "sdot z18.s, z6.b, z0.b[0]\n" - "ld1b { z4.b }, p2/Z, [x11, #7, MUL VL]\n" - "addvl x11, x11, #16\n" + "ld1b { z4.b }, p2/Z, [x28, #7, MUL VL]\n" + "addvl x28, x28, #16\n" "sdot z22.s, z6.b, z1.b[0]\n" - "ld1b { z5.b }, p2/Z, [x11, #-8, MUL VL]\n" + "ld1b { z5.b }, p2/Z, [x28, #-8, MUL VL]\n" "sdot z26.s, z6.b, z2.b[0]\n" "sdot z30.s, z6.b, z3.b[0]\n" - "ld1b { z6.b }, p2/Z, [x11, #-7, MUL VL]\n" + "ld1b { z6.b }, p2/Z, [x28, #-7, MUL VL]\n" "sdot z19.s, z7.b, z0.b[0]\n" "sdot z23.s, z7.b, z1.b[0]\n" "sdot z27.s, z7.b, z2.b[0]\n" "sdot z31.s, z7.b, z3.b[0]\n" - "ld1b { z7.b }, p2/Z, [x11, #-6, MUL VL]\n" + "ld1b { z7.b }, p2/Z, [x28, #-6, MUL VL]\n" "sdot z16.s, z8.b, z0.b[1]\n" "sdot z20.s, z8.b, z1.b[1]\n" "sdot z24.s, z8.b, z2.b[1]\n" "sdot z28.s, z8.b, z3.b[1]\n" - "ld1b { z8.b }, p2/Z, [x11, #-5, MUL VL]\n" + "ld1b { z8.b }, p2/Z, [x28, #-5, MUL VL]\n" "sdot z17.s, z9.b, z0.b[1]\n" "sdot z21.s, z9.b, z1.b[1]\n" "sdot z25.s, z9.b, z2.b[1]\n" "sdot z29.s, z9.b, z3.b[1]\n" - "ld1b { z9.b }, p2/Z, [x11, #-4, MUL VL]\n" + "ld1b { z9.b }, p2/Z, [x28, #-4, MUL VL]\n" "sdot z18.s, z10.b, z0.b[1]\n" "sdot z22.s, z10.b, z1.b[1]\n" "sdot z26.s, z10.b, z2.b[1]\n" "sdot z30.s, z10.b, z3.b[1]\n" - "ld1b { z10.b }, p2/Z, [x11, #-3, MUL VL]\n" + "ld1b { z10.b }, p2/Z, [x28, #-3, MUL VL]\n" "sdot z19.s, z4.b, z0.b[1]\n" "sdot z23.s, z4.b, z1.b[1]\n" "sdot z27.s, z4.b, z2.b[1]\n" "sdot z31.s, z4.b, z3.b[1]\n" - "ld1b { z4.b }, p2/Z, [x11, #-2, MUL VL]\n" + "ld1b { z4.b }, p2/Z, [x28, #-2, MUL VL]\n" "sdot z16.s, z5.b, z0.b[2]\n" "sdot z20.s, z5.b, z1.b[2]\n" "sdot z24.s, z5.b, z2.b[2]\n" "sdot z28.s, z5.b, z3.b[2]\n" - "ld1b { z5.b }, p2/Z, [x11, #-1, MUL VL]\n" + "ld1b { z5.b }, p2/Z, [x28, #-1, MUL VL]\n" "sdot z17.s, z6.b, z0.b[2]\n" "sdot z21.s, z6.b, z1.b[2]\n" "sdot z25.s, z6.b, z2.b[2]\n" @@ -1204,135 +1159,139 @@ void sve_hybrid_s8qa_dot_4x4VL ( "sdot z23.s, z5.b, z1.b[3]\n" "sdot z27.s, z5.b, z2.b[3]\n" "sdot z31.s, z5.b, z3.b[3]\n" - "tbnz %x[flags], #31, 54f\n" + "tbnz %x[flags], #31, 50f\n" "sdot z11.s, z0.b, z15.b\n" "sdot z12.s, z1.b, z15.b\n" "sdot z13.s, z2.b, z15.b\n" "sdot z14.s, z3.b, z15.b\n" - "54:" // Height 4: Multiply loop: unique 7: skip row sum - "prfm pldl1keep, [x26, #0x80]\n" - "sub x27, x27, #0x10\n" - "prfm pldl1keep, [x24, #0x80]\n" - "cmp x27, #0x10\n" + "50:" // Height 4: Multiply loop: unique 7: skip row sum + "prfm pldl1keep, [x23, #0x80]\n" + "sub x24, x24, #0x10\n" "prfm pldl1keep, [x22, #0x80]\n" + "cmp x24, #0x10\n" + "prfm pldl1keep, [x21, #0x80]\n" "prfm pldl1keep, [x20, #0x80]\n" - "bgt 53b\n" - "55:" // Height 4: Multiply loop: Single iteration only - "ld1b { z6.b }, p2/Z, [x11]\n" - "whilelt p0.b, XZR, x27\n" - "ld1b { z7.b }, p2/Z, [x11, #1, MUL VL]\n" - "subs x27, x27, #0x4\n" - "ld1rqb { z0.b }, p0/Z, [x26]\n" - "sdot z16.s, z6.b, z0.b[0]\n" - "ld1rqb { z1.b }, p0/Z, [x24]\n" - "add x26, x26, #0x10\n" - "sdot z17.s, z7.b, z0.b[0]\n" - "ld1rqb { z2.b }, p0/Z, [x22]\n" - "add x24, x24, #0x10\n" - "sdot z20.s, z6.b, z1.b[0]\n" - "ld1rqb { z3.b }, p0/Z, [x20]\n" + "bgt 49b\n" + "51:" // Height 4: Multiply loop: Single iteration only + "ld1b { z4.b }, p2/Z, [x28]\n" + "whilelt p0.b, XZR, x24\n" + "ld1b { z5.b }, p2/Z, [x28, #1, MUL VL]\n" + "subs x24, x24, #0x4\n" + "ld1rqb { z0.b }, p0/Z, [x23]\n" + "sdot z16.s, z4.b, z0.b[0]\n" + "ld1rqb { z1.b }, p0/Z, [x22]\n" + "add x23, x23, #0x10\n" + "sdot z17.s, z5.b, z0.b[0]\n" + "ld1rqb { z2.b }, p0/Z, [x21]\n" "add x22, x22, #0x10\n" - "sdot z24.s, z6.b, z2.b[0]\n" - "ld1b { z8.b }, p2/Z, [x11, #2, MUL VL]\n" + "sdot z20.s, z4.b, z1.b[0]\n" + "ld1rqb { z3.b }, p0/Z, [x20]\n" + "add x21, x21, #0x10\n" + "sdot z24.s, z4.b, z2.b[0]\n" + "ld1b { z6.b }, p2/Z, [x28, #2, MUL VL]\n" "add x20, x20, #0x10\n" - "sdot z21.s, z7.b, z1.b[0]\n" - "ld1b { z9.b }, p2/Z, [x11, #3, MUL VL]\n" - "addvl x11, x11, #4\n" - "sdot z28.s, z6.b, z3.b[0]\n" - "sdot z25.s, z7.b, z2.b[0]\n" - "sdot z29.s, z7.b, z3.b[0]\n" - "sdot z18.s, z8.b, z0.b[0]\n" - "sdot z22.s, z8.b, z1.b[0]\n" - "sdot z26.s, z8.b, z2.b[0]\n" - "sdot z30.s, z8.b, z3.b[0]\n" - "sdot z19.s, z9.b, z0.b[0]\n" - "sdot z23.s, z9.b, z1.b[0]\n" - "sdot z27.s, z9.b, z2.b[0]\n" - "sdot z31.s, z9.b, z3.b[0]\n" - "ble 56f\n" - "ld1b { z10.b }, p2/Z, [x11]\n" - "sdot z16.s, z10.b, z0.b[1]\n" - "ld1b { z4.b }, p2/Z, [x11, #1, MUL VL]\n" - "subs x27, x27, #0x4\n" - "sdot z20.s, z10.b, z1.b[1]\n" - "ld1b { z5.b }, p2/Z, [x11, #2, MUL VL]\n" - "sdot z24.s, z10.b, z2.b[1]\n" - "ld1b { z6.b }, p2/Z, [x11, #3, MUL VL]\n" - "addvl x11, x11, #4\n" - "sdot z28.s, z10.b, z3.b[1]\n" - "sdot z17.s, z4.b, z0.b[1]\n" - "sdot z21.s, z4.b, z1.b[1]\n" - "sdot z25.s, z4.b, z2.b[1]\n" - "sdot z29.s, z4.b, z3.b[1]\n" - "sdot z18.s, z5.b, z0.b[1]\n" - "sdot z22.s, z5.b, z1.b[1]\n" - "sdot z26.s, z5.b, z2.b[1]\n" - "sdot z30.s, z5.b, z3.b[1]\n" - "sdot z19.s, z6.b, z0.b[1]\n" - "sdot z23.s, z6.b, z1.b[1]\n" - "sdot z27.s, z6.b, z2.b[1]\n" - "sdot z31.s, z6.b, z3.b[1]\n" - "ble 56f\n" - "ld1b { z7.b }, p2/Z, [x11]\n" - "sdot z16.s, z7.b, z0.b[2]\n" - "ld1b { z8.b }, p2/Z, [x11, #1, MUL VL]\n" - "subs x27, x27, #0x4\n" - "sdot z20.s, z7.b, z1.b[2]\n" - "ld1b { z9.b }, p2/Z, [x11, #2, MUL VL]\n" - "sdot z24.s, z7.b, z2.b[2]\n" - "ld1b { z10.b }, p2/Z, [x11, #3, MUL VL]\n" - "addvl x11, x11, #4\n" - "sdot z28.s, z7.b, z3.b[2]\n" - "sdot z17.s, z8.b, z0.b[2]\n" - "sdot z21.s, z8.b, z1.b[2]\n" - "sdot z25.s, z8.b, z2.b[2]\n" - "sdot z29.s, z8.b, z3.b[2]\n" - "sdot z18.s, z9.b, z0.b[2]\n" - "sdot z22.s, z9.b, z1.b[2]\n" - "sdot z26.s, z9.b, z2.b[2]\n" - "sdot z30.s, z9.b, z3.b[2]\n" - "sdot z19.s, z10.b, z0.b[2]\n" - "sdot z23.s, z10.b, z1.b[2]\n" - "sdot z27.s, z10.b, z2.b[2]\n" - "sdot z31.s, z10.b, z3.b[2]\n" - "ble 56f\n" - "ld1b { z4.b }, p2/Z, [x11]\n" - "sdot z16.s, z4.b, z0.b[3]\n" - "ld1b { z5.b }, p2/Z, [x11, #1, MUL VL]\n" - "sdot z20.s, z4.b, z1.b[3]\n" - "ld1b { z6.b }, p2/Z, [x11, #2, MUL VL]\n" - "sdot z24.s, z4.b, z2.b[3]\n" - "ld1b { z7.b }, p2/Z, [x11, #3, MUL VL]\n" - "addvl x11, x11, #4\n" - "sdot z28.s, z4.b, z3.b[3]\n" - "sdot z17.s, z5.b, z0.b[3]\n" - "sdot z21.s, z5.b, z1.b[3]\n" - "sdot z25.s, z5.b, z2.b[3]\n" - "sdot z29.s, z5.b, z3.b[3]\n" - "sdot z18.s, z6.b, z0.b[3]\n" - "sdot z22.s, z6.b, z1.b[3]\n" - "sdot z26.s, z6.b, z2.b[3]\n" - "sdot z30.s, z6.b, z3.b[3]\n" - "sdot z19.s, z7.b, z0.b[3]\n" - "sdot z23.s, z7.b, z1.b[3]\n" - "sdot z27.s, z7.b, z2.b[3]\n" - "sdot z31.s, z7.b, z3.b[3]\n" - "56:" // Height 4: Multiply loop: multiply skip - "tbnz %x[flags], #31, 57f\n" + "sdot z21.s, z5.b, z1.b[0]\n" + "ld1b { z7.b }, p2/Z, [x28, #3, MUL VL]\n" + "addvl x28, x28, #4\n" + "sdot z28.s, z4.b, z3.b[0]\n" + "sdot z25.s, z5.b, z2.b[0]\n" + "sdot z29.s, z5.b, z3.b[0]\n" + "sdot z18.s, z6.b, z0.b[0]\n" + "sdot z22.s, z6.b, z1.b[0]\n" + "sdot z26.s, z6.b, z2.b[0]\n" + "sdot z30.s, z6.b, z3.b[0]\n" + "sdot z19.s, z7.b, z0.b[0]\n" + "sdot z23.s, z7.b, z1.b[0]\n" + "sdot z27.s, z7.b, z2.b[0]\n" + "sdot z31.s, z7.b, z3.b[0]\n" + "ble 52f\n" + "ld1b { z8.b }, p2/Z, [x28]\n" + "sdot z16.s, z8.b, z0.b[1]\n" + "ld1b { z9.b }, p2/Z, [x28, #1, MUL VL]\n" + "subs x24, x24, #0x4\n" + "sdot z20.s, z8.b, z1.b[1]\n" + "ld1b { z10.b }, p2/Z, [x28, #2, MUL VL]\n" + "sdot z24.s, z8.b, z2.b[1]\n" + "ld1b { z4.b }, p2/Z, [x28, #3, MUL VL]\n" + "addvl x28, x28, #4\n" + "sdot z28.s, z8.b, z3.b[1]\n" + "sdot z17.s, z9.b, z0.b[1]\n" + "sdot z21.s, z9.b, z1.b[1]\n" + "sdot z25.s, z9.b, z2.b[1]\n" + "sdot z29.s, z9.b, z3.b[1]\n" + "sdot z18.s, z10.b, z0.b[1]\n" + "sdot z22.s, z10.b, z1.b[1]\n" + "sdot z26.s, z10.b, z2.b[1]\n" + "sdot z30.s, z10.b, z3.b[1]\n" + "sdot z19.s, z4.b, z0.b[1]\n" + "sdot z23.s, z4.b, z1.b[1]\n" + "sdot z27.s, z4.b, z2.b[1]\n" + "sdot z31.s, z4.b, z3.b[1]\n" + "ble 52f\n" + "ld1b { z5.b }, p2/Z, [x28]\n" + "sdot z16.s, z5.b, z0.b[2]\n" + "ld1b { z6.b }, p2/Z, [x28, #1, MUL VL]\n" + "subs x24, x24, #0x4\n" + "sdot z20.s, z5.b, z1.b[2]\n" + "ld1b { z7.b }, p2/Z, [x28, #2, MUL VL]\n" + "sdot z24.s, z5.b, z2.b[2]\n" + "ld1b { z8.b }, p2/Z, [x28, #3, MUL VL]\n" + "addvl x28, x28, #4\n" + "sdot z28.s, z5.b, z3.b[2]\n" + "sdot z17.s, z6.b, z0.b[2]\n" + "sdot z21.s, z6.b, z1.b[2]\n" + "sdot z25.s, z6.b, z2.b[2]\n" + "sdot z29.s, z6.b, z3.b[2]\n" + "sdot z18.s, z7.b, z0.b[2]\n" + "sdot z22.s, z7.b, z1.b[2]\n" + "sdot z26.s, z7.b, z2.b[2]\n" + "sdot z30.s, z7.b, z3.b[2]\n" + "sdot z19.s, z8.b, z0.b[2]\n" + "sdot z23.s, z8.b, z1.b[2]\n" + "sdot z27.s, z8.b, z2.b[2]\n" + "sdot z31.s, z8.b, z3.b[2]\n" + "ble 52f\n" + "ld1b { z9.b }, p2/Z, [x28]\n" + "sdot z16.s, z9.b, z0.b[3]\n" + "ld1b { z10.b }, p2/Z, [x28, #1, MUL VL]\n" + "sdot z20.s, z9.b, z1.b[3]\n" + "ld1b { z4.b }, p2/Z, [x28, #2, MUL VL]\n" + "sdot z24.s, z9.b, z2.b[3]\n" + "ld1b { z5.b }, p2/Z, [x28, #3, MUL VL]\n" + "addvl x28, x28, #4\n" + "sdot z28.s, z9.b, z3.b[3]\n" + "sdot z17.s, z10.b, z0.b[3]\n" + "sdot z21.s, z10.b, z1.b[3]\n" + "sdot z25.s, z10.b, z2.b[3]\n" + "sdot z29.s, z10.b, z3.b[3]\n" + "sdot z18.s, z4.b, z0.b[3]\n" + "sdot z22.s, z4.b, z1.b[3]\n" + "sdot z26.s, z4.b, z2.b[3]\n" + "sdot z30.s, z4.b, z3.b[3]\n" + "sdot z19.s, z5.b, z0.b[3]\n" + "sdot z23.s, z5.b, z1.b[3]\n" + "sdot z27.s, z5.b, z2.b[3]\n" + "sdot z31.s, z5.b, z3.b[3]\n" + "52:" // Height 4: Multiply loop: multiply skip + "tbnz %x[flags], #31, 53f\n" "sdot z11.s, z0.b, z15.b\n" "sdot z12.s, z1.b, z15.b\n" "sdot z13.s, z2.b, z15.b\n" "sdot z14.s, z3.b, z15.b\n" - "57:" // Height 4: Multiply loop: unique 8: skip row sum - "prfm pldl1keep, [x26, #0x80]\n" - "add x28, x28, #0x1\n" - "prfm pldl1keep, [x24, #0x80]\n" + "53:" // Height 4: Multiply loop: unique 8: skip row sum + "prfm pldl1keep, [x23, #0x80]\n" + "add x25, x25, #0x1\n" "prfm pldl1keep, [x22, #0x80]\n" + "prfm pldl1keep, [x21, #0x80]\n" "prfm pldl1keep, [x20, #0x80]\n" "ldr w19, [%x[args_ptr], %[offsetof_num_strings]]\n" - "cmp x28, x19\n" - "bne 50b\n" - "tbnz %x[flags], #31, 58f\n" + "cmp x25, x19\n" + "bne 46b\n" + "ldr x19, [%x[args_ptr], %[offsetof_output_offset]]\n" + "add x22, x26, x19\n" + "add x21, x22, x19\n" + "add x20, x21, x19\n" + "tbnz %x[flags], #31, 54f\n" "add x19, %x[qp], %[b_offset]\n" "ld1rw { z4.s }, p2/Z, [x19]\n" "neg z4.s, p2/M, z4.s\n" @@ -1350,19 +1309,19 @@ void sve_hybrid_s8qa_dot_4x4VL ( "mul z12.s, p2/M, z12.s, z4.s\n" "mul z13.s, p2/M, z13.s, z4.s\n" "mul z14.s, p2/M, z14.s, z4.s\n" - "58:" // Height 4: skip row sum fixup + "54:" // Height 4: skip row sum fixup "add z16.s, z16.s, z11.s\n" - "ld1w { z0.s }, p2/Z, [x10]\n" + "ld1w { z0.s }, p2/Z, [x27]\n" "orr %x[flags], %x[flags], #0x80000000\n" "add z17.s, z17.s, z11.s\n" - "ld1w { z1.s }, p2/Z, [x10, #1, MUL VL]\n" - "add x20, %x[qp], %[per_layer_right_shift]\n" + "ld1w { z1.s }, p2/Z, [x27, #1, MUL VL]\n" + "add x23, %x[qp], %[per_layer_right_shift]\n" "add z18.s, z18.s, z11.s\n" - "ld1w { z2.s }, p2/Z, [x10, #2, MUL VL]\n" + "ld1w { z2.s }, p2/Z, [x27, #2, MUL VL]\n" "add x19, %x[qp], %[per_layer_mul]\n" "add z19.s, z19.s, z11.s\n" - "ld1w { z3.s }, p2/Z, [x10, #3, MUL VL]\n" - "addvl x10, x10, #4\n" + "ld1w { z3.s }, p2/Z, [x27, #3, MUL VL]\n" + "addvl x27, x27, #4\n" "add z20.s, z20.s, z12.s\n" "ld1rw { z4.s }, p2/Z, [x19]\n" "add z21.s, z21.s, z12.s\n" @@ -1389,7 +1348,7 @@ void sve_hybrid_s8qa_dot_4x4VL ( "add z26.s, z26.s, z2.s\n" "add z27.s, z27.s, z3.s\n" "add z28.s, z28.s, z0.s\n" - "ld1rw { z0.s }, p2/Z, [x20]\n" + "ld1rw { z0.s }, p2/Z, [x23]\n" "add z29.s, z29.s, z1.s\n" "add z30.s, z30.s, z2.s\n" "add z31.s, z31.s, z3.s\n" @@ -1409,7 +1368,7 @@ void sve_hybrid_s8qa_dot_4x4VL ( ".inst 0x04a477bd // sqrdmulh z29.s, z29.s, z4.s\n" ".inst 0x04a477de // sqrdmulh z30.s, z30.s, z4.s\n" ".inst 0x04a477ff // sqrdmulh z31.s, z31.s, z4.s\n" - "tbz %x[flags], #5, 59f\n" + "tbz %x[flags], #5, 55f\n" "and z4.d, z16.d, z0.d\n" "asr z4.s, z4.s, #0x1f\n" "and z5.d, z17.d, z0.d\n" @@ -1458,7 +1417,7 @@ void sve_hybrid_s8qa_dot_4x4VL ( "sqadd z29.s, z29.s, z10.s\n" "sqadd z30.s, z30.s, z4.s\n" "sqadd z31.s, z31.s, z5.s\n" - "59:" // Height 4: no shift correction + "55:" // Height 4: no shift correction ".inst 0x44828810 // srshl z16.s, p2/M, z16.s, z0.s\n" "add x19, %x[qp], %[c_offset]\n" "ld1rw { z4.s }, p2/Z, [x19]\n" @@ -1489,9 +1448,9 @@ void sve_hybrid_s8qa_dot_4x4VL ( "uzp1 z17.h, z18.h, z19.h\n" "smax z20.s, p2/M, z20.s, z5.s\n" "uzp1 z16.b, z16.b, z17.b\n" - "st1b { z16.b }, p1, [x9]\n" + "st1b { z16.b }, p1, [x26]\n" "add z21.s, z21.s, z4.s\n" - "addvl x9, x9, #1\n" + "addvl x26, x26, #1\n" ".inst 0x44828816 // srshl z22.s, p2/M, z22.s, z0.s\n" ".inst 0x44828817 // srshl z23.s, p2/M, z23.s, z0.s\n" ".inst 0x44828818 // srshl z24.s, p2/M, z24.s, z0.s\n" @@ -1514,61 +1473,58 @@ void sve_hybrid_s8qa_dot_4x4VL ( "uzp1 z21.h, z22.h, z23.h\n" ".inst 0x4482881b // srshl z27.s, p2/M, z27.s, z0.s\n" "uzp1 z20.b, z20.b, z21.b\n" - "st1b { z20.b }, p1, [x25]\n" + "st1b { z20.b }, p1, [x22]\n" "add z26.s, z26.s, z4.s\n" - "addvl x25, x25, #1\n" - "add z27.s, z27.s, z4.s\n" "smax z25.s, p2/M, z25.s, z5.s\n" + "add z27.s, z27.s, z4.s\n" ".inst 0x4482881c // srshl z28.s, p2/M, z28.s, z0.s\n" "smin z26.s, p2/M, z26.s, z6.s\n" - "smin z27.s, p2/M, z27.s, z6.s\n" "uzp1 z24.h, z24.h, z25.h\n" + "smin z27.s, p2/M, z27.s, z6.s\n" "add z28.s, z28.s, z4.s\n" "smax z26.s, p2/M, z26.s, z5.s\n" + ".inst 0x4482881d // srshl z29.s, p2/M, z29.s, z0.s\n" "smax z27.s, p2/M, z27.s, z5.s\n" "smin z28.s, p2/M, z28.s, z6.s\n" - ".inst 0x4482881d // srshl z29.s, p2/M, z29.s, z0.s\n" ".inst 0x4482881e // srshl z30.s, p2/M, z30.s, z0.s\n" + "add z29.s, z29.s, z4.s\n" "uzp1 z25.h, z26.h, z27.h\n" "smax z28.s, p2/M, z28.s, z5.s\n" - "add z29.s, z29.s, z4.s\n" "add z30.s, z30.s, z4.s\n" "uzp1 z24.b, z24.b, z25.b\n" - "st1b { z24.b }, p1, [x23]\n" + "st1b { z24.b }, p1, [x21]\n" "smin z29.s, p2/M, z29.s, z6.s\n" - "addvl x23, x23, #1\n" "smin z30.s, p2/M, z30.s, z6.s\n" ".inst 0x4482881f // srshl z31.s, p2/M, z31.s, z0.s\n" "smax z29.s, p2/M, z29.s, z5.s\n" - "add z31.s, z31.s, z4.s\n" "smax z30.s, p2/M, z30.s, z5.s\n" + "add z31.s, z31.s, z4.s\n" "uzp1 z28.h, z28.h, z29.h\n" "smin z31.s, p2/M, z31.s, z6.s\n" "smax z31.s, p2/M, z31.s, z5.s\n" "uzp1 z29.h, z30.h, z31.h\n" "uzp1 z28.b, z28.b, z29.b\n" - "st1b { z28.b }, p1, [x21]\n" - "addvl x21, x21, #1\n" - "60:" // Height 4: Writeback done - "decw x12, ALL, MUL #4\n" - "cmp x12, XZR\n" - "bgt 48b\n" + "st1b { z28.b }, p1, [x20]\n" + "56:" // Height 4: Writeback done + "decw x9, ALL, MUL #4\n" + "cmp x9, XZR\n" + "bgt 44b\n" "subs %x[M], %x[M], #0x4\n" - "beq 62f\n" + "beq 58f\n" "ldr x20, [%x[args_ptr], %[offsetof_input_offset]]\n" - "tbz %x[flags], #3, 61f\n" + "tbz %x[flags], #3, 57f\n" "add x20, x20, #0x4\n" "str x20, [%x[args_ptr], %[offsetof_input_offset]]\n" "b 1b\n" - "61:" // Update direct input + "57:" // Update direct input "mov x19, #0x4\n" "madd %x[input_ptr], x19, x20, %x[input_ptr]\n" "b 1b\n" - "62:" // Exit + "58:" // Exit : [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", "x11", "x12", "x19", "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" + : "cc", "memory", "p0", "p1", "p2", "x9", "x19", "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" ); } |