C2S4 QS8 Neon GEMM/IGEMM microkernels.
- Rename existing S4C2 to C2S4 as it isa shuffle variant of the C2 dup microkernel.
- Add QC8 microkernels
- Add all sizes. Same set of microkernels as C2 and C4, except no gemmlowp.
PiperOrigin-RevId: 408950530
diff --git a/src/qs8-igemm/c2-neon-mull-padal-shuffle.c.in b/src/qs8-igemm/c2-neon-mull-padal-shuffle.c.in
index b03f9b6..ede34b9 100644
--- a/src/qs8-igemm/c2-neon-mull-padal-shuffle.c.in
+++ b/src/qs8-igemm/c2-neon-mull-padal-shuffle.c.in
@@ -24,7 +24,7 @@
$if REQUANTIZATION == "FP32" and CHANNELWISE and not ARMV8:
$PARAMS_STRUCT = "neon_fp32"
$ISA = "neonv8" if ARMV8 else "neon"
-void xnn_${DATATYPE}_igemm_minmax_${REQUANTIZATION.lower()}_ukernel_${MR}x${NR}s4c2__${ISA}_${"mlal" if MLA else "mull"}_padal(
+void xnn_${DATATYPE}_igemm_minmax_${REQUANTIZATION.lower()}_ukernel_${MR}x${NR}c2s4__${ISA}_${"mlal" if MLA else "mull"}_padal(
size_t mr,
size_t nc,
size_t kc,
diff --git a/src/qs8-igemm/gen/1x16c2s4-minmax-rndnu-neon-mlal-padal.c b/src/qs8-igemm/gen/1x16c2s4-minmax-rndnu-neon-mlal-padal.c
new file mode 100644
index 0000000..a45e306
--- /dev/null
+++ b/src/qs8-igemm/gen/1x16c2s4-minmax-rndnu-neon-mlal-padal.c
@@ -0,0 +1,350 @@
+// Auto-generated file. Do not edit!
+// Template: src/qs8-igemm/c2-neon-mull-padal-shuffle.c.in
+// Generator: tools/xngen
+//
+// Copyright 2021 Google LLC
+//
+// This source code is licensed under the BSD-style license found in the
+// LICENSE file in the root directory of this source tree.
+
+#include <assert.h>
+
+#include <arm_neon.h>
+
+#include <xnnpack/gemm.h>
+#include <xnnpack/math.h>
+
+
+void xnn_qs8_igemm_minmax_rndnu_ukernel_1x16c2s4__neon_mlal_padal(
+ size_t mr,
+ size_t nc,
+ size_t kc,
+ size_t ks,
+ const int8_t** restrict a,
+ const void* restrict w,
+ int8_t* restrict c,
+ size_t cm_stride,
+ size_t cn_stride,
+ size_t a_offset,
+ const int8_t* zero,
+ const union xnn_qs8_conv_minmax_params params[restrict XNN_MIN_ELEMENTS(1)]) XNN_DISABLE_TSAN XNN_DISABLE_MSAN
+{
+ assert(mr != 0);
+ assert(mr <= 1);
+ assert(nc != 0);
+ assert(kc != 0);
+ assert(ks != 0);
+ assert(ks % (1 * sizeof(void*)) == 0);
+ assert(a_offset % sizeof(int8_t) == 0);
+ assert(a != NULL);
+ assert(w != NULL);
+ assert(c != NULL);
+
+ int8_t* c0 = c;
+
+ do {
+ int32x4_t vacc0x0123 = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc0x4567 = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc0x89AB = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc0xCDEF = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+
+ size_t p = ks;
+ do {
+ const int8_t* restrict a0 = a[0];
+ if XNN_UNPREDICTABLE(a0 != zero) {
+ a0 = (const int8_t*) ((uintptr_t) a0 + a_offset);
+ }
+ a += 1;
+
+ size_t k = kc;
+
+ while (k >= 16 * sizeof(int8_t)) {
+ int8x8_t va0x0 = vld1_s8(a0); a0 += 8;
+ int8x8_t va0x1 = vld1_s8(a0); a0 += 8;
+
+ const int8x8_t vb0123c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ int16x8_t vprod0x0123c0 = vmull_s8(vb0123c0x0, va0x0);
+ const int8x8_t vb0123c0x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x0123c0 = vmlal_s8(vprod0x0123c0, vb0123c0x1, va0x1);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c0);
+ int16x8_t vprod0x4567c0 = vmull_s8(vb4567c0x0, va0x0);
+ const int8x8_t vb4567c0x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x4567c0 = vmlal_s8(vprod0x4567c0, vb4567c0x1, va0x1);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c0);
+ int16x8_t vprod0x89ABc0 = vmull_s8(vb89ABc0x0, va0x0);
+ const int8x8_t vb89ABc0x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x89ABc0 = vmlal_s8(vprod0x89ABc0, vb89ABc0x1, va0x1);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc0);
+ int16x8_t vprod0xCDEFc0 = vmull_s8(vbCDEFc0x0, va0x0);
+ const int8x8_t vbCDEFc0x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0xCDEFc0 = vmlal_s8(vprod0xCDEFc0, vbCDEFc0x1, va0x1);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc0);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va0x1 = vext_s8(va0x1, va0x1, 2);
+ int16x8_t vprod0x0123c1 = vmull_s8(vb0123c1x0, va0x0);
+ const int8x8_t vb0123c1x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x0123c1 = vmlal_s8(vprod0x0123c1, vb0123c1x1, va0x1);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c1);
+ int16x8_t vprod0x4567c1 = vmull_s8(vb4567c1x0, va0x0);
+ const int8x8_t vb4567c1x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x4567c1 = vmlal_s8(vprod0x4567c1, vb4567c1x1, va0x1);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c1);
+ int16x8_t vprod0x89ABc1 = vmull_s8(vb89ABc1x0, va0x0);
+ const int8x8_t vb89ABc1x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x89ABc1 = vmlal_s8(vprod0x89ABc1, vb89ABc1x1, va0x1);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc1);
+ int16x8_t vprod0xCDEFc1 = vmull_s8(vbCDEFc1x0, va0x0);
+ const int8x8_t vbCDEFc1x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0xCDEFc1 = vmlal_s8(vprod0xCDEFc1, vbCDEFc1x1, va0x1);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc1);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va0x1 = vext_s8(va0x1, va0x1, 2);
+ int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2x0, va0x0);
+ const int8x8_t vb0123c2x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x0123c2 = vmlal_s8(vprod0x0123c2, vb0123c2x1, va0x1);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2x0, va0x0);
+ const int8x8_t vb4567c2x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x4567c2 = vmlal_s8(vprod0x4567c2, vb4567c2x1, va0x1);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ int16x8_t vprod0x89ABc2 = vmull_s8(vb89ABc2x0, va0x0);
+ const int8x8_t vb89ABc2x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x89ABc2 = vmlal_s8(vprod0x89ABc2, vb89ABc2x1, va0x1);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc2);
+ int16x8_t vprod0xCDEFc2 = vmull_s8(vbCDEFc2x0, va0x0);
+ const int8x8_t vbCDEFc2x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0xCDEFc2 = vmlal_s8(vprod0xCDEFc2, vbCDEFc2x1, va0x1);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc2);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va0x1 = vext_s8(va0x1, va0x1, 2);
+ int16x8_t vprod0x0123c3 = vmull_s8(vb0123c3x0, va0x0);
+ const int8x8_t vb0123c3x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x0123c3 = vmlal_s8(vprod0x0123c3, vb0123c3x1, va0x1);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c3);
+ int16x8_t vprod0x4567c3 = vmull_s8(vb4567c3x0, va0x0);
+ const int8x8_t vb4567c3x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x4567c3 = vmlal_s8(vprod0x4567c3, vb4567c3x1, va0x1);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c3);
+ int16x8_t vprod0x89ABc3 = vmull_s8(vb89ABc3x0, va0x0);
+ const int8x8_t vb89ABc3x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x89ABc3 = vmlal_s8(vprod0x89ABc3, vb89ABc3x1, va0x1);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc3);
+ int16x8_t vprod0xCDEFc3 = vmull_s8(vbCDEFc3x0, va0x0);
+ const int8x8_t vbCDEFc3x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0xCDEFc3 = vmlal_s8(vprod0xCDEFc3, vbCDEFc3x1, va0x1);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc3);
+
+ k -= 16 * sizeof(int8_t);
+ }
+
+ if (k >= 8 * sizeof(int8_t)) {
+ int8x8_t va0x0 = vld1_s8(a0); a0 += 8;
+
+ const int8x8_t vb0123c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ int16x8_t vprod0x0123c0 = vmull_s8(vb0123c0x0, va0x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c0);
+ int16x8_t vprod0x4567c0 = vmull_s8(vb4567c0x0, va0x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c0);
+ int16x8_t vprod0x89ABc0 = vmull_s8(vb89ABc0x0, va0x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc0);
+ int16x8_t vprod0xCDEFc0 = vmull_s8(vbCDEFc0x0, va0x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc0);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ int16x8_t vprod0x0123c1 = vmull_s8(vb0123c1x0, va0x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c1);
+ int16x8_t vprod0x4567c1 = vmull_s8(vb4567c1x0, va0x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c1);
+ int16x8_t vprod0x89ABc1 = vmull_s8(vb89ABc1x0, va0x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc1);
+ int16x8_t vprod0xCDEFc1 = vmull_s8(vbCDEFc1x0, va0x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc1);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2x0, va0x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2x0, va0x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ int16x8_t vprod0x89ABc2 = vmull_s8(vb89ABc2x0, va0x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc2);
+ int16x8_t vprod0xCDEFc2 = vmull_s8(vbCDEFc2x0, va0x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc2);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ int16x8_t vprod0x0123c3 = vmull_s8(vb0123c3x0, va0x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c3);
+ int16x8_t vprod0x4567c3 = vmull_s8(vb4567c3x0, va0x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c3);
+ int16x8_t vprod0x89ABc3 = vmull_s8(vb89ABc3x0, va0x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc3);
+ int16x8_t vprod0xCDEFc3 = vmull_s8(vbCDEFc3x0, va0x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc3);
+
+ k -= 8 * sizeof(int8_t);
+ }
+
+ if XNN_UNLIKELY(k != 0) {
+ const int8x8_t va0 = vld1_s8(a0); a0 = (const int8_t*) ((uintptr_t) a0 + k);
+
+ const int8x8_t vb0123c0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c0 = vmull_s8(vb0123c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c0);
+ const int16x8_t vprod0x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c0);
+ const int16x8_t vprod0x89ABc0 = vmull_s8(vb89ABc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc0);
+ const int16x8_t vprod0xCDEFc0 = vmull_s8(vbCDEFc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc0);
+
+ if (k > 2 * sizeof(int8_t)) {
+ const int8x8_t vb0123c1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c1 = vmull_s8(vb0123c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c1);
+ const int16x8_t vprod0x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c1);
+ const int16x8_t vprod0x89ABc1 = vmull_s8(vb89ABc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc1);
+ const int16x8_t vprod0xCDEFc1 = vmull_s8(vbCDEFc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc1);
+
+ if (k > 4 * sizeof(int8_t)) {
+ const int8x8_t vb0123c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ const int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ const int16x8_t vprod0x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc2);
+ const int16x8_t vprod0xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc2);
+
+ if (k > 6 * sizeof(int8_t)) {
+ const int8x8_t vb0123c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ const int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ const int16x8_t vprod0x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc2);
+ const int16x8_t vprod0xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc2);
+ }
+ }
+ }
+ }
+ p -= 1 * sizeof(void*);
+ } while (p != 0);
+
+ const int32x4_t vright_pre_shift = vld1q_dup_s32(¶ms->rndnu_neon.right_pre_shift);
+ const int32x4_t vmultiplier = vld1q_dup_s32(¶ms->rndnu_neon.multiplier);
+ const int32x4_t vright_post_shift = vld1q_dup_s32(¶ms->rndnu_neon.right_post_shift);
+
+ vacc0x0123 = vshlq_s32(vacc0x0123, vright_pre_shift);
+ vacc0x4567 = vshlq_s32(vacc0x4567, vright_pre_shift);
+ vacc0x89AB = vshlq_s32(vacc0x89AB, vright_pre_shift);
+ vacc0xCDEF = vshlq_s32(vacc0xCDEF, vright_pre_shift);
+
+ vacc0x0123 = vqdmulhq_s32(vacc0x0123, vmultiplier);
+ vacc0x4567 = vqdmulhq_s32(vacc0x4567, vmultiplier);
+ vacc0x89AB = vqdmulhq_s32(vacc0x89AB, vmultiplier);
+ vacc0xCDEF = vqdmulhq_s32(vacc0xCDEF, vmultiplier);
+
+ vacc0x0123 = vrshlq_s32(vacc0x0123, vright_post_shift);
+ vacc0x4567 = vrshlq_s32(vacc0x4567, vright_post_shift);
+ vacc0x89AB = vrshlq_s32(vacc0x89AB, vright_post_shift);
+ vacc0xCDEF = vrshlq_s32(vacc0xCDEF, vright_post_shift);
+
+ const int16x8_t voutput_zero_point = vld1q_dup_s16(¶ms->rndnu_neon.output_zero_point);
+#if XNN_ARCH_ARM64
+ const int16x8_t vacc0x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc0x0123), vacc0x4567), voutput_zero_point);
+ const int16x8_t vacc0x89ABCDEF = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc0x89AB), vacc0xCDEF), voutput_zero_point);
+
+ int8x16_t vout0x0123456789ABCDEF = vqmovn_high_s16(vqmovn_s16(vacc0x01234567), vacc0x89ABCDEF);
+#else
+ const int16x8_t vacc0x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc0x0123), vqmovn_s32(vacc0x4567)), voutput_zero_point);
+ const int16x8_t vacc0x89ABCDEF = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc0x89AB), vqmovn_s32(vacc0xCDEF)), voutput_zero_point);
+
+ int8x16_t vout0x0123456789ABCDEF = vcombine_s8(vqmovn_s16(vacc0x01234567), vqmovn_s16(vacc0x89ABCDEF));
+#endif
+ const int8x16_t voutput_min = vld1q_dup_s8(¶ms->rndnu_neon.output_min);
+ const int8x16_t voutput_max = vld1q_dup_s8(¶ms->rndnu_neon.output_max);
+
+ vout0x0123456789ABCDEF = vmaxq_s8(vout0x0123456789ABCDEF, voutput_min);
+
+ vout0x0123456789ABCDEF = vminq_s8(vout0x0123456789ABCDEF, voutput_max);
+
+ if (nc >= 16) {
+ vst1q_s8(c0 + 0, vout0x0123456789ABCDEF);
+
+ c0 = (int8_t*) ((uintptr_t) c0 + cn_stride);
+
+ a = (const int8_t**restrict) ((uintptr_t) a - ks);
+
+ nc -= 16;
+ } else {
+ int8x8_t vout0x01234567 = vget_low_s8(vout0x0123456789ABCDEF);
+ if (nc & 8) {
+ vst1_s8(c0, vout0x01234567); c0 += 8;
+ vout0x01234567 = vget_high_s8(vout0x0123456789ABCDEF);
+ }
+ if (nc & 4) {
+ vst1_lane_u32(__builtin_assume_aligned(c0, 1), vreinterpret_u32_s8(vout0x01234567), 0); c0 += 4;
+ vout0x01234567 = vext_s8(vout0x01234567, vout0x01234567, 4);
+ }
+ if (nc & 2) {
+ vst1_lane_u16(__builtin_assume_aligned(c0, 1), vreinterpret_u16_s8(vout0x01234567), 0); c0 += 2;
+ vout0x01234567 = vext_s8(vout0x01234567, vout0x01234567, 2);
+ }
+ if (nc & 1) {
+ vst1_lane_s8(c0, vout0x01234567, 0);
+ }
+
+ nc = 0;
+ }
+ } while (nc != 0);
+}
diff --git a/src/qs8-igemm/gen/1x16c2s4-minmax-rndnu-neon-mull-padal.c b/src/qs8-igemm/gen/1x16c2s4-minmax-rndnu-neon-mull-padal.c
new file mode 100644
index 0000000..4f996c1
--- /dev/null
+++ b/src/qs8-igemm/gen/1x16c2s4-minmax-rndnu-neon-mull-padal.c
@@ -0,0 +1,256 @@
+// Auto-generated file. Do not edit!
+// Template: src/qs8-igemm/c2-neon-mull-padal-shuffle.c.in
+// Generator: tools/xngen
+//
+// Copyright 2021 Google LLC
+//
+// This source code is licensed under the BSD-style license found in the
+// LICENSE file in the root directory of this source tree.
+
+#include <assert.h>
+
+#include <arm_neon.h>
+
+#include <xnnpack/gemm.h>
+#include <xnnpack/math.h>
+
+
+void xnn_qs8_igemm_minmax_rndnu_ukernel_1x16c2s4__neon_mull_padal(
+ size_t mr,
+ size_t nc,
+ size_t kc,
+ size_t ks,
+ const int8_t** restrict a,
+ const void* restrict w,
+ int8_t* restrict c,
+ size_t cm_stride,
+ size_t cn_stride,
+ size_t a_offset,
+ const int8_t* zero,
+ const union xnn_qs8_conv_minmax_params params[restrict XNN_MIN_ELEMENTS(1)]) XNN_DISABLE_TSAN XNN_DISABLE_MSAN
+{
+ assert(mr != 0);
+ assert(mr <= 1);
+ assert(nc != 0);
+ assert(kc != 0);
+ assert(ks != 0);
+ assert(ks % (1 * sizeof(void*)) == 0);
+ assert(a_offset % sizeof(int8_t) == 0);
+ assert(a != NULL);
+ assert(w != NULL);
+ assert(c != NULL);
+
+ int8_t* c0 = c;
+
+ do {
+ int32x4_t vacc0x0123 = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc0x4567 = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc0x89AB = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc0xCDEF = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+
+ size_t p = ks;
+ do {
+ const int8_t* restrict a0 = a[0];
+ if XNN_UNPREDICTABLE(a0 != zero) {
+ a0 = (const int8_t*) ((uintptr_t) a0 + a_offset);
+ }
+ a += 1;
+
+ size_t k = kc;
+
+
+ while (k >= 8 * sizeof(int8_t)) {
+ int8x8_t va0x0 = vld1_s8(a0); a0 += 8;
+
+ const int8x8_t vb0123c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ int16x8_t vprod0x0123c0 = vmull_s8(vb0123c0x0, va0x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c0);
+ int16x8_t vprod0x4567c0 = vmull_s8(vb4567c0x0, va0x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c0);
+ int16x8_t vprod0x89ABc0 = vmull_s8(vb89ABc0x0, va0x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc0);
+ int16x8_t vprod0xCDEFc0 = vmull_s8(vbCDEFc0x0, va0x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc0);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ int16x8_t vprod0x0123c1 = vmull_s8(vb0123c1x0, va0x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c1);
+ int16x8_t vprod0x4567c1 = vmull_s8(vb4567c1x0, va0x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c1);
+ int16x8_t vprod0x89ABc1 = vmull_s8(vb89ABc1x0, va0x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc1);
+ int16x8_t vprod0xCDEFc1 = vmull_s8(vbCDEFc1x0, va0x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc1);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2x0, va0x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2x0, va0x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ int16x8_t vprod0x89ABc2 = vmull_s8(vb89ABc2x0, va0x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc2);
+ int16x8_t vprod0xCDEFc2 = vmull_s8(vbCDEFc2x0, va0x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc2);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ int16x8_t vprod0x0123c3 = vmull_s8(vb0123c3x0, va0x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c3);
+ int16x8_t vprod0x4567c3 = vmull_s8(vb4567c3x0, va0x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c3);
+ int16x8_t vprod0x89ABc3 = vmull_s8(vb89ABc3x0, va0x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc3);
+ int16x8_t vprod0xCDEFc3 = vmull_s8(vbCDEFc3x0, va0x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc3);
+
+ k -= 8 * sizeof(int8_t);
+ }
+
+ if XNN_UNLIKELY(k != 0) {
+ const int8x8_t va0 = vld1_s8(a0); a0 = (const int8_t*) ((uintptr_t) a0 + k);
+
+ const int8x8_t vb0123c0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c0 = vmull_s8(vb0123c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c0);
+ const int16x8_t vprod0x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c0);
+ const int16x8_t vprod0x89ABc0 = vmull_s8(vb89ABc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc0);
+ const int16x8_t vprod0xCDEFc0 = vmull_s8(vbCDEFc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc0);
+
+ if (k > 2 * sizeof(int8_t)) {
+ const int8x8_t vb0123c1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c1 = vmull_s8(vb0123c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c1);
+ const int16x8_t vprod0x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c1);
+ const int16x8_t vprod0x89ABc1 = vmull_s8(vb89ABc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc1);
+ const int16x8_t vprod0xCDEFc1 = vmull_s8(vbCDEFc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc1);
+
+ if (k > 4 * sizeof(int8_t)) {
+ const int8x8_t vb0123c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ const int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ const int16x8_t vprod0x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc2);
+ const int16x8_t vprod0xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc2);
+
+ if (k > 6 * sizeof(int8_t)) {
+ const int8x8_t vb0123c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ const int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ const int16x8_t vprod0x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc2);
+ const int16x8_t vprod0xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc2);
+ }
+ }
+ }
+ }
+ p -= 1 * sizeof(void*);
+ } while (p != 0);
+
+ const int32x4_t vright_pre_shift = vld1q_dup_s32(¶ms->rndnu_neon.right_pre_shift);
+ const int32x4_t vmultiplier = vld1q_dup_s32(¶ms->rndnu_neon.multiplier);
+ const int32x4_t vright_post_shift = vld1q_dup_s32(¶ms->rndnu_neon.right_post_shift);
+
+ vacc0x0123 = vshlq_s32(vacc0x0123, vright_pre_shift);
+ vacc0x4567 = vshlq_s32(vacc0x4567, vright_pre_shift);
+ vacc0x89AB = vshlq_s32(vacc0x89AB, vright_pre_shift);
+ vacc0xCDEF = vshlq_s32(vacc0xCDEF, vright_pre_shift);
+
+ vacc0x0123 = vqdmulhq_s32(vacc0x0123, vmultiplier);
+ vacc0x4567 = vqdmulhq_s32(vacc0x4567, vmultiplier);
+ vacc0x89AB = vqdmulhq_s32(vacc0x89AB, vmultiplier);
+ vacc0xCDEF = vqdmulhq_s32(vacc0xCDEF, vmultiplier);
+
+ vacc0x0123 = vrshlq_s32(vacc0x0123, vright_post_shift);
+ vacc0x4567 = vrshlq_s32(vacc0x4567, vright_post_shift);
+ vacc0x89AB = vrshlq_s32(vacc0x89AB, vright_post_shift);
+ vacc0xCDEF = vrshlq_s32(vacc0xCDEF, vright_post_shift);
+
+ const int16x8_t voutput_zero_point = vld1q_dup_s16(¶ms->rndnu_neon.output_zero_point);
+#if XNN_ARCH_ARM64
+ const int16x8_t vacc0x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc0x0123), vacc0x4567), voutput_zero_point);
+ const int16x8_t vacc0x89ABCDEF = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc0x89AB), vacc0xCDEF), voutput_zero_point);
+
+ int8x16_t vout0x0123456789ABCDEF = vqmovn_high_s16(vqmovn_s16(vacc0x01234567), vacc0x89ABCDEF);
+#else
+ const int16x8_t vacc0x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc0x0123), vqmovn_s32(vacc0x4567)), voutput_zero_point);
+ const int16x8_t vacc0x89ABCDEF = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc0x89AB), vqmovn_s32(vacc0xCDEF)), voutput_zero_point);
+
+ int8x16_t vout0x0123456789ABCDEF = vcombine_s8(vqmovn_s16(vacc0x01234567), vqmovn_s16(vacc0x89ABCDEF));
+#endif
+ const int8x16_t voutput_min = vld1q_dup_s8(¶ms->rndnu_neon.output_min);
+ const int8x16_t voutput_max = vld1q_dup_s8(¶ms->rndnu_neon.output_max);
+
+ vout0x0123456789ABCDEF = vmaxq_s8(vout0x0123456789ABCDEF, voutput_min);
+
+ vout0x0123456789ABCDEF = vminq_s8(vout0x0123456789ABCDEF, voutput_max);
+
+ if (nc >= 16) {
+ vst1q_s8(c0 + 0, vout0x0123456789ABCDEF);
+
+ c0 = (int8_t*) ((uintptr_t) c0 + cn_stride);
+
+ a = (const int8_t**restrict) ((uintptr_t) a - ks);
+
+ nc -= 16;
+ } else {
+ int8x8_t vout0x01234567 = vget_low_s8(vout0x0123456789ABCDEF);
+ if (nc & 8) {
+ vst1_s8(c0, vout0x01234567); c0 += 8;
+ vout0x01234567 = vget_high_s8(vout0x0123456789ABCDEF);
+ }
+ if (nc & 4) {
+ vst1_lane_u32(__builtin_assume_aligned(c0, 1), vreinterpret_u32_s8(vout0x01234567), 0); c0 += 4;
+ vout0x01234567 = vext_s8(vout0x01234567, vout0x01234567, 4);
+ }
+ if (nc & 2) {
+ vst1_lane_u16(__builtin_assume_aligned(c0, 1), vreinterpret_u16_s8(vout0x01234567), 0); c0 += 2;
+ vout0x01234567 = vext_s8(vout0x01234567, vout0x01234567, 2);
+ }
+ if (nc & 1) {
+ vst1_lane_s8(c0, vout0x01234567, 0);
+ }
+
+ nc = 0;
+ }
+ } while (nc != 0);
+}
diff --git a/src/qs8-igemm/gen/1x8s4c2-minmax-rndnu-neon-mlal-padal.c b/src/qs8-igemm/gen/1x8c2s4-minmax-fp32-neon-mlal-padal.c
similarity index 86%
copy from src/qs8-igemm/gen/1x8s4c2-minmax-rndnu-neon-mlal-padal.c
copy to src/qs8-igemm/gen/1x8c2s4-minmax-fp32-neon-mlal-padal.c
index c0ff9fc..3cc68ac 100644
--- a/src/qs8-igemm/gen/1x8s4c2-minmax-rndnu-neon-mlal-padal.c
+++ b/src/qs8-igemm/gen/1x8c2s4-minmax-fp32-neon-mlal-padal.c
@@ -15,7 +15,7 @@
#include <xnnpack/math.h>
-void xnn_qs8_igemm_minmax_rndnu_ukernel_1x8s4c2__neon_mlal_padal(
+void xnn_qs8_igemm_minmax_fp32_ukernel_1x8c2s4__neon_mlal_padal(
size_t mr,
size_t nc,
size_t kc,
@@ -190,35 +190,38 @@
p -= 1 * sizeof(void*);
} while (p != 0);
- const int32x4_t vright_pre_shift = vld1q_dup_s32(¶ms->rndnu_neon.right_pre_shift);
- const int32x4_t vmultiplier = vld1q_dup_s32(¶ms->rndnu_neon.multiplier);
- const int32x4_t vright_post_shift = vld1q_dup_s32(¶ms->rndnu_neon.right_post_shift);
+ float32x4_t vfpacc0x0123 = vcvtq_f32_s32(vacc0x0123);
+ float32x4_t vfpacc0x4567 = vcvtq_f32_s32(vacc0x4567);
- vacc0x0123 = vshlq_s32(vacc0x0123, vright_pre_shift);
- vacc0x4567 = vshlq_s32(vacc0x4567, vright_pre_shift);
+ const float32x4_t vscale = vld1q_dup_f32(¶ms->fp32_neon.scale);
+ vfpacc0x0123 = vmulq_f32(vfpacc0x0123, vscale);
+ vfpacc0x4567 = vmulq_f32(vfpacc0x4567, vscale);
- vacc0x0123 = vqdmulhq_s32(vacc0x0123, vmultiplier);
- vacc0x4567 = vqdmulhq_s32(vacc0x4567, vmultiplier);
+ const float32x4_t voutput_min_less_zero_point = vld1q_dup_f32(¶ms->fp32_neon.output_min_less_zero_point);
+ vfpacc0x0123 = vmaxq_f32(vfpacc0x0123, voutput_min_less_zero_point);
+ vfpacc0x4567 = vmaxq_f32(vfpacc0x4567, voutput_min_less_zero_point);
- vacc0x0123 = vrshlq_s32(vacc0x0123, vright_post_shift);
- vacc0x4567 = vrshlq_s32(vacc0x4567, vright_post_shift);
+ const float32x4_t voutput_max_less_zero_point = vld1q_dup_f32(¶ms->fp32_neon.output_max_less_zero_point);
+ vfpacc0x0123 = vminq_f32(vfpacc0x0123, voutput_max_less_zero_point);
+ vfpacc0x4567 = vminq_f32(vfpacc0x4567, voutput_max_less_zero_point);
- const int16x8_t voutput_zero_point = vld1q_dup_s16(¶ms->rndnu_neon.output_zero_point);
+ const float32x4_t vmagic_bias = vld1q_dup_f32(¶ms->fp32_neon.magic_bias);
+ vacc0x0123 = vreinterpretq_s32_f32(vaddq_f32(vfpacc0x0123, vmagic_bias));
+ vacc0x4567 = vreinterpretq_s32_f32(vaddq_f32(vfpacc0x4567, vmagic_bias));
+
+ const int32x4_t vmagic_bias_less_zero_point = vld1q_dup_s32(¶ms->fp32_neon.magic_bias_less_zero_point);
+ vacc0x0123 = vsubq_s32(vacc0x0123, vmagic_bias_less_zero_point);
+ vacc0x4567 = vsubq_s32(vacc0x4567, vmagic_bias_less_zero_point);
+
#if XNN_ARCH_ARM64
- const int16x8_t vacc0x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc0x0123), vacc0x4567), voutput_zero_point);
+ const int16x8_t vacc0x01234567 = vuzp1q_s16(vreinterpretq_s16_s32(vacc0x0123), vreinterpretq_s16_s32(vacc0x4567));
- int8x8_t vout0x01234567 = vqmovn_s16(vacc0x01234567);
+ int8x8_t vout0x01234567 = vmovn_s16(vacc0x01234567);
#else
- const int16x8_t vacc0x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc0x0123), vqmovn_s32(vacc0x4567)), voutput_zero_point);
+ const int16x8_t vacc0x01234567 = vcombine_s16(vmovn_s32(vacc0x0123), vmovn_s32(vacc0x4567));
- int8x8_t vout0x01234567 = vqmovn_s16(vacc0x01234567);
+ int8x8_t vout0x01234567 = vmovn_s16(vacc0x01234567);
#endif
- const int8x8_t voutput_min = vld1_dup_s8(¶ms->rndnu_neon.output_min);
- const int8x8_t voutput_max = vld1_dup_s8(¶ms->rndnu_neon.output_max);
-
- vout0x01234567 = vmax_s8(vout0x01234567, voutput_min);
-
- vout0x01234567 = vmin_s8(vout0x01234567, voutput_max);
if (nc >= 8) {
vst1_s8(c0 + 0, vout0x01234567);
diff --git a/src/qs8-igemm/gen/1x8s4c2-minmax-rndnu-neon-mlal-padal.c b/src/qs8-igemm/gen/1x8c2s4-minmax-fp32-neonv8-mlal-padal.c
similarity index 92%
copy from src/qs8-igemm/gen/1x8s4c2-minmax-rndnu-neon-mlal-padal.c
copy to src/qs8-igemm/gen/1x8c2s4-minmax-fp32-neonv8-mlal-padal.c
index c0ff9fc..1e32b61 100644
--- a/src/qs8-igemm/gen/1x8s4c2-minmax-rndnu-neon-mlal-padal.c
+++ b/src/qs8-igemm/gen/1x8c2s4-minmax-fp32-neonv8-mlal-padal.c
@@ -12,10 +12,11 @@
#include <arm_neon.h>
#include <xnnpack/gemm.h>
+#include <xnnpack/intrinsics-polyfill.h>
#include <xnnpack/math.h>
-void xnn_qs8_igemm_minmax_rndnu_ukernel_1x8s4c2__neon_mlal_padal(
+void xnn_qs8_igemm_minmax_fp32_ukernel_1x8c2s4__neonv8_mlal_padal(
size_t mr,
size_t nc,
size_t kc,
@@ -190,20 +191,17 @@
p -= 1 * sizeof(void*);
} while (p != 0);
- const int32x4_t vright_pre_shift = vld1q_dup_s32(¶ms->rndnu_neon.right_pre_shift);
- const int32x4_t vmultiplier = vld1q_dup_s32(¶ms->rndnu_neon.multiplier);
- const int32x4_t vright_post_shift = vld1q_dup_s32(¶ms->rndnu_neon.right_post_shift);
+ float32x4_t vfpacc0x0123 = vcvtq_f32_s32(vacc0x0123);
+ float32x4_t vfpacc0x4567 = vcvtq_f32_s32(vacc0x4567);
- vacc0x0123 = vshlq_s32(vacc0x0123, vright_pre_shift);
- vacc0x4567 = vshlq_s32(vacc0x4567, vright_pre_shift);
+ const float32x4_t vscale = vld1q_dup_f32(¶ms->fp32_neonv8.scale);
+ vfpacc0x0123 = vmulq_f32(vfpacc0x0123, vscale);
+ vfpacc0x4567 = vmulq_f32(vfpacc0x4567, vscale);
- vacc0x0123 = vqdmulhq_s32(vacc0x0123, vmultiplier);
- vacc0x4567 = vqdmulhq_s32(vacc0x4567, vmultiplier);
+ vacc0x0123 = vcvtnq_s32_f32(vfpacc0x0123);
+ vacc0x4567 = vcvtnq_s32_f32(vfpacc0x4567);
- vacc0x0123 = vrshlq_s32(vacc0x0123, vright_post_shift);
- vacc0x4567 = vrshlq_s32(vacc0x4567, vright_post_shift);
-
- const int16x8_t voutput_zero_point = vld1q_dup_s16(¶ms->rndnu_neon.output_zero_point);
+ const int16x8_t voutput_zero_point = vld1q_dup_s16(¶ms->fp32_neonv8.output_zero_point);
#if XNN_ARCH_ARM64
const int16x8_t vacc0x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc0x0123), vacc0x4567), voutput_zero_point);
@@ -213,8 +211,8 @@
int8x8_t vout0x01234567 = vqmovn_s16(vacc0x01234567);
#endif
- const int8x8_t voutput_min = vld1_dup_s8(¶ms->rndnu_neon.output_min);
- const int8x8_t voutput_max = vld1_dup_s8(¶ms->rndnu_neon.output_max);
+ const int8x8_t voutput_min = vld1_dup_s8(¶ms->fp32_neonv8.output_min);
+ const int8x8_t voutput_max = vld1_dup_s8(¶ms->fp32_neonv8.output_max);
vout0x01234567 = vmax_s8(vout0x01234567, voutput_min);
diff --git a/src/qs8-igemm/gen/1x8s4c2-minmax-rndnu-neon-mlal-padal.c b/src/qs8-igemm/gen/1x8c2s4-minmax-rndnu-neon-mlal-padal.c
similarity index 99%
rename from src/qs8-igemm/gen/1x8s4c2-minmax-rndnu-neon-mlal-padal.c
rename to src/qs8-igemm/gen/1x8c2s4-minmax-rndnu-neon-mlal-padal.c
index c0ff9fc..4a9043b 100644
--- a/src/qs8-igemm/gen/1x8s4c2-minmax-rndnu-neon-mlal-padal.c
+++ b/src/qs8-igemm/gen/1x8c2s4-minmax-rndnu-neon-mlal-padal.c
@@ -15,7 +15,7 @@
#include <xnnpack/math.h>
-void xnn_qs8_igemm_minmax_rndnu_ukernel_1x8s4c2__neon_mlal_padal(
+void xnn_qs8_igemm_minmax_rndnu_ukernel_1x8c2s4__neon_mlal_padal(
size_t mr,
size_t nc,
size_t kc,
diff --git a/src/qs8-igemm/gen/1x8s4c2-minmax-rndnu-neon-mull-padal.c b/src/qs8-igemm/gen/1x8c2s4-minmax-rndnu-neon-mull-padal.c
similarity index 99%
rename from src/qs8-igemm/gen/1x8s4c2-minmax-rndnu-neon-mull-padal.c
rename to src/qs8-igemm/gen/1x8c2s4-minmax-rndnu-neon-mull-padal.c
index 25ebf6c..c088f67 100644
--- a/src/qs8-igemm/gen/1x8s4c2-minmax-rndnu-neon-mull-padal.c
+++ b/src/qs8-igemm/gen/1x8c2s4-minmax-rndnu-neon-mull-padal.c
@@ -15,7 +15,7 @@
#include <xnnpack/math.h>
-void xnn_qs8_igemm_minmax_rndnu_ukernel_1x8s4c2__neon_mull_padal(
+void xnn_qs8_igemm_minmax_rndnu_ukernel_1x8c2s4__neon_mull_padal(
size_t mr,
size_t nc,
size_t kc,
diff --git a/src/qs8-igemm/gen/2x16c2s4-minmax-rndnu-neon-mlal-padal.c b/src/qs8-igemm/gen/2x16c2s4-minmax-rndnu-neon-mlal-padal.c
new file mode 100644
index 0000000..5b4e758
--- /dev/null
+++ b/src/qs8-igemm/gen/2x16c2s4-minmax-rndnu-neon-mlal-padal.c
@@ -0,0 +1,513 @@
+// Auto-generated file. Do not edit!
+// Template: src/qs8-igemm/c2-neon-mull-padal-shuffle.c.in
+// Generator: tools/xngen
+//
+// Copyright 2021 Google LLC
+//
+// This source code is licensed under the BSD-style license found in the
+// LICENSE file in the root directory of this source tree.
+
+#include <assert.h>
+
+#include <arm_neon.h>
+
+#include <xnnpack/gemm.h>
+#include <xnnpack/math.h>
+
+
+void xnn_qs8_igemm_minmax_rndnu_ukernel_2x16c2s4__neon_mlal_padal(
+ size_t mr,
+ size_t nc,
+ size_t kc,
+ size_t ks,
+ const int8_t** restrict a,
+ const void* restrict w,
+ int8_t* restrict c,
+ size_t cm_stride,
+ size_t cn_stride,
+ size_t a_offset,
+ const int8_t* zero,
+ const union xnn_qs8_conv_minmax_params params[restrict XNN_MIN_ELEMENTS(1)]) XNN_DISABLE_TSAN XNN_DISABLE_MSAN
+{
+ assert(mr != 0);
+ assert(mr <= 2);
+ assert(nc != 0);
+ assert(kc != 0);
+ assert(ks != 0);
+ assert(ks % (2 * sizeof(void*)) == 0);
+ assert(a_offset % sizeof(int8_t) == 0);
+ assert(a != NULL);
+ assert(w != NULL);
+ assert(c != NULL);
+
+ int8_t* c0 = c;
+ int8_t* c1 = (int8_t*) ((uintptr_t) c0 + cm_stride);
+ if XNN_UNPREDICTABLE(mr != 2) {
+ c1 = c0;
+ }
+
+ do {
+ int32x4_t vacc0x0123 = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc0x4567 = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc0x89AB = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc0xCDEF = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc1x0123 = vacc0x0123;
+ int32x4_t vacc1x4567 = vacc0x4567;
+ int32x4_t vacc1x89AB = vacc0x89AB;
+ int32x4_t vacc1xCDEF = vacc0xCDEF;
+
+ size_t p = ks;
+ do {
+ const int8_t* restrict a0 = a[0];
+ if XNN_UNPREDICTABLE(a0 != zero) {
+ a0 = (const int8_t*) ((uintptr_t) a0 + a_offset);
+ }
+ const int8_t* restrict a1 = a[1];
+ if XNN_UNPREDICTABLE(a1 != zero) {
+ a1 = (const int8_t*) ((uintptr_t) a1 + a_offset);
+ }
+ a += 2;
+
+ size_t k = kc;
+
+ while (k >= 16 * sizeof(int8_t)) {
+ int8x8_t va0x0 = vld1_s8(a0); a0 += 8;
+ int8x8_t va0x1 = vld1_s8(a0); a0 += 8;
+ int8x8_t va1x0 = vld1_s8(a1); a1 += 8;
+ int8x8_t va1x1 = vld1_s8(a1); a1 += 8;
+
+ const int8x8_t vb0123c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ int16x8_t vprod0x0123c0 = vmull_s8(vb0123c0x0, va0x0);
+ int16x8_t vprod1x0123c0 = vmull_s8(vb0123c0x0, va1x0);
+ const int8x8_t vb0123c0x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x0123c0 = vmlal_s8(vprod0x0123c0, vb0123c0x1, va0x1);
+ vprod1x0123c0 = vmlal_s8(vprod1x0123c0, vb0123c0x1, va1x1);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c0);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c0);
+ int16x8_t vprod0x4567c0 = vmull_s8(vb4567c0x0, va0x0);
+ int16x8_t vprod1x4567c0 = vmull_s8(vb4567c0x0, va1x0);
+ const int8x8_t vb4567c0x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x4567c0 = vmlal_s8(vprod0x4567c0, vb4567c0x1, va0x1);
+ vprod1x4567c0 = vmlal_s8(vprod1x4567c0, vb4567c0x1, va1x1);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c0);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c0);
+ int16x8_t vprod0x89ABc0 = vmull_s8(vb89ABc0x0, va0x0);
+ int16x8_t vprod1x89ABc0 = vmull_s8(vb89ABc0x0, va1x0);
+ const int8x8_t vb89ABc0x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x89ABc0 = vmlal_s8(vprod0x89ABc0, vb89ABc0x1, va0x1);
+ vprod1x89ABc0 = vmlal_s8(vprod1x89ABc0, vb89ABc0x1, va1x1);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc0);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc0);
+ int16x8_t vprod0xCDEFc0 = vmull_s8(vbCDEFc0x0, va0x0);
+ int16x8_t vprod1xCDEFc0 = vmull_s8(vbCDEFc0x0, va1x0);
+ const int8x8_t vbCDEFc0x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0xCDEFc0 = vmlal_s8(vprod0xCDEFc0, vbCDEFc0x1, va0x1);
+ vprod1xCDEFc0 = vmlal_s8(vprod1xCDEFc0, vbCDEFc0x1, va1x1);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc0);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc0);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va0x1 = vext_s8(va0x1, va0x1, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ va1x1 = vext_s8(va1x1, va1x1, 2);
+ int16x8_t vprod0x0123c1 = vmull_s8(vb0123c1x0, va0x0);
+ int16x8_t vprod1x0123c1 = vmull_s8(vb0123c1x0, va1x0);
+ const int8x8_t vb0123c1x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x0123c1 = vmlal_s8(vprod0x0123c1, vb0123c1x1, va0x1);
+ vprod1x0123c1 = vmlal_s8(vprod1x0123c1, vb0123c1x1, va1x1);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c1);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c1);
+ int16x8_t vprod0x4567c1 = vmull_s8(vb4567c1x0, va0x0);
+ int16x8_t vprod1x4567c1 = vmull_s8(vb4567c1x0, va1x0);
+ const int8x8_t vb4567c1x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x4567c1 = vmlal_s8(vprod0x4567c1, vb4567c1x1, va0x1);
+ vprod1x4567c1 = vmlal_s8(vprod1x4567c1, vb4567c1x1, va1x1);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c1);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c1);
+ int16x8_t vprod0x89ABc1 = vmull_s8(vb89ABc1x0, va0x0);
+ int16x8_t vprod1x89ABc1 = vmull_s8(vb89ABc1x0, va1x0);
+ const int8x8_t vb89ABc1x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x89ABc1 = vmlal_s8(vprod0x89ABc1, vb89ABc1x1, va0x1);
+ vprod1x89ABc1 = vmlal_s8(vprod1x89ABc1, vb89ABc1x1, va1x1);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc1);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc1);
+ int16x8_t vprod0xCDEFc1 = vmull_s8(vbCDEFc1x0, va0x0);
+ int16x8_t vprod1xCDEFc1 = vmull_s8(vbCDEFc1x0, va1x0);
+ const int8x8_t vbCDEFc1x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0xCDEFc1 = vmlal_s8(vprod0xCDEFc1, vbCDEFc1x1, va0x1);
+ vprod1xCDEFc1 = vmlal_s8(vprod1xCDEFc1, vbCDEFc1x1, va1x1);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc1);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc1);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va0x1 = vext_s8(va0x1, va0x1, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ va1x1 = vext_s8(va1x1, va1x1, 2);
+ int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2x0, va0x0);
+ int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2x0, va1x0);
+ const int8x8_t vb0123c2x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x0123c2 = vmlal_s8(vprod0x0123c2, vb0123c2x1, va0x1);
+ vprod1x0123c2 = vmlal_s8(vprod1x0123c2, vb0123c2x1, va1x1);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2x0, va0x0);
+ int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2x0, va1x0);
+ const int8x8_t vb4567c2x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x4567c2 = vmlal_s8(vprod0x4567c2, vb4567c2x1, va0x1);
+ vprod1x4567c2 = vmlal_s8(vprod1x4567c2, vb4567c2x1, va1x1);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ int16x8_t vprod0x89ABc2 = vmull_s8(vb89ABc2x0, va0x0);
+ int16x8_t vprod1x89ABc2 = vmull_s8(vb89ABc2x0, va1x0);
+ const int8x8_t vb89ABc2x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x89ABc2 = vmlal_s8(vprod0x89ABc2, vb89ABc2x1, va0x1);
+ vprod1x89ABc2 = vmlal_s8(vprod1x89ABc2, vb89ABc2x1, va1x1);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc2);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc2);
+ int16x8_t vprod0xCDEFc2 = vmull_s8(vbCDEFc2x0, va0x0);
+ int16x8_t vprod1xCDEFc2 = vmull_s8(vbCDEFc2x0, va1x0);
+ const int8x8_t vbCDEFc2x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0xCDEFc2 = vmlal_s8(vprod0xCDEFc2, vbCDEFc2x1, va0x1);
+ vprod1xCDEFc2 = vmlal_s8(vprod1xCDEFc2, vbCDEFc2x1, va1x1);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc2);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc2);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va0x1 = vext_s8(va0x1, va0x1, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ va1x1 = vext_s8(va1x1, va1x1, 2);
+ int16x8_t vprod0x0123c3 = vmull_s8(vb0123c3x0, va0x0);
+ int16x8_t vprod1x0123c3 = vmull_s8(vb0123c3x0, va1x0);
+ const int8x8_t vb0123c3x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x0123c3 = vmlal_s8(vprod0x0123c3, vb0123c3x1, va0x1);
+ vprod1x0123c3 = vmlal_s8(vprod1x0123c3, vb0123c3x1, va1x1);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c3);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c3);
+ int16x8_t vprod0x4567c3 = vmull_s8(vb4567c3x0, va0x0);
+ int16x8_t vprod1x4567c3 = vmull_s8(vb4567c3x0, va1x0);
+ const int8x8_t vb4567c3x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x4567c3 = vmlal_s8(vprod0x4567c3, vb4567c3x1, va0x1);
+ vprod1x4567c3 = vmlal_s8(vprod1x4567c3, vb4567c3x1, va1x1);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c3);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c3);
+ int16x8_t vprod0x89ABc3 = vmull_s8(vb89ABc3x0, va0x0);
+ int16x8_t vprod1x89ABc3 = vmull_s8(vb89ABc3x0, va1x0);
+ const int8x8_t vb89ABc3x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x89ABc3 = vmlal_s8(vprod0x89ABc3, vb89ABc3x1, va0x1);
+ vprod1x89ABc3 = vmlal_s8(vprod1x89ABc3, vb89ABc3x1, va1x1);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc3);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc3);
+ int16x8_t vprod0xCDEFc3 = vmull_s8(vbCDEFc3x0, va0x0);
+ int16x8_t vprod1xCDEFc3 = vmull_s8(vbCDEFc3x0, va1x0);
+ const int8x8_t vbCDEFc3x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0xCDEFc3 = vmlal_s8(vprod0xCDEFc3, vbCDEFc3x1, va0x1);
+ vprod1xCDEFc3 = vmlal_s8(vprod1xCDEFc3, vbCDEFc3x1, va1x1);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc3);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc3);
+
+ k -= 16 * sizeof(int8_t);
+ }
+
+ if (k >= 8 * sizeof(int8_t)) {
+ int8x8_t va0x0 = vld1_s8(a0); a0 += 8;
+ int8x8_t va1x0 = vld1_s8(a1); a1 += 8;
+
+ const int8x8_t vb0123c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ int16x8_t vprod0x0123c0 = vmull_s8(vb0123c0x0, va0x0);
+ int16x8_t vprod1x0123c0 = vmull_s8(vb0123c0x0, va1x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c0);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c0);
+ int16x8_t vprod0x4567c0 = vmull_s8(vb4567c0x0, va0x0);
+ int16x8_t vprod1x4567c0 = vmull_s8(vb4567c0x0, va1x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c0);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c0);
+ int16x8_t vprod0x89ABc0 = vmull_s8(vb89ABc0x0, va0x0);
+ int16x8_t vprod1x89ABc0 = vmull_s8(vb89ABc0x0, va1x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc0);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc0);
+ int16x8_t vprod0xCDEFc0 = vmull_s8(vbCDEFc0x0, va0x0);
+ int16x8_t vprod1xCDEFc0 = vmull_s8(vbCDEFc0x0, va1x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc0);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc0);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ int16x8_t vprod0x0123c1 = vmull_s8(vb0123c1x0, va0x0);
+ int16x8_t vprod1x0123c1 = vmull_s8(vb0123c1x0, va1x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c1);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c1);
+ int16x8_t vprod0x4567c1 = vmull_s8(vb4567c1x0, va0x0);
+ int16x8_t vprod1x4567c1 = vmull_s8(vb4567c1x0, va1x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c1);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c1);
+ int16x8_t vprod0x89ABc1 = vmull_s8(vb89ABc1x0, va0x0);
+ int16x8_t vprod1x89ABc1 = vmull_s8(vb89ABc1x0, va1x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc1);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc1);
+ int16x8_t vprod0xCDEFc1 = vmull_s8(vbCDEFc1x0, va0x0);
+ int16x8_t vprod1xCDEFc1 = vmull_s8(vbCDEFc1x0, va1x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc1);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc1);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2x0, va0x0);
+ int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2x0, va1x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2x0, va0x0);
+ int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2x0, va1x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ int16x8_t vprod0x89ABc2 = vmull_s8(vb89ABc2x0, va0x0);
+ int16x8_t vprod1x89ABc2 = vmull_s8(vb89ABc2x0, va1x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc2);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc2);
+ int16x8_t vprod0xCDEFc2 = vmull_s8(vbCDEFc2x0, va0x0);
+ int16x8_t vprod1xCDEFc2 = vmull_s8(vbCDEFc2x0, va1x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc2);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc2);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ int16x8_t vprod0x0123c3 = vmull_s8(vb0123c3x0, va0x0);
+ int16x8_t vprod1x0123c3 = vmull_s8(vb0123c3x0, va1x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c3);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c3);
+ int16x8_t vprod0x4567c3 = vmull_s8(vb4567c3x0, va0x0);
+ int16x8_t vprod1x4567c3 = vmull_s8(vb4567c3x0, va1x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c3);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c3);
+ int16x8_t vprod0x89ABc3 = vmull_s8(vb89ABc3x0, va0x0);
+ int16x8_t vprod1x89ABc3 = vmull_s8(vb89ABc3x0, va1x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc3);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc3);
+ int16x8_t vprod0xCDEFc3 = vmull_s8(vbCDEFc3x0, va0x0);
+ int16x8_t vprod1xCDEFc3 = vmull_s8(vbCDEFc3x0, va1x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc3);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc3);
+
+ k -= 8 * sizeof(int8_t);
+ }
+
+ if XNN_UNLIKELY(k != 0) {
+ const int8x8_t va0 = vld1_s8(a0); a0 = (const int8_t*) ((uintptr_t) a0 + k);
+ const int8x8_t va1 = vld1_s8(a1); a1 = (const int8_t*) ((uintptr_t) a1 + k);
+
+ const int8x8_t vb0123c0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c0 = vmull_s8(vb0123c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c0);
+ const int16x8_t vprod0x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c0);
+ const int16x8_t vprod0x89ABc0 = vmull_s8(vb89ABc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc0);
+ const int16x8_t vprod0xCDEFc0 = vmull_s8(vbCDEFc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc0);
+ const int16x8_t vprod1x0123c0 = vmull_s8(vb0123c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c0);
+ const int16x8_t vprod1x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c0);
+ const int16x8_t vprod1x89ABc0 = vmull_s8(vb89ABc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0)));
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc0);
+ const int16x8_t vprod1xCDEFc0 = vmull_s8(vbCDEFc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0)));
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc0);
+
+ if (k > 2 * sizeof(int8_t)) {
+ const int8x8_t vb0123c1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c1 = vmull_s8(vb0123c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c1);
+ const int16x8_t vprod0x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c1);
+ const int16x8_t vprod0x89ABc1 = vmull_s8(vb89ABc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc1);
+ const int16x8_t vprod0xCDEFc1 = vmull_s8(vbCDEFc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc1);
+ const int16x8_t vprod1x0123c1 = vmull_s8(vb0123c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c1);
+ const int16x8_t vprod1x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c1);
+ const int16x8_t vprod1x89ABc1 = vmull_s8(vb89ABc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1)));
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc1);
+ const int16x8_t vprod1xCDEFc1 = vmull_s8(vbCDEFc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1)));
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc1);
+
+ if (k > 4 * sizeof(int8_t)) {
+ const int8x8_t vb0123c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ const int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ const int16x8_t vprod0x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc2);
+ const int16x8_t vprod0xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc2);
+ const int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ const int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ const int16x8_t vprod1x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2)));
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc2);
+ const int16x8_t vprod1xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2)));
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc2);
+
+ if (k > 6 * sizeof(int8_t)) {
+ const int8x8_t vb0123c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ const int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ const int16x8_t vprod0x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc2);
+ const int16x8_t vprod0xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc2);
+ const int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 3)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ const int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 3)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ const int16x8_t vprod1x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 3)));
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc2);
+ const int16x8_t vprod1xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 3)));
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc2);
+ }
+ }
+ }
+ }
+ p -= 2 * sizeof(void*);
+ } while (p != 0);
+
+ const int32x4_t vright_pre_shift = vld1q_dup_s32(¶ms->rndnu_neon.right_pre_shift);
+ const int32x4_t vmultiplier = vld1q_dup_s32(¶ms->rndnu_neon.multiplier);
+ const int32x4_t vright_post_shift = vld1q_dup_s32(¶ms->rndnu_neon.right_post_shift);
+
+ vacc0x0123 = vshlq_s32(vacc0x0123, vright_pre_shift);
+ vacc0x4567 = vshlq_s32(vacc0x4567, vright_pre_shift);
+ vacc0x89AB = vshlq_s32(vacc0x89AB, vright_pre_shift);
+ vacc0xCDEF = vshlq_s32(vacc0xCDEF, vright_pre_shift);
+ vacc1x0123 = vshlq_s32(vacc1x0123, vright_pre_shift);
+ vacc1x4567 = vshlq_s32(vacc1x4567, vright_pre_shift);
+ vacc1x89AB = vshlq_s32(vacc1x89AB, vright_pre_shift);
+ vacc1xCDEF = vshlq_s32(vacc1xCDEF, vright_pre_shift);
+
+ vacc0x0123 = vqdmulhq_s32(vacc0x0123, vmultiplier);
+ vacc0x4567 = vqdmulhq_s32(vacc0x4567, vmultiplier);
+ vacc0x89AB = vqdmulhq_s32(vacc0x89AB, vmultiplier);
+ vacc0xCDEF = vqdmulhq_s32(vacc0xCDEF, vmultiplier);
+ vacc1x0123 = vqdmulhq_s32(vacc1x0123, vmultiplier);
+ vacc1x4567 = vqdmulhq_s32(vacc1x4567, vmultiplier);
+ vacc1x89AB = vqdmulhq_s32(vacc1x89AB, vmultiplier);
+ vacc1xCDEF = vqdmulhq_s32(vacc1xCDEF, vmultiplier);
+
+ vacc0x0123 = vrshlq_s32(vacc0x0123, vright_post_shift);
+ vacc0x4567 = vrshlq_s32(vacc0x4567, vright_post_shift);
+ vacc0x89AB = vrshlq_s32(vacc0x89AB, vright_post_shift);
+ vacc0xCDEF = vrshlq_s32(vacc0xCDEF, vright_post_shift);
+ vacc1x0123 = vrshlq_s32(vacc1x0123, vright_post_shift);
+ vacc1x4567 = vrshlq_s32(vacc1x4567, vright_post_shift);
+ vacc1x89AB = vrshlq_s32(vacc1x89AB, vright_post_shift);
+ vacc1xCDEF = vrshlq_s32(vacc1xCDEF, vright_post_shift);
+
+ const int16x8_t voutput_zero_point = vld1q_dup_s16(¶ms->rndnu_neon.output_zero_point);
+#if XNN_ARCH_ARM64
+ const int16x8_t vacc0x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc0x0123), vacc0x4567), voutput_zero_point);
+ const int16x8_t vacc0x89ABCDEF = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc0x89AB), vacc0xCDEF), voutput_zero_point);
+ const int16x8_t vacc1x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc1x0123), vacc1x4567), voutput_zero_point);
+ const int16x8_t vacc1x89ABCDEF = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc1x89AB), vacc1xCDEF), voutput_zero_point);
+
+ int8x16_t vout0x0123456789ABCDEF = vqmovn_high_s16(vqmovn_s16(vacc0x01234567), vacc0x89ABCDEF);
+ int8x16_t vout1x0123456789ABCDEF = vqmovn_high_s16(vqmovn_s16(vacc1x01234567), vacc1x89ABCDEF);
+#else
+ const int16x8_t vacc0x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc0x0123), vqmovn_s32(vacc0x4567)), voutput_zero_point);
+ const int16x8_t vacc0x89ABCDEF = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc0x89AB), vqmovn_s32(vacc0xCDEF)), voutput_zero_point);
+ const int16x8_t vacc1x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc1x0123), vqmovn_s32(vacc1x4567)), voutput_zero_point);
+ const int16x8_t vacc1x89ABCDEF = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc1x89AB), vqmovn_s32(vacc1xCDEF)), voutput_zero_point);
+
+ int8x16_t vout0x0123456789ABCDEF = vcombine_s8(vqmovn_s16(vacc0x01234567), vqmovn_s16(vacc0x89ABCDEF));
+ int8x16_t vout1x0123456789ABCDEF = vcombine_s8(vqmovn_s16(vacc1x01234567), vqmovn_s16(vacc1x89ABCDEF));
+#endif
+ const int8x16_t voutput_min = vld1q_dup_s8(¶ms->rndnu_neon.output_min);
+ const int8x16_t voutput_max = vld1q_dup_s8(¶ms->rndnu_neon.output_max);
+
+ vout1x0123456789ABCDEF = vmaxq_s8(vout1x0123456789ABCDEF, voutput_min);
+ vout0x0123456789ABCDEF = vmaxq_s8(vout0x0123456789ABCDEF, voutput_min);
+
+ vout1x0123456789ABCDEF = vminq_s8(vout1x0123456789ABCDEF, voutput_max);
+ vout0x0123456789ABCDEF = vminq_s8(vout0x0123456789ABCDEF, voutput_max);
+
+ if (nc >= 16) {
+ vst1q_s8(c1 + 0, vout1x0123456789ABCDEF);
+ vst1q_s8(c0 + 0, vout0x0123456789ABCDEF);
+
+ c1 = (int8_t*) ((uintptr_t) c1 + cn_stride);
+ c0 = (int8_t*) ((uintptr_t) c0 + cn_stride);
+
+ a = (const int8_t**restrict) ((uintptr_t) a - ks);
+
+ nc -= 16;
+ } else {
+ int8x16_t vout0x01234567_1x01234567 = vcombine_s8(vget_low_s8(vout0x0123456789ABCDEF), vget_low_s8(vout1x0123456789ABCDEF));
+ if (nc & 8) {
+ vst1_s8(c1, vget_high_s8(vout0x01234567_1x01234567)); c1 += 8;
+ vst1_s8(c0, vget_low_s8(vout0x01234567_1x01234567)); c0 += 8;
+ vout0x01234567_1x01234567 = vcombine_s8(vget_high_s8(vout0x0123456789ABCDEF), vget_high_s8(vout1x0123456789ABCDEF));
+ }
+ if (nc & 4) {
+ vst1q_lane_u32(__builtin_assume_aligned(c1, 1), vreinterpretq_u32_s8(vout0x01234567_1x01234567), 2); c1 += 4;
+ vst1q_lane_u32(__builtin_assume_aligned(c0, 1), vreinterpretq_u32_s8(vout0x01234567_1x01234567), 0); c0 += 4;
+ vout0x01234567_1x01234567 = vextq_s8(vout0x01234567_1x01234567, vout0x01234567_1x01234567, 4);
+ }
+ if (nc & 2) {
+ vst1q_lane_u16(__builtin_assume_aligned(c1, 1), vreinterpretq_u16_s8(vout0x01234567_1x01234567), 4); c1 += 2;
+ vst1q_lane_u16(__builtin_assume_aligned(c0, 1), vreinterpretq_u16_s8(vout0x01234567_1x01234567), 0); c0 += 2;
+ vout0x01234567_1x01234567 = vextq_s8(vout0x01234567_1x01234567, vout0x01234567_1x01234567, 2);
+ }
+ if (nc & 1) {
+ vst1q_lane_s8(c1, vout0x01234567_1x01234567, 8);
+ vst1q_lane_s8(c0, vout0x01234567_1x01234567, 0);
+ }
+
+ nc = 0;
+ }
+ } while (nc != 0);
+}
diff --git a/src/qs8-igemm/gen/2x16c2s4-minmax-rndnu-neon-mull-padal.c b/src/qs8-igemm/gen/2x16c2s4-minmax-rndnu-neon-mull-padal.c
new file mode 100644
index 0000000..a5ea929
--- /dev/null
+++ b/src/qs8-igemm/gen/2x16c2s4-minmax-rndnu-neon-mull-padal.c
@@ -0,0 +1,363 @@
+// Auto-generated file. Do not edit!
+// Template: src/qs8-igemm/c2-neon-mull-padal-shuffle.c.in
+// Generator: tools/xngen
+//
+// Copyright 2021 Google LLC
+//
+// This source code is licensed under the BSD-style license found in the
+// LICENSE file in the root directory of this source tree.
+
+#include <assert.h>
+
+#include <arm_neon.h>
+
+#include <xnnpack/gemm.h>
+#include <xnnpack/math.h>
+
+
+void xnn_qs8_igemm_minmax_rndnu_ukernel_2x16c2s4__neon_mull_padal(
+ size_t mr,
+ size_t nc,
+ size_t kc,
+ size_t ks,
+ const int8_t** restrict a,
+ const void* restrict w,
+ int8_t* restrict c,
+ size_t cm_stride,
+ size_t cn_stride,
+ size_t a_offset,
+ const int8_t* zero,
+ const union xnn_qs8_conv_minmax_params params[restrict XNN_MIN_ELEMENTS(1)]) XNN_DISABLE_TSAN XNN_DISABLE_MSAN
+{
+ assert(mr != 0);
+ assert(mr <= 2);
+ assert(nc != 0);
+ assert(kc != 0);
+ assert(ks != 0);
+ assert(ks % (2 * sizeof(void*)) == 0);
+ assert(a_offset % sizeof(int8_t) == 0);
+ assert(a != NULL);
+ assert(w != NULL);
+ assert(c != NULL);
+
+ int8_t* c0 = c;
+ int8_t* c1 = (int8_t*) ((uintptr_t) c0 + cm_stride);
+ if XNN_UNPREDICTABLE(mr != 2) {
+ c1 = c0;
+ }
+
+ do {
+ int32x4_t vacc0x0123 = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc0x4567 = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc0x89AB = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc0xCDEF = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc1x0123 = vacc0x0123;
+ int32x4_t vacc1x4567 = vacc0x4567;
+ int32x4_t vacc1x89AB = vacc0x89AB;
+ int32x4_t vacc1xCDEF = vacc0xCDEF;
+
+ size_t p = ks;
+ do {
+ const int8_t* restrict a0 = a[0];
+ if XNN_UNPREDICTABLE(a0 != zero) {
+ a0 = (const int8_t*) ((uintptr_t) a0 + a_offset);
+ }
+ const int8_t* restrict a1 = a[1];
+ if XNN_UNPREDICTABLE(a1 != zero) {
+ a1 = (const int8_t*) ((uintptr_t) a1 + a_offset);
+ }
+ a += 2;
+
+ size_t k = kc;
+
+
+ while (k >= 8 * sizeof(int8_t)) {
+ int8x8_t va0x0 = vld1_s8(a0); a0 += 8;
+ int8x8_t va1x0 = vld1_s8(a1); a1 += 8;
+
+ const int8x8_t vb0123c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ int16x8_t vprod0x0123c0 = vmull_s8(vb0123c0x0, va0x0);
+ int16x8_t vprod1x0123c0 = vmull_s8(vb0123c0x0, va1x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c0);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c0);
+ int16x8_t vprod0x4567c0 = vmull_s8(vb4567c0x0, va0x0);
+ int16x8_t vprod1x4567c0 = vmull_s8(vb4567c0x0, va1x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c0);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c0);
+ int16x8_t vprod0x89ABc0 = vmull_s8(vb89ABc0x0, va0x0);
+ int16x8_t vprod1x89ABc0 = vmull_s8(vb89ABc0x0, va1x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc0);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc0);
+ int16x8_t vprod0xCDEFc0 = vmull_s8(vbCDEFc0x0, va0x0);
+ int16x8_t vprod1xCDEFc0 = vmull_s8(vbCDEFc0x0, va1x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc0);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc0);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ int16x8_t vprod0x0123c1 = vmull_s8(vb0123c1x0, va0x0);
+ int16x8_t vprod1x0123c1 = vmull_s8(vb0123c1x0, va1x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c1);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c1);
+ int16x8_t vprod0x4567c1 = vmull_s8(vb4567c1x0, va0x0);
+ int16x8_t vprod1x4567c1 = vmull_s8(vb4567c1x0, va1x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c1);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c1);
+ int16x8_t vprod0x89ABc1 = vmull_s8(vb89ABc1x0, va0x0);
+ int16x8_t vprod1x89ABc1 = vmull_s8(vb89ABc1x0, va1x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc1);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc1);
+ int16x8_t vprod0xCDEFc1 = vmull_s8(vbCDEFc1x0, va0x0);
+ int16x8_t vprod1xCDEFc1 = vmull_s8(vbCDEFc1x0, va1x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc1);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc1);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2x0, va0x0);
+ int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2x0, va1x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2x0, va0x0);
+ int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2x0, va1x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ int16x8_t vprod0x89ABc2 = vmull_s8(vb89ABc2x0, va0x0);
+ int16x8_t vprod1x89ABc2 = vmull_s8(vb89ABc2x0, va1x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc2);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc2);
+ int16x8_t vprod0xCDEFc2 = vmull_s8(vbCDEFc2x0, va0x0);
+ int16x8_t vprod1xCDEFc2 = vmull_s8(vbCDEFc2x0, va1x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc2);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc2);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ int16x8_t vprod0x0123c3 = vmull_s8(vb0123c3x0, va0x0);
+ int16x8_t vprod1x0123c3 = vmull_s8(vb0123c3x0, va1x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c3);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c3);
+ int16x8_t vprod0x4567c3 = vmull_s8(vb4567c3x0, va0x0);
+ int16x8_t vprod1x4567c3 = vmull_s8(vb4567c3x0, va1x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c3);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c3);
+ int16x8_t vprod0x89ABc3 = vmull_s8(vb89ABc3x0, va0x0);
+ int16x8_t vprod1x89ABc3 = vmull_s8(vb89ABc3x0, va1x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc3);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc3);
+ int16x8_t vprod0xCDEFc3 = vmull_s8(vbCDEFc3x0, va0x0);
+ int16x8_t vprod1xCDEFc3 = vmull_s8(vbCDEFc3x0, va1x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc3);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc3);
+
+ k -= 8 * sizeof(int8_t);
+ }
+
+ if XNN_UNLIKELY(k != 0) {
+ const int8x8_t va0 = vld1_s8(a0); a0 = (const int8_t*) ((uintptr_t) a0 + k);
+ const int8x8_t va1 = vld1_s8(a1); a1 = (const int8_t*) ((uintptr_t) a1 + k);
+
+ const int8x8_t vb0123c0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c0 = vmull_s8(vb0123c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c0);
+ const int16x8_t vprod0x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c0);
+ const int16x8_t vprod0x89ABc0 = vmull_s8(vb89ABc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc0);
+ const int16x8_t vprod0xCDEFc0 = vmull_s8(vbCDEFc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc0);
+ const int16x8_t vprod1x0123c0 = vmull_s8(vb0123c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c0);
+ const int16x8_t vprod1x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c0);
+ const int16x8_t vprod1x89ABc0 = vmull_s8(vb89ABc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0)));
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc0);
+ const int16x8_t vprod1xCDEFc0 = vmull_s8(vbCDEFc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0)));
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc0);
+
+ if (k > 2 * sizeof(int8_t)) {
+ const int8x8_t vb0123c1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c1 = vmull_s8(vb0123c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c1);
+ const int16x8_t vprod0x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c1);
+ const int16x8_t vprod0x89ABc1 = vmull_s8(vb89ABc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc1);
+ const int16x8_t vprod0xCDEFc1 = vmull_s8(vbCDEFc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc1);
+ const int16x8_t vprod1x0123c1 = vmull_s8(vb0123c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c1);
+ const int16x8_t vprod1x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c1);
+ const int16x8_t vprod1x89ABc1 = vmull_s8(vb89ABc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1)));
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc1);
+ const int16x8_t vprod1xCDEFc1 = vmull_s8(vbCDEFc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1)));
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc1);
+
+ if (k > 4 * sizeof(int8_t)) {
+ const int8x8_t vb0123c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ const int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ const int16x8_t vprod0x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc2);
+ const int16x8_t vprod0xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc2);
+ const int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ const int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ const int16x8_t vprod1x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2)));
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc2);
+ const int16x8_t vprod1xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2)));
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc2);
+
+ if (k > 6 * sizeof(int8_t)) {
+ const int8x8_t vb0123c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ const int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ const int16x8_t vprod0x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc2);
+ const int16x8_t vprod0xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc2);
+ const int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 3)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ const int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 3)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ const int16x8_t vprod1x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 3)));
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc2);
+ const int16x8_t vprod1xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 3)));
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc2);
+ }
+ }
+ }
+ }
+ p -= 2 * sizeof(void*);
+ } while (p != 0);
+
+ const int32x4_t vright_pre_shift = vld1q_dup_s32(¶ms->rndnu_neon.right_pre_shift);
+ const int32x4_t vmultiplier = vld1q_dup_s32(¶ms->rndnu_neon.multiplier);
+ const int32x4_t vright_post_shift = vld1q_dup_s32(¶ms->rndnu_neon.right_post_shift);
+
+ vacc0x0123 = vshlq_s32(vacc0x0123, vright_pre_shift);
+ vacc0x4567 = vshlq_s32(vacc0x4567, vright_pre_shift);
+ vacc0x89AB = vshlq_s32(vacc0x89AB, vright_pre_shift);
+ vacc0xCDEF = vshlq_s32(vacc0xCDEF, vright_pre_shift);
+ vacc1x0123 = vshlq_s32(vacc1x0123, vright_pre_shift);
+ vacc1x4567 = vshlq_s32(vacc1x4567, vright_pre_shift);
+ vacc1x89AB = vshlq_s32(vacc1x89AB, vright_pre_shift);
+ vacc1xCDEF = vshlq_s32(vacc1xCDEF, vright_pre_shift);
+
+ vacc0x0123 = vqdmulhq_s32(vacc0x0123, vmultiplier);
+ vacc0x4567 = vqdmulhq_s32(vacc0x4567, vmultiplier);
+ vacc0x89AB = vqdmulhq_s32(vacc0x89AB, vmultiplier);
+ vacc0xCDEF = vqdmulhq_s32(vacc0xCDEF, vmultiplier);
+ vacc1x0123 = vqdmulhq_s32(vacc1x0123, vmultiplier);
+ vacc1x4567 = vqdmulhq_s32(vacc1x4567, vmultiplier);
+ vacc1x89AB = vqdmulhq_s32(vacc1x89AB, vmultiplier);
+ vacc1xCDEF = vqdmulhq_s32(vacc1xCDEF, vmultiplier);
+
+ vacc0x0123 = vrshlq_s32(vacc0x0123, vright_post_shift);
+ vacc0x4567 = vrshlq_s32(vacc0x4567, vright_post_shift);
+ vacc0x89AB = vrshlq_s32(vacc0x89AB, vright_post_shift);
+ vacc0xCDEF = vrshlq_s32(vacc0xCDEF, vright_post_shift);
+ vacc1x0123 = vrshlq_s32(vacc1x0123, vright_post_shift);
+ vacc1x4567 = vrshlq_s32(vacc1x4567, vright_post_shift);
+ vacc1x89AB = vrshlq_s32(vacc1x89AB, vright_post_shift);
+ vacc1xCDEF = vrshlq_s32(vacc1xCDEF, vright_post_shift);
+
+ const int16x8_t voutput_zero_point = vld1q_dup_s16(¶ms->rndnu_neon.output_zero_point);
+#if XNN_ARCH_ARM64
+ const int16x8_t vacc0x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc0x0123), vacc0x4567), voutput_zero_point);
+ const int16x8_t vacc0x89ABCDEF = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc0x89AB), vacc0xCDEF), voutput_zero_point);
+ const int16x8_t vacc1x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc1x0123), vacc1x4567), voutput_zero_point);
+ const int16x8_t vacc1x89ABCDEF = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc1x89AB), vacc1xCDEF), voutput_zero_point);
+
+ int8x16_t vout0x0123456789ABCDEF = vqmovn_high_s16(vqmovn_s16(vacc0x01234567), vacc0x89ABCDEF);
+ int8x16_t vout1x0123456789ABCDEF = vqmovn_high_s16(vqmovn_s16(vacc1x01234567), vacc1x89ABCDEF);
+#else
+ const int16x8_t vacc0x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc0x0123), vqmovn_s32(vacc0x4567)), voutput_zero_point);
+ const int16x8_t vacc0x89ABCDEF = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc0x89AB), vqmovn_s32(vacc0xCDEF)), voutput_zero_point);
+ const int16x8_t vacc1x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc1x0123), vqmovn_s32(vacc1x4567)), voutput_zero_point);
+ const int16x8_t vacc1x89ABCDEF = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc1x89AB), vqmovn_s32(vacc1xCDEF)), voutput_zero_point);
+
+ int8x16_t vout0x0123456789ABCDEF = vcombine_s8(vqmovn_s16(vacc0x01234567), vqmovn_s16(vacc0x89ABCDEF));
+ int8x16_t vout1x0123456789ABCDEF = vcombine_s8(vqmovn_s16(vacc1x01234567), vqmovn_s16(vacc1x89ABCDEF));
+#endif
+ const int8x16_t voutput_min = vld1q_dup_s8(¶ms->rndnu_neon.output_min);
+ const int8x16_t voutput_max = vld1q_dup_s8(¶ms->rndnu_neon.output_max);
+
+ vout1x0123456789ABCDEF = vmaxq_s8(vout1x0123456789ABCDEF, voutput_min);
+ vout0x0123456789ABCDEF = vmaxq_s8(vout0x0123456789ABCDEF, voutput_min);
+
+ vout1x0123456789ABCDEF = vminq_s8(vout1x0123456789ABCDEF, voutput_max);
+ vout0x0123456789ABCDEF = vminq_s8(vout0x0123456789ABCDEF, voutput_max);
+
+ if (nc >= 16) {
+ vst1q_s8(c1 + 0, vout1x0123456789ABCDEF);
+ vst1q_s8(c0 + 0, vout0x0123456789ABCDEF);
+
+ c1 = (int8_t*) ((uintptr_t) c1 + cn_stride);
+ c0 = (int8_t*) ((uintptr_t) c0 + cn_stride);
+
+ a = (const int8_t**restrict) ((uintptr_t) a - ks);
+
+ nc -= 16;
+ } else {
+ int8x16_t vout0x01234567_1x01234567 = vcombine_s8(vget_low_s8(vout0x0123456789ABCDEF), vget_low_s8(vout1x0123456789ABCDEF));
+ if (nc & 8) {
+ vst1_s8(c1, vget_high_s8(vout0x01234567_1x01234567)); c1 += 8;
+ vst1_s8(c0, vget_low_s8(vout0x01234567_1x01234567)); c0 += 8;
+ vout0x01234567_1x01234567 = vcombine_s8(vget_high_s8(vout0x0123456789ABCDEF), vget_high_s8(vout1x0123456789ABCDEF));
+ }
+ if (nc & 4) {
+ vst1q_lane_u32(__builtin_assume_aligned(c1, 1), vreinterpretq_u32_s8(vout0x01234567_1x01234567), 2); c1 += 4;
+ vst1q_lane_u32(__builtin_assume_aligned(c0, 1), vreinterpretq_u32_s8(vout0x01234567_1x01234567), 0); c0 += 4;
+ vout0x01234567_1x01234567 = vextq_s8(vout0x01234567_1x01234567, vout0x01234567_1x01234567, 4);
+ }
+ if (nc & 2) {
+ vst1q_lane_u16(__builtin_assume_aligned(c1, 1), vreinterpretq_u16_s8(vout0x01234567_1x01234567), 4); c1 += 2;
+ vst1q_lane_u16(__builtin_assume_aligned(c0, 1), vreinterpretq_u16_s8(vout0x01234567_1x01234567), 0); c0 += 2;
+ vout0x01234567_1x01234567 = vextq_s8(vout0x01234567_1x01234567, vout0x01234567_1x01234567, 2);
+ }
+ if (nc & 1) {
+ vst1q_lane_s8(c1, vout0x01234567_1x01234567, 8);
+ vst1q_lane_s8(c0, vout0x01234567_1x01234567, 0);
+ }
+
+ nc = 0;
+ }
+ } while (nc != 0);
+}
diff --git a/src/qs8-igemm/gen/2x8s4c2-minmax-rndnu-neon-mlal-padal.c b/src/qs8-igemm/gen/2x8c2s4-minmax-fp32-neon-mlal-padal.c
similarity index 84%
copy from src/qs8-igemm/gen/2x8s4c2-minmax-rndnu-neon-mlal-padal.c
copy to src/qs8-igemm/gen/2x8c2s4-minmax-fp32-neon-mlal-padal.c
index 4b97f1b..c5235d5 100644
--- a/src/qs8-igemm/gen/2x8s4c2-minmax-rndnu-neon-mlal-padal.c
+++ b/src/qs8-igemm/gen/2x8c2s4-minmax-fp32-neon-mlal-padal.c
@@ -15,7 +15,7 @@
#include <xnnpack/math.h>
-void xnn_qs8_igemm_minmax_rndnu_ukernel_2x8s4c2__neon_mlal_padal(
+void xnn_qs8_igemm_minmax_fp32_ukernel_2x8c2s4__neon_mlal_padal(
size_t mr,
size_t nc,
size_t kc,
@@ -269,43 +269,52 @@
p -= 2 * sizeof(void*);
} while (p != 0);
- const int32x4_t vright_pre_shift = vld1q_dup_s32(¶ms->rndnu_neon.right_pre_shift);
- const int32x4_t vmultiplier = vld1q_dup_s32(¶ms->rndnu_neon.multiplier);
- const int32x4_t vright_post_shift = vld1q_dup_s32(¶ms->rndnu_neon.right_post_shift);
+ float32x4_t vfpacc0x0123 = vcvtq_f32_s32(vacc0x0123);
+ float32x4_t vfpacc0x4567 = vcvtq_f32_s32(vacc0x4567);
+ float32x4_t vfpacc1x0123 = vcvtq_f32_s32(vacc1x0123);
+ float32x4_t vfpacc1x4567 = vcvtq_f32_s32(vacc1x4567);
- vacc0x0123 = vshlq_s32(vacc0x0123, vright_pre_shift);
- vacc0x4567 = vshlq_s32(vacc0x4567, vright_pre_shift);
- vacc1x0123 = vshlq_s32(vacc1x0123, vright_pre_shift);
- vacc1x4567 = vshlq_s32(vacc1x4567, vright_pre_shift);
+ const float32x4_t vscale = vld1q_dup_f32(¶ms->fp32_neon.scale);
+ vfpacc0x0123 = vmulq_f32(vfpacc0x0123, vscale);
+ vfpacc0x4567 = vmulq_f32(vfpacc0x4567, vscale);
+ vfpacc1x0123 = vmulq_f32(vfpacc1x0123, vscale);
+ vfpacc1x4567 = vmulq_f32(vfpacc1x4567, vscale);
- vacc0x0123 = vqdmulhq_s32(vacc0x0123, vmultiplier);
- vacc0x4567 = vqdmulhq_s32(vacc0x4567, vmultiplier);
- vacc1x0123 = vqdmulhq_s32(vacc1x0123, vmultiplier);
- vacc1x4567 = vqdmulhq_s32(vacc1x4567, vmultiplier);
+ const float32x4_t voutput_min_less_zero_point = vld1q_dup_f32(¶ms->fp32_neon.output_min_less_zero_point);
+ vfpacc0x0123 = vmaxq_f32(vfpacc0x0123, voutput_min_less_zero_point);
+ vfpacc0x4567 = vmaxq_f32(vfpacc0x4567, voutput_min_less_zero_point);
+ vfpacc1x0123 = vmaxq_f32(vfpacc1x0123, voutput_min_less_zero_point);
+ vfpacc1x4567 = vmaxq_f32(vfpacc1x4567, voutput_min_less_zero_point);
- vacc0x0123 = vrshlq_s32(vacc0x0123, vright_post_shift);
- vacc0x4567 = vrshlq_s32(vacc0x4567, vright_post_shift);
- vacc1x0123 = vrshlq_s32(vacc1x0123, vright_post_shift);
- vacc1x4567 = vrshlq_s32(vacc1x4567, vright_post_shift);
+ const float32x4_t voutput_max_less_zero_point = vld1q_dup_f32(¶ms->fp32_neon.output_max_less_zero_point);
+ vfpacc0x0123 = vminq_f32(vfpacc0x0123, voutput_max_less_zero_point);
+ vfpacc0x4567 = vminq_f32(vfpacc0x4567, voutput_max_less_zero_point);
+ vfpacc1x0123 = vminq_f32(vfpacc1x0123, voutput_max_less_zero_point);
+ vfpacc1x4567 = vminq_f32(vfpacc1x4567, voutput_max_less_zero_point);
- const int16x8_t voutput_zero_point = vld1q_dup_s16(¶ms->rndnu_neon.output_zero_point);
+ const float32x4_t vmagic_bias = vld1q_dup_f32(¶ms->fp32_neon.magic_bias);
+ vacc0x0123 = vreinterpretq_s32_f32(vaddq_f32(vfpacc0x0123, vmagic_bias));
+ vacc0x4567 = vreinterpretq_s32_f32(vaddq_f32(vfpacc0x4567, vmagic_bias));
+ vacc1x0123 = vreinterpretq_s32_f32(vaddq_f32(vfpacc1x0123, vmagic_bias));
+ vacc1x4567 = vreinterpretq_s32_f32(vaddq_f32(vfpacc1x4567, vmagic_bias));
+
+ const int32x4_t vmagic_bias_less_zero_point = vld1q_dup_s32(¶ms->fp32_neon.magic_bias_less_zero_point);
+ vacc0x0123 = vsubq_s32(vacc0x0123, vmagic_bias_less_zero_point);
+ vacc0x4567 = vsubq_s32(vacc0x4567, vmagic_bias_less_zero_point);
+ vacc1x0123 = vsubq_s32(vacc1x0123, vmagic_bias_less_zero_point);
+ vacc1x4567 = vsubq_s32(vacc1x4567, vmagic_bias_less_zero_point);
+
#if XNN_ARCH_ARM64
- const int16x8_t vacc0x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc0x0123), vacc0x4567), voutput_zero_point);
- const int16x8_t vacc1x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc1x0123), vacc1x4567), voutput_zero_point);
+ const int16x8_t vacc0x01234567 = vuzp1q_s16(vreinterpretq_s16_s32(vacc0x0123), vreinterpretq_s16_s32(vacc0x4567));
+ const int16x8_t vacc1x01234567 = vuzp1q_s16(vreinterpretq_s16_s32(vacc1x0123), vreinterpretq_s16_s32(vacc1x4567));
- int8x16_t vout0x01234567_1x01234567 = vqmovn_high_s16(vqmovn_s16(vacc0x01234567), vacc1x01234567);
+ int8x16_t vout0x01234567_1x01234567 = vuzp1q_s8(vreinterpretq_s8_s16(vacc0x01234567), vreinterpretq_s8_s16(vacc1x01234567));
#else
- const int16x8_t vacc0x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc0x0123), vqmovn_s32(vacc0x4567)), voutput_zero_point);
- const int16x8_t vacc1x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc1x0123), vqmovn_s32(vacc1x4567)), voutput_zero_point);
+ const int16x8_t vacc0x01234567 = vcombine_s16(vmovn_s32(vacc0x0123), vmovn_s32(vacc0x4567));
+ const int16x8_t vacc1x01234567 = vcombine_s16(vmovn_s32(vacc1x0123), vmovn_s32(vacc1x4567));
- int8x16_t vout0x01234567_1x01234567 = vcombine_s8(vqmovn_s16(vacc0x01234567), vqmovn_s16(vacc1x01234567));
+ int8x16_t vout0x01234567_1x01234567 = vcombine_s8(vmovn_s16(vacc0x01234567), vmovn_s16(vacc1x01234567));
#endif
- const int8x16_t voutput_min = vld1q_dup_s8(¶ms->rndnu_neon.output_min);
- const int8x16_t voutput_max = vld1q_dup_s8(¶ms->rndnu_neon.output_max);
-
- vout0x01234567_1x01234567 = vmaxq_s8(vout0x01234567_1x01234567, voutput_min);
-
- vout0x01234567_1x01234567 = vminq_s8(vout0x01234567_1x01234567, voutput_max);
if (nc >= 8) {
vst1_s8(c1 + 0, vget_high_s8(vout0x01234567_1x01234567));
diff --git a/src/qs8-igemm/gen/2x8s4c2-minmax-rndnu-neon-mlal-padal.c b/src/qs8-igemm/gen/2x8c2s4-minmax-fp32-neonv8-mlal-padal.c
similarity index 93%
copy from src/qs8-igemm/gen/2x8s4c2-minmax-rndnu-neon-mlal-padal.c
copy to src/qs8-igemm/gen/2x8c2s4-minmax-fp32-neonv8-mlal-padal.c
index 4b97f1b..e0febc0 100644
--- a/src/qs8-igemm/gen/2x8s4c2-minmax-rndnu-neon-mlal-padal.c
+++ b/src/qs8-igemm/gen/2x8c2s4-minmax-fp32-neonv8-mlal-padal.c
@@ -12,10 +12,11 @@
#include <arm_neon.h>
#include <xnnpack/gemm.h>
+#include <xnnpack/intrinsics-polyfill.h>
#include <xnnpack/math.h>
-void xnn_qs8_igemm_minmax_rndnu_ukernel_2x8s4c2__neon_mlal_padal(
+void xnn_qs8_igemm_minmax_fp32_ukernel_2x8c2s4__neonv8_mlal_padal(
size_t mr,
size_t nc,
size_t kc,
@@ -269,26 +270,23 @@
p -= 2 * sizeof(void*);
} while (p != 0);
- const int32x4_t vright_pre_shift = vld1q_dup_s32(¶ms->rndnu_neon.right_pre_shift);
- const int32x4_t vmultiplier = vld1q_dup_s32(¶ms->rndnu_neon.multiplier);
- const int32x4_t vright_post_shift = vld1q_dup_s32(¶ms->rndnu_neon.right_post_shift);
+ float32x4_t vfpacc0x0123 = vcvtq_f32_s32(vacc0x0123);
+ float32x4_t vfpacc0x4567 = vcvtq_f32_s32(vacc0x4567);
+ float32x4_t vfpacc1x0123 = vcvtq_f32_s32(vacc1x0123);
+ float32x4_t vfpacc1x4567 = vcvtq_f32_s32(vacc1x4567);
- vacc0x0123 = vshlq_s32(vacc0x0123, vright_pre_shift);
- vacc0x4567 = vshlq_s32(vacc0x4567, vright_pre_shift);
- vacc1x0123 = vshlq_s32(vacc1x0123, vright_pre_shift);
- vacc1x4567 = vshlq_s32(vacc1x4567, vright_pre_shift);
+ const float32x4_t vscale = vld1q_dup_f32(¶ms->fp32_neonv8.scale);
+ vfpacc0x0123 = vmulq_f32(vfpacc0x0123, vscale);
+ vfpacc0x4567 = vmulq_f32(vfpacc0x4567, vscale);
+ vfpacc1x0123 = vmulq_f32(vfpacc1x0123, vscale);
+ vfpacc1x4567 = vmulq_f32(vfpacc1x4567, vscale);
- vacc0x0123 = vqdmulhq_s32(vacc0x0123, vmultiplier);
- vacc0x4567 = vqdmulhq_s32(vacc0x4567, vmultiplier);
- vacc1x0123 = vqdmulhq_s32(vacc1x0123, vmultiplier);
- vacc1x4567 = vqdmulhq_s32(vacc1x4567, vmultiplier);
+ vacc0x0123 = vcvtnq_s32_f32(vfpacc0x0123);
+ vacc0x4567 = vcvtnq_s32_f32(vfpacc0x4567);
+ vacc1x0123 = vcvtnq_s32_f32(vfpacc1x0123);
+ vacc1x4567 = vcvtnq_s32_f32(vfpacc1x4567);
- vacc0x0123 = vrshlq_s32(vacc0x0123, vright_post_shift);
- vacc0x4567 = vrshlq_s32(vacc0x4567, vright_post_shift);
- vacc1x0123 = vrshlq_s32(vacc1x0123, vright_post_shift);
- vacc1x4567 = vrshlq_s32(vacc1x4567, vright_post_shift);
-
- const int16x8_t voutput_zero_point = vld1q_dup_s16(¶ms->rndnu_neon.output_zero_point);
+ const int16x8_t voutput_zero_point = vld1q_dup_s16(¶ms->fp32_neonv8.output_zero_point);
#if XNN_ARCH_ARM64
const int16x8_t vacc0x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc0x0123), vacc0x4567), voutput_zero_point);
const int16x8_t vacc1x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc1x0123), vacc1x4567), voutput_zero_point);
@@ -300,8 +298,8 @@
int8x16_t vout0x01234567_1x01234567 = vcombine_s8(vqmovn_s16(vacc0x01234567), vqmovn_s16(vacc1x01234567));
#endif
- const int8x16_t voutput_min = vld1q_dup_s8(¶ms->rndnu_neon.output_min);
- const int8x16_t voutput_max = vld1q_dup_s8(¶ms->rndnu_neon.output_max);
+ const int8x16_t voutput_min = vld1q_dup_s8(¶ms->fp32_neonv8.output_min);
+ const int8x16_t voutput_max = vld1q_dup_s8(¶ms->fp32_neonv8.output_max);
vout0x01234567_1x01234567 = vmaxq_s8(vout0x01234567_1x01234567, voutput_min);
diff --git a/src/qs8-igemm/gen/2x8s4c2-minmax-rndnu-neon-mlal-padal.c b/src/qs8-igemm/gen/2x8c2s4-minmax-rndnu-neon-mlal-padal.c
similarity index 99%
rename from src/qs8-igemm/gen/2x8s4c2-minmax-rndnu-neon-mlal-padal.c
rename to src/qs8-igemm/gen/2x8c2s4-minmax-rndnu-neon-mlal-padal.c
index 4b97f1b..173e067 100644
--- a/src/qs8-igemm/gen/2x8s4c2-minmax-rndnu-neon-mlal-padal.c
+++ b/src/qs8-igemm/gen/2x8c2s4-minmax-rndnu-neon-mlal-padal.c
@@ -15,7 +15,7 @@
#include <xnnpack/math.h>
-void xnn_qs8_igemm_minmax_rndnu_ukernel_2x8s4c2__neon_mlal_padal(
+void xnn_qs8_igemm_minmax_rndnu_ukernel_2x8c2s4__neon_mlal_padal(
size_t mr,
size_t nc,
size_t kc,
diff --git a/src/qs8-igemm/gen/2x8s4c2-minmax-rndnu-neon-mull-padal.c b/src/qs8-igemm/gen/2x8c2s4-minmax-rndnu-neon-mull-padal.c
similarity index 99%
rename from src/qs8-igemm/gen/2x8s4c2-minmax-rndnu-neon-mull-padal.c
rename to src/qs8-igemm/gen/2x8c2s4-minmax-rndnu-neon-mull-padal.c
index eaad097..5f1cf14 100644
--- a/src/qs8-igemm/gen/2x8s4c2-minmax-rndnu-neon-mull-padal.c
+++ b/src/qs8-igemm/gen/2x8c2s4-minmax-rndnu-neon-mull-padal.c
@@ -15,7 +15,7 @@
#include <xnnpack/math.h>
-void xnn_qs8_igemm_minmax_rndnu_ukernel_2x8s4c2__neon_mull_padal(
+void xnn_qs8_igemm_minmax_rndnu_ukernel_2x8c2s4__neon_mull_padal(
size_t mr,
size_t nc,
size_t kc,
diff --git a/src/qs8-igemm/gen/3x16c2s4-minmax-rndnu-neon-mlal-padal.c b/src/qs8-igemm/gen/3x16c2s4-minmax-rndnu-neon-mlal-padal.c
new file mode 100644
index 0000000..d0da12d
--- /dev/null
+++ b/src/qs8-igemm/gen/3x16c2s4-minmax-rndnu-neon-mlal-padal.c
@@ -0,0 +1,680 @@
+// Auto-generated file. Do not edit!
+// Template: src/qs8-igemm/c2-neon-mull-padal-shuffle.c.in
+// Generator: tools/xngen
+//
+// Copyright 2021 Google LLC
+//
+// This source code is licensed under the BSD-style license found in the
+// LICENSE file in the root directory of this source tree.
+
+#include <assert.h>
+
+#include <arm_neon.h>
+
+#include <xnnpack/gemm.h>
+#include <xnnpack/math.h>
+
+
+void xnn_qs8_igemm_minmax_rndnu_ukernel_3x16c2s4__neon_mlal_padal(
+ size_t mr,
+ size_t nc,
+ size_t kc,
+ size_t ks,
+ const int8_t** restrict a,
+ const void* restrict w,
+ int8_t* restrict c,
+ size_t cm_stride,
+ size_t cn_stride,
+ size_t a_offset,
+ const int8_t* zero,
+ const union xnn_qs8_conv_minmax_params params[restrict XNN_MIN_ELEMENTS(1)]) XNN_DISABLE_TSAN XNN_DISABLE_MSAN
+{
+ assert(mr != 0);
+ assert(mr <= 3);
+ assert(nc != 0);
+ assert(kc != 0);
+ assert(ks != 0);
+ assert(ks % (3 * sizeof(void*)) == 0);
+ assert(a_offset % sizeof(int8_t) == 0);
+ assert(a != NULL);
+ assert(w != NULL);
+ assert(c != NULL);
+
+ int8_t* c0 = c;
+ int8_t* c1 = (int8_t*) ((uintptr_t) c0 + cm_stride);
+ if XNN_UNPREDICTABLE(mr < 2) {
+ c1 = c0;
+ }
+ int8_t* c2 = (int8_t*) ((uintptr_t) c1 + cm_stride);
+ if XNN_UNPREDICTABLE(mr <= 2) {
+ c2 = c1;
+ }
+
+ do {
+ int32x4_t vacc0x0123 = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc0x4567 = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc0x89AB = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc0xCDEF = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc1x0123 = vacc0x0123;
+ int32x4_t vacc1x4567 = vacc0x4567;
+ int32x4_t vacc1x89AB = vacc0x89AB;
+ int32x4_t vacc1xCDEF = vacc0xCDEF;
+ int32x4_t vacc2x0123 = vacc0x0123;
+ int32x4_t vacc2x4567 = vacc0x4567;
+ int32x4_t vacc2x89AB = vacc0x89AB;
+ int32x4_t vacc2xCDEF = vacc0xCDEF;
+
+ size_t p = ks;
+ do {
+ const int8_t* restrict a0 = a[0];
+ if XNN_UNPREDICTABLE(a0 != zero) {
+ a0 = (const int8_t*) ((uintptr_t) a0 + a_offset);
+ }
+ const int8_t* restrict a1 = a[1];
+ if XNN_UNPREDICTABLE(a1 != zero) {
+ a1 = (const int8_t*) ((uintptr_t) a1 + a_offset);
+ }
+ const int8_t* restrict a2 = a[2];
+ if XNN_UNPREDICTABLE(a2 != zero) {
+ a2 = (const int8_t*) ((uintptr_t) a2 + a_offset);
+ }
+ a += 3;
+
+ size_t k = kc;
+
+ while (k >= 16 * sizeof(int8_t)) {
+ int8x8_t va0x0 = vld1_s8(a0); a0 += 8;
+ int8x8_t va0x1 = vld1_s8(a0); a0 += 8;
+ int8x8_t va1x0 = vld1_s8(a1); a1 += 8;
+ int8x8_t va1x1 = vld1_s8(a1); a1 += 8;
+ int8x8_t va2x0 = vld1_s8(a2); a2 += 8;
+ int8x8_t va2x1 = vld1_s8(a2); a2 += 8;
+
+ const int8x8_t vb0123c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ int16x8_t vprod0x0123c0 = vmull_s8(vb0123c0x0, va0x0);
+ int16x8_t vprod1x0123c0 = vmull_s8(vb0123c0x0, va1x0);
+ int16x8_t vprod2x0123c0 = vmull_s8(vb0123c0x0, va2x0);
+ const int8x8_t vb0123c0x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x0123c0 = vmlal_s8(vprod0x0123c0, vb0123c0x1, va0x1);
+ vprod1x0123c0 = vmlal_s8(vprod1x0123c0, vb0123c0x1, va1x1);
+ vprod2x0123c0 = vmlal_s8(vprod2x0123c0, vb0123c0x1, va2x1);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c0);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c0);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c0);
+ int16x8_t vprod0x4567c0 = vmull_s8(vb4567c0x0, va0x0);
+ int16x8_t vprod1x4567c0 = vmull_s8(vb4567c0x0, va1x0);
+ int16x8_t vprod2x4567c0 = vmull_s8(vb4567c0x0, va2x0);
+ const int8x8_t vb4567c0x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x4567c0 = vmlal_s8(vprod0x4567c0, vb4567c0x1, va0x1);
+ vprod1x4567c0 = vmlal_s8(vprod1x4567c0, vb4567c0x1, va1x1);
+ vprod2x4567c0 = vmlal_s8(vprod2x4567c0, vb4567c0x1, va2x1);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c0);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c0);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c0);
+ int16x8_t vprod0x89ABc0 = vmull_s8(vb89ABc0x0, va0x0);
+ int16x8_t vprod1x89ABc0 = vmull_s8(vb89ABc0x0, va1x0);
+ int16x8_t vprod2x89ABc0 = vmull_s8(vb89ABc0x0, va2x0);
+ const int8x8_t vb89ABc0x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x89ABc0 = vmlal_s8(vprod0x89ABc0, vb89ABc0x1, va0x1);
+ vprod1x89ABc0 = vmlal_s8(vprod1x89ABc0, vb89ABc0x1, va1x1);
+ vprod2x89ABc0 = vmlal_s8(vprod2x89ABc0, vb89ABc0x1, va2x1);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc0);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc0);
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc0);
+ int16x8_t vprod0xCDEFc0 = vmull_s8(vbCDEFc0x0, va0x0);
+ int16x8_t vprod1xCDEFc0 = vmull_s8(vbCDEFc0x0, va1x0);
+ int16x8_t vprod2xCDEFc0 = vmull_s8(vbCDEFc0x0, va2x0);
+ const int8x8_t vbCDEFc0x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0xCDEFc0 = vmlal_s8(vprod0xCDEFc0, vbCDEFc0x1, va0x1);
+ vprod1xCDEFc0 = vmlal_s8(vprod1xCDEFc0, vbCDEFc0x1, va1x1);
+ vprod2xCDEFc0 = vmlal_s8(vprod2xCDEFc0, vbCDEFc0x1, va2x1);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc0);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc0);
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc0);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va0x1 = vext_s8(va0x1, va0x1, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ va1x1 = vext_s8(va1x1, va1x1, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
+ va2x1 = vext_s8(va2x1, va2x1, 2);
+ int16x8_t vprod0x0123c1 = vmull_s8(vb0123c1x0, va0x0);
+ int16x8_t vprod1x0123c1 = vmull_s8(vb0123c1x0, va1x0);
+ int16x8_t vprod2x0123c1 = vmull_s8(vb0123c1x0, va2x0);
+ const int8x8_t vb0123c1x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x0123c1 = vmlal_s8(vprod0x0123c1, vb0123c1x1, va0x1);
+ vprod1x0123c1 = vmlal_s8(vprod1x0123c1, vb0123c1x1, va1x1);
+ vprod2x0123c1 = vmlal_s8(vprod2x0123c1, vb0123c1x1, va2x1);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c1);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c1);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c1);
+ int16x8_t vprod0x4567c1 = vmull_s8(vb4567c1x0, va0x0);
+ int16x8_t vprod1x4567c1 = vmull_s8(vb4567c1x0, va1x0);
+ int16x8_t vprod2x4567c1 = vmull_s8(vb4567c1x0, va2x0);
+ const int8x8_t vb4567c1x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x4567c1 = vmlal_s8(vprod0x4567c1, vb4567c1x1, va0x1);
+ vprod1x4567c1 = vmlal_s8(vprod1x4567c1, vb4567c1x1, va1x1);
+ vprod2x4567c1 = vmlal_s8(vprod2x4567c1, vb4567c1x1, va2x1);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c1);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c1);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c1);
+ int16x8_t vprod0x89ABc1 = vmull_s8(vb89ABc1x0, va0x0);
+ int16x8_t vprod1x89ABc1 = vmull_s8(vb89ABc1x0, va1x0);
+ int16x8_t vprod2x89ABc1 = vmull_s8(vb89ABc1x0, va2x0);
+ const int8x8_t vb89ABc1x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x89ABc1 = vmlal_s8(vprod0x89ABc1, vb89ABc1x1, va0x1);
+ vprod1x89ABc1 = vmlal_s8(vprod1x89ABc1, vb89ABc1x1, va1x1);
+ vprod2x89ABc1 = vmlal_s8(vprod2x89ABc1, vb89ABc1x1, va2x1);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc1);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc1);
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc1);
+ int16x8_t vprod0xCDEFc1 = vmull_s8(vbCDEFc1x0, va0x0);
+ int16x8_t vprod1xCDEFc1 = vmull_s8(vbCDEFc1x0, va1x0);
+ int16x8_t vprod2xCDEFc1 = vmull_s8(vbCDEFc1x0, va2x0);
+ const int8x8_t vbCDEFc1x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0xCDEFc1 = vmlal_s8(vprod0xCDEFc1, vbCDEFc1x1, va0x1);
+ vprod1xCDEFc1 = vmlal_s8(vprod1xCDEFc1, vbCDEFc1x1, va1x1);
+ vprod2xCDEFc1 = vmlal_s8(vprod2xCDEFc1, vbCDEFc1x1, va2x1);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc1);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc1);
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc1);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va0x1 = vext_s8(va0x1, va0x1, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ va1x1 = vext_s8(va1x1, va1x1, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
+ va2x1 = vext_s8(va2x1, va2x1, 2);
+ int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2x0, va0x0);
+ int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2x0, va1x0);
+ int16x8_t vprod2x0123c2 = vmull_s8(vb0123c2x0, va2x0);
+ const int8x8_t vb0123c2x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x0123c2 = vmlal_s8(vprod0x0123c2, vb0123c2x1, va0x1);
+ vprod1x0123c2 = vmlal_s8(vprod1x0123c2, vb0123c2x1, va1x1);
+ vprod2x0123c2 = vmlal_s8(vprod2x0123c2, vb0123c2x1, va2x1);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c2);
+ int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2x0, va0x0);
+ int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2x0, va1x0);
+ int16x8_t vprod2x4567c2 = vmull_s8(vb4567c2x0, va2x0);
+ const int8x8_t vb4567c2x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x4567c2 = vmlal_s8(vprod0x4567c2, vb4567c2x1, va0x1);
+ vprod1x4567c2 = vmlal_s8(vprod1x4567c2, vb4567c2x1, va1x1);
+ vprod2x4567c2 = vmlal_s8(vprod2x4567c2, vb4567c2x1, va2x1);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c2);
+ int16x8_t vprod0x89ABc2 = vmull_s8(vb89ABc2x0, va0x0);
+ int16x8_t vprod1x89ABc2 = vmull_s8(vb89ABc2x0, va1x0);
+ int16x8_t vprod2x89ABc2 = vmull_s8(vb89ABc2x0, va2x0);
+ const int8x8_t vb89ABc2x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x89ABc2 = vmlal_s8(vprod0x89ABc2, vb89ABc2x1, va0x1);
+ vprod1x89ABc2 = vmlal_s8(vprod1x89ABc2, vb89ABc2x1, va1x1);
+ vprod2x89ABc2 = vmlal_s8(vprod2x89ABc2, vb89ABc2x1, va2x1);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc2);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc2);
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc2);
+ int16x8_t vprod0xCDEFc2 = vmull_s8(vbCDEFc2x0, va0x0);
+ int16x8_t vprod1xCDEFc2 = vmull_s8(vbCDEFc2x0, va1x0);
+ int16x8_t vprod2xCDEFc2 = vmull_s8(vbCDEFc2x0, va2x0);
+ const int8x8_t vbCDEFc2x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0xCDEFc2 = vmlal_s8(vprod0xCDEFc2, vbCDEFc2x1, va0x1);
+ vprod1xCDEFc2 = vmlal_s8(vprod1xCDEFc2, vbCDEFc2x1, va1x1);
+ vprod2xCDEFc2 = vmlal_s8(vprod2xCDEFc2, vbCDEFc2x1, va2x1);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc2);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc2);
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc2);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va0x1 = vext_s8(va0x1, va0x1, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ va1x1 = vext_s8(va1x1, va1x1, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
+ va2x1 = vext_s8(va2x1, va2x1, 2);
+ int16x8_t vprod0x0123c3 = vmull_s8(vb0123c3x0, va0x0);
+ int16x8_t vprod1x0123c3 = vmull_s8(vb0123c3x0, va1x0);
+ int16x8_t vprod2x0123c3 = vmull_s8(vb0123c3x0, va2x0);
+ const int8x8_t vb0123c3x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x0123c3 = vmlal_s8(vprod0x0123c3, vb0123c3x1, va0x1);
+ vprod1x0123c3 = vmlal_s8(vprod1x0123c3, vb0123c3x1, va1x1);
+ vprod2x0123c3 = vmlal_s8(vprod2x0123c3, vb0123c3x1, va2x1);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c3);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c3);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c3);
+ int16x8_t vprod0x4567c3 = vmull_s8(vb4567c3x0, va0x0);
+ int16x8_t vprod1x4567c3 = vmull_s8(vb4567c3x0, va1x0);
+ int16x8_t vprod2x4567c3 = vmull_s8(vb4567c3x0, va2x0);
+ const int8x8_t vb4567c3x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x4567c3 = vmlal_s8(vprod0x4567c3, vb4567c3x1, va0x1);
+ vprod1x4567c3 = vmlal_s8(vprod1x4567c3, vb4567c3x1, va1x1);
+ vprod2x4567c3 = vmlal_s8(vprod2x4567c3, vb4567c3x1, va2x1);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c3);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c3);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c3);
+ int16x8_t vprod0x89ABc3 = vmull_s8(vb89ABc3x0, va0x0);
+ int16x8_t vprod1x89ABc3 = vmull_s8(vb89ABc3x0, va1x0);
+ int16x8_t vprod2x89ABc3 = vmull_s8(vb89ABc3x0, va2x0);
+ const int8x8_t vb89ABc3x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x89ABc3 = vmlal_s8(vprod0x89ABc3, vb89ABc3x1, va0x1);
+ vprod1x89ABc3 = vmlal_s8(vprod1x89ABc3, vb89ABc3x1, va1x1);
+ vprod2x89ABc3 = vmlal_s8(vprod2x89ABc3, vb89ABc3x1, va2x1);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc3);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc3);
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc3);
+ int16x8_t vprod0xCDEFc3 = vmull_s8(vbCDEFc3x0, va0x0);
+ int16x8_t vprod1xCDEFc3 = vmull_s8(vbCDEFc3x0, va1x0);
+ int16x8_t vprod2xCDEFc3 = vmull_s8(vbCDEFc3x0, va2x0);
+ const int8x8_t vbCDEFc3x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0xCDEFc3 = vmlal_s8(vprod0xCDEFc3, vbCDEFc3x1, va0x1);
+ vprod1xCDEFc3 = vmlal_s8(vprod1xCDEFc3, vbCDEFc3x1, va1x1);
+ vprod2xCDEFc3 = vmlal_s8(vprod2xCDEFc3, vbCDEFc3x1, va2x1);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc3);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc3);
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc3);
+
+ k -= 16 * sizeof(int8_t);
+ }
+
+ if (k >= 8 * sizeof(int8_t)) {
+ int8x8_t va0x0 = vld1_s8(a0); a0 += 8;
+ int8x8_t va1x0 = vld1_s8(a1); a1 += 8;
+ int8x8_t va2x0 = vld1_s8(a2); a2 += 8;
+
+ const int8x8_t vb0123c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ int16x8_t vprod0x0123c0 = vmull_s8(vb0123c0x0, va0x0);
+ int16x8_t vprod1x0123c0 = vmull_s8(vb0123c0x0, va1x0);
+ int16x8_t vprod2x0123c0 = vmull_s8(vb0123c0x0, va2x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c0);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c0);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c0);
+ int16x8_t vprod0x4567c0 = vmull_s8(vb4567c0x0, va0x0);
+ int16x8_t vprod1x4567c0 = vmull_s8(vb4567c0x0, va1x0);
+ int16x8_t vprod2x4567c0 = vmull_s8(vb4567c0x0, va2x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c0);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c0);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c0);
+ int16x8_t vprod0x89ABc0 = vmull_s8(vb89ABc0x0, va0x0);
+ int16x8_t vprod1x89ABc0 = vmull_s8(vb89ABc0x0, va1x0);
+ int16x8_t vprod2x89ABc0 = vmull_s8(vb89ABc0x0, va2x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc0);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc0);
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc0);
+ int16x8_t vprod0xCDEFc0 = vmull_s8(vbCDEFc0x0, va0x0);
+ int16x8_t vprod1xCDEFc0 = vmull_s8(vbCDEFc0x0, va1x0);
+ int16x8_t vprod2xCDEFc0 = vmull_s8(vbCDEFc0x0, va2x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc0);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc0);
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc0);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
+ int16x8_t vprod0x0123c1 = vmull_s8(vb0123c1x0, va0x0);
+ int16x8_t vprod1x0123c1 = vmull_s8(vb0123c1x0, va1x0);
+ int16x8_t vprod2x0123c1 = vmull_s8(vb0123c1x0, va2x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c1);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c1);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c1);
+ int16x8_t vprod0x4567c1 = vmull_s8(vb4567c1x0, va0x0);
+ int16x8_t vprod1x4567c1 = vmull_s8(vb4567c1x0, va1x0);
+ int16x8_t vprod2x4567c1 = vmull_s8(vb4567c1x0, va2x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c1);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c1);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c1);
+ int16x8_t vprod0x89ABc1 = vmull_s8(vb89ABc1x0, va0x0);
+ int16x8_t vprod1x89ABc1 = vmull_s8(vb89ABc1x0, va1x0);
+ int16x8_t vprod2x89ABc1 = vmull_s8(vb89ABc1x0, va2x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc1);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc1);
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc1);
+ int16x8_t vprod0xCDEFc1 = vmull_s8(vbCDEFc1x0, va0x0);
+ int16x8_t vprod1xCDEFc1 = vmull_s8(vbCDEFc1x0, va1x0);
+ int16x8_t vprod2xCDEFc1 = vmull_s8(vbCDEFc1x0, va2x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc1);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc1);
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc1);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
+ int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2x0, va0x0);
+ int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2x0, va1x0);
+ int16x8_t vprod2x0123c2 = vmull_s8(vb0123c2x0, va2x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c2);
+ int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2x0, va0x0);
+ int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2x0, va1x0);
+ int16x8_t vprod2x4567c2 = vmull_s8(vb4567c2x0, va2x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c2);
+ int16x8_t vprod0x89ABc2 = vmull_s8(vb89ABc2x0, va0x0);
+ int16x8_t vprod1x89ABc2 = vmull_s8(vb89ABc2x0, va1x0);
+ int16x8_t vprod2x89ABc2 = vmull_s8(vb89ABc2x0, va2x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc2);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc2);
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc2);
+ int16x8_t vprod0xCDEFc2 = vmull_s8(vbCDEFc2x0, va0x0);
+ int16x8_t vprod1xCDEFc2 = vmull_s8(vbCDEFc2x0, va1x0);
+ int16x8_t vprod2xCDEFc2 = vmull_s8(vbCDEFc2x0, va2x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc2);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc2);
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc2);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
+ int16x8_t vprod0x0123c3 = vmull_s8(vb0123c3x0, va0x0);
+ int16x8_t vprod1x0123c3 = vmull_s8(vb0123c3x0, va1x0);
+ int16x8_t vprod2x0123c3 = vmull_s8(vb0123c3x0, va2x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c3);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c3);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c3);
+ int16x8_t vprod0x4567c3 = vmull_s8(vb4567c3x0, va0x0);
+ int16x8_t vprod1x4567c3 = vmull_s8(vb4567c3x0, va1x0);
+ int16x8_t vprod2x4567c3 = vmull_s8(vb4567c3x0, va2x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c3);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c3);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c3);
+ int16x8_t vprod0x89ABc3 = vmull_s8(vb89ABc3x0, va0x0);
+ int16x8_t vprod1x89ABc3 = vmull_s8(vb89ABc3x0, va1x0);
+ int16x8_t vprod2x89ABc3 = vmull_s8(vb89ABc3x0, va2x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc3);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc3);
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc3);
+ int16x8_t vprod0xCDEFc3 = vmull_s8(vbCDEFc3x0, va0x0);
+ int16x8_t vprod1xCDEFc3 = vmull_s8(vbCDEFc3x0, va1x0);
+ int16x8_t vprod2xCDEFc3 = vmull_s8(vbCDEFc3x0, va2x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc3);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc3);
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc3);
+
+ k -= 8 * sizeof(int8_t);
+ }
+
+ if XNN_UNLIKELY(k != 0) {
+ const int8x8_t va0 = vld1_s8(a0); a0 = (const int8_t*) ((uintptr_t) a0 + k);
+ const int8x8_t va1 = vld1_s8(a1); a1 = (const int8_t*) ((uintptr_t) a1 + k);
+ const int8x8_t va2 = vld1_s8(a2); a2 = (const int8_t*) ((uintptr_t) a2 + k);
+
+ const int8x8_t vb0123c0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c0 = vmull_s8(vb0123c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c0);
+ const int16x8_t vprod0x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c0);
+ const int16x8_t vprod0x89ABc0 = vmull_s8(vb89ABc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc0);
+ const int16x8_t vprod0xCDEFc0 = vmull_s8(vbCDEFc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc0);
+ const int16x8_t vprod1x0123c0 = vmull_s8(vb0123c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c0);
+ const int16x8_t vprod1x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c0);
+ const int16x8_t vprod1x89ABc0 = vmull_s8(vb89ABc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0)));
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc0);
+ const int16x8_t vprod1xCDEFc0 = vmull_s8(vbCDEFc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0)));
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc0);
+ const int16x8_t vprod2x0123c0 = vmull_s8(vb0123c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 0)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c0);
+ const int16x8_t vprod2x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 0)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c0);
+ const int16x8_t vprod2x89ABc0 = vmull_s8(vb89ABc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 0)));
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc0);
+ const int16x8_t vprod2xCDEFc0 = vmull_s8(vbCDEFc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 0)));
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc0);
+
+ if (k > 2 * sizeof(int8_t)) {
+ const int8x8_t vb0123c1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c1 = vmull_s8(vb0123c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c1);
+ const int16x8_t vprod0x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c1);
+ const int16x8_t vprod0x89ABc1 = vmull_s8(vb89ABc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc1);
+ const int16x8_t vprod0xCDEFc1 = vmull_s8(vbCDEFc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc1);
+ const int16x8_t vprod1x0123c1 = vmull_s8(vb0123c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c1);
+ const int16x8_t vprod1x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c1);
+ const int16x8_t vprod1x89ABc1 = vmull_s8(vb89ABc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1)));
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc1);
+ const int16x8_t vprod1xCDEFc1 = vmull_s8(vbCDEFc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1)));
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc1);
+ const int16x8_t vprod2x0123c1 = vmull_s8(vb0123c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 1)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c1);
+ const int16x8_t vprod2x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 1)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c1);
+ const int16x8_t vprod2x89ABc1 = vmull_s8(vb89ABc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 1)));
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc1);
+ const int16x8_t vprod2xCDEFc1 = vmull_s8(vbCDEFc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 1)));
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc1);
+
+ if (k > 4 * sizeof(int8_t)) {
+ const int8x8_t vb0123c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ const int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ const int16x8_t vprod0x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc2);
+ const int16x8_t vprod0xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc2);
+ const int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ const int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ const int16x8_t vprod1x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2)));
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc2);
+ const int16x8_t vprod1xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2)));
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc2);
+ const int16x8_t vprod2x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 2)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c2);
+ const int16x8_t vprod2x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 2)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c2);
+ const int16x8_t vprod2x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 2)));
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc2);
+ const int16x8_t vprod2xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 2)));
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc2);
+
+ if (k > 6 * sizeof(int8_t)) {
+ const int8x8_t vb0123c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ const int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ const int16x8_t vprod0x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc2);
+ const int16x8_t vprod0xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc2);
+ const int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 3)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ const int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 3)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ const int16x8_t vprod1x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 3)));
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc2);
+ const int16x8_t vprod1xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 3)));
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc2);
+ const int16x8_t vprod2x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 3)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c2);
+ const int16x8_t vprod2x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 3)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c2);
+ const int16x8_t vprod2x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 3)));
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc2);
+ const int16x8_t vprod2xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 3)));
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc2);
+ }
+ }
+ }
+ }
+ p -= 3 * sizeof(void*);
+ } while (p != 0);
+
+ const int32x4_t vright_pre_shift = vld1q_dup_s32(¶ms->rndnu_neon.right_pre_shift);
+ const int32x4_t vmultiplier = vld1q_dup_s32(¶ms->rndnu_neon.multiplier);
+ const int32x4_t vright_post_shift = vld1q_dup_s32(¶ms->rndnu_neon.right_post_shift);
+
+ vacc0x0123 = vshlq_s32(vacc0x0123, vright_pre_shift);
+ vacc0x4567 = vshlq_s32(vacc0x4567, vright_pre_shift);
+ vacc0x89AB = vshlq_s32(vacc0x89AB, vright_pre_shift);
+ vacc0xCDEF = vshlq_s32(vacc0xCDEF, vright_pre_shift);
+ vacc1x0123 = vshlq_s32(vacc1x0123, vright_pre_shift);
+ vacc1x4567 = vshlq_s32(vacc1x4567, vright_pre_shift);
+ vacc1x89AB = vshlq_s32(vacc1x89AB, vright_pre_shift);
+ vacc1xCDEF = vshlq_s32(vacc1xCDEF, vright_pre_shift);
+ vacc2x0123 = vshlq_s32(vacc2x0123, vright_pre_shift);
+ vacc2x4567 = vshlq_s32(vacc2x4567, vright_pre_shift);
+ vacc2x89AB = vshlq_s32(vacc2x89AB, vright_pre_shift);
+ vacc2xCDEF = vshlq_s32(vacc2xCDEF, vright_pre_shift);
+
+ vacc0x0123 = vqdmulhq_s32(vacc0x0123, vmultiplier);
+ vacc0x4567 = vqdmulhq_s32(vacc0x4567, vmultiplier);
+ vacc0x89AB = vqdmulhq_s32(vacc0x89AB, vmultiplier);
+ vacc0xCDEF = vqdmulhq_s32(vacc0xCDEF, vmultiplier);
+ vacc1x0123 = vqdmulhq_s32(vacc1x0123, vmultiplier);
+ vacc1x4567 = vqdmulhq_s32(vacc1x4567, vmultiplier);
+ vacc1x89AB = vqdmulhq_s32(vacc1x89AB, vmultiplier);
+ vacc1xCDEF = vqdmulhq_s32(vacc1xCDEF, vmultiplier);
+ vacc2x0123 = vqdmulhq_s32(vacc2x0123, vmultiplier);
+ vacc2x4567 = vqdmulhq_s32(vacc2x4567, vmultiplier);
+ vacc2x89AB = vqdmulhq_s32(vacc2x89AB, vmultiplier);
+ vacc2xCDEF = vqdmulhq_s32(vacc2xCDEF, vmultiplier);
+
+ vacc0x0123 = vrshlq_s32(vacc0x0123, vright_post_shift);
+ vacc0x4567 = vrshlq_s32(vacc0x4567, vright_post_shift);
+ vacc0x89AB = vrshlq_s32(vacc0x89AB, vright_post_shift);
+ vacc0xCDEF = vrshlq_s32(vacc0xCDEF, vright_post_shift);
+ vacc1x0123 = vrshlq_s32(vacc1x0123, vright_post_shift);
+ vacc1x4567 = vrshlq_s32(vacc1x4567, vright_post_shift);
+ vacc1x89AB = vrshlq_s32(vacc1x89AB, vright_post_shift);
+ vacc1xCDEF = vrshlq_s32(vacc1xCDEF, vright_post_shift);
+ vacc2x0123 = vrshlq_s32(vacc2x0123, vright_post_shift);
+ vacc2x4567 = vrshlq_s32(vacc2x4567, vright_post_shift);
+ vacc2x89AB = vrshlq_s32(vacc2x89AB, vright_post_shift);
+ vacc2xCDEF = vrshlq_s32(vacc2xCDEF, vright_post_shift);
+
+ const int16x8_t voutput_zero_point = vld1q_dup_s16(¶ms->rndnu_neon.output_zero_point);
+#if XNN_ARCH_ARM64
+ const int16x8_t vacc0x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc0x0123), vacc0x4567), voutput_zero_point);
+ const int16x8_t vacc0x89ABCDEF = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc0x89AB), vacc0xCDEF), voutput_zero_point);
+ const int16x8_t vacc1x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc1x0123), vacc1x4567), voutput_zero_point);
+ const int16x8_t vacc1x89ABCDEF = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc1x89AB), vacc1xCDEF), voutput_zero_point);
+ const int16x8_t vacc2x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc2x0123), vacc2x4567), voutput_zero_point);
+ const int16x8_t vacc2x89ABCDEF = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc2x89AB), vacc2xCDEF), voutput_zero_point);
+
+ int8x16_t vout0x0123456789ABCDEF = vqmovn_high_s16(vqmovn_s16(vacc0x01234567), vacc0x89ABCDEF);
+ int8x16_t vout1x0123456789ABCDEF = vqmovn_high_s16(vqmovn_s16(vacc1x01234567), vacc1x89ABCDEF);
+ int8x16_t vout2x0123456789ABCDEF = vqmovn_high_s16(vqmovn_s16(vacc2x01234567), vacc2x89ABCDEF);
+#else
+ const int16x8_t vacc0x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc0x0123), vqmovn_s32(vacc0x4567)), voutput_zero_point);
+ const int16x8_t vacc0x89ABCDEF = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc0x89AB), vqmovn_s32(vacc0xCDEF)), voutput_zero_point);
+ const int16x8_t vacc1x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc1x0123), vqmovn_s32(vacc1x4567)), voutput_zero_point);
+ const int16x8_t vacc1x89ABCDEF = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc1x89AB), vqmovn_s32(vacc1xCDEF)), voutput_zero_point);
+ const int16x8_t vacc2x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc2x0123), vqmovn_s32(vacc2x4567)), voutput_zero_point);
+ const int16x8_t vacc2x89ABCDEF = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc2x89AB), vqmovn_s32(vacc2xCDEF)), voutput_zero_point);
+
+ int8x16_t vout0x0123456789ABCDEF = vcombine_s8(vqmovn_s16(vacc0x01234567), vqmovn_s16(vacc0x89ABCDEF));
+ int8x16_t vout1x0123456789ABCDEF = vcombine_s8(vqmovn_s16(vacc1x01234567), vqmovn_s16(vacc1x89ABCDEF));
+ int8x16_t vout2x0123456789ABCDEF = vcombine_s8(vqmovn_s16(vacc2x01234567), vqmovn_s16(vacc2x89ABCDEF));
+#endif
+ const int8x16_t voutput_min = vld1q_dup_s8(¶ms->rndnu_neon.output_min);
+ const int8x16_t voutput_max = vld1q_dup_s8(¶ms->rndnu_neon.output_max);
+
+ vout2x0123456789ABCDEF = vmaxq_s8(vout2x0123456789ABCDEF, voutput_min);
+ vout1x0123456789ABCDEF = vmaxq_s8(vout1x0123456789ABCDEF, voutput_min);
+ vout0x0123456789ABCDEF = vmaxq_s8(vout0x0123456789ABCDEF, voutput_min);
+
+ vout2x0123456789ABCDEF = vminq_s8(vout2x0123456789ABCDEF, voutput_max);
+ vout1x0123456789ABCDEF = vminq_s8(vout1x0123456789ABCDEF, voutput_max);
+ vout0x0123456789ABCDEF = vminq_s8(vout0x0123456789ABCDEF, voutput_max);
+
+ if (nc >= 16) {
+ vst1q_s8(c2 + 0, vout2x0123456789ABCDEF);
+ vst1q_s8(c1 + 0, vout1x0123456789ABCDEF);
+ vst1q_s8(c0 + 0, vout0x0123456789ABCDEF);
+
+ c2 = (int8_t*) ((uintptr_t) c2 + cn_stride);
+ c1 = (int8_t*) ((uintptr_t) c1 + cn_stride);
+ c0 = (int8_t*) ((uintptr_t) c0 + cn_stride);
+
+ a = (const int8_t**restrict) ((uintptr_t) a - ks);
+
+ nc -= 16;
+ } else {
+ int8x8_t vout2x01234567 = vget_low_s8(vout2x0123456789ABCDEF);
+ int8x16_t vout0x01234567_1x01234567 = vcombine_s8(vget_low_s8(vout0x0123456789ABCDEF), vget_low_s8(vout1x0123456789ABCDEF));
+ if (nc & 8) {
+ vst1_s8(c2, vout2x01234567); c2 += 8;
+ vst1_s8(c1, vget_high_s8(vout0x01234567_1x01234567)); c1 += 8;
+ vst1_s8(c0, vget_low_s8(vout0x01234567_1x01234567)); c0 += 8;
+ vout2x01234567 = vget_high_s8(vout2x0123456789ABCDEF);
+ vout0x01234567_1x01234567 = vcombine_s8(vget_high_s8(vout0x0123456789ABCDEF), vget_high_s8(vout1x0123456789ABCDEF));
+ }
+ if (nc & 4) {
+ vst1_lane_u32(__builtin_assume_aligned(c2, 1), vreinterpret_u32_s8(vout2x01234567), 0); c2 += 4;
+ vst1q_lane_u32(__builtin_assume_aligned(c1, 1), vreinterpretq_u32_s8(vout0x01234567_1x01234567), 2); c1 += 4;
+ vst1q_lane_u32(__builtin_assume_aligned(c0, 1), vreinterpretq_u32_s8(vout0x01234567_1x01234567), 0); c0 += 4;
+ vout2x01234567 = vext_s8(vout2x01234567, vout2x01234567, 4);
+ vout0x01234567_1x01234567 = vextq_s8(vout0x01234567_1x01234567, vout0x01234567_1x01234567, 4);
+ }
+ if (nc & 2) {
+ vst1_lane_u16(__builtin_assume_aligned(c2, 1), vreinterpret_u16_s8(vout2x01234567), 0); c2 += 2;
+ vst1q_lane_u16(__builtin_assume_aligned(c1, 1), vreinterpretq_u16_s8(vout0x01234567_1x01234567), 4); c1 += 2;
+ vst1q_lane_u16(__builtin_assume_aligned(c0, 1), vreinterpretq_u16_s8(vout0x01234567_1x01234567), 0); c0 += 2;
+ vout2x01234567 = vext_s8(vout2x01234567, vout2x01234567, 2);
+ vout0x01234567_1x01234567 = vextq_s8(vout0x01234567_1x01234567, vout0x01234567_1x01234567, 2);
+ }
+ if (nc & 1) {
+ vst1_lane_s8(c2, vout2x01234567, 0);
+ vst1q_lane_s8(c1, vout0x01234567_1x01234567, 8);
+ vst1q_lane_s8(c0, vout0x01234567_1x01234567, 0);
+ }
+
+ nc = 0;
+ }
+ } while (nc != 0);
+}
diff --git a/src/qs8-igemm/gen/3x16c2s4-minmax-rndnu-neon-mull-padal.c b/src/qs8-igemm/gen/3x16c2s4-minmax-rndnu-neon-mull-padal.c
new file mode 100644
index 0000000..20f8045
--- /dev/null
+++ b/src/qs8-igemm/gen/3x16c2s4-minmax-rndnu-neon-mull-padal.c
@@ -0,0 +1,474 @@
+// Auto-generated file. Do not edit!
+// Template: src/qs8-igemm/c2-neon-mull-padal-shuffle.c.in
+// Generator: tools/xngen
+//
+// Copyright 2021 Google LLC
+//
+// This source code is licensed under the BSD-style license found in the
+// LICENSE file in the root directory of this source tree.
+
+#include <assert.h>
+
+#include <arm_neon.h>
+
+#include <xnnpack/gemm.h>
+#include <xnnpack/math.h>
+
+
+void xnn_qs8_igemm_minmax_rndnu_ukernel_3x16c2s4__neon_mull_padal(
+ size_t mr,
+ size_t nc,
+ size_t kc,
+ size_t ks,
+ const int8_t** restrict a,
+ const void* restrict w,
+ int8_t* restrict c,
+ size_t cm_stride,
+ size_t cn_stride,
+ size_t a_offset,
+ const int8_t* zero,
+ const union xnn_qs8_conv_minmax_params params[restrict XNN_MIN_ELEMENTS(1)]) XNN_DISABLE_TSAN XNN_DISABLE_MSAN
+{
+ assert(mr != 0);
+ assert(mr <= 3);
+ assert(nc != 0);
+ assert(kc != 0);
+ assert(ks != 0);
+ assert(ks % (3 * sizeof(void*)) == 0);
+ assert(a_offset % sizeof(int8_t) == 0);
+ assert(a != NULL);
+ assert(w != NULL);
+ assert(c != NULL);
+
+ int8_t* c0 = c;
+ int8_t* c1 = (int8_t*) ((uintptr_t) c0 + cm_stride);
+ if XNN_UNPREDICTABLE(mr < 2) {
+ c1 = c0;
+ }
+ int8_t* c2 = (int8_t*) ((uintptr_t) c1 + cm_stride);
+ if XNN_UNPREDICTABLE(mr <= 2) {
+ c2 = c1;
+ }
+
+ do {
+ int32x4_t vacc0x0123 = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc0x4567 = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc0x89AB = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc0xCDEF = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc1x0123 = vacc0x0123;
+ int32x4_t vacc1x4567 = vacc0x4567;
+ int32x4_t vacc1x89AB = vacc0x89AB;
+ int32x4_t vacc1xCDEF = vacc0xCDEF;
+ int32x4_t vacc2x0123 = vacc0x0123;
+ int32x4_t vacc2x4567 = vacc0x4567;
+ int32x4_t vacc2x89AB = vacc0x89AB;
+ int32x4_t vacc2xCDEF = vacc0xCDEF;
+
+ size_t p = ks;
+ do {
+ const int8_t* restrict a0 = a[0];
+ if XNN_UNPREDICTABLE(a0 != zero) {
+ a0 = (const int8_t*) ((uintptr_t) a0 + a_offset);
+ }
+ const int8_t* restrict a1 = a[1];
+ if XNN_UNPREDICTABLE(a1 != zero) {
+ a1 = (const int8_t*) ((uintptr_t) a1 + a_offset);
+ }
+ const int8_t* restrict a2 = a[2];
+ if XNN_UNPREDICTABLE(a2 != zero) {
+ a2 = (const int8_t*) ((uintptr_t) a2 + a_offset);
+ }
+ a += 3;
+
+ size_t k = kc;
+
+
+ while (k >= 8 * sizeof(int8_t)) {
+ int8x8_t va0x0 = vld1_s8(a0); a0 += 8;
+ int8x8_t va1x0 = vld1_s8(a1); a1 += 8;
+ int8x8_t va2x0 = vld1_s8(a2); a2 += 8;
+
+ const int8x8_t vb0123c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ int16x8_t vprod0x0123c0 = vmull_s8(vb0123c0x0, va0x0);
+ int16x8_t vprod1x0123c0 = vmull_s8(vb0123c0x0, va1x0);
+ int16x8_t vprod2x0123c0 = vmull_s8(vb0123c0x0, va2x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c0);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c0);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c0);
+ int16x8_t vprod0x4567c0 = vmull_s8(vb4567c0x0, va0x0);
+ int16x8_t vprod1x4567c0 = vmull_s8(vb4567c0x0, va1x0);
+ int16x8_t vprod2x4567c0 = vmull_s8(vb4567c0x0, va2x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c0);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c0);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c0);
+ int16x8_t vprod0x89ABc0 = vmull_s8(vb89ABc0x0, va0x0);
+ int16x8_t vprod1x89ABc0 = vmull_s8(vb89ABc0x0, va1x0);
+ int16x8_t vprod2x89ABc0 = vmull_s8(vb89ABc0x0, va2x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc0);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc0);
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc0);
+ int16x8_t vprod0xCDEFc0 = vmull_s8(vbCDEFc0x0, va0x0);
+ int16x8_t vprod1xCDEFc0 = vmull_s8(vbCDEFc0x0, va1x0);
+ int16x8_t vprod2xCDEFc0 = vmull_s8(vbCDEFc0x0, va2x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc0);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc0);
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc0);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
+ int16x8_t vprod0x0123c1 = vmull_s8(vb0123c1x0, va0x0);
+ int16x8_t vprod1x0123c1 = vmull_s8(vb0123c1x0, va1x0);
+ int16x8_t vprod2x0123c1 = vmull_s8(vb0123c1x0, va2x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c1);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c1);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c1);
+ int16x8_t vprod0x4567c1 = vmull_s8(vb4567c1x0, va0x0);
+ int16x8_t vprod1x4567c1 = vmull_s8(vb4567c1x0, va1x0);
+ int16x8_t vprod2x4567c1 = vmull_s8(vb4567c1x0, va2x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c1);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c1);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c1);
+ int16x8_t vprod0x89ABc1 = vmull_s8(vb89ABc1x0, va0x0);
+ int16x8_t vprod1x89ABc1 = vmull_s8(vb89ABc1x0, va1x0);
+ int16x8_t vprod2x89ABc1 = vmull_s8(vb89ABc1x0, va2x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc1);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc1);
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc1);
+ int16x8_t vprod0xCDEFc1 = vmull_s8(vbCDEFc1x0, va0x0);
+ int16x8_t vprod1xCDEFc1 = vmull_s8(vbCDEFc1x0, va1x0);
+ int16x8_t vprod2xCDEFc1 = vmull_s8(vbCDEFc1x0, va2x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc1);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc1);
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc1);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
+ int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2x0, va0x0);
+ int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2x0, va1x0);
+ int16x8_t vprod2x0123c2 = vmull_s8(vb0123c2x0, va2x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c2);
+ int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2x0, va0x0);
+ int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2x0, va1x0);
+ int16x8_t vprod2x4567c2 = vmull_s8(vb4567c2x0, va2x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c2);
+ int16x8_t vprod0x89ABc2 = vmull_s8(vb89ABc2x0, va0x0);
+ int16x8_t vprod1x89ABc2 = vmull_s8(vb89ABc2x0, va1x0);
+ int16x8_t vprod2x89ABc2 = vmull_s8(vb89ABc2x0, va2x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc2);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc2);
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc2);
+ int16x8_t vprod0xCDEFc2 = vmull_s8(vbCDEFc2x0, va0x0);
+ int16x8_t vprod1xCDEFc2 = vmull_s8(vbCDEFc2x0, va1x0);
+ int16x8_t vprod2xCDEFc2 = vmull_s8(vbCDEFc2x0, va2x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc2);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc2);
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc2);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
+ int16x8_t vprod0x0123c3 = vmull_s8(vb0123c3x0, va0x0);
+ int16x8_t vprod1x0123c3 = vmull_s8(vb0123c3x0, va1x0);
+ int16x8_t vprod2x0123c3 = vmull_s8(vb0123c3x0, va2x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c3);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c3);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c3);
+ int16x8_t vprod0x4567c3 = vmull_s8(vb4567c3x0, va0x0);
+ int16x8_t vprod1x4567c3 = vmull_s8(vb4567c3x0, va1x0);
+ int16x8_t vprod2x4567c3 = vmull_s8(vb4567c3x0, va2x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c3);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c3);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c3);
+ int16x8_t vprod0x89ABc3 = vmull_s8(vb89ABc3x0, va0x0);
+ int16x8_t vprod1x89ABc3 = vmull_s8(vb89ABc3x0, va1x0);
+ int16x8_t vprod2x89ABc3 = vmull_s8(vb89ABc3x0, va2x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc3);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc3);
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc3);
+ int16x8_t vprod0xCDEFc3 = vmull_s8(vbCDEFc3x0, va0x0);
+ int16x8_t vprod1xCDEFc3 = vmull_s8(vbCDEFc3x0, va1x0);
+ int16x8_t vprod2xCDEFc3 = vmull_s8(vbCDEFc3x0, va2x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc3);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc3);
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc3);
+
+ k -= 8 * sizeof(int8_t);
+ }
+
+ if XNN_UNLIKELY(k != 0) {
+ const int8x8_t va0 = vld1_s8(a0); a0 = (const int8_t*) ((uintptr_t) a0 + k);
+ const int8x8_t va1 = vld1_s8(a1); a1 = (const int8_t*) ((uintptr_t) a1 + k);
+ const int8x8_t va2 = vld1_s8(a2); a2 = (const int8_t*) ((uintptr_t) a2 + k);
+
+ const int8x8_t vb0123c0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c0 = vmull_s8(vb0123c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c0);
+ const int16x8_t vprod0x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c0);
+ const int16x8_t vprod0x89ABc0 = vmull_s8(vb89ABc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc0);
+ const int16x8_t vprod0xCDEFc0 = vmull_s8(vbCDEFc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc0);
+ const int16x8_t vprod1x0123c0 = vmull_s8(vb0123c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c0);
+ const int16x8_t vprod1x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c0);
+ const int16x8_t vprod1x89ABc0 = vmull_s8(vb89ABc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0)));
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc0);
+ const int16x8_t vprod1xCDEFc0 = vmull_s8(vbCDEFc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0)));
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc0);
+ const int16x8_t vprod2x0123c0 = vmull_s8(vb0123c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 0)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c0);
+ const int16x8_t vprod2x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 0)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c0);
+ const int16x8_t vprod2x89ABc0 = vmull_s8(vb89ABc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 0)));
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc0);
+ const int16x8_t vprod2xCDEFc0 = vmull_s8(vbCDEFc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 0)));
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc0);
+
+ if (k > 2 * sizeof(int8_t)) {
+ const int8x8_t vb0123c1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c1 = vmull_s8(vb0123c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c1);
+ const int16x8_t vprod0x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c1);
+ const int16x8_t vprod0x89ABc1 = vmull_s8(vb89ABc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc1);
+ const int16x8_t vprod0xCDEFc1 = vmull_s8(vbCDEFc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc1);
+ const int16x8_t vprod1x0123c1 = vmull_s8(vb0123c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c1);
+ const int16x8_t vprod1x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c1);
+ const int16x8_t vprod1x89ABc1 = vmull_s8(vb89ABc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1)));
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc1);
+ const int16x8_t vprod1xCDEFc1 = vmull_s8(vbCDEFc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1)));
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc1);
+ const int16x8_t vprod2x0123c1 = vmull_s8(vb0123c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 1)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c1);
+ const int16x8_t vprod2x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 1)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c1);
+ const int16x8_t vprod2x89ABc1 = vmull_s8(vb89ABc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 1)));
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc1);
+ const int16x8_t vprod2xCDEFc1 = vmull_s8(vbCDEFc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 1)));
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc1);
+
+ if (k > 4 * sizeof(int8_t)) {
+ const int8x8_t vb0123c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ const int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ const int16x8_t vprod0x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc2);
+ const int16x8_t vprod0xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc2);
+ const int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ const int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ const int16x8_t vprod1x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2)));
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc2);
+ const int16x8_t vprod1xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2)));
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc2);
+ const int16x8_t vprod2x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 2)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c2);
+ const int16x8_t vprod2x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 2)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c2);
+ const int16x8_t vprod2x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 2)));
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc2);
+ const int16x8_t vprod2xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 2)));
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc2);
+
+ if (k > 6 * sizeof(int8_t)) {
+ const int8x8_t vb0123c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ const int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ const int16x8_t vprod0x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc2);
+ const int16x8_t vprod0xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc2);
+ const int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 3)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ const int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 3)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ const int16x8_t vprod1x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 3)));
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc2);
+ const int16x8_t vprod1xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 3)));
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc2);
+ const int16x8_t vprod2x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 3)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c2);
+ const int16x8_t vprod2x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 3)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c2);
+ const int16x8_t vprod2x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 3)));
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc2);
+ const int16x8_t vprod2xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 3)));
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc2);
+ }
+ }
+ }
+ }
+ p -= 3 * sizeof(void*);
+ } while (p != 0);
+
+ const int32x4_t vright_pre_shift = vld1q_dup_s32(¶ms->rndnu_neon.right_pre_shift);
+ const int32x4_t vmultiplier = vld1q_dup_s32(¶ms->rndnu_neon.multiplier);
+ const int32x4_t vright_post_shift = vld1q_dup_s32(¶ms->rndnu_neon.right_post_shift);
+
+ vacc0x0123 = vshlq_s32(vacc0x0123, vright_pre_shift);
+ vacc0x4567 = vshlq_s32(vacc0x4567, vright_pre_shift);
+ vacc0x89AB = vshlq_s32(vacc0x89AB, vright_pre_shift);
+ vacc0xCDEF = vshlq_s32(vacc0xCDEF, vright_pre_shift);
+ vacc1x0123 = vshlq_s32(vacc1x0123, vright_pre_shift);
+ vacc1x4567 = vshlq_s32(vacc1x4567, vright_pre_shift);
+ vacc1x89AB = vshlq_s32(vacc1x89AB, vright_pre_shift);
+ vacc1xCDEF = vshlq_s32(vacc1xCDEF, vright_pre_shift);
+ vacc2x0123 = vshlq_s32(vacc2x0123, vright_pre_shift);
+ vacc2x4567 = vshlq_s32(vacc2x4567, vright_pre_shift);
+ vacc2x89AB = vshlq_s32(vacc2x89AB, vright_pre_shift);
+ vacc2xCDEF = vshlq_s32(vacc2xCDEF, vright_pre_shift);
+
+ vacc0x0123 = vqdmulhq_s32(vacc0x0123, vmultiplier);
+ vacc0x4567 = vqdmulhq_s32(vacc0x4567, vmultiplier);
+ vacc0x89AB = vqdmulhq_s32(vacc0x89AB, vmultiplier);
+ vacc0xCDEF = vqdmulhq_s32(vacc0xCDEF, vmultiplier);
+ vacc1x0123 = vqdmulhq_s32(vacc1x0123, vmultiplier);
+ vacc1x4567 = vqdmulhq_s32(vacc1x4567, vmultiplier);
+ vacc1x89AB = vqdmulhq_s32(vacc1x89AB, vmultiplier);
+ vacc1xCDEF = vqdmulhq_s32(vacc1xCDEF, vmultiplier);
+ vacc2x0123 = vqdmulhq_s32(vacc2x0123, vmultiplier);
+ vacc2x4567 = vqdmulhq_s32(vacc2x4567, vmultiplier);
+ vacc2x89AB = vqdmulhq_s32(vacc2x89AB, vmultiplier);
+ vacc2xCDEF = vqdmulhq_s32(vacc2xCDEF, vmultiplier);
+
+ vacc0x0123 = vrshlq_s32(vacc0x0123, vright_post_shift);
+ vacc0x4567 = vrshlq_s32(vacc0x4567, vright_post_shift);
+ vacc0x89AB = vrshlq_s32(vacc0x89AB, vright_post_shift);
+ vacc0xCDEF = vrshlq_s32(vacc0xCDEF, vright_post_shift);
+ vacc1x0123 = vrshlq_s32(vacc1x0123, vright_post_shift);
+ vacc1x4567 = vrshlq_s32(vacc1x4567, vright_post_shift);
+ vacc1x89AB = vrshlq_s32(vacc1x89AB, vright_post_shift);
+ vacc1xCDEF = vrshlq_s32(vacc1xCDEF, vright_post_shift);
+ vacc2x0123 = vrshlq_s32(vacc2x0123, vright_post_shift);
+ vacc2x4567 = vrshlq_s32(vacc2x4567, vright_post_shift);
+ vacc2x89AB = vrshlq_s32(vacc2x89AB, vright_post_shift);
+ vacc2xCDEF = vrshlq_s32(vacc2xCDEF, vright_post_shift);
+
+ const int16x8_t voutput_zero_point = vld1q_dup_s16(¶ms->rndnu_neon.output_zero_point);
+#if XNN_ARCH_ARM64
+ const int16x8_t vacc0x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc0x0123), vacc0x4567), voutput_zero_point);
+ const int16x8_t vacc0x89ABCDEF = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc0x89AB), vacc0xCDEF), voutput_zero_point);
+ const int16x8_t vacc1x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc1x0123), vacc1x4567), voutput_zero_point);
+ const int16x8_t vacc1x89ABCDEF = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc1x89AB), vacc1xCDEF), voutput_zero_point);
+ const int16x8_t vacc2x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc2x0123), vacc2x4567), voutput_zero_point);
+ const int16x8_t vacc2x89ABCDEF = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc2x89AB), vacc2xCDEF), voutput_zero_point);
+
+ int8x16_t vout0x0123456789ABCDEF = vqmovn_high_s16(vqmovn_s16(vacc0x01234567), vacc0x89ABCDEF);
+ int8x16_t vout1x0123456789ABCDEF = vqmovn_high_s16(vqmovn_s16(vacc1x01234567), vacc1x89ABCDEF);
+ int8x16_t vout2x0123456789ABCDEF = vqmovn_high_s16(vqmovn_s16(vacc2x01234567), vacc2x89ABCDEF);
+#else
+ const int16x8_t vacc0x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc0x0123), vqmovn_s32(vacc0x4567)), voutput_zero_point);
+ const int16x8_t vacc0x89ABCDEF = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc0x89AB), vqmovn_s32(vacc0xCDEF)), voutput_zero_point);
+ const int16x8_t vacc1x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc1x0123), vqmovn_s32(vacc1x4567)), voutput_zero_point);
+ const int16x8_t vacc1x89ABCDEF = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc1x89AB), vqmovn_s32(vacc1xCDEF)), voutput_zero_point);
+ const int16x8_t vacc2x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc2x0123), vqmovn_s32(vacc2x4567)), voutput_zero_point);
+ const int16x8_t vacc2x89ABCDEF = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc2x89AB), vqmovn_s32(vacc2xCDEF)), voutput_zero_point);
+
+ int8x16_t vout0x0123456789ABCDEF = vcombine_s8(vqmovn_s16(vacc0x01234567), vqmovn_s16(vacc0x89ABCDEF));
+ int8x16_t vout1x0123456789ABCDEF = vcombine_s8(vqmovn_s16(vacc1x01234567), vqmovn_s16(vacc1x89ABCDEF));
+ int8x16_t vout2x0123456789ABCDEF = vcombine_s8(vqmovn_s16(vacc2x01234567), vqmovn_s16(vacc2x89ABCDEF));
+#endif
+ const int8x16_t voutput_min = vld1q_dup_s8(¶ms->rndnu_neon.output_min);
+ const int8x16_t voutput_max = vld1q_dup_s8(¶ms->rndnu_neon.output_max);
+
+ vout2x0123456789ABCDEF = vmaxq_s8(vout2x0123456789ABCDEF, voutput_min);
+ vout1x0123456789ABCDEF = vmaxq_s8(vout1x0123456789ABCDEF, voutput_min);
+ vout0x0123456789ABCDEF = vmaxq_s8(vout0x0123456789ABCDEF, voutput_min);
+
+ vout2x0123456789ABCDEF = vminq_s8(vout2x0123456789ABCDEF, voutput_max);
+ vout1x0123456789ABCDEF = vminq_s8(vout1x0123456789ABCDEF, voutput_max);
+ vout0x0123456789ABCDEF = vminq_s8(vout0x0123456789ABCDEF, voutput_max);
+
+ if (nc >= 16) {
+ vst1q_s8(c2 + 0, vout2x0123456789ABCDEF);
+ vst1q_s8(c1 + 0, vout1x0123456789ABCDEF);
+ vst1q_s8(c0 + 0, vout0x0123456789ABCDEF);
+
+ c2 = (int8_t*) ((uintptr_t) c2 + cn_stride);
+ c1 = (int8_t*) ((uintptr_t) c1 + cn_stride);
+ c0 = (int8_t*) ((uintptr_t) c0 + cn_stride);
+
+ a = (const int8_t**restrict) ((uintptr_t) a - ks);
+
+ nc -= 16;
+ } else {
+ int8x8_t vout2x01234567 = vget_low_s8(vout2x0123456789ABCDEF);
+ int8x16_t vout0x01234567_1x01234567 = vcombine_s8(vget_low_s8(vout0x0123456789ABCDEF), vget_low_s8(vout1x0123456789ABCDEF));
+ if (nc & 8) {
+ vst1_s8(c2, vout2x01234567); c2 += 8;
+ vst1_s8(c1, vget_high_s8(vout0x01234567_1x01234567)); c1 += 8;
+ vst1_s8(c0, vget_low_s8(vout0x01234567_1x01234567)); c0 += 8;
+ vout2x01234567 = vget_high_s8(vout2x0123456789ABCDEF);
+ vout0x01234567_1x01234567 = vcombine_s8(vget_high_s8(vout0x0123456789ABCDEF), vget_high_s8(vout1x0123456789ABCDEF));
+ }
+ if (nc & 4) {
+ vst1_lane_u32(__builtin_assume_aligned(c2, 1), vreinterpret_u32_s8(vout2x01234567), 0); c2 += 4;
+ vst1q_lane_u32(__builtin_assume_aligned(c1, 1), vreinterpretq_u32_s8(vout0x01234567_1x01234567), 2); c1 += 4;
+ vst1q_lane_u32(__builtin_assume_aligned(c0, 1), vreinterpretq_u32_s8(vout0x01234567_1x01234567), 0); c0 += 4;
+ vout2x01234567 = vext_s8(vout2x01234567, vout2x01234567, 4);
+ vout0x01234567_1x01234567 = vextq_s8(vout0x01234567_1x01234567, vout0x01234567_1x01234567, 4);
+ }
+ if (nc & 2) {
+ vst1_lane_u16(__builtin_assume_aligned(c2, 1), vreinterpret_u16_s8(vout2x01234567), 0); c2 += 2;
+ vst1q_lane_u16(__builtin_assume_aligned(c1, 1), vreinterpretq_u16_s8(vout0x01234567_1x01234567), 4); c1 += 2;
+ vst1q_lane_u16(__builtin_assume_aligned(c0, 1), vreinterpretq_u16_s8(vout0x01234567_1x01234567), 0); c0 += 2;
+ vout2x01234567 = vext_s8(vout2x01234567, vout2x01234567, 2);
+ vout0x01234567_1x01234567 = vextq_s8(vout0x01234567_1x01234567, vout0x01234567_1x01234567, 2);
+ }
+ if (nc & 1) {
+ vst1_lane_s8(c2, vout2x01234567, 0);
+ vst1q_lane_s8(c1, vout0x01234567_1x01234567, 8);
+ vst1q_lane_s8(c0, vout0x01234567_1x01234567, 0);
+ }
+
+ nc = 0;
+ }
+ } while (nc != 0);
+}
diff --git a/src/qs8-igemm/gen/2x8s4c2-minmax-rndnu-neon-mlal-padal.c b/src/qs8-igemm/gen/3x8c2s4-minmax-rndnu-neon-mlal-padal.c
similarity index 73%
copy from src/qs8-igemm/gen/2x8s4c2-minmax-rndnu-neon-mlal-padal.c
copy to src/qs8-igemm/gen/3x8c2s4-minmax-rndnu-neon-mlal-padal.c
index 4b97f1b..303ab08 100644
--- a/src/qs8-igemm/gen/2x8s4c2-minmax-rndnu-neon-mlal-padal.c
+++ b/src/qs8-igemm/gen/3x8c2s4-minmax-rndnu-neon-mlal-padal.c
@@ -15,7 +15,7 @@
#include <xnnpack/math.h>
-void xnn_qs8_igemm_minmax_rndnu_ukernel_2x8s4c2__neon_mlal_padal(
+void xnn_qs8_igemm_minmax_rndnu_ukernel_3x8c2s4__neon_mlal_padal(
size_t mr,
size_t nc,
size_t kc,
@@ -30,11 +30,11 @@
const union xnn_qs8_conv_minmax_params params[restrict XNN_MIN_ELEMENTS(1)]) XNN_DISABLE_TSAN XNN_DISABLE_MSAN
{
assert(mr != 0);
- assert(mr <= 2);
+ assert(mr <= 3);
assert(nc != 0);
assert(kc != 0);
assert(ks != 0);
- assert(ks % (2 * sizeof(void*)) == 0);
+ assert(ks % (3 * sizeof(void*)) == 0);
assert(a_offset % sizeof(int8_t) == 0);
assert(a != NULL);
assert(w != NULL);
@@ -42,15 +42,21 @@
int8_t* c0 = c;
int8_t* c1 = (int8_t*) ((uintptr_t) c0 + cm_stride);
- if XNN_UNPREDICTABLE(mr != 2) {
+ if XNN_UNPREDICTABLE(mr < 2) {
c1 = c0;
}
+ int8_t* c2 = (int8_t*) ((uintptr_t) c1 + cm_stride);
+ if XNN_UNPREDICTABLE(mr <= 2) {
+ c2 = c1;
+ }
do {
int32x4_t vacc0x0123 = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
int32x4_t vacc0x4567 = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
int32x4_t vacc1x0123 = vacc0x0123;
int32x4_t vacc1x4567 = vacc0x4567;
+ int32x4_t vacc2x0123 = vacc0x0123;
+ int32x4_t vacc2x4567 = vacc0x4567;
size_t p = ks;
do {
@@ -62,7 +68,11 @@
if XNN_UNPREDICTABLE(a1 != zero) {
a1 = (const int8_t*) ((uintptr_t) a1 + a_offset);
}
- a += 2;
+ const int8_t* restrict a2 = a[2];
+ if XNN_UNPREDICTABLE(a2 != zero) {
+ a2 = (const int8_t*) ((uintptr_t) a2 + a_offset);
+ }
+ a += 3;
size_t k = kc;
@@ -71,6 +81,8 @@
int8x8_t va0x1 = vld1_s8(a0); a0 += 8;
int8x8_t va1x0 = vld1_s8(a1); a1 += 8;
int8x8_t va1x1 = vld1_s8(a1); a1 += 8;
+ int8x8_t va2x0 = vld1_s8(a2); a2 += 8;
+ int8x8_t va2x1 = vld1_s8(a2); a2 += 8;
const int8x8_t vb0123c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
const int8x8_t vb4567c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
@@ -83,72 +95,102 @@
int16x8_t vprod0x0123c0 = vmull_s8(vb0123c0x0, va0x0);
int16x8_t vprod1x0123c0 = vmull_s8(vb0123c0x0, va1x0);
+ int16x8_t vprod2x0123c0 = vmull_s8(vb0123c0x0, va2x0);
const int8x8_t vb0123c0x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
vprod0x0123c0 = vmlal_s8(vprod0x0123c0, vb0123c0x1, va0x1);
vprod1x0123c0 = vmlal_s8(vprod1x0123c0, vb0123c0x1, va1x1);
+ vprod2x0123c0 = vmlal_s8(vprod2x0123c0, vb0123c0x1, va2x1);
vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c0);
vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c0);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c0);
int16x8_t vprod0x4567c0 = vmull_s8(vb4567c0x0, va0x0);
int16x8_t vprod1x4567c0 = vmull_s8(vb4567c0x0, va1x0);
+ int16x8_t vprod2x4567c0 = vmull_s8(vb4567c0x0, va2x0);
const int8x8_t vb4567c0x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
vprod0x4567c0 = vmlal_s8(vprod0x4567c0, vb4567c0x1, va0x1);
vprod1x4567c0 = vmlal_s8(vprod1x4567c0, vb4567c0x1, va1x1);
+ vprod2x4567c0 = vmlal_s8(vprod2x4567c0, vb4567c0x1, va2x1);
vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c0);
vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c0);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c0);
va0x0 = vext_s8(va0x0, va0x0, 2);
va0x1 = vext_s8(va0x1, va0x1, 2);
va1x0 = vext_s8(va1x0, va1x0, 2);
va1x1 = vext_s8(va1x1, va1x1, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
+ va2x1 = vext_s8(va2x1, va2x1, 2);
int16x8_t vprod0x0123c1 = vmull_s8(vb0123c1x0, va0x0);
int16x8_t vprod1x0123c1 = vmull_s8(vb0123c1x0, va1x0);
+ int16x8_t vprod2x0123c1 = vmull_s8(vb0123c1x0, va2x0);
const int8x8_t vb0123c1x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
vprod0x0123c1 = vmlal_s8(vprod0x0123c1, vb0123c1x1, va0x1);
vprod1x0123c1 = vmlal_s8(vprod1x0123c1, vb0123c1x1, va1x1);
+ vprod2x0123c1 = vmlal_s8(vprod2x0123c1, vb0123c1x1, va2x1);
vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c1);
vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c1);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c1);
int16x8_t vprod0x4567c1 = vmull_s8(vb4567c1x0, va0x0);
int16x8_t vprod1x4567c1 = vmull_s8(vb4567c1x0, va1x0);
+ int16x8_t vprod2x4567c1 = vmull_s8(vb4567c1x0, va2x0);
const int8x8_t vb4567c1x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
vprod0x4567c1 = vmlal_s8(vprod0x4567c1, vb4567c1x1, va0x1);
vprod1x4567c1 = vmlal_s8(vprod1x4567c1, vb4567c1x1, va1x1);
+ vprod2x4567c1 = vmlal_s8(vprod2x4567c1, vb4567c1x1, va2x1);
vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c1);
vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c1);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c1);
va0x0 = vext_s8(va0x0, va0x0, 2);
va0x1 = vext_s8(va0x1, va0x1, 2);
va1x0 = vext_s8(va1x0, va1x0, 2);
va1x1 = vext_s8(va1x1, va1x1, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
+ va2x1 = vext_s8(va2x1, va2x1, 2);
int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2x0, va0x0);
int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2x0, va1x0);
+ int16x8_t vprod2x0123c2 = vmull_s8(vb0123c2x0, va2x0);
const int8x8_t vb0123c2x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
vprod0x0123c2 = vmlal_s8(vprod0x0123c2, vb0123c2x1, va0x1);
vprod1x0123c2 = vmlal_s8(vprod1x0123c2, vb0123c2x1, va1x1);
+ vprod2x0123c2 = vmlal_s8(vprod2x0123c2, vb0123c2x1, va2x1);
vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c2);
int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2x0, va0x0);
int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2x0, va1x0);
+ int16x8_t vprod2x4567c2 = vmull_s8(vb4567c2x0, va2x0);
const int8x8_t vb4567c2x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
vprod0x4567c2 = vmlal_s8(vprod0x4567c2, vb4567c2x1, va0x1);
vprod1x4567c2 = vmlal_s8(vprod1x4567c2, vb4567c2x1, va1x1);
+ vprod2x4567c2 = vmlal_s8(vprod2x4567c2, vb4567c2x1, va2x1);
vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c2);
va0x0 = vext_s8(va0x0, va0x0, 2);
va0x1 = vext_s8(va0x1, va0x1, 2);
va1x0 = vext_s8(va1x0, va1x0, 2);
va1x1 = vext_s8(va1x1, va1x1, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
+ va2x1 = vext_s8(va2x1, va2x1, 2);
int16x8_t vprod0x0123c3 = vmull_s8(vb0123c3x0, va0x0);
int16x8_t vprod1x0123c3 = vmull_s8(vb0123c3x0, va1x0);
+ int16x8_t vprod2x0123c3 = vmull_s8(vb0123c3x0, va2x0);
const int8x8_t vb0123c3x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
vprod0x0123c3 = vmlal_s8(vprod0x0123c3, vb0123c3x1, va0x1);
vprod1x0123c3 = vmlal_s8(vprod1x0123c3, vb0123c3x1, va1x1);
+ vprod2x0123c3 = vmlal_s8(vprod2x0123c3, vb0123c3x1, va2x1);
vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c3);
vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c3);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c3);
int16x8_t vprod0x4567c3 = vmull_s8(vb4567c3x0, va0x0);
int16x8_t vprod1x4567c3 = vmull_s8(vb4567c3x0, va1x0);
+ int16x8_t vprod2x4567c3 = vmull_s8(vb4567c3x0, va2x0);
const int8x8_t vb4567c3x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
vprod0x4567c3 = vmlal_s8(vprod0x4567c3, vb4567c3x1, va0x1);
vprod1x4567c3 = vmlal_s8(vprod1x4567c3, vb4567c3x1, va1x1);
+ vprod2x4567c3 = vmlal_s8(vprod2x4567c3, vb4567c3x1, va2x1);
vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c3);
vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c3);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c3);
k -= 16 * sizeof(int8_t);
}
@@ -156,6 +198,7 @@
if (k >= 8 * sizeof(int8_t)) {
int8x8_t va0x0 = vld1_s8(a0); a0 += 8;
int8x8_t va1x0 = vld1_s8(a1); a1 += 8;
+ int8x8_t va2x0 = vld1_s8(a2); a2 += 8;
const int8x8_t vb0123c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
const int8x8_t vb4567c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
@@ -168,42 +211,61 @@
int16x8_t vprod0x0123c0 = vmull_s8(vb0123c0x0, va0x0);
int16x8_t vprod1x0123c0 = vmull_s8(vb0123c0x0, va1x0);
+ int16x8_t vprod2x0123c0 = vmull_s8(vb0123c0x0, va2x0);
vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c0);
vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c0);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c0);
int16x8_t vprod0x4567c0 = vmull_s8(vb4567c0x0, va0x0);
int16x8_t vprod1x4567c0 = vmull_s8(vb4567c0x0, va1x0);
+ int16x8_t vprod2x4567c0 = vmull_s8(vb4567c0x0, va2x0);
vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c0);
vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c0);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c0);
va0x0 = vext_s8(va0x0, va0x0, 2);
va1x0 = vext_s8(va1x0, va1x0, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
int16x8_t vprod0x0123c1 = vmull_s8(vb0123c1x0, va0x0);
int16x8_t vprod1x0123c1 = vmull_s8(vb0123c1x0, va1x0);
+ int16x8_t vprod2x0123c1 = vmull_s8(vb0123c1x0, va2x0);
vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c1);
vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c1);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c1);
int16x8_t vprod0x4567c1 = vmull_s8(vb4567c1x0, va0x0);
int16x8_t vprod1x4567c1 = vmull_s8(vb4567c1x0, va1x0);
+ int16x8_t vprod2x4567c1 = vmull_s8(vb4567c1x0, va2x0);
vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c1);
vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c1);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c1);
va0x0 = vext_s8(va0x0, va0x0, 2);
va1x0 = vext_s8(va1x0, va1x0, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2x0, va0x0);
int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2x0, va1x0);
+ int16x8_t vprod2x0123c2 = vmull_s8(vb0123c2x0, va2x0);
vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c2);
int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2x0, va0x0);
int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2x0, va1x0);
+ int16x8_t vprod2x4567c2 = vmull_s8(vb4567c2x0, va2x0);
vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c2);
va0x0 = vext_s8(va0x0, va0x0, 2);
va1x0 = vext_s8(va1x0, va1x0, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
int16x8_t vprod0x0123c3 = vmull_s8(vb0123c3x0, va0x0);
int16x8_t vprod1x0123c3 = vmull_s8(vb0123c3x0, va1x0);
+ int16x8_t vprod2x0123c3 = vmull_s8(vb0123c3x0, va2x0);
vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c3);
vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c3);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c3);
int16x8_t vprod0x4567c3 = vmull_s8(vb4567c3x0, va0x0);
int16x8_t vprod1x4567c3 = vmull_s8(vb4567c3x0, va1x0);
+ int16x8_t vprod2x4567c3 = vmull_s8(vb4567c3x0, va2x0);
vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c3);
vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c3);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c3);
k -= 8 * sizeof(int8_t);
}
@@ -211,6 +273,7 @@
if XNN_UNLIKELY(k != 0) {
const int8x8_t va0 = vld1_s8(a0); a0 = (const int8_t*) ((uintptr_t) a0 + k);
const int8x8_t va1 = vld1_s8(a1); a1 = (const int8_t*) ((uintptr_t) a1 + k);
+ const int8x8_t va2 = vld1_s8(a2); a2 = (const int8_t*) ((uintptr_t) a2 + k);
const int8x8_t vb0123c0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
const int8x8_t vb4567c0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
@@ -223,6 +286,10 @@
vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c0);
const int16x8_t vprod1x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0)));
vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c0);
+ const int16x8_t vprod2x0123c0 = vmull_s8(vb0123c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 0)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c0);
+ const int16x8_t vprod2x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 0)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c0);
if (k > 2 * sizeof(int8_t)) {
const int8x8_t vb0123c1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
@@ -236,6 +303,10 @@
vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c1);
const int16x8_t vprod1x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1)));
vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c1);
+ const int16x8_t vprod2x0123c1 = vmull_s8(vb0123c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 1)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c1);
+ const int16x8_t vprod2x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 1)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c1);
if (k > 4 * sizeof(int8_t)) {
const int8x8_t vb0123c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
@@ -249,6 +320,10 @@
vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
const int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2)));
vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ const int16x8_t vprod2x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 2)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c2);
+ const int16x8_t vprod2x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 2)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c2);
if (k > 6 * sizeof(int8_t)) {
const int8x8_t vb0123c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
@@ -262,11 +337,15 @@
vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
const int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 3)));
vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ const int16x8_t vprod2x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 3)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c2);
+ const int16x8_t vprod2x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 3)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c2);
}
}
}
}
- p -= 2 * sizeof(void*);
+ p -= 3 * sizeof(void*);
} while (p != 0);
const int32x4_t vright_pre_shift = vld1q_dup_s32(¶ms->rndnu_neon.right_pre_shift);
@@ -277,40 +356,54 @@
vacc0x4567 = vshlq_s32(vacc0x4567, vright_pre_shift);
vacc1x0123 = vshlq_s32(vacc1x0123, vright_pre_shift);
vacc1x4567 = vshlq_s32(vacc1x4567, vright_pre_shift);
+ vacc2x0123 = vshlq_s32(vacc2x0123, vright_pre_shift);
+ vacc2x4567 = vshlq_s32(vacc2x4567, vright_pre_shift);
vacc0x0123 = vqdmulhq_s32(vacc0x0123, vmultiplier);
vacc0x4567 = vqdmulhq_s32(vacc0x4567, vmultiplier);
vacc1x0123 = vqdmulhq_s32(vacc1x0123, vmultiplier);
vacc1x4567 = vqdmulhq_s32(vacc1x4567, vmultiplier);
+ vacc2x0123 = vqdmulhq_s32(vacc2x0123, vmultiplier);
+ vacc2x4567 = vqdmulhq_s32(vacc2x4567, vmultiplier);
vacc0x0123 = vrshlq_s32(vacc0x0123, vright_post_shift);
vacc0x4567 = vrshlq_s32(vacc0x4567, vright_post_shift);
vacc1x0123 = vrshlq_s32(vacc1x0123, vright_post_shift);
vacc1x4567 = vrshlq_s32(vacc1x4567, vright_post_shift);
+ vacc2x0123 = vrshlq_s32(vacc2x0123, vright_post_shift);
+ vacc2x4567 = vrshlq_s32(vacc2x4567, vright_post_shift);
const int16x8_t voutput_zero_point = vld1q_dup_s16(¶ms->rndnu_neon.output_zero_point);
#if XNN_ARCH_ARM64
const int16x8_t vacc0x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc0x0123), vacc0x4567), voutput_zero_point);
const int16x8_t vacc1x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc1x0123), vacc1x4567), voutput_zero_point);
+ const int16x8_t vacc2x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc2x0123), vacc2x4567), voutput_zero_point);
int8x16_t vout0x01234567_1x01234567 = vqmovn_high_s16(vqmovn_s16(vacc0x01234567), vacc1x01234567);
+ int8x8_t vout2x01234567 = vqmovn_s16(vacc2x01234567);
#else
const int16x8_t vacc0x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc0x0123), vqmovn_s32(vacc0x4567)), voutput_zero_point);
const int16x8_t vacc1x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc1x0123), vqmovn_s32(vacc1x4567)), voutput_zero_point);
+ const int16x8_t vacc2x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc2x0123), vqmovn_s32(vacc2x4567)), voutput_zero_point);
int8x16_t vout0x01234567_1x01234567 = vcombine_s8(vqmovn_s16(vacc0x01234567), vqmovn_s16(vacc1x01234567));
+ int8x8_t vout2x01234567 = vqmovn_s16(vacc2x01234567);
#endif
const int8x16_t voutput_min = vld1q_dup_s8(¶ms->rndnu_neon.output_min);
const int8x16_t voutput_max = vld1q_dup_s8(¶ms->rndnu_neon.output_max);
+ vout2x01234567 = vmax_s8(vout2x01234567, vget_low_s8(voutput_min));
vout0x01234567_1x01234567 = vmaxq_s8(vout0x01234567_1x01234567, voutput_min);
+ vout2x01234567 = vmin_s8(vout2x01234567, vget_low_s8(voutput_max));
vout0x01234567_1x01234567 = vminq_s8(vout0x01234567_1x01234567, voutput_max);
if (nc >= 8) {
+ vst1_s8(c2 + 0, vout2x01234567);
vst1_s8(c1 + 0, vget_high_s8(vout0x01234567_1x01234567));
vst1_s8(c0 + 0, vget_low_s8(vout0x01234567_1x01234567));
+ c2 = (int8_t*) ((uintptr_t) c2 + cn_stride);
c1 = (int8_t*) ((uintptr_t) c1 + cn_stride);
c0 = (int8_t*) ((uintptr_t) c0 + cn_stride);
@@ -319,16 +412,21 @@
nc -= 8;
} else {
if (nc & 4) {
+ vst1_lane_u32(__builtin_assume_aligned(c2, 1), vreinterpret_u32_s8(vout2x01234567), 0); c2 += 4;
vst1q_lane_u32(__builtin_assume_aligned(c1, 1), vreinterpretq_u32_s8(vout0x01234567_1x01234567), 2); c1 += 4;
vst1q_lane_u32(__builtin_assume_aligned(c0, 1), vreinterpretq_u32_s8(vout0x01234567_1x01234567), 0); c0 += 4;
+ vout2x01234567 = vext_s8(vout2x01234567, vout2x01234567, 4);
vout0x01234567_1x01234567 = vextq_s8(vout0x01234567_1x01234567, vout0x01234567_1x01234567, 4);
}
if (nc & 2) {
+ vst1_lane_u16(__builtin_assume_aligned(c2, 1), vreinterpret_u16_s8(vout2x01234567), 0); c2 += 2;
vst1q_lane_u16(__builtin_assume_aligned(c1, 1), vreinterpretq_u16_s8(vout0x01234567_1x01234567), 4); c1 += 2;
vst1q_lane_u16(__builtin_assume_aligned(c0, 1), vreinterpretq_u16_s8(vout0x01234567_1x01234567), 0); c0 += 2;
+ vout2x01234567 = vext_s8(vout2x01234567, vout2x01234567, 2);
vout0x01234567_1x01234567 = vextq_s8(vout0x01234567_1x01234567, vout0x01234567_1x01234567, 2);
}
if (nc & 1) {
+ vst1_lane_s8(c2, vout2x01234567, 0);
vst1q_lane_s8(c1, vout0x01234567_1x01234567, 8);
vst1q_lane_s8(c0, vout0x01234567_1x01234567, 0);
}
diff --git a/src/qs8-igemm/gen/2x8s4c2-minmax-rndnu-neon-mull-padal.c b/src/qs8-igemm/gen/3x8c2s4-minmax-rndnu-neon-mull-padal.c
similarity index 73%
copy from src/qs8-igemm/gen/2x8s4c2-minmax-rndnu-neon-mull-padal.c
copy to src/qs8-igemm/gen/3x8c2s4-minmax-rndnu-neon-mull-padal.c
index eaad097..c875cdc 100644
--- a/src/qs8-igemm/gen/2x8s4c2-minmax-rndnu-neon-mull-padal.c
+++ b/src/qs8-igemm/gen/3x8c2s4-minmax-rndnu-neon-mull-padal.c
@@ -15,7 +15,7 @@
#include <xnnpack/math.h>
-void xnn_qs8_igemm_minmax_rndnu_ukernel_2x8s4c2__neon_mull_padal(
+void xnn_qs8_igemm_minmax_rndnu_ukernel_3x8c2s4__neon_mull_padal(
size_t mr,
size_t nc,
size_t kc,
@@ -30,11 +30,11 @@
const union xnn_qs8_conv_minmax_params params[restrict XNN_MIN_ELEMENTS(1)]) XNN_DISABLE_TSAN XNN_DISABLE_MSAN
{
assert(mr != 0);
- assert(mr <= 2);
+ assert(mr <= 3);
assert(nc != 0);
assert(kc != 0);
assert(ks != 0);
- assert(ks % (2 * sizeof(void*)) == 0);
+ assert(ks % (3 * sizeof(void*)) == 0);
assert(a_offset % sizeof(int8_t) == 0);
assert(a != NULL);
assert(w != NULL);
@@ -42,15 +42,21 @@
int8_t* c0 = c;
int8_t* c1 = (int8_t*) ((uintptr_t) c0 + cm_stride);
- if XNN_UNPREDICTABLE(mr != 2) {
+ if XNN_UNPREDICTABLE(mr < 2) {
c1 = c0;
}
+ int8_t* c2 = (int8_t*) ((uintptr_t) c1 + cm_stride);
+ if XNN_UNPREDICTABLE(mr <= 2) {
+ c2 = c1;
+ }
do {
int32x4_t vacc0x0123 = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
int32x4_t vacc0x4567 = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
int32x4_t vacc1x0123 = vacc0x0123;
int32x4_t vacc1x4567 = vacc0x4567;
+ int32x4_t vacc2x0123 = vacc0x0123;
+ int32x4_t vacc2x4567 = vacc0x4567;
size_t p = ks;
do {
@@ -62,7 +68,11 @@
if XNN_UNPREDICTABLE(a1 != zero) {
a1 = (const int8_t*) ((uintptr_t) a1 + a_offset);
}
- a += 2;
+ const int8_t* restrict a2 = a[2];
+ if XNN_UNPREDICTABLE(a2 != zero) {
+ a2 = (const int8_t*) ((uintptr_t) a2 + a_offset);
+ }
+ a += 3;
size_t k = kc;
@@ -70,6 +80,7 @@
while (k >= 8 * sizeof(int8_t)) {
int8x8_t va0x0 = vld1_s8(a0); a0 += 8;
int8x8_t va1x0 = vld1_s8(a1); a1 += 8;
+ int8x8_t va2x0 = vld1_s8(a2); a2 += 8;
const int8x8_t vb0123c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
const int8x8_t vb4567c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
@@ -82,42 +93,61 @@
int16x8_t vprod0x0123c0 = vmull_s8(vb0123c0x0, va0x0);
int16x8_t vprod1x0123c0 = vmull_s8(vb0123c0x0, va1x0);
+ int16x8_t vprod2x0123c0 = vmull_s8(vb0123c0x0, va2x0);
vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c0);
vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c0);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c0);
int16x8_t vprod0x4567c0 = vmull_s8(vb4567c0x0, va0x0);
int16x8_t vprod1x4567c0 = vmull_s8(vb4567c0x0, va1x0);
+ int16x8_t vprod2x4567c0 = vmull_s8(vb4567c0x0, va2x0);
vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c0);
vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c0);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c0);
va0x0 = vext_s8(va0x0, va0x0, 2);
va1x0 = vext_s8(va1x0, va1x0, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
int16x8_t vprod0x0123c1 = vmull_s8(vb0123c1x0, va0x0);
int16x8_t vprod1x0123c1 = vmull_s8(vb0123c1x0, va1x0);
+ int16x8_t vprod2x0123c1 = vmull_s8(vb0123c1x0, va2x0);
vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c1);
vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c1);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c1);
int16x8_t vprod0x4567c1 = vmull_s8(vb4567c1x0, va0x0);
int16x8_t vprod1x4567c1 = vmull_s8(vb4567c1x0, va1x0);
+ int16x8_t vprod2x4567c1 = vmull_s8(vb4567c1x0, va2x0);
vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c1);
vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c1);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c1);
va0x0 = vext_s8(va0x0, va0x0, 2);
va1x0 = vext_s8(va1x0, va1x0, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2x0, va0x0);
int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2x0, va1x0);
+ int16x8_t vprod2x0123c2 = vmull_s8(vb0123c2x0, va2x0);
vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c2);
int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2x0, va0x0);
int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2x0, va1x0);
+ int16x8_t vprod2x4567c2 = vmull_s8(vb4567c2x0, va2x0);
vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c2);
va0x0 = vext_s8(va0x0, va0x0, 2);
va1x0 = vext_s8(va1x0, va1x0, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
int16x8_t vprod0x0123c3 = vmull_s8(vb0123c3x0, va0x0);
int16x8_t vprod1x0123c3 = vmull_s8(vb0123c3x0, va1x0);
+ int16x8_t vprod2x0123c3 = vmull_s8(vb0123c3x0, va2x0);
vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c3);
vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c3);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c3);
int16x8_t vprod0x4567c3 = vmull_s8(vb4567c3x0, va0x0);
int16x8_t vprod1x4567c3 = vmull_s8(vb4567c3x0, va1x0);
+ int16x8_t vprod2x4567c3 = vmull_s8(vb4567c3x0, va2x0);
vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c3);
vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c3);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c3);
k -= 8 * sizeof(int8_t);
}
@@ -125,6 +155,7 @@
if XNN_UNLIKELY(k != 0) {
const int8x8_t va0 = vld1_s8(a0); a0 = (const int8_t*) ((uintptr_t) a0 + k);
const int8x8_t va1 = vld1_s8(a1); a1 = (const int8_t*) ((uintptr_t) a1 + k);
+ const int8x8_t va2 = vld1_s8(a2); a2 = (const int8_t*) ((uintptr_t) a2 + k);
const int8x8_t vb0123c0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
const int8x8_t vb4567c0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
@@ -137,6 +168,10 @@
vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c0);
const int16x8_t vprod1x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0)));
vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c0);
+ const int16x8_t vprod2x0123c0 = vmull_s8(vb0123c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 0)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c0);
+ const int16x8_t vprod2x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 0)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c0);
if (k > 2 * sizeof(int8_t)) {
const int8x8_t vb0123c1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
@@ -150,6 +185,10 @@
vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c1);
const int16x8_t vprod1x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1)));
vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c1);
+ const int16x8_t vprod2x0123c1 = vmull_s8(vb0123c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 1)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c1);
+ const int16x8_t vprod2x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 1)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c1);
if (k > 4 * sizeof(int8_t)) {
const int8x8_t vb0123c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
@@ -163,6 +202,10 @@
vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
const int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2)));
vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ const int16x8_t vprod2x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 2)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c2);
+ const int16x8_t vprod2x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 2)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c2);
if (k > 6 * sizeof(int8_t)) {
const int8x8_t vb0123c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
@@ -176,11 +219,15 @@
vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
const int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 3)));
vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ const int16x8_t vprod2x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 3)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c2);
+ const int16x8_t vprod2x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 3)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c2);
}
}
}
}
- p -= 2 * sizeof(void*);
+ p -= 3 * sizeof(void*);
} while (p != 0);
const int32x4_t vright_pre_shift = vld1q_dup_s32(¶ms->rndnu_neon.right_pre_shift);
@@ -191,40 +238,54 @@
vacc0x4567 = vshlq_s32(vacc0x4567, vright_pre_shift);
vacc1x0123 = vshlq_s32(vacc1x0123, vright_pre_shift);
vacc1x4567 = vshlq_s32(vacc1x4567, vright_pre_shift);
+ vacc2x0123 = vshlq_s32(vacc2x0123, vright_pre_shift);
+ vacc2x4567 = vshlq_s32(vacc2x4567, vright_pre_shift);
vacc0x0123 = vqdmulhq_s32(vacc0x0123, vmultiplier);
vacc0x4567 = vqdmulhq_s32(vacc0x4567, vmultiplier);
vacc1x0123 = vqdmulhq_s32(vacc1x0123, vmultiplier);
vacc1x4567 = vqdmulhq_s32(vacc1x4567, vmultiplier);
+ vacc2x0123 = vqdmulhq_s32(vacc2x0123, vmultiplier);
+ vacc2x4567 = vqdmulhq_s32(vacc2x4567, vmultiplier);
vacc0x0123 = vrshlq_s32(vacc0x0123, vright_post_shift);
vacc0x4567 = vrshlq_s32(vacc0x4567, vright_post_shift);
vacc1x0123 = vrshlq_s32(vacc1x0123, vright_post_shift);
vacc1x4567 = vrshlq_s32(vacc1x4567, vright_post_shift);
+ vacc2x0123 = vrshlq_s32(vacc2x0123, vright_post_shift);
+ vacc2x4567 = vrshlq_s32(vacc2x4567, vright_post_shift);
const int16x8_t voutput_zero_point = vld1q_dup_s16(¶ms->rndnu_neon.output_zero_point);
#if XNN_ARCH_ARM64
const int16x8_t vacc0x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc0x0123), vacc0x4567), voutput_zero_point);
const int16x8_t vacc1x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc1x0123), vacc1x4567), voutput_zero_point);
+ const int16x8_t vacc2x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc2x0123), vacc2x4567), voutput_zero_point);
int8x16_t vout0x01234567_1x01234567 = vqmovn_high_s16(vqmovn_s16(vacc0x01234567), vacc1x01234567);
+ int8x8_t vout2x01234567 = vqmovn_s16(vacc2x01234567);
#else
const int16x8_t vacc0x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc0x0123), vqmovn_s32(vacc0x4567)), voutput_zero_point);
const int16x8_t vacc1x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc1x0123), vqmovn_s32(vacc1x4567)), voutput_zero_point);
+ const int16x8_t vacc2x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc2x0123), vqmovn_s32(vacc2x4567)), voutput_zero_point);
int8x16_t vout0x01234567_1x01234567 = vcombine_s8(vqmovn_s16(vacc0x01234567), vqmovn_s16(vacc1x01234567));
+ int8x8_t vout2x01234567 = vqmovn_s16(vacc2x01234567);
#endif
const int8x16_t voutput_min = vld1q_dup_s8(¶ms->rndnu_neon.output_min);
const int8x16_t voutput_max = vld1q_dup_s8(¶ms->rndnu_neon.output_max);
+ vout2x01234567 = vmax_s8(vout2x01234567, vget_low_s8(voutput_min));
vout0x01234567_1x01234567 = vmaxq_s8(vout0x01234567_1x01234567, voutput_min);
+ vout2x01234567 = vmin_s8(vout2x01234567, vget_low_s8(voutput_max));
vout0x01234567_1x01234567 = vminq_s8(vout0x01234567_1x01234567, voutput_max);
if (nc >= 8) {
+ vst1_s8(c2 + 0, vout2x01234567);
vst1_s8(c1 + 0, vget_high_s8(vout0x01234567_1x01234567));
vst1_s8(c0 + 0, vget_low_s8(vout0x01234567_1x01234567));
+ c2 = (int8_t*) ((uintptr_t) c2 + cn_stride);
c1 = (int8_t*) ((uintptr_t) c1 + cn_stride);
c0 = (int8_t*) ((uintptr_t) c0 + cn_stride);
@@ -233,16 +294,21 @@
nc -= 8;
} else {
if (nc & 4) {
+ vst1_lane_u32(__builtin_assume_aligned(c2, 1), vreinterpret_u32_s8(vout2x01234567), 0); c2 += 4;
vst1q_lane_u32(__builtin_assume_aligned(c1, 1), vreinterpretq_u32_s8(vout0x01234567_1x01234567), 2); c1 += 4;
vst1q_lane_u32(__builtin_assume_aligned(c0, 1), vreinterpretq_u32_s8(vout0x01234567_1x01234567), 0); c0 += 4;
+ vout2x01234567 = vext_s8(vout2x01234567, vout2x01234567, 4);
vout0x01234567_1x01234567 = vextq_s8(vout0x01234567_1x01234567, vout0x01234567_1x01234567, 4);
}
if (nc & 2) {
+ vst1_lane_u16(__builtin_assume_aligned(c2, 1), vreinterpret_u16_s8(vout2x01234567), 0); c2 += 2;
vst1q_lane_u16(__builtin_assume_aligned(c1, 1), vreinterpretq_u16_s8(vout0x01234567_1x01234567), 4); c1 += 2;
vst1q_lane_u16(__builtin_assume_aligned(c0, 1), vreinterpretq_u16_s8(vout0x01234567_1x01234567), 0); c0 += 2;
+ vout2x01234567 = vext_s8(vout2x01234567, vout2x01234567, 2);
vout0x01234567_1x01234567 = vextq_s8(vout0x01234567_1x01234567, vout0x01234567_1x01234567, 2);
}
if (nc & 1) {
+ vst1_lane_s8(c2, vout2x01234567, 0);
vst1q_lane_s8(c1, vout0x01234567_1x01234567, 8);
vst1q_lane_s8(c0, vout0x01234567_1x01234567, 0);
}
diff --git a/src/qs8-igemm/gen/4x16c2s4-minmax-rndnu-neon-mlal-padal.c b/src/qs8-igemm/gen/4x16c2s4-minmax-rndnu-neon-mlal-padal.c
new file mode 100644
index 0000000..4236536
--- /dev/null
+++ b/src/qs8-igemm/gen/4x16c2s4-minmax-rndnu-neon-mlal-padal.c
@@ -0,0 +1,843 @@
+// Auto-generated file. Do not edit!
+// Template: src/qs8-igemm/c2-neon-mull-padal-shuffle.c.in
+// Generator: tools/xngen
+//
+// Copyright 2021 Google LLC
+//
+// This source code is licensed under the BSD-style license found in the
+// LICENSE file in the root directory of this source tree.
+
+#include <assert.h>
+
+#include <arm_neon.h>
+
+#include <xnnpack/gemm.h>
+#include <xnnpack/math.h>
+
+
+void xnn_qs8_igemm_minmax_rndnu_ukernel_4x16c2s4__neon_mlal_padal(
+ size_t mr,
+ size_t nc,
+ size_t kc,
+ size_t ks,
+ const int8_t** restrict a,
+ const void* restrict w,
+ int8_t* restrict c,
+ size_t cm_stride,
+ size_t cn_stride,
+ size_t a_offset,
+ const int8_t* zero,
+ const union xnn_qs8_conv_minmax_params params[restrict XNN_MIN_ELEMENTS(1)]) XNN_DISABLE_TSAN XNN_DISABLE_MSAN
+{
+ assert(mr != 0);
+ assert(mr <= 4);
+ assert(nc != 0);
+ assert(kc != 0);
+ assert(ks != 0);
+ assert(ks % (4 * sizeof(void*)) == 0);
+ assert(a_offset % sizeof(int8_t) == 0);
+ assert(a != NULL);
+ assert(w != NULL);
+ assert(c != NULL);
+
+ int8_t* c0 = c;
+ int8_t* c1 = (int8_t*) ((uintptr_t) c0 + cm_stride);
+ if XNN_UNPREDICTABLE(mr < 2) {
+ c1 = c0;
+ }
+ int8_t* c2 = (int8_t*) ((uintptr_t) c1 + cm_stride);
+ if XNN_UNPREDICTABLE(mr <= 2) {
+ c2 = c1;
+ }
+ int8_t* c3 = (int8_t*) ((uintptr_t) c2 + cm_stride);
+ if XNN_UNPREDICTABLE(mr != 4) {
+ c3 = c2;
+ }
+
+ do {
+ int32x4_t vacc0x0123 = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc0x4567 = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc0x89AB = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc0xCDEF = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc1x0123 = vacc0x0123;
+ int32x4_t vacc1x4567 = vacc0x4567;
+ int32x4_t vacc1x89AB = vacc0x89AB;
+ int32x4_t vacc1xCDEF = vacc0xCDEF;
+ int32x4_t vacc2x0123 = vacc0x0123;
+ int32x4_t vacc2x4567 = vacc0x4567;
+ int32x4_t vacc2x89AB = vacc0x89AB;
+ int32x4_t vacc2xCDEF = vacc0xCDEF;
+ int32x4_t vacc3x0123 = vacc0x0123;
+ int32x4_t vacc3x4567 = vacc0x4567;
+ int32x4_t vacc3x89AB = vacc0x89AB;
+ int32x4_t vacc3xCDEF = vacc0xCDEF;
+
+ size_t p = ks;
+ do {
+ const int8_t* restrict a0 = a[0];
+ if XNN_UNPREDICTABLE(a0 != zero) {
+ a0 = (const int8_t*) ((uintptr_t) a0 + a_offset);
+ }
+ const int8_t* restrict a1 = a[1];
+ if XNN_UNPREDICTABLE(a1 != zero) {
+ a1 = (const int8_t*) ((uintptr_t) a1 + a_offset);
+ }
+ const int8_t* restrict a2 = a[2];
+ if XNN_UNPREDICTABLE(a2 != zero) {
+ a2 = (const int8_t*) ((uintptr_t) a2 + a_offset);
+ }
+ const int8_t* restrict a3 = a[3];
+ if XNN_UNPREDICTABLE(a3 != zero) {
+ a3 = (const int8_t*) ((uintptr_t) a3 + a_offset);
+ }
+ a += 4;
+
+ size_t k = kc;
+
+ while (k >= 16 * sizeof(int8_t)) {
+ int8x8_t va0x0 = vld1_s8(a0); a0 += 8;
+ int8x8_t va0x1 = vld1_s8(a0); a0 += 8;
+ int8x8_t va1x0 = vld1_s8(a1); a1 += 8;
+ int8x8_t va1x1 = vld1_s8(a1); a1 += 8;
+ int8x8_t va2x0 = vld1_s8(a2); a2 += 8;
+ int8x8_t va2x1 = vld1_s8(a2); a2 += 8;
+ int8x8_t va3x0 = vld1_s8(a3); a3 += 8;
+ int8x8_t va3x1 = vld1_s8(a3); a3 += 8;
+
+ const int8x8_t vb0123c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ int16x8_t vprod0x0123c0 = vmull_s8(vb0123c0x0, va0x0);
+ int16x8_t vprod1x0123c0 = vmull_s8(vb0123c0x0, va1x0);
+ int16x8_t vprod2x0123c0 = vmull_s8(vb0123c0x0, va2x0);
+ int16x8_t vprod3x0123c0 = vmull_s8(vb0123c0x0, va3x0);
+ const int8x8_t vb0123c0x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x0123c0 = vmlal_s8(vprod0x0123c0, vb0123c0x1, va0x1);
+ vprod1x0123c0 = vmlal_s8(vprod1x0123c0, vb0123c0x1, va1x1);
+ vprod2x0123c0 = vmlal_s8(vprod2x0123c0, vb0123c0x1, va2x1);
+ vprod3x0123c0 = vmlal_s8(vprod3x0123c0, vb0123c0x1, va3x1);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c0);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c0);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c0);
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c0);
+ int16x8_t vprod0x4567c0 = vmull_s8(vb4567c0x0, va0x0);
+ int16x8_t vprod1x4567c0 = vmull_s8(vb4567c0x0, va1x0);
+ int16x8_t vprod2x4567c0 = vmull_s8(vb4567c0x0, va2x0);
+ int16x8_t vprod3x4567c0 = vmull_s8(vb4567c0x0, va3x0);
+ const int8x8_t vb4567c0x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x4567c0 = vmlal_s8(vprod0x4567c0, vb4567c0x1, va0x1);
+ vprod1x4567c0 = vmlal_s8(vprod1x4567c0, vb4567c0x1, va1x1);
+ vprod2x4567c0 = vmlal_s8(vprod2x4567c0, vb4567c0x1, va2x1);
+ vprod3x4567c0 = vmlal_s8(vprod3x4567c0, vb4567c0x1, va3x1);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c0);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c0);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c0);
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c0);
+ int16x8_t vprod0x89ABc0 = vmull_s8(vb89ABc0x0, va0x0);
+ int16x8_t vprod1x89ABc0 = vmull_s8(vb89ABc0x0, va1x0);
+ int16x8_t vprod2x89ABc0 = vmull_s8(vb89ABc0x0, va2x0);
+ int16x8_t vprod3x89ABc0 = vmull_s8(vb89ABc0x0, va3x0);
+ const int8x8_t vb89ABc0x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x89ABc0 = vmlal_s8(vprod0x89ABc0, vb89ABc0x1, va0x1);
+ vprod1x89ABc0 = vmlal_s8(vprod1x89ABc0, vb89ABc0x1, va1x1);
+ vprod2x89ABc0 = vmlal_s8(vprod2x89ABc0, vb89ABc0x1, va2x1);
+ vprod3x89ABc0 = vmlal_s8(vprod3x89ABc0, vb89ABc0x1, va3x1);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc0);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc0);
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc0);
+ vacc3x89AB = vpadalq_s16(vacc3x89AB, vprod3x89ABc0);
+ int16x8_t vprod0xCDEFc0 = vmull_s8(vbCDEFc0x0, va0x0);
+ int16x8_t vprod1xCDEFc0 = vmull_s8(vbCDEFc0x0, va1x0);
+ int16x8_t vprod2xCDEFc0 = vmull_s8(vbCDEFc0x0, va2x0);
+ int16x8_t vprod3xCDEFc0 = vmull_s8(vbCDEFc0x0, va3x0);
+ const int8x8_t vbCDEFc0x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0xCDEFc0 = vmlal_s8(vprod0xCDEFc0, vbCDEFc0x1, va0x1);
+ vprod1xCDEFc0 = vmlal_s8(vprod1xCDEFc0, vbCDEFc0x1, va1x1);
+ vprod2xCDEFc0 = vmlal_s8(vprod2xCDEFc0, vbCDEFc0x1, va2x1);
+ vprod3xCDEFc0 = vmlal_s8(vprod3xCDEFc0, vbCDEFc0x1, va3x1);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc0);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc0);
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc0);
+ vacc3xCDEF = vpadalq_s16(vacc3xCDEF, vprod3xCDEFc0);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va0x1 = vext_s8(va0x1, va0x1, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ va1x1 = vext_s8(va1x1, va1x1, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
+ va2x1 = vext_s8(va2x1, va2x1, 2);
+ va3x0 = vext_s8(va3x0, va3x0, 2);
+ va3x1 = vext_s8(va3x1, va3x1, 2);
+ int16x8_t vprod0x0123c1 = vmull_s8(vb0123c1x0, va0x0);
+ int16x8_t vprod1x0123c1 = vmull_s8(vb0123c1x0, va1x0);
+ int16x8_t vprod2x0123c1 = vmull_s8(vb0123c1x0, va2x0);
+ int16x8_t vprod3x0123c1 = vmull_s8(vb0123c1x0, va3x0);
+ const int8x8_t vb0123c1x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x0123c1 = vmlal_s8(vprod0x0123c1, vb0123c1x1, va0x1);
+ vprod1x0123c1 = vmlal_s8(vprod1x0123c1, vb0123c1x1, va1x1);
+ vprod2x0123c1 = vmlal_s8(vprod2x0123c1, vb0123c1x1, va2x1);
+ vprod3x0123c1 = vmlal_s8(vprod3x0123c1, vb0123c1x1, va3x1);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c1);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c1);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c1);
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c1);
+ int16x8_t vprod0x4567c1 = vmull_s8(vb4567c1x0, va0x0);
+ int16x8_t vprod1x4567c1 = vmull_s8(vb4567c1x0, va1x0);
+ int16x8_t vprod2x4567c1 = vmull_s8(vb4567c1x0, va2x0);
+ int16x8_t vprod3x4567c1 = vmull_s8(vb4567c1x0, va3x0);
+ const int8x8_t vb4567c1x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x4567c1 = vmlal_s8(vprod0x4567c1, vb4567c1x1, va0x1);
+ vprod1x4567c1 = vmlal_s8(vprod1x4567c1, vb4567c1x1, va1x1);
+ vprod2x4567c1 = vmlal_s8(vprod2x4567c1, vb4567c1x1, va2x1);
+ vprod3x4567c1 = vmlal_s8(vprod3x4567c1, vb4567c1x1, va3x1);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c1);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c1);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c1);
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c1);
+ int16x8_t vprod0x89ABc1 = vmull_s8(vb89ABc1x0, va0x0);
+ int16x8_t vprod1x89ABc1 = vmull_s8(vb89ABc1x0, va1x0);
+ int16x8_t vprod2x89ABc1 = vmull_s8(vb89ABc1x0, va2x0);
+ int16x8_t vprod3x89ABc1 = vmull_s8(vb89ABc1x0, va3x0);
+ const int8x8_t vb89ABc1x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x89ABc1 = vmlal_s8(vprod0x89ABc1, vb89ABc1x1, va0x1);
+ vprod1x89ABc1 = vmlal_s8(vprod1x89ABc1, vb89ABc1x1, va1x1);
+ vprod2x89ABc1 = vmlal_s8(vprod2x89ABc1, vb89ABc1x1, va2x1);
+ vprod3x89ABc1 = vmlal_s8(vprod3x89ABc1, vb89ABc1x1, va3x1);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc1);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc1);
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc1);
+ vacc3x89AB = vpadalq_s16(vacc3x89AB, vprod3x89ABc1);
+ int16x8_t vprod0xCDEFc1 = vmull_s8(vbCDEFc1x0, va0x0);
+ int16x8_t vprod1xCDEFc1 = vmull_s8(vbCDEFc1x0, va1x0);
+ int16x8_t vprod2xCDEFc1 = vmull_s8(vbCDEFc1x0, va2x0);
+ int16x8_t vprod3xCDEFc1 = vmull_s8(vbCDEFc1x0, va3x0);
+ const int8x8_t vbCDEFc1x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0xCDEFc1 = vmlal_s8(vprod0xCDEFc1, vbCDEFc1x1, va0x1);
+ vprod1xCDEFc1 = vmlal_s8(vprod1xCDEFc1, vbCDEFc1x1, va1x1);
+ vprod2xCDEFc1 = vmlal_s8(vprod2xCDEFc1, vbCDEFc1x1, va2x1);
+ vprod3xCDEFc1 = vmlal_s8(vprod3xCDEFc1, vbCDEFc1x1, va3x1);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc1);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc1);
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc1);
+ vacc3xCDEF = vpadalq_s16(vacc3xCDEF, vprod3xCDEFc1);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va0x1 = vext_s8(va0x1, va0x1, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ va1x1 = vext_s8(va1x1, va1x1, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
+ va2x1 = vext_s8(va2x1, va2x1, 2);
+ va3x0 = vext_s8(va3x0, va3x0, 2);
+ va3x1 = vext_s8(va3x1, va3x1, 2);
+ int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2x0, va0x0);
+ int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2x0, va1x0);
+ int16x8_t vprod2x0123c2 = vmull_s8(vb0123c2x0, va2x0);
+ int16x8_t vprod3x0123c2 = vmull_s8(vb0123c2x0, va3x0);
+ const int8x8_t vb0123c2x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x0123c2 = vmlal_s8(vprod0x0123c2, vb0123c2x1, va0x1);
+ vprod1x0123c2 = vmlal_s8(vprod1x0123c2, vb0123c2x1, va1x1);
+ vprod2x0123c2 = vmlal_s8(vprod2x0123c2, vb0123c2x1, va2x1);
+ vprod3x0123c2 = vmlal_s8(vprod3x0123c2, vb0123c2x1, va3x1);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c2);
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c2);
+ int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2x0, va0x0);
+ int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2x0, va1x0);
+ int16x8_t vprod2x4567c2 = vmull_s8(vb4567c2x0, va2x0);
+ int16x8_t vprod3x4567c2 = vmull_s8(vb4567c2x0, va3x0);
+ const int8x8_t vb4567c2x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x4567c2 = vmlal_s8(vprod0x4567c2, vb4567c2x1, va0x1);
+ vprod1x4567c2 = vmlal_s8(vprod1x4567c2, vb4567c2x1, va1x1);
+ vprod2x4567c2 = vmlal_s8(vprod2x4567c2, vb4567c2x1, va2x1);
+ vprod3x4567c2 = vmlal_s8(vprod3x4567c2, vb4567c2x1, va3x1);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c2);
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c2);
+ int16x8_t vprod0x89ABc2 = vmull_s8(vb89ABc2x0, va0x0);
+ int16x8_t vprod1x89ABc2 = vmull_s8(vb89ABc2x0, va1x0);
+ int16x8_t vprod2x89ABc2 = vmull_s8(vb89ABc2x0, va2x0);
+ int16x8_t vprod3x89ABc2 = vmull_s8(vb89ABc2x0, va3x0);
+ const int8x8_t vb89ABc2x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x89ABc2 = vmlal_s8(vprod0x89ABc2, vb89ABc2x1, va0x1);
+ vprod1x89ABc2 = vmlal_s8(vprod1x89ABc2, vb89ABc2x1, va1x1);
+ vprod2x89ABc2 = vmlal_s8(vprod2x89ABc2, vb89ABc2x1, va2x1);
+ vprod3x89ABc2 = vmlal_s8(vprod3x89ABc2, vb89ABc2x1, va3x1);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc2);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc2);
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc2);
+ vacc3x89AB = vpadalq_s16(vacc3x89AB, vprod3x89ABc2);
+ int16x8_t vprod0xCDEFc2 = vmull_s8(vbCDEFc2x0, va0x0);
+ int16x8_t vprod1xCDEFc2 = vmull_s8(vbCDEFc2x0, va1x0);
+ int16x8_t vprod2xCDEFc2 = vmull_s8(vbCDEFc2x0, va2x0);
+ int16x8_t vprod3xCDEFc2 = vmull_s8(vbCDEFc2x0, va3x0);
+ const int8x8_t vbCDEFc2x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0xCDEFc2 = vmlal_s8(vprod0xCDEFc2, vbCDEFc2x1, va0x1);
+ vprod1xCDEFc2 = vmlal_s8(vprod1xCDEFc2, vbCDEFc2x1, va1x1);
+ vprod2xCDEFc2 = vmlal_s8(vprod2xCDEFc2, vbCDEFc2x1, va2x1);
+ vprod3xCDEFc2 = vmlal_s8(vprod3xCDEFc2, vbCDEFc2x1, va3x1);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc2);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc2);
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc2);
+ vacc3xCDEF = vpadalq_s16(vacc3xCDEF, vprod3xCDEFc2);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va0x1 = vext_s8(va0x1, va0x1, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ va1x1 = vext_s8(va1x1, va1x1, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
+ va2x1 = vext_s8(va2x1, va2x1, 2);
+ va3x0 = vext_s8(va3x0, va3x0, 2);
+ va3x1 = vext_s8(va3x1, va3x1, 2);
+ int16x8_t vprod0x0123c3 = vmull_s8(vb0123c3x0, va0x0);
+ int16x8_t vprod1x0123c3 = vmull_s8(vb0123c3x0, va1x0);
+ int16x8_t vprod2x0123c3 = vmull_s8(vb0123c3x0, va2x0);
+ int16x8_t vprod3x0123c3 = vmull_s8(vb0123c3x0, va3x0);
+ const int8x8_t vb0123c3x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x0123c3 = vmlal_s8(vprod0x0123c3, vb0123c3x1, va0x1);
+ vprod1x0123c3 = vmlal_s8(vprod1x0123c3, vb0123c3x1, va1x1);
+ vprod2x0123c3 = vmlal_s8(vprod2x0123c3, vb0123c3x1, va2x1);
+ vprod3x0123c3 = vmlal_s8(vprod3x0123c3, vb0123c3x1, va3x1);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c3);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c3);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c3);
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c3);
+ int16x8_t vprod0x4567c3 = vmull_s8(vb4567c3x0, va0x0);
+ int16x8_t vprod1x4567c3 = vmull_s8(vb4567c3x0, va1x0);
+ int16x8_t vprod2x4567c3 = vmull_s8(vb4567c3x0, va2x0);
+ int16x8_t vprod3x4567c3 = vmull_s8(vb4567c3x0, va3x0);
+ const int8x8_t vb4567c3x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x4567c3 = vmlal_s8(vprod0x4567c3, vb4567c3x1, va0x1);
+ vprod1x4567c3 = vmlal_s8(vprod1x4567c3, vb4567c3x1, va1x1);
+ vprod2x4567c3 = vmlal_s8(vprod2x4567c3, vb4567c3x1, va2x1);
+ vprod3x4567c3 = vmlal_s8(vprod3x4567c3, vb4567c3x1, va3x1);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c3);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c3);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c3);
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c3);
+ int16x8_t vprod0x89ABc3 = vmull_s8(vb89ABc3x0, va0x0);
+ int16x8_t vprod1x89ABc3 = vmull_s8(vb89ABc3x0, va1x0);
+ int16x8_t vprod2x89ABc3 = vmull_s8(vb89ABc3x0, va2x0);
+ int16x8_t vprod3x89ABc3 = vmull_s8(vb89ABc3x0, va3x0);
+ const int8x8_t vb89ABc3x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x89ABc3 = vmlal_s8(vprod0x89ABc3, vb89ABc3x1, va0x1);
+ vprod1x89ABc3 = vmlal_s8(vprod1x89ABc3, vb89ABc3x1, va1x1);
+ vprod2x89ABc3 = vmlal_s8(vprod2x89ABc3, vb89ABc3x1, va2x1);
+ vprod3x89ABc3 = vmlal_s8(vprod3x89ABc3, vb89ABc3x1, va3x1);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc3);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc3);
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc3);
+ vacc3x89AB = vpadalq_s16(vacc3x89AB, vprod3x89ABc3);
+ int16x8_t vprod0xCDEFc3 = vmull_s8(vbCDEFc3x0, va0x0);
+ int16x8_t vprod1xCDEFc3 = vmull_s8(vbCDEFc3x0, va1x0);
+ int16x8_t vprod2xCDEFc3 = vmull_s8(vbCDEFc3x0, va2x0);
+ int16x8_t vprod3xCDEFc3 = vmull_s8(vbCDEFc3x0, va3x0);
+ const int8x8_t vbCDEFc3x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0xCDEFc3 = vmlal_s8(vprod0xCDEFc3, vbCDEFc3x1, va0x1);
+ vprod1xCDEFc3 = vmlal_s8(vprod1xCDEFc3, vbCDEFc3x1, va1x1);
+ vprod2xCDEFc3 = vmlal_s8(vprod2xCDEFc3, vbCDEFc3x1, va2x1);
+ vprod3xCDEFc3 = vmlal_s8(vprod3xCDEFc3, vbCDEFc3x1, va3x1);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc3);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc3);
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc3);
+ vacc3xCDEF = vpadalq_s16(vacc3xCDEF, vprod3xCDEFc3);
+
+ k -= 16 * sizeof(int8_t);
+ }
+
+ if (k >= 8 * sizeof(int8_t)) {
+ int8x8_t va0x0 = vld1_s8(a0); a0 += 8;
+ int8x8_t va1x0 = vld1_s8(a1); a1 += 8;
+ int8x8_t va2x0 = vld1_s8(a2); a2 += 8;
+ int8x8_t va3x0 = vld1_s8(a3); a3 += 8;
+
+ const int8x8_t vb0123c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ int16x8_t vprod0x0123c0 = vmull_s8(vb0123c0x0, va0x0);
+ int16x8_t vprod1x0123c0 = vmull_s8(vb0123c0x0, va1x0);
+ int16x8_t vprod2x0123c0 = vmull_s8(vb0123c0x0, va2x0);
+ int16x8_t vprod3x0123c0 = vmull_s8(vb0123c0x0, va3x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c0);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c0);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c0);
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c0);
+ int16x8_t vprod0x4567c0 = vmull_s8(vb4567c0x0, va0x0);
+ int16x8_t vprod1x4567c0 = vmull_s8(vb4567c0x0, va1x0);
+ int16x8_t vprod2x4567c0 = vmull_s8(vb4567c0x0, va2x0);
+ int16x8_t vprod3x4567c0 = vmull_s8(vb4567c0x0, va3x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c0);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c0);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c0);
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c0);
+ int16x8_t vprod0x89ABc0 = vmull_s8(vb89ABc0x0, va0x0);
+ int16x8_t vprod1x89ABc0 = vmull_s8(vb89ABc0x0, va1x0);
+ int16x8_t vprod2x89ABc0 = vmull_s8(vb89ABc0x0, va2x0);
+ int16x8_t vprod3x89ABc0 = vmull_s8(vb89ABc0x0, va3x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc0);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc0);
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc0);
+ vacc3x89AB = vpadalq_s16(vacc3x89AB, vprod3x89ABc0);
+ int16x8_t vprod0xCDEFc0 = vmull_s8(vbCDEFc0x0, va0x0);
+ int16x8_t vprod1xCDEFc0 = vmull_s8(vbCDEFc0x0, va1x0);
+ int16x8_t vprod2xCDEFc0 = vmull_s8(vbCDEFc0x0, va2x0);
+ int16x8_t vprod3xCDEFc0 = vmull_s8(vbCDEFc0x0, va3x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc0);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc0);
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc0);
+ vacc3xCDEF = vpadalq_s16(vacc3xCDEF, vprod3xCDEFc0);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
+ va3x0 = vext_s8(va3x0, va3x0, 2);
+ int16x8_t vprod0x0123c1 = vmull_s8(vb0123c1x0, va0x0);
+ int16x8_t vprod1x0123c1 = vmull_s8(vb0123c1x0, va1x0);
+ int16x8_t vprod2x0123c1 = vmull_s8(vb0123c1x0, va2x0);
+ int16x8_t vprod3x0123c1 = vmull_s8(vb0123c1x0, va3x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c1);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c1);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c1);
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c1);
+ int16x8_t vprod0x4567c1 = vmull_s8(vb4567c1x0, va0x0);
+ int16x8_t vprod1x4567c1 = vmull_s8(vb4567c1x0, va1x0);
+ int16x8_t vprod2x4567c1 = vmull_s8(vb4567c1x0, va2x0);
+ int16x8_t vprod3x4567c1 = vmull_s8(vb4567c1x0, va3x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c1);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c1);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c1);
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c1);
+ int16x8_t vprod0x89ABc1 = vmull_s8(vb89ABc1x0, va0x0);
+ int16x8_t vprod1x89ABc1 = vmull_s8(vb89ABc1x0, va1x0);
+ int16x8_t vprod2x89ABc1 = vmull_s8(vb89ABc1x0, va2x0);
+ int16x8_t vprod3x89ABc1 = vmull_s8(vb89ABc1x0, va3x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc1);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc1);
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc1);
+ vacc3x89AB = vpadalq_s16(vacc3x89AB, vprod3x89ABc1);
+ int16x8_t vprod0xCDEFc1 = vmull_s8(vbCDEFc1x0, va0x0);
+ int16x8_t vprod1xCDEFc1 = vmull_s8(vbCDEFc1x0, va1x0);
+ int16x8_t vprod2xCDEFc1 = vmull_s8(vbCDEFc1x0, va2x0);
+ int16x8_t vprod3xCDEFc1 = vmull_s8(vbCDEFc1x0, va3x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc1);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc1);
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc1);
+ vacc3xCDEF = vpadalq_s16(vacc3xCDEF, vprod3xCDEFc1);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
+ va3x0 = vext_s8(va3x0, va3x0, 2);
+ int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2x0, va0x0);
+ int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2x0, va1x0);
+ int16x8_t vprod2x0123c2 = vmull_s8(vb0123c2x0, va2x0);
+ int16x8_t vprod3x0123c2 = vmull_s8(vb0123c2x0, va3x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c2);
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c2);
+ int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2x0, va0x0);
+ int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2x0, va1x0);
+ int16x8_t vprod2x4567c2 = vmull_s8(vb4567c2x0, va2x0);
+ int16x8_t vprod3x4567c2 = vmull_s8(vb4567c2x0, va3x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c2);
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c2);
+ int16x8_t vprod0x89ABc2 = vmull_s8(vb89ABc2x0, va0x0);
+ int16x8_t vprod1x89ABc2 = vmull_s8(vb89ABc2x0, va1x0);
+ int16x8_t vprod2x89ABc2 = vmull_s8(vb89ABc2x0, va2x0);
+ int16x8_t vprod3x89ABc2 = vmull_s8(vb89ABc2x0, va3x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc2);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc2);
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc2);
+ vacc3x89AB = vpadalq_s16(vacc3x89AB, vprod3x89ABc2);
+ int16x8_t vprod0xCDEFc2 = vmull_s8(vbCDEFc2x0, va0x0);
+ int16x8_t vprod1xCDEFc2 = vmull_s8(vbCDEFc2x0, va1x0);
+ int16x8_t vprod2xCDEFc2 = vmull_s8(vbCDEFc2x0, va2x0);
+ int16x8_t vprod3xCDEFc2 = vmull_s8(vbCDEFc2x0, va3x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc2);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc2);
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc2);
+ vacc3xCDEF = vpadalq_s16(vacc3xCDEF, vprod3xCDEFc2);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
+ va3x0 = vext_s8(va3x0, va3x0, 2);
+ int16x8_t vprod0x0123c3 = vmull_s8(vb0123c3x0, va0x0);
+ int16x8_t vprod1x0123c3 = vmull_s8(vb0123c3x0, va1x0);
+ int16x8_t vprod2x0123c3 = vmull_s8(vb0123c3x0, va2x0);
+ int16x8_t vprod3x0123c3 = vmull_s8(vb0123c3x0, va3x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c3);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c3);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c3);
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c3);
+ int16x8_t vprod0x4567c3 = vmull_s8(vb4567c3x0, va0x0);
+ int16x8_t vprod1x4567c3 = vmull_s8(vb4567c3x0, va1x0);
+ int16x8_t vprod2x4567c3 = vmull_s8(vb4567c3x0, va2x0);
+ int16x8_t vprod3x4567c3 = vmull_s8(vb4567c3x0, va3x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c3);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c3);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c3);
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c3);
+ int16x8_t vprod0x89ABc3 = vmull_s8(vb89ABc3x0, va0x0);
+ int16x8_t vprod1x89ABc3 = vmull_s8(vb89ABc3x0, va1x0);
+ int16x8_t vprod2x89ABc3 = vmull_s8(vb89ABc3x0, va2x0);
+ int16x8_t vprod3x89ABc3 = vmull_s8(vb89ABc3x0, va3x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc3);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc3);
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc3);
+ vacc3x89AB = vpadalq_s16(vacc3x89AB, vprod3x89ABc3);
+ int16x8_t vprod0xCDEFc3 = vmull_s8(vbCDEFc3x0, va0x0);
+ int16x8_t vprod1xCDEFc3 = vmull_s8(vbCDEFc3x0, va1x0);
+ int16x8_t vprod2xCDEFc3 = vmull_s8(vbCDEFc3x0, va2x0);
+ int16x8_t vprod3xCDEFc3 = vmull_s8(vbCDEFc3x0, va3x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc3);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc3);
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc3);
+ vacc3xCDEF = vpadalq_s16(vacc3xCDEF, vprod3xCDEFc3);
+
+ k -= 8 * sizeof(int8_t);
+ }
+
+ if XNN_UNLIKELY(k != 0) {
+ const int8x8_t va0 = vld1_s8(a0); a0 = (const int8_t*) ((uintptr_t) a0 + k);
+ const int8x8_t va1 = vld1_s8(a1); a1 = (const int8_t*) ((uintptr_t) a1 + k);
+ const int8x8_t va2 = vld1_s8(a2); a2 = (const int8_t*) ((uintptr_t) a2 + k);
+ const int8x8_t va3 = vld1_s8(a3); a3 = (const int8_t*) ((uintptr_t) a3 + k);
+
+ const int8x8_t vb0123c0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c0 = vmull_s8(vb0123c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c0);
+ const int16x8_t vprod0x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c0);
+ const int16x8_t vprod0x89ABc0 = vmull_s8(vb89ABc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc0);
+ const int16x8_t vprod0xCDEFc0 = vmull_s8(vbCDEFc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc0);
+ const int16x8_t vprod1x0123c0 = vmull_s8(vb0123c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c0);
+ const int16x8_t vprod1x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c0);
+ const int16x8_t vprod1x89ABc0 = vmull_s8(vb89ABc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0)));
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc0);
+ const int16x8_t vprod1xCDEFc0 = vmull_s8(vbCDEFc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0)));
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc0);
+ const int16x8_t vprod2x0123c0 = vmull_s8(vb0123c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 0)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c0);
+ const int16x8_t vprod2x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 0)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c0);
+ const int16x8_t vprod2x89ABc0 = vmull_s8(vb89ABc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 0)));
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc0);
+ const int16x8_t vprod2xCDEFc0 = vmull_s8(vbCDEFc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 0)));
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc0);
+ const int16x8_t vprod3x0123c0 = vmull_s8(vb0123c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 0)));
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c0);
+ const int16x8_t vprod3x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 0)));
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c0);
+ const int16x8_t vprod3x89ABc0 = vmull_s8(vb89ABc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 0)));
+ vacc3x89AB = vpadalq_s16(vacc3x89AB, vprod3x89ABc0);
+ const int16x8_t vprod3xCDEFc0 = vmull_s8(vbCDEFc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 0)));
+ vacc3xCDEF = vpadalq_s16(vacc3xCDEF, vprod3xCDEFc0);
+
+ if (k > 2 * sizeof(int8_t)) {
+ const int8x8_t vb0123c1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c1 = vmull_s8(vb0123c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c1);
+ const int16x8_t vprod0x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c1);
+ const int16x8_t vprod0x89ABc1 = vmull_s8(vb89ABc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc1);
+ const int16x8_t vprod0xCDEFc1 = vmull_s8(vbCDEFc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc1);
+ const int16x8_t vprod1x0123c1 = vmull_s8(vb0123c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c1);
+ const int16x8_t vprod1x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c1);
+ const int16x8_t vprod1x89ABc1 = vmull_s8(vb89ABc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1)));
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc1);
+ const int16x8_t vprod1xCDEFc1 = vmull_s8(vbCDEFc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1)));
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc1);
+ const int16x8_t vprod2x0123c1 = vmull_s8(vb0123c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 1)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c1);
+ const int16x8_t vprod2x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 1)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c1);
+ const int16x8_t vprod2x89ABc1 = vmull_s8(vb89ABc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 1)));
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc1);
+ const int16x8_t vprod2xCDEFc1 = vmull_s8(vbCDEFc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 1)));
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc1);
+ const int16x8_t vprod3x0123c1 = vmull_s8(vb0123c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 1)));
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c1);
+ const int16x8_t vprod3x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 1)));
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c1);
+ const int16x8_t vprod3x89ABc1 = vmull_s8(vb89ABc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 1)));
+ vacc3x89AB = vpadalq_s16(vacc3x89AB, vprod3x89ABc1);
+ const int16x8_t vprod3xCDEFc1 = vmull_s8(vbCDEFc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 1)));
+ vacc3xCDEF = vpadalq_s16(vacc3xCDEF, vprod3xCDEFc1);
+
+ if (k > 4 * sizeof(int8_t)) {
+ const int8x8_t vb0123c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ const int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ const int16x8_t vprod0x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc2);
+ const int16x8_t vprod0xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc2);
+ const int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ const int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ const int16x8_t vprod1x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2)));
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc2);
+ const int16x8_t vprod1xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2)));
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc2);
+ const int16x8_t vprod2x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 2)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c2);
+ const int16x8_t vprod2x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 2)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c2);
+ const int16x8_t vprod2x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 2)));
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc2);
+ const int16x8_t vprod2xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 2)));
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc2);
+ const int16x8_t vprod3x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 2)));
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c2);
+ const int16x8_t vprod3x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 2)));
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c2);
+ const int16x8_t vprod3x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 2)));
+ vacc3x89AB = vpadalq_s16(vacc3x89AB, vprod3x89ABc2);
+ const int16x8_t vprod3xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 2)));
+ vacc3xCDEF = vpadalq_s16(vacc3xCDEF, vprod3xCDEFc2);
+
+ if (k > 6 * sizeof(int8_t)) {
+ const int8x8_t vb0123c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ const int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ const int16x8_t vprod0x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc2);
+ const int16x8_t vprod0xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc2);
+ const int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 3)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ const int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 3)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ const int16x8_t vprod1x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 3)));
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc2);
+ const int16x8_t vprod1xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 3)));
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc2);
+ const int16x8_t vprod2x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 3)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c2);
+ const int16x8_t vprod2x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 3)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c2);
+ const int16x8_t vprod2x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 3)));
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc2);
+ const int16x8_t vprod2xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 3)));
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc2);
+ const int16x8_t vprod3x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 3)));
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c2);
+ const int16x8_t vprod3x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 3)));
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c2);
+ const int16x8_t vprod3x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 3)));
+ vacc3x89AB = vpadalq_s16(vacc3x89AB, vprod3x89ABc2);
+ const int16x8_t vprod3xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 3)));
+ vacc3xCDEF = vpadalq_s16(vacc3xCDEF, vprod3xCDEFc2);
+ }
+ }
+ }
+ }
+ p -= 4 * sizeof(void*);
+ } while (p != 0);
+
+ const int32x4_t vright_pre_shift = vld1q_dup_s32(¶ms->rndnu_neon.right_pre_shift);
+ const int32x4_t vmultiplier = vld1q_dup_s32(¶ms->rndnu_neon.multiplier);
+ const int32x4_t vright_post_shift = vld1q_dup_s32(¶ms->rndnu_neon.right_post_shift);
+
+ vacc0x0123 = vshlq_s32(vacc0x0123, vright_pre_shift);
+ vacc0x4567 = vshlq_s32(vacc0x4567, vright_pre_shift);
+ vacc0x89AB = vshlq_s32(vacc0x89AB, vright_pre_shift);
+ vacc0xCDEF = vshlq_s32(vacc0xCDEF, vright_pre_shift);
+ vacc1x0123 = vshlq_s32(vacc1x0123, vright_pre_shift);
+ vacc1x4567 = vshlq_s32(vacc1x4567, vright_pre_shift);
+ vacc1x89AB = vshlq_s32(vacc1x89AB, vright_pre_shift);
+ vacc1xCDEF = vshlq_s32(vacc1xCDEF, vright_pre_shift);
+ vacc2x0123 = vshlq_s32(vacc2x0123, vright_pre_shift);
+ vacc2x4567 = vshlq_s32(vacc2x4567, vright_pre_shift);
+ vacc2x89AB = vshlq_s32(vacc2x89AB, vright_pre_shift);
+ vacc2xCDEF = vshlq_s32(vacc2xCDEF, vright_pre_shift);
+ vacc3x0123 = vshlq_s32(vacc3x0123, vright_pre_shift);
+ vacc3x4567 = vshlq_s32(vacc3x4567, vright_pre_shift);
+ vacc3x89AB = vshlq_s32(vacc3x89AB, vright_pre_shift);
+ vacc3xCDEF = vshlq_s32(vacc3xCDEF, vright_pre_shift);
+
+ vacc0x0123 = vqdmulhq_s32(vacc0x0123, vmultiplier);
+ vacc0x4567 = vqdmulhq_s32(vacc0x4567, vmultiplier);
+ vacc0x89AB = vqdmulhq_s32(vacc0x89AB, vmultiplier);
+ vacc0xCDEF = vqdmulhq_s32(vacc0xCDEF, vmultiplier);
+ vacc1x0123 = vqdmulhq_s32(vacc1x0123, vmultiplier);
+ vacc1x4567 = vqdmulhq_s32(vacc1x4567, vmultiplier);
+ vacc1x89AB = vqdmulhq_s32(vacc1x89AB, vmultiplier);
+ vacc1xCDEF = vqdmulhq_s32(vacc1xCDEF, vmultiplier);
+ vacc2x0123 = vqdmulhq_s32(vacc2x0123, vmultiplier);
+ vacc2x4567 = vqdmulhq_s32(vacc2x4567, vmultiplier);
+ vacc2x89AB = vqdmulhq_s32(vacc2x89AB, vmultiplier);
+ vacc2xCDEF = vqdmulhq_s32(vacc2xCDEF, vmultiplier);
+ vacc3x0123 = vqdmulhq_s32(vacc3x0123, vmultiplier);
+ vacc3x4567 = vqdmulhq_s32(vacc3x4567, vmultiplier);
+ vacc3x89AB = vqdmulhq_s32(vacc3x89AB, vmultiplier);
+ vacc3xCDEF = vqdmulhq_s32(vacc3xCDEF, vmultiplier);
+
+ vacc0x0123 = vrshlq_s32(vacc0x0123, vright_post_shift);
+ vacc0x4567 = vrshlq_s32(vacc0x4567, vright_post_shift);
+ vacc0x89AB = vrshlq_s32(vacc0x89AB, vright_post_shift);
+ vacc0xCDEF = vrshlq_s32(vacc0xCDEF, vright_post_shift);
+ vacc1x0123 = vrshlq_s32(vacc1x0123, vright_post_shift);
+ vacc1x4567 = vrshlq_s32(vacc1x4567, vright_post_shift);
+ vacc1x89AB = vrshlq_s32(vacc1x89AB, vright_post_shift);
+ vacc1xCDEF = vrshlq_s32(vacc1xCDEF, vright_post_shift);
+ vacc2x0123 = vrshlq_s32(vacc2x0123, vright_post_shift);
+ vacc2x4567 = vrshlq_s32(vacc2x4567, vright_post_shift);
+ vacc2x89AB = vrshlq_s32(vacc2x89AB, vright_post_shift);
+ vacc2xCDEF = vrshlq_s32(vacc2xCDEF, vright_post_shift);
+ vacc3x0123 = vrshlq_s32(vacc3x0123, vright_post_shift);
+ vacc3x4567 = vrshlq_s32(vacc3x4567, vright_post_shift);
+ vacc3x89AB = vrshlq_s32(vacc3x89AB, vright_post_shift);
+ vacc3xCDEF = vrshlq_s32(vacc3xCDEF, vright_post_shift);
+
+ const int16x8_t voutput_zero_point = vld1q_dup_s16(¶ms->rndnu_neon.output_zero_point);
+#if XNN_ARCH_ARM64
+ const int16x8_t vacc0x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc0x0123), vacc0x4567), voutput_zero_point);
+ const int16x8_t vacc0x89ABCDEF = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc0x89AB), vacc0xCDEF), voutput_zero_point);
+ const int16x8_t vacc1x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc1x0123), vacc1x4567), voutput_zero_point);
+ const int16x8_t vacc1x89ABCDEF = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc1x89AB), vacc1xCDEF), voutput_zero_point);
+ const int16x8_t vacc2x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc2x0123), vacc2x4567), voutput_zero_point);
+ const int16x8_t vacc2x89ABCDEF = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc2x89AB), vacc2xCDEF), voutput_zero_point);
+ const int16x8_t vacc3x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc3x0123), vacc3x4567), voutput_zero_point);
+ const int16x8_t vacc3x89ABCDEF = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc3x89AB), vacc3xCDEF), voutput_zero_point);
+
+ int8x16_t vout0x0123456789ABCDEF = vqmovn_high_s16(vqmovn_s16(vacc0x01234567), vacc0x89ABCDEF);
+ int8x16_t vout1x0123456789ABCDEF = vqmovn_high_s16(vqmovn_s16(vacc1x01234567), vacc1x89ABCDEF);
+ int8x16_t vout2x0123456789ABCDEF = vqmovn_high_s16(vqmovn_s16(vacc2x01234567), vacc2x89ABCDEF);
+ int8x16_t vout3x0123456789ABCDEF = vqmovn_high_s16(vqmovn_s16(vacc3x01234567), vacc3x89ABCDEF);
+#else
+ const int16x8_t vacc0x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc0x0123), vqmovn_s32(vacc0x4567)), voutput_zero_point);
+ const int16x8_t vacc0x89ABCDEF = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc0x89AB), vqmovn_s32(vacc0xCDEF)), voutput_zero_point);
+ const int16x8_t vacc1x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc1x0123), vqmovn_s32(vacc1x4567)), voutput_zero_point);
+ const int16x8_t vacc1x89ABCDEF = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc1x89AB), vqmovn_s32(vacc1xCDEF)), voutput_zero_point);
+ const int16x8_t vacc2x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc2x0123), vqmovn_s32(vacc2x4567)), voutput_zero_point);
+ const int16x8_t vacc2x89ABCDEF = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc2x89AB), vqmovn_s32(vacc2xCDEF)), voutput_zero_point);
+ const int16x8_t vacc3x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc3x0123), vqmovn_s32(vacc3x4567)), voutput_zero_point);
+ const int16x8_t vacc3x89ABCDEF = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc3x89AB), vqmovn_s32(vacc3xCDEF)), voutput_zero_point);
+
+ int8x16_t vout0x0123456789ABCDEF = vcombine_s8(vqmovn_s16(vacc0x01234567), vqmovn_s16(vacc0x89ABCDEF));
+ int8x16_t vout1x0123456789ABCDEF = vcombine_s8(vqmovn_s16(vacc1x01234567), vqmovn_s16(vacc1x89ABCDEF));
+ int8x16_t vout2x0123456789ABCDEF = vcombine_s8(vqmovn_s16(vacc2x01234567), vqmovn_s16(vacc2x89ABCDEF));
+ int8x16_t vout3x0123456789ABCDEF = vcombine_s8(vqmovn_s16(vacc3x01234567), vqmovn_s16(vacc3x89ABCDEF));
+#endif
+ const int8x16_t voutput_min = vld1q_dup_s8(¶ms->rndnu_neon.output_min);
+ const int8x16_t voutput_max = vld1q_dup_s8(¶ms->rndnu_neon.output_max);
+
+ vout3x0123456789ABCDEF = vmaxq_s8(vout3x0123456789ABCDEF, voutput_min);
+ vout2x0123456789ABCDEF = vmaxq_s8(vout2x0123456789ABCDEF, voutput_min);
+ vout1x0123456789ABCDEF = vmaxq_s8(vout1x0123456789ABCDEF, voutput_min);
+ vout0x0123456789ABCDEF = vmaxq_s8(vout0x0123456789ABCDEF, voutput_min);
+
+ vout3x0123456789ABCDEF = vminq_s8(vout3x0123456789ABCDEF, voutput_max);
+ vout2x0123456789ABCDEF = vminq_s8(vout2x0123456789ABCDEF, voutput_max);
+ vout1x0123456789ABCDEF = vminq_s8(vout1x0123456789ABCDEF, voutput_max);
+ vout0x0123456789ABCDEF = vminq_s8(vout0x0123456789ABCDEF, voutput_max);
+
+ if (nc >= 16) {
+ vst1q_s8(c3 + 0, vout3x0123456789ABCDEF);
+ vst1q_s8(c2 + 0, vout2x0123456789ABCDEF);
+ vst1q_s8(c1 + 0, vout1x0123456789ABCDEF);
+ vst1q_s8(c0 + 0, vout0x0123456789ABCDEF);
+
+ c3 = (int8_t*) ((uintptr_t) c3 + cn_stride);
+ c2 = (int8_t*) ((uintptr_t) c2 + cn_stride);
+ c1 = (int8_t*) ((uintptr_t) c1 + cn_stride);
+ c0 = (int8_t*) ((uintptr_t) c0 + cn_stride);
+
+ a = (const int8_t**restrict) ((uintptr_t) a - ks);
+
+ nc -= 16;
+ } else {
+ int8x16_t vout2x01234567_3x01234567 = vcombine_s8(vget_low_s8(vout2x0123456789ABCDEF), vget_low_s8(vout3x0123456789ABCDEF));
+ int8x16_t vout0x01234567_1x01234567 = vcombine_s8(vget_low_s8(vout0x0123456789ABCDEF), vget_low_s8(vout1x0123456789ABCDEF));
+ if (nc & 8) {
+ vst1_s8(c3, vget_high_s8(vout2x01234567_3x01234567)); c3 += 8;
+ vst1_s8(c2, vget_low_s8(vout2x01234567_3x01234567)); c2 += 8;
+ vst1_s8(c1, vget_high_s8(vout0x01234567_1x01234567)); c1 += 8;
+ vst1_s8(c0, vget_low_s8(vout0x01234567_1x01234567)); c0 += 8;
+ vout2x01234567_3x01234567 = vcombine_s8(vget_high_s8(vout2x0123456789ABCDEF), vget_high_s8(vout3x0123456789ABCDEF));
+ vout0x01234567_1x01234567 = vcombine_s8(vget_high_s8(vout0x0123456789ABCDEF), vget_high_s8(vout1x0123456789ABCDEF));
+ }
+ if (nc & 4) {
+ vst1q_lane_u32(__builtin_assume_aligned(c3, 1), vreinterpretq_u32_s8(vout2x01234567_3x01234567), 2); c3 += 4;
+ vst1q_lane_u32(__builtin_assume_aligned(c2, 1), vreinterpretq_u32_s8(vout2x01234567_3x01234567), 0); c2 += 4;
+ vst1q_lane_u32(__builtin_assume_aligned(c1, 1), vreinterpretq_u32_s8(vout0x01234567_1x01234567), 2); c1 += 4;
+ vst1q_lane_u32(__builtin_assume_aligned(c0, 1), vreinterpretq_u32_s8(vout0x01234567_1x01234567), 0); c0 += 4;
+ vout2x01234567_3x01234567 = vextq_s8(vout2x01234567_3x01234567, vout2x01234567_3x01234567, 4);
+ vout0x01234567_1x01234567 = vextq_s8(vout0x01234567_1x01234567, vout0x01234567_1x01234567, 4);
+ }
+ if (nc & 2) {
+ vst1q_lane_u16(__builtin_assume_aligned(c3, 1), vreinterpretq_u16_s8(vout2x01234567_3x01234567), 4); c3 += 2;
+ vst1q_lane_u16(__builtin_assume_aligned(c2, 1), vreinterpretq_u16_s8(vout2x01234567_3x01234567), 0); c2 += 2;
+ vst1q_lane_u16(__builtin_assume_aligned(c1, 1), vreinterpretq_u16_s8(vout0x01234567_1x01234567), 4); c1 += 2;
+ vst1q_lane_u16(__builtin_assume_aligned(c0, 1), vreinterpretq_u16_s8(vout0x01234567_1x01234567), 0); c0 += 2;
+ vout2x01234567_3x01234567 = vextq_s8(vout2x01234567_3x01234567, vout2x01234567_3x01234567, 2);
+ vout0x01234567_1x01234567 = vextq_s8(vout0x01234567_1x01234567, vout0x01234567_1x01234567, 2);
+ }
+ if (nc & 1) {
+ vst1q_lane_s8(c3, vout2x01234567_3x01234567, 8);
+ vst1q_lane_s8(c2, vout2x01234567_3x01234567, 0);
+ vst1q_lane_s8(c1, vout0x01234567_1x01234567, 8);
+ vst1q_lane_s8(c0, vout0x01234567_1x01234567, 0);
+ }
+
+ nc = 0;
+ }
+ } while (nc != 0);
+}
diff --git a/src/qs8-igemm/gen/4x16c2s4-minmax-rndnu-neon-mull-padal.c b/src/qs8-igemm/gen/4x16c2s4-minmax-rndnu-neon-mull-padal.c
new file mode 100644
index 0000000..23c0d24
--- /dev/null
+++ b/src/qs8-igemm/gen/4x16c2s4-minmax-rndnu-neon-mull-padal.c
@@ -0,0 +1,581 @@
+// Auto-generated file. Do not edit!
+// Template: src/qs8-igemm/c2-neon-mull-padal-shuffle.c.in
+// Generator: tools/xngen
+//
+// Copyright 2021 Google LLC
+//
+// This source code is licensed under the BSD-style license found in the
+// LICENSE file in the root directory of this source tree.
+
+#include <assert.h>
+
+#include <arm_neon.h>
+
+#include <xnnpack/gemm.h>
+#include <xnnpack/math.h>
+
+
+void xnn_qs8_igemm_minmax_rndnu_ukernel_4x16c2s4__neon_mull_padal(
+ size_t mr,
+ size_t nc,
+ size_t kc,
+ size_t ks,
+ const int8_t** restrict a,
+ const void* restrict w,
+ int8_t* restrict c,
+ size_t cm_stride,
+ size_t cn_stride,
+ size_t a_offset,
+ const int8_t* zero,
+ const union xnn_qs8_conv_minmax_params params[restrict XNN_MIN_ELEMENTS(1)]) XNN_DISABLE_TSAN XNN_DISABLE_MSAN
+{
+ assert(mr != 0);
+ assert(mr <= 4);
+ assert(nc != 0);
+ assert(kc != 0);
+ assert(ks != 0);
+ assert(ks % (4 * sizeof(void*)) == 0);
+ assert(a_offset % sizeof(int8_t) == 0);
+ assert(a != NULL);
+ assert(w != NULL);
+ assert(c != NULL);
+
+ int8_t* c0 = c;
+ int8_t* c1 = (int8_t*) ((uintptr_t) c0 + cm_stride);
+ if XNN_UNPREDICTABLE(mr < 2) {
+ c1 = c0;
+ }
+ int8_t* c2 = (int8_t*) ((uintptr_t) c1 + cm_stride);
+ if XNN_UNPREDICTABLE(mr <= 2) {
+ c2 = c1;
+ }
+ int8_t* c3 = (int8_t*) ((uintptr_t) c2 + cm_stride);
+ if XNN_UNPREDICTABLE(mr != 4) {
+ c3 = c2;
+ }
+
+ do {
+ int32x4_t vacc0x0123 = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc0x4567 = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc0x89AB = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc0xCDEF = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc1x0123 = vacc0x0123;
+ int32x4_t vacc1x4567 = vacc0x4567;
+ int32x4_t vacc1x89AB = vacc0x89AB;
+ int32x4_t vacc1xCDEF = vacc0xCDEF;
+ int32x4_t vacc2x0123 = vacc0x0123;
+ int32x4_t vacc2x4567 = vacc0x4567;
+ int32x4_t vacc2x89AB = vacc0x89AB;
+ int32x4_t vacc2xCDEF = vacc0xCDEF;
+ int32x4_t vacc3x0123 = vacc0x0123;
+ int32x4_t vacc3x4567 = vacc0x4567;
+ int32x4_t vacc3x89AB = vacc0x89AB;
+ int32x4_t vacc3xCDEF = vacc0xCDEF;
+
+ size_t p = ks;
+ do {
+ const int8_t* restrict a0 = a[0];
+ if XNN_UNPREDICTABLE(a0 != zero) {
+ a0 = (const int8_t*) ((uintptr_t) a0 + a_offset);
+ }
+ const int8_t* restrict a1 = a[1];
+ if XNN_UNPREDICTABLE(a1 != zero) {
+ a1 = (const int8_t*) ((uintptr_t) a1 + a_offset);
+ }
+ const int8_t* restrict a2 = a[2];
+ if XNN_UNPREDICTABLE(a2 != zero) {
+ a2 = (const int8_t*) ((uintptr_t) a2 + a_offset);
+ }
+ const int8_t* restrict a3 = a[3];
+ if XNN_UNPREDICTABLE(a3 != zero) {
+ a3 = (const int8_t*) ((uintptr_t) a3 + a_offset);
+ }
+ a += 4;
+
+ size_t k = kc;
+
+
+ while (k >= 8 * sizeof(int8_t)) {
+ int8x8_t va0x0 = vld1_s8(a0); a0 += 8;
+ int8x8_t va1x0 = vld1_s8(a1); a1 += 8;
+ int8x8_t va2x0 = vld1_s8(a2); a2 += 8;
+ int8x8_t va3x0 = vld1_s8(a3); a3 += 8;
+
+ const int8x8_t vb0123c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ int16x8_t vprod0x0123c0 = vmull_s8(vb0123c0x0, va0x0);
+ int16x8_t vprod1x0123c0 = vmull_s8(vb0123c0x0, va1x0);
+ int16x8_t vprod2x0123c0 = vmull_s8(vb0123c0x0, va2x0);
+ int16x8_t vprod3x0123c0 = vmull_s8(vb0123c0x0, va3x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c0);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c0);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c0);
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c0);
+ int16x8_t vprod0x4567c0 = vmull_s8(vb4567c0x0, va0x0);
+ int16x8_t vprod1x4567c0 = vmull_s8(vb4567c0x0, va1x0);
+ int16x8_t vprod2x4567c0 = vmull_s8(vb4567c0x0, va2x0);
+ int16x8_t vprod3x4567c0 = vmull_s8(vb4567c0x0, va3x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c0);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c0);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c0);
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c0);
+ int16x8_t vprod0x89ABc0 = vmull_s8(vb89ABc0x0, va0x0);
+ int16x8_t vprod1x89ABc0 = vmull_s8(vb89ABc0x0, va1x0);
+ int16x8_t vprod2x89ABc0 = vmull_s8(vb89ABc0x0, va2x0);
+ int16x8_t vprod3x89ABc0 = vmull_s8(vb89ABc0x0, va3x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc0);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc0);
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc0);
+ vacc3x89AB = vpadalq_s16(vacc3x89AB, vprod3x89ABc0);
+ int16x8_t vprod0xCDEFc0 = vmull_s8(vbCDEFc0x0, va0x0);
+ int16x8_t vprod1xCDEFc0 = vmull_s8(vbCDEFc0x0, va1x0);
+ int16x8_t vprod2xCDEFc0 = vmull_s8(vbCDEFc0x0, va2x0);
+ int16x8_t vprod3xCDEFc0 = vmull_s8(vbCDEFc0x0, va3x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc0);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc0);
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc0);
+ vacc3xCDEF = vpadalq_s16(vacc3xCDEF, vprod3xCDEFc0);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
+ va3x0 = vext_s8(va3x0, va3x0, 2);
+ int16x8_t vprod0x0123c1 = vmull_s8(vb0123c1x0, va0x0);
+ int16x8_t vprod1x0123c1 = vmull_s8(vb0123c1x0, va1x0);
+ int16x8_t vprod2x0123c1 = vmull_s8(vb0123c1x0, va2x0);
+ int16x8_t vprod3x0123c1 = vmull_s8(vb0123c1x0, va3x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c1);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c1);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c1);
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c1);
+ int16x8_t vprod0x4567c1 = vmull_s8(vb4567c1x0, va0x0);
+ int16x8_t vprod1x4567c1 = vmull_s8(vb4567c1x0, va1x0);
+ int16x8_t vprod2x4567c1 = vmull_s8(vb4567c1x0, va2x0);
+ int16x8_t vprod3x4567c1 = vmull_s8(vb4567c1x0, va3x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c1);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c1);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c1);
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c1);
+ int16x8_t vprod0x89ABc1 = vmull_s8(vb89ABc1x0, va0x0);
+ int16x8_t vprod1x89ABc1 = vmull_s8(vb89ABc1x0, va1x0);
+ int16x8_t vprod2x89ABc1 = vmull_s8(vb89ABc1x0, va2x0);
+ int16x8_t vprod3x89ABc1 = vmull_s8(vb89ABc1x0, va3x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc1);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc1);
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc1);
+ vacc3x89AB = vpadalq_s16(vacc3x89AB, vprod3x89ABc1);
+ int16x8_t vprod0xCDEFc1 = vmull_s8(vbCDEFc1x0, va0x0);
+ int16x8_t vprod1xCDEFc1 = vmull_s8(vbCDEFc1x0, va1x0);
+ int16x8_t vprod2xCDEFc1 = vmull_s8(vbCDEFc1x0, va2x0);
+ int16x8_t vprod3xCDEFc1 = vmull_s8(vbCDEFc1x0, va3x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc1);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc1);
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc1);
+ vacc3xCDEF = vpadalq_s16(vacc3xCDEF, vprod3xCDEFc1);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
+ va3x0 = vext_s8(va3x0, va3x0, 2);
+ int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2x0, va0x0);
+ int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2x0, va1x0);
+ int16x8_t vprod2x0123c2 = vmull_s8(vb0123c2x0, va2x0);
+ int16x8_t vprod3x0123c2 = vmull_s8(vb0123c2x0, va3x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c2);
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c2);
+ int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2x0, va0x0);
+ int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2x0, va1x0);
+ int16x8_t vprod2x4567c2 = vmull_s8(vb4567c2x0, va2x0);
+ int16x8_t vprod3x4567c2 = vmull_s8(vb4567c2x0, va3x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c2);
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c2);
+ int16x8_t vprod0x89ABc2 = vmull_s8(vb89ABc2x0, va0x0);
+ int16x8_t vprod1x89ABc2 = vmull_s8(vb89ABc2x0, va1x0);
+ int16x8_t vprod2x89ABc2 = vmull_s8(vb89ABc2x0, va2x0);
+ int16x8_t vprod3x89ABc2 = vmull_s8(vb89ABc2x0, va3x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc2);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc2);
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc2);
+ vacc3x89AB = vpadalq_s16(vacc3x89AB, vprod3x89ABc2);
+ int16x8_t vprod0xCDEFc2 = vmull_s8(vbCDEFc2x0, va0x0);
+ int16x8_t vprod1xCDEFc2 = vmull_s8(vbCDEFc2x0, va1x0);
+ int16x8_t vprod2xCDEFc2 = vmull_s8(vbCDEFc2x0, va2x0);
+ int16x8_t vprod3xCDEFc2 = vmull_s8(vbCDEFc2x0, va3x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc2);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc2);
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc2);
+ vacc3xCDEF = vpadalq_s16(vacc3xCDEF, vprod3xCDEFc2);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
+ va3x0 = vext_s8(va3x0, va3x0, 2);
+ int16x8_t vprod0x0123c3 = vmull_s8(vb0123c3x0, va0x0);
+ int16x8_t vprod1x0123c3 = vmull_s8(vb0123c3x0, va1x0);
+ int16x8_t vprod2x0123c3 = vmull_s8(vb0123c3x0, va2x0);
+ int16x8_t vprod3x0123c3 = vmull_s8(vb0123c3x0, va3x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c3);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c3);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c3);
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c3);
+ int16x8_t vprod0x4567c3 = vmull_s8(vb4567c3x0, va0x0);
+ int16x8_t vprod1x4567c3 = vmull_s8(vb4567c3x0, va1x0);
+ int16x8_t vprod2x4567c3 = vmull_s8(vb4567c3x0, va2x0);
+ int16x8_t vprod3x4567c3 = vmull_s8(vb4567c3x0, va3x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c3);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c3);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c3);
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c3);
+ int16x8_t vprod0x89ABc3 = vmull_s8(vb89ABc3x0, va0x0);
+ int16x8_t vprod1x89ABc3 = vmull_s8(vb89ABc3x0, va1x0);
+ int16x8_t vprod2x89ABc3 = vmull_s8(vb89ABc3x0, va2x0);
+ int16x8_t vprod3x89ABc3 = vmull_s8(vb89ABc3x0, va3x0);
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc3);
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc3);
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc3);
+ vacc3x89AB = vpadalq_s16(vacc3x89AB, vprod3x89ABc3);
+ int16x8_t vprod0xCDEFc3 = vmull_s8(vbCDEFc3x0, va0x0);
+ int16x8_t vprod1xCDEFc3 = vmull_s8(vbCDEFc3x0, va1x0);
+ int16x8_t vprod2xCDEFc3 = vmull_s8(vbCDEFc3x0, va2x0);
+ int16x8_t vprod3xCDEFc3 = vmull_s8(vbCDEFc3x0, va3x0);
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc3);
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc3);
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc3);
+ vacc3xCDEF = vpadalq_s16(vacc3xCDEF, vprod3xCDEFc3);
+
+ k -= 8 * sizeof(int8_t);
+ }
+
+ if XNN_UNLIKELY(k != 0) {
+ const int8x8_t va0 = vld1_s8(a0); a0 = (const int8_t*) ((uintptr_t) a0 + k);
+ const int8x8_t va1 = vld1_s8(a1); a1 = (const int8_t*) ((uintptr_t) a1 + k);
+ const int8x8_t va2 = vld1_s8(a2); a2 = (const int8_t*) ((uintptr_t) a2 + k);
+ const int8x8_t va3 = vld1_s8(a3); a3 = (const int8_t*) ((uintptr_t) a3 + k);
+
+ const int8x8_t vb0123c0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c0 = vmull_s8(vb0123c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c0);
+ const int16x8_t vprod0x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c0);
+ const int16x8_t vprod0x89ABc0 = vmull_s8(vb89ABc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc0);
+ const int16x8_t vprod0xCDEFc0 = vmull_s8(vbCDEFc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc0);
+ const int16x8_t vprod1x0123c0 = vmull_s8(vb0123c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c0);
+ const int16x8_t vprod1x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c0);
+ const int16x8_t vprod1x89ABc0 = vmull_s8(vb89ABc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0)));
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc0);
+ const int16x8_t vprod1xCDEFc0 = vmull_s8(vbCDEFc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0)));
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc0);
+ const int16x8_t vprod2x0123c0 = vmull_s8(vb0123c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 0)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c0);
+ const int16x8_t vprod2x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 0)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c0);
+ const int16x8_t vprod2x89ABc0 = vmull_s8(vb89ABc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 0)));
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc0);
+ const int16x8_t vprod2xCDEFc0 = vmull_s8(vbCDEFc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 0)));
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc0);
+ const int16x8_t vprod3x0123c0 = vmull_s8(vb0123c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 0)));
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c0);
+ const int16x8_t vprod3x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 0)));
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c0);
+ const int16x8_t vprod3x89ABc0 = vmull_s8(vb89ABc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 0)));
+ vacc3x89AB = vpadalq_s16(vacc3x89AB, vprod3x89ABc0);
+ const int16x8_t vprod3xCDEFc0 = vmull_s8(vbCDEFc0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 0)));
+ vacc3xCDEF = vpadalq_s16(vacc3xCDEF, vprod3xCDEFc0);
+
+ if (k > 2 * sizeof(int8_t)) {
+ const int8x8_t vb0123c1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c1 = vmull_s8(vb0123c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c1);
+ const int16x8_t vprod0x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c1);
+ const int16x8_t vprod0x89ABc1 = vmull_s8(vb89ABc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc1);
+ const int16x8_t vprod0xCDEFc1 = vmull_s8(vbCDEFc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc1);
+ const int16x8_t vprod1x0123c1 = vmull_s8(vb0123c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c1);
+ const int16x8_t vprod1x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c1);
+ const int16x8_t vprod1x89ABc1 = vmull_s8(vb89ABc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1)));
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc1);
+ const int16x8_t vprod1xCDEFc1 = vmull_s8(vbCDEFc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1)));
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc1);
+ const int16x8_t vprod2x0123c1 = vmull_s8(vb0123c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 1)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c1);
+ const int16x8_t vprod2x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 1)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c1);
+ const int16x8_t vprod2x89ABc1 = vmull_s8(vb89ABc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 1)));
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc1);
+ const int16x8_t vprod2xCDEFc1 = vmull_s8(vbCDEFc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 1)));
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc1);
+ const int16x8_t vprod3x0123c1 = vmull_s8(vb0123c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 1)));
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c1);
+ const int16x8_t vprod3x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 1)));
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c1);
+ const int16x8_t vprod3x89ABc1 = vmull_s8(vb89ABc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 1)));
+ vacc3x89AB = vpadalq_s16(vacc3x89AB, vprod3x89ABc1);
+ const int16x8_t vprod3xCDEFc1 = vmull_s8(vbCDEFc1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 1)));
+ vacc3xCDEF = vpadalq_s16(vacc3xCDEF, vprod3xCDEFc1);
+
+ if (k > 4 * sizeof(int8_t)) {
+ const int8x8_t vb0123c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ const int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ const int16x8_t vprod0x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc2);
+ const int16x8_t vprod0xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc2);
+ const int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ const int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ const int16x8_t vprod1x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2)));
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc2);
+ const int16x8_t vprod1xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2)));
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc2);
+ const int16x8_t vprod2x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 2)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c2);
+ const int16x8_t vprod2x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 2)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c2);
+ const int16x8_t vprod2x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 2)));
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc2);
+ const int16x8_t vprod2xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 2)));
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc2);
+ const int16x8_t vprod3x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 2)));
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c2);
+ const int16x8_t vprod3x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 2)));
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c2);
+ const int16x8_t vprod3x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 2)));
+ vacc3x89AB = vpadalq_s16(vacc3x89AB, vprod3x89ABc2);
+ const int16x8_t vprod3xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 2)));
+ vacc3xCDEF = vpadalq_s16(vacc3xCDEF, vprod3xCDEFc2);
+
+ if (k > 6 * sizeof(int8_t)) {
+ const int8x8_t vb0123c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb89ABc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vbCDEFc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ const int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ const int16x8_t vprod0x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc2);
+ const int16x8_t vprod0xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc2);
+ const int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 3)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ const int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 3)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ const int16x8_t vprod1x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 3)));
+ vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc2);
+ const int16x8_t vprod1xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 3)));
+ vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc2);
+ const int16x8_t vprod2x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 3)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c2);
+ const int16x8_t vprod2x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 3)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c2);
+ const int16x8_t vprod2x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 3)));
+ vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc2);
+ const int16x8_t vprod2xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 3)));
+ vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc2);
+ const int16x8_t vprod3x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 3)));
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c2);
+ const int16x8_t vprod3x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 3)));
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c2);
+ const int16x8_t vprod3x89ABc2 = vmull_s8(vb89ABc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 3)));
+ vacc3x89AB = vpadalq_s16(vacc3x89AB, vprod3x89ABc2);
+ const int16x8_t vprod3xCDEFc2 = vmull_s8(vbCDEFc2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 3)));
+ vacc3xCDEF = vpadalq_s16(vacc3xCDEF, vprod3xCDEFc2);
+ }
+ }
+ }
+ }
+ p -= 4 * sizeof(void*);
+ } while (p != 0);
+
+ const int32x4_t vright_pre_shift = vld1q_dup_s32(¶ms->rndnu_neon.right_pre_shift);
+ const int32x4_t vmultiplier = vld1q_dup_s32(¶ms->rndnu_neon.multiplier);
+ const int32x4_t vright_post_shift = vld1q_dup_s32(¶ms->rndnu_neon.right_post_shift);
+
+ vacc0x0123 = vshlq_s32(vacc0x0123, vright_pre_shift);
+ vacc0x4567 = vshlq_s32(vacc0x4567, vright_pre_shift);
+ vacc0x89AB = vshlq_s32(vacc0x89AB, vright_pre_shift);
+ vacc0xCDEF = vshlq_s32(vacc0xCDEF, vright_pre_shift);
+ vacc1x0123 = vshlq_s32(vacc1x0123, vright_pre_shift);
+ vacc1x4567 = vshlq_s32(vacc1x4567, vright_pre_shift);
+ vacc1x89AB = vshlq_s32(vacc1x89AB, vright_pre_shift);
+ vacc1xCDEF = vshlq_s32(vacc1xCDEF, vright_pre_shift);
+ vacc2x0123 = vshlq_s32(vacc2x0123, vright_pre_shift);
+ vacc2x4567 = vshlq_s32(vacc2x4567, vright_pre_shift);
+ vacc2x89AB = vshlq_s32(vacc2x89AB, vright_pre_shift);
+ vacc2xCDEF = vshlq_s32(vacc2xCDEF, vright_pre_shift);
+ vacc3x0123 = vshlq_s32(vacc3x0123, vright_pre_shift);
+ vacc3x4567 = vshlq_s32(vacc3x4567, vright_pre_shift);
+ vacc3x89AB = vshlq_s32(vacc3x89AB, vright_pre_shift);
+ vacc3xCDEF = vshlq_s32(vacc3xCDEF, vright_pre_shift);
+
+ vacc0x0123 = vqdmulhq_s32(vacc0x0123, vmultiplier);
+ vacc0x4567 = vqdmulhq_s32(vacc0x4567, vmultiplier);
+ vacc0x89AB = vqdmulhq_s32(vacc0x89AB, vmultiplier);
+ vacc0xCDEF = vqdmulhq_s32(vacc0xCDEF, vmultiplier);
+ vacc1x0123 = vqdmulhq_s32(vacc1x0123, vmultiplier);
+ vacc1x4567 = vqdmulhq_s32(vacc1x4567, vmultiplier);
+ vacc1x89AB = vqdmulhq_s32(vacc1x89AB, vmultiplier);
+ vacc1xCDEF = vqdmulhq_s32(vacc1xCDEF, vmultiplier);
+ vacc2x0123 = vqdmulhq_s32(vacc2x0123, vmultiplier);
+ vacc2x4567 = vqdmulhq_s32(vacc2x4567, vmultiplier);
+ vacc2x89AB = vqdmulhq_s32(vacc2x89AB, vmultiplier);
+ vacc2xCDEF = vqdmulhq_s32(vacc2xCDEF, vmultiplier);
+ vacc3x0123 = vqdmulhq_s32(vacc3x0123, vmultiplier);
+ vacc3x4567 = vqdmulhq_s32(vacc3x4567, vmultiplier);
+ vacc3x89AB = vqdmulhq_s32(vacc3x89AB, vmultiplier);
+ vacc3xCDEF = vqdmulhq_s32(vacc3xCDEF, vmultiplier);
+
+ vacc0x0123 = vrshlq_s32(vacc0x0123, vright_post_shift);
+ vacc0x4567 = vrshlq_s32(vacc0x4567, vright_post_shift);
+ vacc0x89AB = vrshlq_s32(vacc0x89AB, vright_post_shift);
+ vacc0xCDEF = vrshlq_s32(vacc0xCDEF, vright_post_shift);
+ vacc1x0123 = vrshlq_s32(vacc1x0123, vright_post_shift);
+ vacc1x4567 = vrshlq_s32(vacc1x4567, vright_post_shift);
+ vacc1x89AB = vrshlq_s32(vacc1x89AB, vright_post_shift);
+ vacc1xCDEF = vrshlq_s32(vacc1xCDEF, vright_post_shift);
+ vacc2x0123 = vrshlq_s32(vacc2x0123, vright_post_shift);
+ vacc2x4567 = vrshlq_s32(vacc2x4567, vright_post_shift);
+ vacc2x89AB = vrshlq_s32(vacc2x89AB, vright_post_shift);
+ vacc2xCDEF = vrshlq_s32(vacc2xCDEF, vright_post_shift);
+ vacc3x0123 = vrshlq_s32(vacc3x0123, vright_post_shift);
+ vacc3x4567 = vrshlq_s32(vacc3x4567, vright_post_shift);
+ vacc3x89AB = vrshlq_s32(vacc3x89AB, vright_post_shift);
+ vacc3xCDEF = vrshlq_s32(vacc3xCDEF, vright_post_shift);
+
+ const int16x8_t voutput_zero_point = vld1q_dup_s16(¶ms->rndnu_neon.output_zero_point);
+#if XNN_ARCH_ARM64
+ const int16x8_t vacc0x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc0x0123), vacc0x4567), voutput_zero_point);
+ const int16x8_t vacc0x89ABCDEF = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc0x89AB), vacc0xCDEF), voutput_zero_point);
+ const int16x8_t vacc1x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc1x0123), vacc1x4567), voutput_zero_point);
+ const int16x8_t vacc1x89ABCDEF = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc1x89AB), vacc1xCDEF), voutput_zero_point);
+ const int16x8_t vacc2x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc2x0123), vacc2x4567), voutput_zero_point);
+ const int16x8_t vacc2x89ABCDEF = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc2x89AB), vacc2xCDEF), voutput_zero_point);
+ const int16x8_t vacc3x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc3x0123), vacc3x4567), voutput_zero_point);
+ const int16x8_t vacc3x89ABCDEF = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc3x89AB), vacc3xCDEF), voutput_zero_point);
+
+ int8x16_t vout0x0123456789ABCDEF = vqmovn_high_s16(vqmovn_s16(vacc0x01234567), vacc0x89ABCDEF);
+ int8x16_t vout1x0123456789ABCDEF = vqmovn_high_s16(vqmovn_s16(vacc1x01234567), vacc1x89ABCDEF);
+ int8x16_t vout2x0123456789ABCDEF = vqmovn_high_s16(vqmovn_s16(vacc2x01234567), vacc2x89ABCDEF);
+ int8x16_t vout3x0123456789ABCDEF = vqmovn_high_s16(vqmovn_s16(vacc3x01234567), vacc3x89ABCDEF);
+#else
+ const int16x8_t vacc0x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc0x0123), vqmovn_s32(vacc0x4567)), voutput_zero_point);
+ const int16x8_t vacc0x89ABCDEF = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc0x89AB), vqmovn_s32(vacc0xCDEF)), voutput_zero_point);
+ const int16x8_t vacc1x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc1x0123), vqmovn_s32(vacc1x4567)), voutput_zero_point);
+ const int16x8_t vacc1x89ABCDEF = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc1x89AB), vqmovn_s32(vacc1xCDEF)), voutput_zero_point);
+ const int16x8_t vacc2x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc2x0123), vqmovn_s32(vacc2x4567)), voutput_zero_point);
+ const int16x8_t vacc2x89ABCDEF = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc2x89AB), vqmovn_s32(vacc2xCDEF)), voutput_zero_point);
+ const int16x8_t vacc3x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc3x0123), vqmovn_s32(vacc3x4567)), voutput_zero_point);
+ const int16x8_t vacc3x89ABCDEF = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc3x89AB), vqmovn_s32(vacc3xCDEF)), voutput_zero_point);
+
+ int8x16_t vout0x0123456789ABCDEF = vcombine_s8(vqmovn_s16(vacc0x01234567), vqmovn_s16(vacc0x89ABCDEF));
+ int8x16_t vout1x0123456789ABCDEF = vcombine_s8(vqmovn_s16(vacc1x01234567), vqmovn_s16(vacc1x89ABCDEF));
+ int8x16_t vout2x0123456789ABCDEF = vcombine_s8(vqmovn_s16(vacc2x01234567), vqmovn_s16(vacc2x89ABCDEF));
+ int8x16_t vout3x0123456789ABCDEF = vcombine_s8(vqmovn_s16(vacc3x01234567), vqmovn_s16(vacc3x89ABCDEF));
+#endif
+ const int8x16_t voutput_min = vld1q_dup_s8(¶ms->rndnu_neon.output_min);
+ const int8x16_t voutput_max = vld1q_dup_s8(¶ms->rndnu_neon.output_max);
+
+ vout3x0123456789ABCDEF = vmaxq_s8(vout3x0123456789ABCDEF, voutput_min);
+ vout2x0123456789ABCDEF = vmaxq_s8(vout2x0123456789ABCDEF, voutput_min);
+ vout1x0123456789ABCDEF = vmaxq_s8(vout1x0123456789ABCDEF, voutput_min);
+ vout0x0123456789ABCDEF = vmaxq_s8(vout0x0123456789ABCDEF, voutput_min);
+
+ vout3x0123456789ABCDEF = vminq_s8(vout3x0123456789ABCDEF, voutput_max);
+ vout2x0123456789ABCDEF = vminq_s8(vout2x0123456789ABCDEF, voutput_max);
+ vout1x0123456789ABCDEF = vminq_s8(vout1x0123456789ABCDEF, voutput_max);
+ vout0x0123456789ABCDEF = vminq_s8(vout0x0123456789ABCDEF, voutput_max);
+
+ if (nc >= 16) {
+ vst1q_s8(c3 + 0, vout3x0123456789ABCDEF);
+ vst1q_s8(c2 + 0, vout2x0123456789ABCDEF);
+ vst1q_s8(c1 + 0, vout1x0123456789ABCDEF);
+ vst1q_s8(c0 + 0, vout0x0123456789ABCDEF);
+
+ c3 = (int8_t*) ((uintptr_t) c3 + cn_stride);
+ c2 = (int8_t*) ((uintptr_t) c2 + cn_stride);
+ c1 = (int8_t*) ((uintptr_t) c1 + cn_stride);
+ c0 = (int8_t*) ((uintptr_t) c0 + cn_stride);
+
+ a = (const int8_t**restrict) ((uintptr_t) a - ks);
+
+ nc -= 16;
+ } else {
+ int8x16_t vout2x01234567_3x01234567 = vcombine_s8(vget_low_s8(vout2x0123456789ABCDEF), vget_low_s8(vout3x0123456789ABCDEF));
+ int8x16_t vout0x01234567_1x01234567 = vcombine_s8(vget_low_s8(vout0x0123456789ABCDEF), vget_low_s8(vout1x0123456789ABCDEF));
+ if (nc & 8) {
+ vst1_s8(c3, vget_high_s8(vout2x01234567_3x01234567)); c3 += 8;
+ vst1_s8(c2, vget_low_s8(vout2x01234567_3x01234567)); c2 += 8;
+ vst1_s8(c1, vget_high_s8(vout0x01234567_1x01234567)); c1 += 8;
+ vst1_s8(c0, vget_low_s8(vout0x01234567_1x01234567)); c0 += 8;
+ vout2x01234567_3x01234567 = vcombine_s8(vget_high_s8(vout2x0123456789ABCDEF), vget_high_s8(vout3x0123456789ABCDEF));
+ vout0x01234567_1x01234567 = vcombine_s8(vget_high_s8(vout0x0123456789ABCDEF), vget_high_s8(vout1x0123456789ABCDEF));
+ }
+ if (nc & 4) {
+ vst1q_lane_u32(__builtin_assume_aligned(c3, 1), vreinterpretq_u32_s8(vout2x01234567_3x01234567), 2); c3 += 4;
+ vst1q_lane_u32(__builtin_assume_aligned(c2, 1), vreinterpretq_u32_s8(vout2x01234567_3x01234567), 0); c2 += 4;
+ vst1q_lane_u32(__builtin_assume_aligned(c1, 1), vreinterpretq_u32_s8(vout0x01234567_1x01234567), 2); c1 += 4;
+ vst1q_lane_u32(__builtin_assume_aligned(c0, 1), vreinterpretq_u32_s8(vout0x01234567_1x01234567), 0); c0 += 4;
+ vout2x01234567_3x01234567 = vextq_s8(vout2x01234567_3x01234567, vout2x01234567_3x01234567, 4);
+ vout0x01234567_1x01234567 = vextq_s8(vout0x01234567_1x01234567, vout0x01234567_1x01234567, 4);
+ }
+ if (nc & 2) {
+ vst1q_lane_u16(__builtin_assume_aligned(c3, 1), vreinterpretq_u16_s8(vout2x01234567_3x01234567), 4); c3 += 2;
+ vst1q_lane_u16(__builtin_assume_aligned(c2, 1), vreinterpretq_u16_s8(vout2x01234567_3x01234567), 0); c2 += 2;
+ vst1q_lane_u16(__builtin_assume_aligned(c1, 1), vreinterpretq_u16_s8(vout0x01234567_1x01234567), 4); c1 += 2;
+ vst1q_lane_u16(__builtin_assume_aligned(c0, 1), vreinterpretq_u16_s8(vout0x01234567_1x01234567), 0); c0 += 2;
+ vout2x01234567_3x01234567 = vextq_s8(vout2x01234567_3x01234567, vout2x01234567_3x01234567, 2);
+ vout0x01234567_1x01234567 = vextq_s8(vout0x01234567_1x01234567, vout0x01234567_1x01234567, 2);
+ }
+ if (nc & 1) {
+ vst1q_lane_s8(c3, vout2x01234567_3x01234567, 8);
+ vst1q_lane_s8(c2, vout2x01234567_3x01234567, 0);
+ vst1q_lane_s8(c1, vout0x01234567_1x01234567, 8);
+ vst1q_lane_s8(c0, vout0x01234567_1x01234567, 0);
+ }
+
+ nc = 0;
+ }
+ } while (nc != 0);
+}
diff --git a/src/qs8-igemm/gen/4x8c2s4-minmax-rndnu-neon-mlal-padal.c b/src/qs8-igemm/gen/4x8c2s4-minmax-rndnu-neon-mlal-padal.c
new file mode 100644
index 0000000..50b76ac
--- /dev/null
+++ b/src/qs8-igemm/gen/4x8c2s4-minmax-rndnu-neon-mlal-padal.c
@@ -0,0 +1,529 @@
+// Auto-generated file. Do not edit!
+// Template: src/qs8-igemm/c2-neon-mull-padal-shuffle.c.in
+// Generator: tools/xngen
+//
+// Copyright 2021 Google LLC
+//
+// This source code is licensed under the BSD-style license found in the
+// LICENSE file in the root directory of this source tree.
+
+#include <assert.h>
+
+#include <arm_neon.h>
+
+#include <xnnpack/gemm.h>
+#include <xnnpack/math.h>
+
+
+void xnn_qs8_igemm_minmax_rndnu_ukernel_4x8c2s4__neon_mlal_padal(
+ size_t mr,
+ size_t nc,
+ size_t kc,
+ size_t ks,
+ const int8_t** restrict a,
+ const void* restrict w,
+ int8_t* restrict c,
+ size_t cm_stride,
+ size_t cn_stride,
+ size_t a_offset,
+ const int8_t* zero,
+ const union xnn_qs8_conv_minmax_params params[restrict XNN_MIN_ELEMENTS(1)]) XNN_DISABLE_TSAN XNN_DISABLE_MSAN
+{
+ assert(mr != 0);
+ assert(mr <= 4);
+ assert(nc != 0);
+ assert(kc != 0);
+ assert(ks != 0);
+ assert(ks % (4 * sizeof(void*)) == 0);
+ assert(a_offset % sizeof(int8_t) == 0);
+ assert(a != NULL);
+ assert(w != NULL);
+ assert(c != NULL);
+
+ int8_t* c0 = c;
+ int8_t* c1 = (int8_t*) ((uintptr_t) c0 + cm_stride);
+ if XNN_UNPREDICTABLE(mr < 2) {
+ c1 = c0;
+ }
+ int8_t* c2 = (int8_t*) ((uintptr_t) c1 + cm_stride);
+ if XNN_UNPREDICTABLE(mr <= 2) {
+ c2 = c1;
+ }
+ int8_t* c3 = (int8_t*) ((uintptr_t) c2 + cm_stride);
+ if XNN_UNPREDICTABLE(mr != 4) {
+ c3 = c2;
+ }
+
+ do {
+ int32x4_t vacc0x0123 = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc0x4567 = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc1x0123 = vacc0x0123;
+ int32x4_t vacc1x4567 = vacc0x4567;
+ int32x4_t vacc2x0123 = vacc0x0123;
+ int32x4_t vacc2x4567 = vacc0x4567;
+ int32x4_t vacc3x0123 = vacc0x0123;
+ int32x4_t vacc3x4567 = vacc0x4567;
+
+ size_t p = ks;
+ do {
+ const int8_t* restrict a0 = a[0];
+ if XNN_UNPREDICTABLE(a0 != zero) {
+ a0 = (const int8_t*) ((uintptr_t) a0 + a_offset);
+ }
+ const int8_t* restrict a1 = a[1];
+ if XNN_UNPREDICTABLE(a1 != zero) {
+ a1 = (const int8_t*) ((uintptr_t) a1 + a_offset);
+ }
+ const int8_t* restrict a2 = a[2];
+ if XNN_UNPREDICTABLE(a2 != zero) {
+ a2 = (const int8_t*) ((uintptr_t) a2 + a_offset);
+ }
+ const int8_t* restrict a3 = a[3];
+ if XNN_UNPREDICTABLE(a3 != zero) {
+ a3 = (const int8_t*) ((uintptr_t) a3 + a_offset);
+ }
+ a += 4;
+
+ size_t k = kc;
+
+ while (k >= 16 * sizeof(int8_t)) {
+ int8x8_t va0x0 = vld1_s8(a0); a0 += 8;
+ int8x8_t va0x1 = vld1_s8(a0); a0 += 8;
+ int8x8_t va1x0 = vld1_s8(a1); a1 += 8;
+ int8x8_t va1x1 = vld1_s8(a1); a1 += 8;
+ int8x8_t va2x0 = vld1_s8(a2); a2 += 8;
+ int8x8_t va2x1 = vld1_s8(a2); a2 += 8;
+ int8x8_t va3x0 = vld1_s8(a3); a3 += 8;
+ int8x8_t va3x1 = vld1_s8(a3); a3 += 8;
+
+ const int8x8_t vb0123c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ int16x8_t vprod0x0123c0 = vmull_s8(vb0123c0x0, va0x0);
+ int16x8_t vprod1x0123c0 = vmull_s8(vb0123c0x0, va1x0);
+ int16x8_t vprod2x0123c0 = vmull_s8(vb0123c0x0, va2x0);
+ int16x8_t vprod3x0123c0 = vmull_s8(vb0123c0x0, va3x0);
+ const int8x8_t vb0123c0x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x0123c0 = vmlal_s8(vprod0x0123c0, vb0123c0x1, va0x1);
+ vprod1x0123c0 = vmlal_s8(vprod1x0123c0, vb0123c0x1, va1x1);
+ vprod2x0123c0 = vmlal_s8(vprod2x0123c0, vb0123c0x1, va2x1);
+ vprod3x0123c0 = vmlal_s8(vprod3x0123c0, vb0123c0x1, va3x1);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c0);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c0);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c0);
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c0);
+ int16x8_t vprod0x4567c0 = vmull_s8(vb4567c0x0, va0x0);
+ int16x8_t vprod1x4567c0 = vmull_s8(vb4567c0x0, va1x0);
+ int16x8_t vprod2x4567c0 = vmull_s8(vb4567c0x0, va2x0);
+ int16x8_t vprod3x4567c0 = vmull_s8(vb4567c0x0, va3x0);
+ const int8x8_t vb4567c0x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x4567c0 = vmlal_s8(vprod0x4567c0, vb4567c0x1, va0x1);
+ vprod1x4567c0 = vmlal_s8(vprod1x4567c0, vb4567c0x1, va1x1);
+ vprod2x4567c0 = vmlal_s8(vprod2x4567c0, vb4567c0x1, va2x1);
+ vprod3x4567c0 = vmlal_s8(vprod3x4567c0, vb4567c0x1, va3x1);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c0);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c0);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c0);
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c0);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va0x1 = vext_s8(va0x1, va0x1, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ va1x1 = vext_s8(va1x1, va1x1, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
+ va2x1 = vext_s8(va2x1, va2x1, 2);
+ va3x0 = vext_s8(va3x0, va3x0, 2);
+ va3x1 = vext_s8(va3x1, va3x1, 2);
+ int16x8_t vprod0x0123c1 = vmull_s8(vb0123c1x0, va0x0);
+ int16x8_t vprod1x0123c1 = vmull_s8(vb0123c1x0, va1x0);
+ int16x8_t vprod2x0123c1 = vmull_s8(vb0123c1x0, va2x0);
+ int16x8_t vprod3x0123c1 = vmull_s8(vb0123c1x0, va3x0);
+ const int8x8_t vb0123c1x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x0123c1 = vmlal_s8(vprod0x0123c1, vb0123c1x1, va0x1);
+ vprod1x0123c1 = vmlal_s8(vprod1x0123c1, vb0123c1x1, va1x1);
+ vprod2x0123c1 = vmlal_s8(vprod2x0123c1, vb0123c1x1, va2x1);
+ vprod3x0123c1 = vmlal_s8(vprod3x0123c1, vb0123c1x1, va3x1);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c1);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c1);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c1);
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c1);
+ int16x8_t vprod0x4567c1 = vmull_s8(vb4567c1x0, va0x0);
+ int16x8_t vprod1x4567c1 = vmull_s8(vb4567c1x0, va1x0);
+ int16x8_t vprod2x4567c1 = vmull_s8(vb4567c1x0, va2x0);
+ int16x8_t vprod3x4567c1 = vmull_s8(vb4567c1x0, va3x0);
+ const int8x8_t vb4567c1x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x4567c1 = vmlal_s8(vprod0x4567c1, vb4567c1x1, va0x1);
+ vprod1x4567c1 = vmlal_s8(vprod1x4567c1, vb4567c1x1, va1x1);
+ vprod2x4567c1 = vmlal_s8(vprod2x4567c1, vb4567c1x1, va2x1);
+ vprod3x4567c1 = vmlal_s8(vprod3x4567c1, vb4567c1x1, va3x1);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c1);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c1);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c1);
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c1);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va0x1 = vext_s8(va0x1, va0x1, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ va1x1 = vext_s8(va1x1, va1x1, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
+ va2x1 = vext_s8(va2x1, va2x1, 2);
+ va3x0 = vext_s8(va3x0, va3x0, 2);
+ va3x1 = vext_s8(va3x1, va3x1, 2);
+ int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2x0, va0x0);
+ int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2x0, va1x0);
+ int16x8_t vprod2x0123c2 = vmull_s8(vb0123c2x0, va2x0);
+ int16x8_t vprod3x0123c2 = vmull_s8(vb0123c2x0, va3x0);
+ const int8x8_t vb0123c2x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x0123c2 = vmlal_s8(vprod0x0123c2, vb0123c2x1, va0x1);
+ vprod1x0123c2 = vmlal_s8(vprod1x0123c2, vb0123c2x1, va1x1);
+ vprod2x0123c2 = vmlal_s8(vprod2x0123c2, vb0123c2x1, va2x1);
+ vprod3x0123c2 = vmlal_s8(vprod3x0123c2, vb0123c2x1, va3x1);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c2);
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c2);
+ int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2x0, va0x0);
+ int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2x0, va1x0);
+ int16x8_t vprod2x4567c2 = vmull_s8(vb4567c2x0, va2x0);
+ int16x8_t vprod3x4567c2 = vmull_s8(vb4567c2x0, va3x0);
+ const int8x8_t vb4567c2x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x4567c2 = vmlal_s8(vprod0x4567c2, vb4567c2x1, va0x1);
+ vprod1x4567c2 = vmlal_s8(vprod1x4567c2, vb4567c2x1, va1x1);
+ vprod2x4567c2 = vmlal_s8(vprod2x4567c2, vb4567c2x1, va2x1);
+ vprod3x4567c2 = vmlal_s8(vprod3x4567c2, vb4567c2x1, va3x1);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c2);
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c2);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va0x1 = vext_s8(va0x1, va0x1, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ va1x1 = vext_s8(va1x1, va1x1, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
+ va2x1 = vext_s8(va2x1, va2x1, 2);
+ va3x0 = vext_s8(va3x0, va3x0, 2);
+ va3x1 = vext_s8(va3x1, va3x1, 2);
+ int16x8_t vprod0x0123c3 = vmull_s8(vb0123c3x0, va0x0);
+ int16x8_t vprod1x0123c3 = vmull_s8(vb0123c3x0, va1x0);
+ int16x8_t vprod2x0123c3 = vmull_s8(vb0123c3x0, va2x0);
+ int16x8_t vprod3x0123c3 = vmull_s8(vb0123c3x0, va3x0);
+ const int8x8_t vb0123c3x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x0123c3 = vmlal_s8(vprod0x0123c3, vb0123c3x1, va0x1);
+ vprod1x0123c3 = vmlal_s8(vprod1x0123c3, vb0123c3x1, va1x1);
+ vprod2x0123c3 = vmlal_s8(vprod2x0123c3, vb0123c3x1, va2x1);
+ vprod3x0123c3 = vmlal_s8(vprod3x0123c3, vb0123c3x1, va3x1);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c3);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c3);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c3);
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c3);
+ int16x8_t vprod0x4567c3 = vmull_s8(vb4567c3x0, va0x0);
+ int16x8_t vprod1x4567c3 = vmull_s8(vb4567c3x0, va1x0);
+ int16x8_t vprod2x4567c3 = vmull_s8(vb4567c3x0, va2x0);
+ int16x8_t vprod3x4567c3 = vmull_s8(vb4567c3x0, va3x0);
+ const int8x8_t vb4567c3x1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ vprod0x4567c3 = vmlal_s8(vprod0x4567c3, vb4567c3x1, va0x1);
+ vprod1x4567c3 = vmlal_s8(vprod1x4567c3, vb4567c3x1, va1x1);
+ vprod2x4567c3 = vmlal_s8(vprod2x4567c3, vb4567c3x1, va2x1);
+ vprod3x4567c3 = vmlal_s8(vprod3x4567c3, vb4567c3x1, va3x1);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c3);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c3);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c3);
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c3);
+
+ k -= 16 * sizeof(int8_t);
+ }
+
+ if (k >= 8 * sizeof(int8_t)) {
+ int8x8_t va0x0 = vld1_s8(a0); a0 += 8;
+ int8x8_t va1x0 = vld1_s8(a1); a1 += 8;
+ int8x8_t va2x0 = vld1_s8(a2); a2 += 8;
+ int8x8_t va3x0 = vld1_s8(a3); a3 += 8;
+
+ const int8x8_t vb0123c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ int16x8_t vprod0x0123c0 = vmull_s8(vb0123c0x0, va0x0);
+ int16x8_t vprod1x0123c0 = vmull_s8(vb0123c0x0, va1x0);
+ int16x8_t vprod2x0123c0 = vmull_s8(vb0123c0x0, va2x0);
+ int16x8_t vprod3x0123c0 = vmull_s8(vb0123c0x0, va3x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c0);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c0);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c0);
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c0);
+ int16x8_t vprod0x4567c0 = vmull_s8(vb4567c0x0, va0x0);
+ int16x8_t vprod1x4567c0 = vmull_s8(vb4567c0x0, va1x0);
+ int16x8_t vprod2x4567c0 = vmull_s8(vb4567c0x0, va2x0);
+ int16x8_t vprod3x4567c0 = vmull_s8(vb4567c0x0, va3x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c0);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c0);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c0);
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c0);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
+ va3x0 = vext_s8(va3x0, va3x0, 2);
+ int16x8_t vprod0x0123c1 = vmull_s8(vb0123c1x0, va0x0);
+ int16x8_t vprod1x0123c1 = vmull_s8(vb0123c1x0, va1x0);
+ int16x8_t vprod2x0123c1 = vmull_s8(vb0123c1x0, va2x0);
+ int16x8_t vprod3x0123c1 = vmull_s8(vb0123c1x0, va3x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c1);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c1);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c1);
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c1);
+ int16x8_t vprod0x4567c1 = vmull_s8(vb4567c1x0, va0x0);
+ int16x8_t vprod1x4567c1 = vmull_s8(vb4567c1x0, va1x0);
+ int16x8_t vprod2x4567c1 = vmull_s8(vb4567c1x0, va2x0);
+ int16x8_t vprod3x4567c1 = vmull_s8(vb4567c1x0, va3x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c1);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c1);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c1);
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c1);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
+ va3x0 = vext_s8(va3x0, va3x0, 2);
+ int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2x0, va0x0);
+ int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2x0, va1x0);
+ int16x8_t vprod2x0123c2 = vmull_s8(vb0123c2x0, va2x0);
+ int16x8_t vprod3x0123c2 = vmull_s8(vb0123c2x0, va3x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c2);
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c2);
+ int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2x0, va0x0);
+ int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2x0, va1x0);
+ int16x8_t vprod2x4567c2 = vmull_s8(vb4567c2x0, va2x0);
+ int16x8_t vprod3x4567c2 = vmull_s8(vb4567c2x0, va3x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c2);
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c2);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
+ va3x0 = vext_s8(va3x0, va3x0, 2);
+ int16x8_t vprod0x0123c3 = vmull_s8(vb0123c3x0, va0x0);
+ int16x8_t vprod1x0123c3 = vmull_s8(vb0123c3x0, va1x0);
+ int16x8_t vprod2x0123c3 = vmull_s8(vb0123c3x0, va2x0);
+ int16x8_t vprod3x0123c3 = vmull_s8(vb0123c3x0, va3x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c3);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c3);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c3);
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c3);
+ int16x8_t vprod0x4567c3 = vmull_s8(vb4567c3x0, va0x0);
+ int16x8_t vprod1x4567c3 = vmull_s8(vb4567c3x0, va1x0);
+ int16x8_t vprod2x4567c3 = vmull_s8(vb4567c3x0, va2x0);
+ int16x8_t vprod3x4567c3 = vmull_s8(vb4567c3x0, va3x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c3);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c3);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c3);
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c3);
+
+ k -= 8 * sizeof(int8_t);
+ }
+
+ if XNN_UNLIKELY(k != 0) {
+ const int8x8_t va0 = vld1_s8(a0); a0 = (const int8_t*) ((uintptr_t) a0 + k);
+ const int8x8_t va1 = vld1_s8(a1); a1 = (const int8_t*) ((uintptr_t) a1 + k);
+ const int8x8_t va2 = vld1_s8(a2); a2 = (const int8_t*) ((uintptr_t) a2 + k);
+ const int8x8_t va3 = vld1_s8(a3); a3 = (const int8_t*) ((uintptr_t) a3 + k);
+
+ const int8x8_t vb0123c0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c0 = vmull_s8(vb0123c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c0);
+ const int16x8_t vprod0x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c0);
+ const int16x8_t vprod1x0123c0 = vmull_s8(vb0123c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c0);
+ const int16x8_t vprod1x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c0);
+ const int16x8_t vprod2x0123c0 = vmull_s8(vb0123c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 0)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c0);
+ const int16x8_t vprod2x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 0)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c0);
+ const int16x8_t vprod3x0123c0 = vmull_s8(vb0123c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 0)));
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c0);
+ const int16x8_t vprod3x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 0)));
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c0);
+
+ if (k > 2 * sizeof(int8_t)) {
+ const int8x8_t vb0123c1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c1 = vmull_s8(vb0123c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c1);
+ const int16x8_t vprod0x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c1);
+ const int16x8_t vprod1x0123c1 = vmull_s8(vb0123c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c1);
+ const int16x8_t vprod1x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c1);
+ const int16x8_t vprod2x0123c1 = vmull_s8(vb0123c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 1)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c1);
+ const int16x8_t vprod2x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 1)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c1);
+ const int16x8_t vprod3x0123c1 = vmull_s8(vb0123c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 1)));
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c1);
+ const int16x8_t vprod3x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 1)));
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c1);
+
+ if (k > 4 * sizeof(int8_t)) {
+ const int8x8_t vb0123c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ const int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ const int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ const int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ const int16x8_t vprod2x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 2)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c2);
+ const int16x8_t vprod2x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 2)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c2);
+ const int16x8_t vprod3x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 2)));
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c2);
+ const int16x8_t vprod3x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 2)));
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c2);
+
+ if (k > 6 * sizeof(int8_t)) {
+ const int8x8_t vb0123c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ const int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ const int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 3)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ const int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 3)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ const int16x8_t vprod2x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 3)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c2);
+ const int16x8_t vprod2x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 3)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c2);
+ const int16x8_t vprod3x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 3)));
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c2);
+ const int16x8_t vprod3x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 3)));
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c2);
+ }
+ }
+ }
+ }
+ p -= 4 * sizeof(void*);
+ } while (p != 0);
+
+ const int32x4_t vright_pre_shift = vld1q_dup_s32(¶ms->rndnu_neon.right_pre_shift);
+ const int32x4_t vmultiplier = vld1q_dup_s32(¶ms->rndnu_neon.multiplier);
+ const int32x4_t vright_post_shift = vld1q_dup_s32(¶ms->rndnu_neon.right_post_shift);
+
+ vacc0x0123 = vshlq_s32(vacc0x0123, vright_pre_shift);
+ vacc0x4567 = vshlq_s32(vacc0x4567, vright_pre_shift);
+ vacc1x0123 = vshlq_s32(vacc1x0123, vright_pre_shift);
+ vacc1x4567 = vshlq_s32(vacc1x4567, vright_pre_shift);
+ vacc2x0123 = vshlq_s32(vacc2x0123, vright_pre_shift);
+ vacc2x4567 = vshlq_s32(vacc2x4567, vright_pre_shift);
+ vacc3x0123 = vshlq_s32(vacc3x0123, vright_pre_shift);
+ vacc3x4567 = vshlq_s32(vacc3x4567, vright_pre_shift);
+
+ vacc0x0123 = vqdmulhq_s32(vacc0x0123, vmultiplier);
+ vacc0x4567 = vqdmulhq_s32(vacc0x4567, vmultiplier);
+ vacc1x0123 = vqdmulhq_s32(vacc1x0123, vmultiplier);
+ vacc1x4567 = vqdmulhq_s32(vacc1x4567, vmultiplier);
+ vacc2x0123 = vqdmulhq_s32(vacc2x0123, vmultiplier);
+ vacc2x4567 = vqdmulhq_s32(vacc2x4567, vmultiplier);
+ vacc3x0123 = vqdmulhq_s32(vacc3x0123, vmultiplier);
+ vacc3x4567 = vqdmulhq_s32(vacc3x4567, vmultiplier);
+
+ vacc0x0123 = vrshlq_s32(vacc0x0123, vright_post_shift);
+ vacc0x4567 = vrshlq_s32(vacc0x4567, vright_post_shift);
+ vacc1x0123 = vrshlq_s32(vacc1x0123, vright_post_shift);
+ vacc1x4567 = vrshlq_s32(vacc1x4567, vright_post_shift);
+ vacc2x0123 = vrshlq_s32(vacc2x0123, vright_post_shift);
+ vacc2x4567 = vrshlq_s32(vacc2x4567, vright_post_shift);
+ vacc3x0123 = vrshlq_s32(vacc3x0123, vright_post_shift);
+ vacc3x4567 = vrshlq_s32(vacc3x4567, vright_post_shift);
+
+ const int16x8_t voutput_zero_point = vld1q_dup_s16(¶ms->rndnu_neon.output_zero_point);
+#if XNN_ARCH_ARM64
+ const int16x8_t vacc0x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc0x0123), vacc0x4567), voutput_zero_point);
+ const int16x8_t vacc1x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc1x0123), vacc1x4567), voutput_zero_point);
+ const int16x8_t vacc2x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc2x0123), vacc2x4567), voutput_zero_point);
+ const int16x8_t vacc3x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc3x0123), vacc3x4567), voutput_zero_point);
+
+ int8x16_t vout0x01234567_1x01234567 = vqmovn_high_s16(vqmovn_s16(vacc0x01234567), vacc1x01234567);
+ int8x16_t vout2x01234567_3x01234567 = vqmovn_high_s16(vqmovn_s16(vacc2x01234567), vacc3x01234567);
+#else
+ const int16x8_t vacc0x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc0x0123), vqmovn_s32(vacc0x4567)), voutput_zero_point);
+ const int16x8_t vacc1x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc1x0123), vqmovn_s32(vacc1x4567)), voutput_zero_point);
+ const int16x8_t vacc2x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc2x0123), vqmovn_s32(vacc2x4567)), voutput_zero_point);
+ const int16x8_t vacc3x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc3x0123), vqmovn_s32(vacc3x4567)), voutput_zero_point);
+
+ int8x16_t vout0x01234567_1x01234567 = vcombine_s8(vqmovn_s16(vacc0x01234567), vqmovn_s16(vacc1x01234567));
+ int8x16_t vout2x01234567_3x01234567 = vcombine_s8(vqmovn_s16(vacc2x01234567), vqmovn_s16(vacc3x01234567));
+#endif
+ const int8x16_t voutput_min = vld1q_dup_s8(¶ms->rndnu_neon.output_min);
+ const int8x16_t voutput_max = vld1q_dup_s8(¶ms->rndnu_neon.output_max);
+
+ vout2x01234567_3x01234567 = vmaxq_s8(vout2x01234567_3x01234567, voutput_min);
+ vout0x01234567_1x01234567 = vmaxq_s8(vout0x01234567_1x01234567, voutput_min);
+
+ vout2x01234567_3x01234567 = vminq_s8(vout2x01234567_3x01234567, voutput_max);
+ vout0x01234567_1x01234567 = vminq_s8(vout0x01234567_1x01234567, voutput_max);
+
+ if (nc >= 8) {
+ vst1_s8(c3 + 0, vget_high_s8(vout2x01234567_3x01234567));
+ vst1_s8(c2 + 0, vget_low_s8(vout2x01234567_3x01234567));
+ vst1_s8(c1 + 0, vget_high_s8(vout0x01234567_1x01234567));
+ vst1_s8(c0 + 0, vget_low_s8(vout0x01234567_1x01234567));
+
+ c3 = (int8_t*) ((uintptr_t) c3 + cn_stride);
+ c2 = (int8_t*) ((uintptr_t) c2 + cn_stride);
+ c1 = (int8_t*) ((uintptr_t) c1 + cn_stride);
+ c0 = (int8_t*) ((uintptr_t) c0 + cn_stride);
+
+ a = (const int8_t**restrict) ((uintptr_t) a - ks);
+
+ nc -= 8;
+ } else {
+ if (nc & 4) {
+ vst1q_lane_u32(__builtin_assume_aligned(c3, 1), vreinterpretq_u32_s8(vout2x01234567_3x01234567), 2); c3 += 4;
+ vst1q_lane_u32(__builtin_assume_aligned(c2, 1), vreinterpretq_u32_s8(vout2x01234567_3x01234567), 0); c2 += 4;
+ vst1q_lane_u32(__builtin_assume_aligned(c1, 1), vreinterpretq_u32_s8(vout0x01234567_1x01234567), 2); c1 += 4;
+ vst1q_lane_u32(__builtin_assume_aligned(c0, 1), vreinterpretq_u32_s8(vout0x01234567_1x01234567), 0); c0 += 4;
+ vout2x01234567_3x01234567 = vextq_s8(vout2x01234567_3x01234567, vout2x01234567_3x01234567, 4);
+ vout0x01234567_1x01234567 = vextq_s8(vout0x01234567_1x01234567, vout0x01234567_1x01234567, 4);
+ }
+ if (nc & 2) {
+ vst1q_lane_u16(__builtin_assume_aligned(c3, 1), vreinterpretq_u16_s8(vout2x01234567_3x01234567), 4); c3 += 2;
+ vst1q_lane_u16(__builtin_assume_aligned(c2, 1), vreinterpretq_u16_s8(vout2x01234567_3x01234567), 0); c2 += 2;
+ vst1q_lane_u16(__builtin_assume_aligned(c1, 1), vreinterpretq_u16_s8(vout0x01234567_1x01234567), 4); c1 += 2;
+ vst1q_lane_u16(__builtin_assume_aligned(c0, 1), vreinterpretq_u16_s8(vout0x01234567_1x01234567), 0); c0 += 2;
+ vout2x01234567_3x01234567 = vextq_s8(vout2x01234567_3x01234567, vout2x01234567_3x01234567, 2);
+ vout0x01234567_1x01234567 = vextq_s8(vout0x01234567_1x01234567, vout0x01234567_1x01234567, 2);
+ }
+ if (nc & 1) {
+ vst1q_lane_s8(c3, vout2x01234567_3x01234567, 8);
+ vst1q_lane_s8(c2, vout2x01234567_3x01234567, 0);
+ vst1q_lane_s8(c1, vout0x01234567_1x01234567, 8);
+ vst1q_lane_s8(c0, vout0x01234567_1x01234567, 0);
+ }
+
+ nc = 0;
+ }
+ } while (nc != 0);
+}
diff --git a/src/qs8-igemm/gen/4x8c2s4-minmax-rndnu-neon-mull-padal.c b/src/qs8-igemm/gen/4x8c2s4-minmax-rndnu-neon-mull-padal.c
new file mode 100644
index 0000000..6e474ea
--- /dev/null
+++ b/src/qs8-igemm/gen/4x8c2s4-minmax-rndnu-neon-mull-padal.c
@@ -0,0 +1,379 @@
+// Auto-generated file. Do not edit!
+// Template: src/qs8-igemm/c2-neon-mull-padal-shuffle.c.in
+// Generator: tools/xngen
+//
+// Copyright 2021 Google LLC
+//
+// This source code is licensed under the BSD-style license found in the
+// LICENSE file in the root directory of this source tree.
+
+#include <assert.h>
+
+#include <arm_neon.h>
+
+#include <xnnpack/gemm.h>
+#include <xnnpack/math.h>
+
+
+void xnn_qs8_igemm_minmax_rndnu_ukernel_4x8c2s4__neon_mull_padal(
+ size_t mr,
+ size_t nc,
+ size_t kc,
+ size_t ks,
+ const int8_t** restrict a,
+ const void* restrict w,
+ int8_t* restrict c,
+ size_t cm_stride,
+ size_t cn_stride,
+ size_t a_offset,
+ const int8_t* zero,
+ const union xnn_qs8_conv_minmax_params params[restrict XNN_MIN_ELEMENTS(1)]) XNN_DISABLE_TSAN XNN_DISABLE_MSAN
+{
+ assert(mr != 0);
+ assert(mr <= 4);
+ assert(nc != 0);
+ assert(kc != 0);
+ assert(ks != 0);
+ assert(ks % (4 * sizeof(void*)) == 0);
+ assert(a_offset % sizeof(int8_t) == 0);
+ assert(a != NULL);
+ assert(w != NULL);
+ assert(c != NULL);
+
+ int8_t* c0 = c;
+ int8_t* c1 = (int8_t*) ((uintptr_t) c0 + cm_stride);
+ if XNN_UNPREDICTABLE(mr < 2) {
+ c1 = c0;
+ }
+ int8_t* c2 = (int8_t*) ((uintptr_t) c1 + cm_stride);
+ if XNN_UNPREDICTABLE(mr <= 2) {
+ c2 = c1;
+ }
+ int8_t* c3 = (int8_t*) ((uintptr_t) c2 + cm_stride);
+ if XNN_UNPREDICTABLE(mr != 4) {
+ c3 = c2;
+ }
+
+ do {
+ int32x4_t vacc0x0123 = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc0x4567 = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
+ int32x4_t vacc1x0123 = vacc0x0123;
+ int32x4_t vacc1x4567 = vacc0x4567;
+ int32x4_t vacc2x0123 = vacc0x0123;
+ int32x4_t vacc2x4567 = vacc0x4567;
+ int32x4_t vacc3x0123 = vacc0x0123;
+ int32x4_t vacc3x4567 = vacc0x4567;
+
+ size_t p = ks;
+ do {
+ const int8_t* restrict a0 = a[0];
+ if XNN_UNPREDICTABLE(a0 != zero) {
+ a0 = (const int8_t*) ((uintptr_t) a0 + a_offset);
+ }
+ const int8_t* restrict a1 = a[1];
+ if XNN_UNPREDICTABLE(a1 != zero) {
+ a1 = (const int8_t*) ((uintptr_t) a1 + a_offset);
+ }
+ const int8_t* restrict a2 = a[2];
+ if XNN_UNPREDICTABLE(a2 != zero) {
+ a2 = (const int8_t*) ((uintptr_t) a2 + a_offset);
+ }
+ const int8_t* restrict a3 = a[3];
+ if XNN_UNPREDICTABLE(a3 != zero) {
+ a3 = (const int8_t*) ((uintptr_t) a3 + a_offset);
+ }
+ a += 4;
+
+ size_t k = kc;
+
+
+ while (k >= 8 * sizeof(int8_t)) {
+ int8x8_t va0x0 = vld1_s8(a0); a0 += 8;
+ int8x8_t va1x0 = vld1_s8(a1); a1 += 8;
+ int8x8_t va2x0 = vld1_s8(a2); a2 += 8;
+ int8x8_t va3x0 = vld1_s8(a3); a3 += 8;
+
+ const int8x8_t vb0123c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c0x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c1x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb0123c3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c3x0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ int16x8_t vprod0x0123c0 = vmull_s8(vb0123c0x0, va0x0);
+ int16x8_t vprod1x0123c0 = vmull_s8(vb0123c0x0, va1x0);
+ int16x8_t vprod2x0123c0 = vmull_s8(vb0123c0x0, va2x0);
+ int16x8_t vprod3x0123c0 = vmull_s8(vb0123c0x0, va3x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c0);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c0);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c0);
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c0);
+ int16x8_t vprod0x4567c0 = vmull_s8(vb4567c0x0, va0x0);
+ int16x8_t vprod1x4567c0 = vmull_s8(vb4567c0x0, va1x0);
+ int16x8_t vprod2x4567c0 = vmull_s8(vb4567c0x0, va2x0);
+ int16x8_t vprod3x4567c0 = vmull_s8(vb4567c0x0, va3x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c0);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c0);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c0);
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c0);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
+ va3x0 = vext_s8(va3x0, va3x0, 2);
+ int16x8_t vprod0x0123c1 = vmull_s8(vb0123c1x0, va0x0);
+ int16x8_t vprod1x0123c1 = vmull_s8(vb0123c1x0, va1x0);
+ int16x8_t vprod2x0123c1 = vmull_s8(vb0123c1x0, va2x0);
+ int16x8_t vprod3x0123c1 = vmull_s8(vb0123c1x0, va3x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c1);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c1);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c1);
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c1);
+ int16x8_t vprod0x4567c1 = vmull_s8(vb4567c1x0, va0x0);
+ int16x8_t vprod1x4567c1 = vmull_s8(vb4567c1x0, va1x0);
+ int16x8_t vprod2x4567c1 = vmull_s8(vb4567c1x0, va2x0);
+ int16x8_t vprod3x4567c1 = vmull_s8(vb4567c1x0, va3x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c1);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c1);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c1);
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c1);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
+ va3x0 = vext_s8(va3x0, va3x0, 2);
+ int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2x0, va0x0);
+ int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2x0, va1x0);
+ int16x8_t vprod2x0123c2 = vmull_s8(vb0123c2x0, va2x0);
+ int16x8_t vprod3x0123c2 = vmull_s8(vb0123c2x0, va3x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c2);
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c2);
+ int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2x0, va0x0);
+ int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2x0, va1x0);
+ int16x8_t vprod2x4567c2 = vmull_s8(vb4567c2x0, va2x0);
+ int16x8_t vprod3x4567c2 = vmull_s8(vb4567c2x0, va3x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c2);
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c2);
+ va0x0 = vext_s8(va0x0, va0x0, 2);
+ va1x0 = vext_s8(va1x0, va1x0, 2);
+ va2x0 = vext_s8(va2x0, va2x0, 2);
+ va3x0 = vext_s8(va3x0, va3x0, 2);
+ int16x8_t vprod0x0123c3 = vmull_s8(vb0123c3x0, va0x0);
+ int16x8_t vprod1x0123c3 = vmull_s8(vb0123c3x0, va1x0);
+ int16x8_t vprod2x0123c3 = vmull_s8(vb0123c3x0, va2x0);
+ int16x8_t vprod3x0123c3 = vmull_s8(vb0123c3x0, va3x0);
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c3);
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c3);
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c3);
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c3);
+ int16x8_t vprod0x4567c3 = vmull_s8(vb4567c3x0, va0x0);
+ int16x8_t vprod1x4567c3 = vmull_s8(vb4567c3x0, va1x0);
+ int16x8_t vprod2x4567c3 = vmull_s8(vb4567c3x0, va2x0);
+ int16x8_t vprod3x4567c3 = vmull_s8(vb4567c3x0, va3x0);
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c3);
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c3);
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c3);
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c3);
+
+ k -= 8 * sizeof(int8_t);
+ }
+
+ if XNN_UNLIKELY(k != 0) {
+ const int8x8_t va0 = vld1_s8(a0); a0 = (const int8_t*) ((uintptr_t) a0 + k);
+ const int8x8_t va1 = vld1_s8(a1); a1 = (const int8_t*) ((uintptr_t) a1 + k);
+ const int8x8_t va2 = vld1_s8(a2); a2 = (const int8_t*) ((uintptr_t) a2 + k);
+ const int8x8_t va3 = vld1_s8(a3); a3 = (const int8_t*) ((uintptr_t) a3 + k);
+
+ const int8x8_t vb0123c0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c0 = vmull_s8(vb0123c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c0);
+ const int16x8_t vprod0x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c0);
+ const int16x8_t vprod1x0123c0 = vmull_s8(vb0123c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c0);
+ const int16x8_t vprod1x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c0);
+ const int16x8_t vprod2x0123c0 = vmull_s8(vb0123c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 0)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c0);
+ const int16x8_t vprod2x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 0)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c0);
+ const int16x8_t vprod3x0123c0 = vmull_s8(vb0123c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 0)));
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c0);
+ const int16x8_t vprod3x4567c0 = vmull_s8(vb4567c0, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 0)));
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c0);
+
+ if (k > 2 * sizeof(int8_t)) {
+ const int8x8_t vb0123c1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c1 = vmull_s8(vb0123c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c1);
+ const int16x8_t vprod0x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c1);
+ const int16x8_t vprod1x0123c1 = vmull_s8(vb0123c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c1);
+ const int16x8_t vprod1x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c1);
+ const int16x8_t vprod2x0123c1 = vmull_s8(vb0123c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 1)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c1);
+ const int16x8_t vprod2x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 1)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c1);
+ const int16x8_t vprod3x0123c1 = vmull_s8(vb0123c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 1)));
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c1);
+ const int16x8_t vprod3x4567c1 = vmull_s8(vb4567c1, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 1)));
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c1);
+
+ if (k > 4 * sizeof(int8_t)) {
+ const int8x8_t vb0123c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ const int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ const int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ const int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ const int16x8_t vprod2x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 2)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c2);
+ const int16x8_t vprod2x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 2)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c2);
+ const int16x8_t vprod3x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 2)));
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c2);
+ const int16x8_t vprod3x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 2)));
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c2);
+
+ if (k > 6 * sizeof(int8_t)) {
+ const int8x8_t vb0123c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+ const int8x8_t vb4567c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
+
+ const int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
+ const int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 3)));
+ vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
+ const int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 3)));
+ vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
+ const int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 3)));
+ vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
+ const int16x8_t vprod2x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 3)));
+ vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c2);
+ const int16x8_t vprod2x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 3)));
+ vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c2);
+ const int16x8_t vprod3x0123c2 = vmull_s8(vb0123c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 3)));
+ vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c2);
+ const int16x8_t vprod3x4567c2 = vmull_s8(vb4567c2, vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 3)));
+ vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c2);
+ }
+ }
+ }
+ }
+ p -= 4 * sizeof(void*);
+ } while (p != 0);
+
+ const int32x4_t vright_pre_shift = vld1q_dup_s32(¶ms->rndnu_neon.right_pre_shift);
+ const int32x4_t vmultiplier = vld1q_dup_s32(¶ms->rndnu_neon.multiplier);
+ const int32x4_t vright_post_shift = vld1q_dup_s32(¶ms->rndnu_neon.right_post_shift);
+
+ vacc0x0123 = vshlq_s32(vacc0x0123, vright_pre_shift);
+ vacc0x4567 = vshlq_s32(vacc0x4567, vright_pre_shift);
+ vacc1x0123 = vshlq_s32(vacc1x0123, vright_pre_shift);
+ vacc1x4567 = vshlq_s32(vacc1x4567, vright_pre_shift);
+ vacc2x0123 = vshlq_s32(vacc2x0123, vright_pre_shift);
+ vacc2x4567 = vshlq_s32(vacc2x4567, vright_pre_shift);
+ vacc3x0123 = vshlq_s32(vacc3x0123, vright_pre_shift);
+ vacc3x4567 = vshlq_s32(vacc3x4567, vright_pre_shift);
+
+ vacc0x0123 = vqdmulhq_s32(vacc0x0123, vmultiplier);
+ vacc0x4567 = vqdmulhq_s32(vacc0x4567, vmultiplier);
+ vacc1x0123 = vqdmulhq_s32(vacc1x0123, vmultiplier);
+ vacc1x4567 = vqdmulhq_s32(vacc1x4567, vmultiplier);
+ vacc2x0123 = vqdmulhq_s32(vacc2x0123, vmultiplier);
+ vacc2x4567 = vqdmulhq_s32(vacc2x4567, vmultiplier);
+ vacc3x0123 = vqdmulhq_s32(vacc3x0123, vmultiplier);
+ vacc3x4567 = vqdmulhq_s32(vacc3x4567, vmultiplier);
+
+ vacc0x0123 = vrshlq_s32(vacc0x0123, vright_post_shift);
+ vacc0x4567 = vrshlq_s32(vacc0x4567, vright_post_shift);
+ vacc1x0123 = vrshlq_s32(vacc1x0123, vright_post_shift);
+ vacc1x4567 = vrshlq_s32(vacc1x4567, vright_post_shift);
+ vacc2x0123 = vrshlq_s32(vacc2x0123, vright_post_shift);
+ vacc2x4567 = vrshlq_s32(vacc2x4567, vright_post_shift);
+ vacc3x0123 = vrshlq_s32(vacc3x0123, vright_post_shift);
+ vacc3x4567 = vrshlq_s32(vacc3x4567, vright_post_shift);
+
+ const int16x8_t voutput_zero_point = vld1q_dup_s16(¶ms->rndnu_neon.output_zero_point);
+#if XNN_ARCH_ARM64
+ const int16x8_t vacc0x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc0x0123), vacc0x4567), voutput_zero_point);
+ const int16x8_t vacc1x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc1x0123), vacc1x4567), voutput_zero_point);
+ const int16x8_t vacc2x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc2x0123), vacc2x4567), voutput_zero_point);
+ const int16x8_t vacc3x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc3x0123), vacc3x4567), voutput_zero_point);
+
+ int8x16_t vout0x01234567_1x01234567 = vqmovn_high_s16(vqmovn_s16(vacc0x01234567), vacc1x01234567);
+ int8x16_t vout2x01234567_3x01234567 = vqmovn_high_s16(vqmovn_s16(vacc2x01234567), vacc3x01234567);
+#else
+ const int16x8_t vacc0x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc0x0123), vqmovn_s32(vacc0x4567)), voutput_zero_point);
+ const int16x8_t vacc1x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc1x0123), vqmovn_s32(vacc1x4567)), voutput_zero_point);
+ const int16x8_t vacc2x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc2x0123), vqmovn_s32(vacc2x4567)), voutput_zero_point);
+ const int16x8_t vacc3x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc3x0123), vqmovn_s32(vacc3x4567)), voutput_zero_point);
+
+ int8x16_t vout0x01234567_1x01234567 = vcombine_s8(vqmovn_s16(vacc0x01234567), vqmovn_s16(vacc1x01234567));
+ int8x16_t vout2x01234567_3x01234567 = vcombine_s8(vqmovn_s16(vacc2x01234567), vqmovn_s16(vacc3x01234567));
+#endif
+ const int8x16_t voutput_min = vld1q_dup_s8(¶ms->rndnu_neon.output_min);
+ const int8x16_t voutput_max = vld1q_dup_s8(¶ms->rndnu_neon.output_max);
+
+ vout2x01234567_3x01234567 = vmaxq_s8(vout2x01234567_3x01234567, voutput_min);
+ vout0x01234567_1x01234567 = vmaxq_s8(vout0x01234567_1x01234567, voutput_min);
+
+ vout2x01234567_3x01234567 = vminq_s8(vout2x01234567_3x01234567, voutput_max);
+ vout0x01234567_1x01234567 = vminq_s8(vout0x01234567_1x01234567, voutput_max);
+
+ if (nc >= 8) {
+ vst1_s8(c3 + 0, vget_high_s8(vout2x01234567_3x01234567));
+ vst1_s8(c2 + 0, vget_low_s8(vout2x01234567_3x01234567));
+ vst1_s8(c1 + 0, vget_high_s8(vout0x01234567_1x01234567));
+ vst1_s8(c0 + 0, vget_low_s8(vout0x01234567_1x01234567));
+
+ c3 = (int8_t*) ((uintptr_t) c3 + cn_stride);
+ c2 = (int8_t*) ((uintptr_t) c2 + cn_stride);
+ c1 = (int8_t*) ((uintptr_t) c1 + cn_stride);
+ c0 = (int8_t*) ((uintptr_t) c0 + cn_stride);
+
+ a = (const int8_t**restrict) ((uintptr_t) a - ks);
+
+ nc -= 8;
+ } else {
+ if (nc & 4) {
+ vst1q_lane_u32(__builtin_assume_aligned(c3, 1), vreinterpretq_u32_s8(vout2x01234567_3x01234567), 2); c3 += 4;
+ vst1q_lane_u32(__builtin_assume_aligned(c2, 1), vreinterpretq_u32_s8(vout2x01234567_3x01234567), 0); c2 += 4;
+ vst1q_lane_u32(__builtin_assume_aligned(c1, 1), vreinterpretq_u32_s8(vout0x01234567_1x01234567), 2); c1 += 4;
+ vst1q_lane_u32(__builtin_assume_aligned(c0, 1), vreinterpretq_u32_s8(vout0x01234567_1x01234567), 0); c0 += 4;
+ vout2x01234567_3x01234567 = vextq_s8(vout2x01234567_3x01234567, vout2x01234567_3x01234567, 4);
+ vout0x01234567_1x01234567 = vextq_s8(vout0x01234567_1x01234567, vout0x01234567_1x01234567, 4);
+ }
+ if (nc & 2) {
+ vst1q_lane_u16(__builtin_assume_aligned(c3, 1), vreinterpretq_u16_s8(vout2x01234567_3x01234567), 4); c3 += 2;
+ vst1q_lane_u16(__builtin_assume_aligned(c2, 1), vreinterpretq_u16_s8(vout2x01234567_3x01234567), 0); c2 += 2;
+ vst1q_lane_u16(__builtin_assume_aligned(c1, 1), vreinterpretq_u16_s8(vout0x01234567_1x01234567), 4); c1 += 2;
+ vst1q_lane_u16(__builtin_assume_aligned(c0, 1), vreinterpretq_u16_s8(vout0x01234567_1x01234567), 0); c0 += 2;
+ vout2x01234567_3x01234567 = vextq_s8(vout2x01234567_3x01234567, vout2x01234567_3x01234567, 2);
+ vout0x01234567_1x01234567 = vextq_s8(vout0x01234567_1x01234567, vout0x01234567_1x01234567, 2);
+ }
+ if (nc & 1) {
+ vst1q_lane_s8(c3, vout2x01234567_3x01234567, 8);
+ vst1q_lane_s8(c2, vout2x01234567_3x01234567, 0);
+ vst1q_lane_s8(c1, vout0x01234567_1x01234567, 8);
+ vst1q_lane_s8(c0, vout0x01234567_1x01234567, 0);
+ }
+
+ nc = 0;
+ }
+ } while (nc != 0);
+}