Debian Codegraph @

src/qd8-f32-qc8w-gemm/gen/qd8-f32-qc8w-gemm-6x32-minmax-neoni8mm.c

raw
1 // Auto-generated file. Do not edit!
2 // Template: src/qs8-gemm/c8-neoni8mm.c.in
3 // Generator: tools/xngen
4 //
5 // Copyright 2023 Google LLC
6 //
7 // This source code is licensed under the BSD-style license found in the
8 // LICENSE file in the root directory of this source tree.
9
10 #include <assert.h>
11
12 #include <arm_neon.h>
13
14 #include "xnnpack/gemm.h"
15 #include "xnnpack/math.h"
16
17
18 void xnn_qd8_f32_qc8w_gemm_minmax_ukernel_6x32c8__neoni8mm(
19 size_t mr,
20 size_t nc,
21 size_t kc,
22 const int8_t* restrict a,
23 size_t a_stride,
24 const void* restrict w,
25 float* restrict c,
26 size_t cm_stride,
27 size_t cn_stride,
28 const union xnn_f32_minmax_params params[restrict XNN_MIN_ELEMENTS(1)],
29 const struct xnn_qd8_quantization_params quantization_params[restrict XNN_MIN_ELEMENTS(1)]) XNN_OOB_READS
30 {
31 assert(mr != 0);
32 assert(mr <= 6);
33 assert(nc != 0);
34 assert(kc != 0);
35 assert(kc % sizeof(int8_t) == 0);
36 assert(a != NULL);
37 assert(w != NULL);
38 assert(c != NULL);
39
40 kc = round_up_po2(kc, 8 * sizeof(int8_t));
41 const int8_t* a0 = a;
42 float* c0 = c;
43 const int8_t* a1 = (const int8_t*) ((uintptr_t) a0 + a_stride);
44 float* c1 = (float*) ((uintptr_t) c0 + cm_stride);
45 if XNN_UNPREDICTABLE(mr < 2) {
46 a1 = a0;
47 c1 = c0;
48 }
49 const int8_t* a2 = (const int8_t*) ((uintptr_t) a1 + a_stride);
50 float* c2 = (float*) ((uintptr_t) c1 + cm_stride);
51 if XNN_UNPREDICTABLE(mr <= 2) {
52 a2 = a1;
53 c2 = c1;
54 }
55 const int8_t* a3 = (const int8_t*) ((uintptr_t) a2 + a_stride);
56 float* c3 = (float*) ((uintptr_t) c2 + cm_stride);
57 if XNN_UNPREDICTABLE(mr < 4) {
58 a3 = a2;
59 c3 = c2;
60 }
61 const int8_t* a4 = (const int8_t*) ((uintptr_t) a3 + a_stride);
62 float* c4 = (float*) ((uintptr_t) c3 + cm_stride);
63 if XNN_UNPREDICTABLE(mr <= 4) {
64 a4 = a3;
65 c4 = c3;
66 }
67 const int8_t* a5 = (const int8_t*) ((uintptr_t) a4 + a_stride);
68 float* c5 = (float*) ((uintptr_t) c4 + cm_stride);
69 if XNN_UNPREDICTABLE(mr != 6) {
70 a5 = a4;
71 c5 = c4;
72 }
73
74 // Loop over groups of 32 columns.
75 do {
76 // Initialize accumulators with bias. 32 bias values are loaded from the
77 // weight matrix, at the start of the group of 32 columns.
78 const int32x4_t vinput_zero_point01 = vld1q_s32(&quantization_params[0].zero_point);
79 const int32x4_t vksum0123 = vld1q_s32(w); w = (const int32_t*) w + 4;
80 const int32x4_t vksumzp0x0123 = vmulq_lane_s32(vksum0123, vget_low_s32(vinput_zero_point01), 0);
81 const int32x4_t vksumzp1x0123 = vmulq_lane_s32(vksum0123, vget_high_s32(vinput_zero_point01), 0);
82 const int32x4_t vksum4567 = vld1q_s32(w); w = (const int32_t*) w + 4;
83 const int32x4_t vksumzp0x4567 = vmulq_lane_s32(vksum4567, vget_low_s32(vinput_zero_point01), 0);
84 const int32x4_t vksumzp1x4567 = vmulq_lane_s32(vksum4567, vget_high_s32(vinput_zero_point01), 0);
85 const int32x4_t vksum89AB = vld1q_s32(w); w = (const int32_t*) w + 4;
86 const int32x4_t vksumzp0x89AB = vmulq_lane_s32(vksum89AB, vget_low_s32(vinput_zero_point01), 0);
87 const int32x4_t vksumzp1x89AB = vmulq_lane_s32(vksum89AB, vget_high_s32(vinput_zero_point01), 0);
88 const int32x4_t vksumCDEF = vld1q_s32(w); w = (const int32_t*) w + 4;
89 const int32x4_t vksumzp0xCDEF = vmulq_lane_s32(vksumCDEF, vget_low_s32(vinput_zero_point01), 0);
90 const int32x4_t vksumzp1xCDEF = vmulq_lane_s32(vksumCDEF, vget_high_s32(vinput_zero_point01), 0);
91 const int32x4_t vksumGHIJ = vld1q_s32(w); w = (const int32_t*) w + 4;
92 const int32x4_t vksumzp0xGHIJ = vmulq_lane_s32(vksumGHIJ, vget_low_s32(vinput_zero_point01), 0);
93 const int32x4_t vksumzp1xGHIJ = vmulq_lane_s32(vksumGHIJ, vget_high_s32(vinput_zero_point01), 0);
94 const int32x4_t vksumKLMN = vld1q_s32(w); w = (const int32_t*) w + 4;
95 const int32x4_t vksumzp0xKLMN = vmulq_lane_s32(vksumKLMN, vget_low_s32(vinput_zero_point01), 0);
96 const int32x4_t vksumzp1xKLMN = vmulq_lane_s32(vksumKLMN, vget_high_s32(vinput_zero_point01), 0);
97 const int32x4_t vksumOPQR = vld1q_s32(w); w = (const int32_t*) w + 4;
98 const int32x4_t vksumzp0xOPQR = vmulq_lane_s32(vksumOPQR, vget_low_s32(vinput_zero_point01), 0);
99 const int32x4_t vksumzp1xOPQR = vmulq_lane_s32(vksumOPQR, vget_high_s32(vinput_zero_point01), 0);
100 const int32x4_t vksumSTUV = vld1q_s32(w); w = (const int32_t*) w + 4;
101 const int32x4_t vksumzp0xSTUV = vmulq_lane_s32(vksumSTUV, vget_low_s32(vinput_zero_point01), 0);
102 const int32x4_t vksumzp1xSTUV = vmulq_lane_s32(vksumSTUV, vget_high_s32(vinput_zero_point01), 0);
103 const int32x4_t vinput_zero_point23 = vld1q_s32(&quantization_params[2].zero_point);
104 const int32x4_t vksumzp2x0123 = vmulq_lane_s32(vksum0123, vget_low_s32(vinput_zero_point23), 0);
105 const int32x4_t vksumzp3x0123 = vmulq_lane_s32(vksum0123, vget_high_s32(vinput_zero_point23), 0);
106 const int32x4_t vksumzp2x4567 = vmulq_lane_s32(vksum4567, vget_low_s32(vinput_zero_point23), 0);
107 const int32x4_t vksumzp3x4567 = vmulq_lane_s32(vksum4567, vget_high_s32(vinput_zero_point23), 0);
108 const int32x4_t vksumzp2x89AB = vmulq_lane_s32(vksum89AB, vget_low_s32(vinput_zero_point23), 0);
109 const int32x4_t vksumzp3x89AB = vmulq_lane_s32(vksum89AB, vget_high_s32(vinput_zero_point23), 0);
110 const int32x4_t vksumzp2xCDEF = vmulq_lane_s32(vksumCDEF, vget_low_s32(vinput_zero_point23), 0);
111 const int32x4_t vksumzp3xCDEF = vmulq_lane_s32(vksumCDEF, vget_high_s32(vinput_zero_point23), 0);
112 const int32x4_t vksumzp2xGHIJ = vmulq_lane_s32(vksumGHIJ, vget_low_s32(vinput_zero_point23), 0);
113 const int32x4_t vksumzp3xGHIJ = vmulq_lane_s32(vksumGHIJ, vget_high_s32(vinput_zero_point23), 0);
114 const int32x4_t vksumzp2xKLMN = vmulq_lane_s32(vksumKLMN, vget_low_s32(vinput_zero_point23), 0);
115 const int32x4_t vksumzp3xKLMN = vmulq_lane_s32(vksumKLMN, vget_high_s32(vinput_zero_point23), 0);
116 const int32x4_t vksumzp2xOPQR = vmulq_lane_s32(vksumOPQR, vget_low_s32(vinput_zero_point23), 0);
117 const int32x4_t vksumzp3xOPQR = vmulq_lane_s32(vksumOPQR, vget_high_s32(vinput_zero_point23), 0);
118 const int32x4_t vksumzp2xSTUV = vmulq_lane_s32(vksumSTUV, vget_low_s32(vinput_zero_point23), 0);
119 const int32x4_t vksumzp3xSTUV = vmulq_lane_s32(vksumSTUV, vget_high_s32(vinput_zero_point23), 0);
120 const int32x4_t vinput_zero_point45 = vld1q_s32(&quantization_params[4].zero_point);
121 const int32x4_t vksumzp4x0123 = vmulq_lane_s32(vksum0123, vget_low_s32(vinput_zero_point45), 0);
122 const int32x4_t vksumzp5x0123 = vmulq_lane_s32(vksum0123, vget_high_s32(vinput_zero_point45), 0);
123 const int32x4_t vksumzp4x4567 = vmulq_lane_s32(vksum4567, vget_low_s32(vinput_zero_point45), 0);
124 const int32x4_t vksumzp5x4567 = vmulq_lane_s32(vksum4567, vget_high_s32(vinput_zero_point45), 0);
125 const int32x4_t vksumzp4x89AB = vmulq_lane_s32(vksum89AB, vget_low_s32(vinput_zero_point45), 0);
126 const int32x4_t vksumzp5x89AB = vmulq_lane_s32(vksum89AB, vget_high_s32(vinput_zero_point45), 0);
127 const int32x4_t vksumzp4xCDEF = vmulq_lane_s32(vksumCDEF, vget_low_s32(vinput_zero_point45), 0);
128 const int32x4_t vksumzp5xCDEF = vmulq_lane_s32(vksumCDEF, vget_high_s32(vinput_zero_point45), 0);
129 const int32x4_t vksumzp4xGHIJ = vmulq_lane_s32(vksumGHIJ, vget_low_s32(vinput_zero_point45), 0);
130 const int32x4_t vksumzp5xGHIJ = vmulq_lane_s32(vksumGHIJ, vget_high_s32(vinput_zero_point45), 0);
131 const int32x4_t vksumzp4xKLMN = vmulq_lane_s32(vksumKLMN, vget_low_s32(vinput_zero_point45), 0);
132 const int32x4_t vksumzp5xKLMN = vmulq_lane_s32(vksumKLMN, vget_high_s32(vinput_zero_point45), 0);
133 const int32x4_t vksumzp4xOPQR = vmulq_lane_s32(vksumOPQR, vget_low_s32(vinput_zero_point45), 0);
134 const int32x4_t vksumzp5xOPQR = vmulq_lane_s32(vksumOPQR, vget_high_s32(vinput_zero_point45), 0);
135 const int32x4_t vksumzp4xSTUV = vmulq_lane_s32(vksumSTUV, vget_low_s32(vinput_zero_point45), 0);
136 const int32x4_t vksumzp5xSTUV = vmulq_lane_s32(vksumSTUV, vget_high_s32(vinput_zero_point45), 0);
137
138 int32x4_t vacc01x01 = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp0x0123), vreinterpretq_u64_s32(vksumzp1x0123)));
139 int32x4_t vacc01x23 = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp0x0123), vreinterpretq_u64_s32(vksumzp1x0123)));
140 int32x4_t vacc01x45 = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp0x4567), vreinterpretq_u64_s32(vksumzp1x4567)));
141 int32x4_t vacc01x67 = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp0x4567), vreinterpretq_u64_s32(vksumzp1x4567)));
142 int32x4_t vacc01x89 = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp0x89AB), vreinterpretq_u64_s32(vksumzp1x89AB)));
143 int32x4_t vacc01xAB = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp0x89AB), vreinterpretq_u64_s32(vksumzp1x89AB)));
144 int32x4_t vacc01xCD = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp0xCDEF), vreinterpretq_u64_s32(vksumzp1xCDEF)));
145 int32x4_t vacc01xEF = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp0xCDEF), vreinterpretq_u64_s32(vksumzp1xCDEF)));
146 int32x4_t vacc01xGH = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp0xGHIJ), vreinterpretq_u64_s32(vksumzp1xGHIJ)));
147 int32x4_t vacc01xIJ = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp0xGHIJ), vreinterpretq_u64_s32(vksumzp1xGHIJ)));
148 int32x4_t vacc01xKL = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp0xKLMN), vreinterpretq_u64_s32(vksumzp1xKLMN)));
149 int32x4_t vacc01xMN = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp0xKLMN), vreinterpretq_u64_s32(vksumzp1xKLMN)));
150 int32x4_t vacc01xOP = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp0xOPQR), vreinterpretq_u64_s32(vksumzp1xOPQR)));
151 int32x4_t vacc01xQR = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp0xOPQR), vreinterpretq_u64_s32(vksumzp1xOPQR)));
152 int32x4_t vacc01xST = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp0xSTUV), vreinterpretq_u64_s32(vksumzp1xSTUV)));
153 int32x4_t vacc01xUV = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp0xSTUV), vreinterpretq_u64_s32(vksumzp1xSTUV)));
154 int32x4_t vacc23x01 = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp2x0123), vreinterpretq_u64_s32(vksumzp3x0123)));
155 int32x4_t vacc23x23 = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp2x0123), vreinterpretq_u64_s32(vksumzp3x0123)));
156 int32x4_t vacc23x45 = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp2x4567), vreinterpretq_u64_s32(vksumzp3x4567)));
157 int32x4_t vacc23x67 = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp2x4567), vreinterpretq_u64_s32(vksumzp3x4567)));
158 int32x4_t vacc23x89 = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp2x89AB), vreinterpretq_u64_s32(vksumzp3x89AB)));
159 int32x4_t vacc23xAB = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp2x89AB), vreinterpretq_u64_s32(vksumzp3x89AB)));
160 int32x4_t vacc23xCD = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp2xCDEF), vreinterpretq_u64_s32(vksumzp3xCDEF)));
161 int32x4_t vacc23xEF = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp2xCDEF), vreinterpretq_u64_s32(vksumzp3xCDEF)));
162 int32x4_t vacc23xGH = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp2xGHIJ), vreinterpretq_u64_s32(vksumzp3xGHIJ)));
163 int32x4_t vacc23xIJ = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp2xGHIJ), vreinterpretq_u64_s32(vksumzp3xGHIJ)));
164 int32x4_t vacc23xKL = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp2xKLMN), vreinterpretq_u64_s32(vksumzp3xKLMN)));
165 int32x4_t vacc23xMN = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp2xKLMN), vreinterpretq_u64_s32(vksumzp3xKLMN)));
166 int32x4_t vacc23xOP = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp2xOPQR), vreinterpretq_u64_s32(vksumzp3xOPQR)));
167 int32x4_t vacc23xQR = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp2xOPQR), vreinterpretq_u64_s32(vksumzp3xOPQR)));
168 int32x4_t vacc23xST = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp2xSTUV), vreinterpretq_u64_s32(vksumzp3xSTUV)));
169 int32x4_t vacc23xUV = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp2xSTUV), vreinterpretq_u64_s32(vksumzp3xSTUV)));
170 int32x4_t vacc45x01 = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp4x0123), vreinterpretq_u64_s32(vksumzp5x0123)));
171 int32x4_t vacc45x23 = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp4x0123), vreinterpretq_u64_s32(vksumzp5x0123)));
172 int32x4_t vacc45x45 = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp4x4567), vreinterpretq_u64_s32(vksumzp5x4567)));
173 int32x4_t vacc45x67 = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp4x4567), vreinterpretq_u64_s32(vksumzp5x4567)));
174 int32x4_t vacc45x89 = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp4x89AB), vreinterpretq_u64_s32(vksumzp5x89AB)));
175 int32x4_t vacc45xAB = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp4x89AB), vreinterpretq_u64_s32(vksumzp5x89AB)));
176 int32x4_t vacc45xCD = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp4xCDEF), vreinterpretq_u64_s32(vksumzp5xCDEF)));
177 int32x4_t vacc45xEF = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp4xCDEF), vreinterpretq_u64_s32(vksumzp5xCDEF)));
178 int32x4_t vacc45xGH = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp4xGHIJ), vreinterpretq_u64_s32(vksumzp5xGHIJ)));
179 int32x4_t vacc45xIJ = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp4xGHIJ), vreinterpretq_u64_s32(vksumzp5xGHIJ)));
180 int32x4_t vacc45xKL = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp4xKLMN), vreinterpretq_u64_s32(vksumzp5xKLMN)));
181 int32x4_t vacc45xMN = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp4xKLMN), vreinterpretq_u64_s32(vksumzp5xKLMN)));
182 int32x4_t vacc45xOP = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp4xOPQR), vreinterpretq_u64_s32(vksumzp5xOPQR)));
183 int32x4_t vacc45xQR = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp4xOPQR), vreinterpretq_u64_s32(vksumzp5xOPQR)));
184 int32x4_t vacc45xST = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp4xSTUV), vreinterpretq_u64_s32(vksumzp5xSTUV)));
185 int32x4_t vacc45xUV = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp4xSTUV), vreinterpretq_u64_s32(vksumzp5xSTUV)));
186
187 // Inner accumulation loop along the 32 columns.
188 size_t k = kc;
189 // 2x partial unrolled loop to load 8 bytes at a time.
190
191 uint64x2x2_t va01x0123456789ABCDEF;
192 va01x0123456789ABCDEF.val[0] = vdupq_n_u64(0);
193 va01x0123456789ABCDEF.val[1] = vdupq_n_u64(0);
194 uint64x2x2_t va23x0123456789ABCDEF;
195 va23x0123456789ABCDEF.val[0] = vdupq_n_u64(0);
196 va23x0123456789ABCDEF.val[1] = vdupq_n_u64(0);
197 uint64x2x2_t va45x0123456789ABCDEF;
198 va45x0123456789ABCDEF.val[0] = vdupq_n_u64(0);
199 va45x0123456789ABCDEF.val[1] = vdupq_n_u64(0);
200
201 while (k >= 16 * sizeof(int8_t)) {
202 // Load a 6x16 block of activations.
203 va01x0123456789ABCDEF = vld2q_lane_u64((const void*) a0, va01x0123456789ABCDEF, 0); a0 += 16;
204 va23x0123456789ABCDEF = vld2q_lane_u64((const void*) a2, va23x0123456789ABCDEF, 0); a2 += 16;
205 va45x0123456789ABCDEF = vld2q_lane_u64((const void*) a4, va45x0123456789ABCDEF, 0); a4 += 16;
206 va01x0123456789ABCDEF = vld2q_lane_u64((const void*) a1, va01x0123456789ABCDEF, 1); a1 += 16;
207 va23x0123456789ABCDEF = vld2q_lane_u64((const void*) a3, va23x0123456789ABCDEF, 1); a3 += 16;
208 va45x0123456789ABCDEF = vld2q_lane_u64((const void*) a5, va45x0123456789ABCDEF, 1); a5 += 16;
209
210 const int8x16_t va01x01234567 = vreinterpretq_s8_u64(va01x0123456789ABCDEF.val[0]);
211 const int8x16_t va01x89ABCDEF = vreinterpretq_s8_u64(va01x0123456789ABCDEF.val[1]);
212 const int8x16_t va23x01234567 = vreinterpretq_s8_u64(va23x0123456789ABCDEF.val[0]);
213 const int8x16_t va23x89ABCDEF = vreinterpretq_s8_u64(va23x0123456789ABCDEF.val[1]);
214 const int8x16_t va45x01234567 = vreinterpretq_s8_u64(va45x0123456789ABCDEF.val[0]);
215 const int8x16_t va45x89ABCDEF = vreinterpretq_s8_u64(va45x0123456789ABCDEF.val[1]);
216
217 // Load a 16x32 block of weights.
218 const int8x16_t vb01x01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
219 const int8x16_t vb23x01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
220 const int8x16_t vb45x01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
221 const int8x16_t vb67x01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
222 const int8x16_t vb89x01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
223 const int8x16_t vbABx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
224 const int8x16_t vbCDx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
225 const int8x16_t vbEFx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
226 const int8x16_t vbGHx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
227 const int8x16_t vbIJx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
228 const int8x16_t vbKLx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
229 const int8x16_t vbMNx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
230 const int8x16_t vbOPx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
231 const int8x16_t vbQRx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
232 const int8x16_t vbSTx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
233 const int8x16_t vbUVx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
234 const int8x16_t vb01x89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
235 const int8x16_t vb23x89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
236 const int8x16_t vb45x89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
237 const int8x16_t vb67x89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
238 const int8x16_t vb89x89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
239 const int8x16_t vbABx89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
240 const int8x16_t vbCDx89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
241 const int8x16_t vbEFx89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
242 const int8x16_t vbGHx89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
243 const int8x16_t vbIJx89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
244 const int8x16_t vbKLx89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
245 const int8x16_t vbMNx89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
246 const int8x16_t vbOPx89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
247 const int8x16_t vbQRx89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
248 const int8x16_t vbSTx89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
249 const int8x16_t vbUVx89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
250
251 // Multiply-accumulate: 6x8 * 8x32 --> 6x32.
252 vacc01x01 = vmmlaq_s32(vacc01x01, va01x01234567, vb01x01234567);
253 vacc01x23 = vmmlaq_s32(vacc01x23, va01x01234567, vb23x01234567);
254 vacc01x45 = vmmlaq_s32(vacc01x45, va01x01234567, vb45x01234567);
255 vacc01x67 = vmmlaq_s32(vacc01x67, va01x01234567, vb67x01234567);
256 vacc01x89 = vmmlaq_s32(vacc01x89, va01x01234567, vb89x01234567);
257 vacc01xAB = vmmlaq_s32(vacc01xAB, va01x01234567, vbABx01234567);
258 vacc01xCD = vmmlaq_s32(vacc01xCD, va01x01234567, vbCDx01234567);
259 vacc01xEF = vmmlaq_s32(vacc01xEF, va01x01234567, vbEFx01234567);
260 vacc01xGH = vmmlaq_s32(vacc01xGH, va01x01234567, vbGHx01234567);
261 vacc01xIJ = vmmlaq_s32(vacc01xIJ, va01x01234567, vbIJx01234567);
262 vacc01xKL = vmmlaq_s32(vacc01xKL, va01x01234567, vbKLx01234567);
263 vacc01xMN = vmmlaq_s32(vacc01xMN, va01x01234567, vbMNx01234567);
264 vacc01xOP = vmmlaq_s32(vacc01xOP, va01x01234567, vbOPx01234567);
265 vacc01xQR = vmmlaq_s32(vacc01xQR, va01x01234567, vbQRx01234567);
266 vacc01xST = vmmlaq_s32(vacc01xST, va01x01234567, vbSTx01234567);
267 vacc01xUV = vmmlaq_s32(vacc01xUV, va01x01234567, vbUVx01234567);
268 vacc23x01 = vmmlaq_s32(vacc23x01, va23x01234567, vb01x01234567);
269 vacc23x23 = vmmlaq_s32(vacc23x23, va23x01234567, vb23x01234567);
270 vacc23x45 = vmmlaq_s32(vacc23x45, va23x01234567, vb45x01234567);
271 vacc23x67 = vmmlaq_s32(vacc23x67, va23x01234567, vb67x01234567);
272 vacc23x89 = vmmlaq_s32(vacc23x89, va23x01234567, vb89x01234567);
273 vacc23xAB = vmmlaq_s32(vacc23xAB, va23x01234567, vbABx01234567);
274 vacc23xCD = vmmlaq_s32(vacc23xCD, va23x01234567, vbCDx01234567);
275 vacc23xEF = vmmlaq_s32(vacc23xEF, va23x01234567, vbEFx01234567);
276 vacc23xGH = vmmlaq_s32(vacc23xGH, va23x01234567, vbGHx01234567);
277 vacc23xIJ = vmmlaq_s32(vacc23xIJ, va23x01234567, vbIJx01234567);
278 vacc23xKL = vmmlaq_s32(vacc23xKL, va23x01234567, vbKLx01234567);
279 vacc23xMN = vmmlaq_s32(vacc23xMN, va23x01234567, vbMNx01234567);
280 vacc23xOP = vmmlaq_s32(vacc23xOP, va23x01234567, vbOPx01234567);
281 vacc23xQR = vmmlaq_s32(vacc23xQR, va23x01234567, vbQRx01234567);
282 vacc23xST = vmmlaq_s32(vacc23xST, va23x01234567, vbSTx01234567);
283 vacc23xUV = vmmlaq_s32(vacc23xUV, va23x01234567, vbUVx01234567);
284 vacc45x01 = vmmlaq_s32(vacc45x01, va45x01234567, vb01x01234567);
285 vacc45x23 = vmmlaq_s32(vacc45x23, va45x01234567, vb23x01234567);
286 vacc45x45 = vmmlaq_s32(vacc45x45, va45x01234567, vb45x01234567);
287 vacc45x67 = vmmlaq_s32(vacc45x67, va45x01234567, vb67x01234567);
288 vacc45x89 = vmmlaq_s32(vacc45x89, va45x01234567, vb89x01234567);
289 vacc45xAB = vmmlaq_s32(vacc45xAB, va45x01234567, vbABx01234567);
290 vacc45xCD = vmmlaq_s32(vacc45xCD, va45x01234567, vbCDx01234567);
291 vacc45xEF = vmmlaq_s32(vacc45xEF, va45x01234567, vbEFx01234567);
292 vacc45xGH = vmmlaq_s32(vacc45xGH, va45x01234567, vbGHx01234567);
293 vacc45xIJ = vmmlaq_s32(vacc45xIJ, va45x01234567, vbIJx01234567);
294 vacc45xKL = vmmlaq_s32(vacc45xKL, va45x01234567, vbKLx01234567);
295 vacc45xMN = vmmlaq_s32(vacc45xMN, va45x01234567, vbMNx01234567);
296 vacc45xOP = vmmlaq_s32(vacc45xOP, va45x01234567, vbOPx01234567);
297 vacc45xQR = vmmlaq_s32(vacc45xQR, va45x01234567, vbQRx01234567);
298 vacc45xST = vmmlaq_s32(vacc45xST, va45x01234567, vbSTx01234567);
299 vacc45xUV = vmmlaq_s32(vacc45xUV, va45x01234567, vbUVx01234567);
300 vacc01x01 = vmmlaq_s32(vacc01x01, va01x89ABCDEF, vb01x89ABCDEF);
301 vacc01x23 = vmmlaq_s32(vacc01x23, va01x89ABCDEF, vb23x89ABCDEF);
302 vacc01x45 = vmmlaq_s32(vacc01x45, va01x89ABCDEF, vb45x89ABCDEF);
303 vacc01x67 = vmmlaq_s32(vacc01x67, va01x89ABCDEF, vb67x89ABCDEF);
304 vacc01x89 = vmmlaq_s32(vacc01x89, va01x89ABCDEF, vb89x89ABCDEF);
305 vacc01xAB = vmmlaq_s32(vacc01xAB, va01x89ABCDEF, vbABx89ABCDEF);
306 vacc01xCD = vmmlaq_s32(vacc01xCD, va01x89ABCDEF, vbCDx89ABCDEF);
307 vacc01xEF = vmmlaq_s32(vacc01xEF, va01x89ABCDEF, vbEFx89ABCDEF);
308 vacc01xGH = vmmlaq_s32(vacc01xGH, va01x89ABCDEF, vbGHx89ABCDEF);
309 vacc01xIJ = vmmlaq_s32(vacc01xIJ, va01x89ABCDEF, vbIJx89ABCDEF);
310 vacc01xKL = vmmlaq_s32(vacc01xKL, va01x89ABCDEF, vbKLx89ABCDEF);
311 vacc01xMN = vmmlaq_s32(vacc01xMN, va01x89ABCDEF, vbMNx89ABCDEF);
312 vacc01xOP = vmmlaq_s32(vacc01xOP, va01x89ABCDEF, vbOPx89ABCDEF);
313 vacc01xQR = vmmlaq_s32(vacc01xQR, va01x89ABCDEF, vbQRx89ABCDEF);
314 vacc01xST = vmmlaq_s32(vacc01xST, va01x89ABCDEF, vbSTx89ABCDEF);
315 vacc01xUV = vmmlaq_s32(vacc01xUV, va01x89ABCDEF, vbUVx89ABCDEF);
316 vacc23x01 = vmmlaq_s32(vacc23x01, va23x89ABCDEF, vb01x89ABCDEF);
317 vacc23x23 = vmmlaq_s32(vacc23x23, va23x89ABCDEF, vb23x89ABCDEF);
318 vacc23x45 = vmmlaq_s32(vacc23x45, va23x89ABCDEF, vb45x89ABCDEF);
319 vacc23x67 = vmmlaq_s32(vacc23x67, va23x89ABCDEF, vb67x89ABCDEF);
320 vacc23x89 = vmmlaq_s32(vacc23x89, va23x89ABCDEF, vb89x89ABCDEF);
321 vacc23xAB = vmmlaq_s32(vacc23xAB, va23x89ABCDEF, vbABx89ABCDEF);
322 vacc23xCD = vmmlaq_s32(vacc23xCD, va23x89ABCDEF, vbCDx89ABCDEF);
323 vacc23xEF = vmmlaq_s32(vacc23xEF, va23x89ABCDEF, vbEFx89ABCDEF);
324 vacc23xGH = vmmlaq_s32(vacc23xGH, va23x89ABCDEF, vbGHx89ABCDEF);
325 vacc23xIJ = vmmlaq_s32(vacc23xIJ, va23x89ABCDEF, vbIJx89ABCDEF);
326 vacc23xKL = vmmlaq_s32(vacc23xKL, va23x89ABCDEF, vbKLx89ABCDEF);
327 vacc23xMN = vmmlaq_s32(vacc23xMN, va23x89ABCDEF, vbMNx89ABCDEF);
328 vacc23xOP = vmmlaq_s32(vacc23xOP, va23x89ABCDEF, vbOPx89ABCDEF);
329 vacc23xQR = vmmlaq_s32(vacc23xQR, va23x89ABCDEF, vbQRx89ABCDEF);
330 vacc23xST = vmmlaq_s32(vacc23xST, va23x89ABCDEF, vbSTx89ABCDEF);
331 vacc23xUV = vmmlaq_s32(vacc23xUV, va23x89ABCDEF, vbUVx89ABCDEF);
332 vacc45x01 = vmmlaq_s32(vacc45x01, va45x89ABCDEF, vb01x89ABCDEF);
333 vacc45x23 = vmmlaq_s32(vacc45x23, va45x89ABCDEF, vb23x89ABCDEF);
334 vacc45x45 = vmmlaq_s32(vacc45x45, va45x89ABCDEF, vb45x89ABCDEF);
335 vacc45x67 = vmmlaq_s32(vacc45x67, va45x89ABCDEF, vb67x89ABCDEF);
336 vacc45x89 = vmmlaq_s32(vacc45x89, va45x89ABCDEF, vb89x89ABCDEF);
337 vacc45xAB = vmmlaq_s32(vacc45xAB, va45x89ABCDEF, vbABx89ABCDEF);
338 vacc45xCD = vmmlaq_s32(vacc45xCD, va45x89ABCDEF, vbCDx89ABCDEF);
339 vacc45xEF = vmmlaq_s32(vacc45xEF, va45x89ABCDEF, vbEFx89ABCDEF);
340 vacc45xGH = vmmlaq_s32(vacc45xGH, va45x89ABCDEF, vbGHx89ABCDEF);
341 vacc45xIJ = vmmlaq_s32(vacc45xIJ, va45x89ABCDEF, vbIJx89ABCDEF);
342 vacc45xKL = vmmlaq_s32(vacc45xKL, va45x89ABCDEF, vbKLx89ABCDEF);
343 vacc45xMN = vmmlaq_s32(vacc45xMN, va45x89ABCDEF, vbMNx89ABCDEF);
344 vacc45xOP = vmmlaq_s32(vacc45xOP, va45x89ABCDEF, vbOPx89ABCDEF);
345 vacc45xQR = vmmlaq_s32(vacc45xQR, va45x89ABCDEF, vbQRx89ABCDEF);
346 vacc45xST = vmmlaq_s32(vacc45xST, va45x89ABCDEF, vbSTx89ABCDEF);
347 vacc45xUV = vmmlaq_s32(vacc45xUV, va45x89ABCDEF, vbUVx89ABCDEF);
348
349 k -= 16 * sizeof(int8_t);
350 }
351 // Handle up to 8 final positions of `k`
352 if XNN_UNLIKELY(k != 0) {
353 // Load a 6x8 block of activations.
354 uint64x2_t va01x01234567 = vld1q_dup_u64((const void*) a0); a0 += 8;
355 uint64x2_t va23x01234567 = vld1q_dup_u64((const void*) a2); a2 += 8;
356 uint64x2_t va45x01234567 = vld1q_dup_u64((const void*) a4); a4 += 8;
357 va01x01234567 = vld1q_lane_u64((const void*) a1, va01x01234567, 1); a1 += 8;
358 va23x01234567 = vld1q_lane_u64((const void*) a3, va23x01234567, 1); a3 += 8;
359 va45x01234567 = vld1q_lane_u64((const void*) a5, va45x01234567, 1); a5 += 8;
360
361 // Load a 16x32 block of weights.
362 const int8x16_t vb01x01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
363 const int8x16_t vb23x01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
364 const int8x16_t vb45x01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
365 const int8x16_t vb67x01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
366 const int8x16_t vb89x01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
367 const int8x16_t vbABx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
368 const int8x16_t vbCDx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
369 const int8x16_t vbEFx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
370 const int8x16_t vbGHx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
371 const int8x16_t vbIJx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
372 const int8x16_t vbKLx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
373 const int8x16_t vbMNx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
374 const int8x16_t vbOPx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
375 const int8x16_t vbQRx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
376 const int8x16_t vbSTx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
377 const int8x16_t vbUVx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
378
379 // Multiply-accumulate: 6x4 * 4x32 --> 6x32.
380 vacc01x01 = vmmlaq_s32(vacc01x01, vreinterpretq_s8_u64(va01x01234567), vb01x01234567);
381 vacc01x23 = vmmlaq_s32(vacc01x23, vreinterpretq_s8_u64(va01x01234567), vb23x01234567);
382 vacc01x45 = vmmlaq_s32(vacc01x45, vreinterpretq_s8_u64(va01x01234567), vb45x01234567);
383 vacc01x67 = vmmlaq_s32(vacc01x67, vreinterpretq_s8_u64(va01x01234567), vb67x01234567);
384 vacc01x89 = vmmlaq_s32(vacc01x89, vreinterpretq_s8_u64(va01x01234567), vb89x01234567);
385 vacc01xAB = vmmlaq_s32(vacc01xAB, vreinterpretq_s8_u64(va01x01234567), vbABx01234567);
386 vacc01xCD = vmmlaq_s32(vacc01xCD, vreinterpretq_s8_u64(va01x01234567), vbCDx01234567);
387 vacc01xEF = vmmlaq_s32(vacc01xEF, vreinterpretq_s8_u64(va01x01234567), vbEFx01234567);
388 vacc01xGH = vmmlaq_s32(vacc01xGH, vreinterpretq_s8_u64(va01x01234567), vbGHx01234567);
389 vacc01xIJ = vmmlaq_s32(vacc01xIJ, vreinterpretq_s8_u64(va01x01234567), vbIJx01234567);
390 vacc01xKL = vmmlaq_s32(vacc01xKL, vreinterpretq_s8_u64(va01x01234567), vbKLx01234567);
391 vacc01xMN = vmmlaq_s32(vacc01xMN, vreinterpretq_s8_u64(va01x01234567), vbMNx01234567);
392 vacc01xOP = vmmlaq_s32(vacc01xOP, vreinterpretq_s8_u64(va01x01234567), vbOPx01234567);
393 vacc01xQR = vmmlaq_s32(vacc01xQR, vreinterpretq_s8_u64(va01x01234567), vbQRx01234567);
394 vacc01xST = vmmlaq_s32(vacc01xST, vreinterpretq_s8_u64(va01x01234567), vbSTx01234567);
395 vacc01xUV = vmmlaq_s32(vacc01xUV, vreinterpretq_s8_u64(va01x01234567), vbUVx01234567);
396 vacc23x01 = vmmlaq_s32(vacc23x01, vreinterpretq_s8_u64(va23x01234567), vb01x01234567);
397 vacc23x23 = vmmlaq_s32(vacc23x23, vreinterpretq_s8_u64(va23x01234567), vb23x01234567);
398 vacc23x45 = vmmlaq_s32(vacc23x45, vreinterpretq_s8_u64(va23x01234567), vb45x01234567);
399 vacc23x67 = vmmlaq_s32(vacc23x67, vreinterpretq_s8_u64(va23x01234567), vb67x01234567);
400 vacc23x89 = vmmlaq_s32(vacc23x89, vreinterpretq_s8_u64(va23x01234567), vb89x01234567);
401 vacc23xAB = vmmlaq_s32(vacc23xAB, vreinterpretq_s8_u64(va23x01234567), vbABx01234567);
402 vacc23xCD = vmmlaq_s32(vacc23xCD, vreinterpretq_s8_u64(va23x01234567), vbCDx01234567);
403 vacc23xEF = vmmlaq_s32(vacc23xEF, vreinterpretq_s8_u64(va23x01234567), vbEFx01234567);
404 vacc23xGH = vmmlaq_s32(vacc23xGH, vreinterpretq_s8_u64(va23x01234567), vbGHx01234567);
405 vacc23xIJ = vmmlaq_s32(vacc23xIJ, vreinterpretq_s8_u64(va23x01234567), vbIJx01234567);
406 vacc23xKL = vmmlaq_s32(vacc23xKL, vreinterpretq_s8_u64(va23x01234567), vbKLx01234567);
407 vacc23xMN = vmmlaq_s32(vacc23xMN, vreinterpretq_s8_u64(va23x01234567), vbMNx01234567);
408 vacc23xOP = vmmlaq_s32(vacc23xOP, vreinterpretq_s8_u64(va23x01234567), vbOPx01234567);
409 vacc23xQR = vmmlaq_s32(vacc23xQR, vreinterpretq_s8_u64(va23x01234567), vbQRx01234567);
410 vacc23xST = vmmlaq_s32(vacc23xST, vreinterpretq_s8_u64(va23x01234567), vbSTx01234567);
411 vacc23xUV = vmmlaq_s32(vacc23xUV, vreinterpretq_s8_u64(va23x01234567), vbUVx01234567);
412 vacc45x01 = vmmlaq_s32(vacc45x01, vreinterpretq_s8_u64(va45x01234567), vb01x01234567);
413 vacc45x23 = vmmlaq_s32(vacc45x23, vreinterpretq_s8_u64(va45x01234567), vb23x01234567);
414 vacc45x45 = vmmlaq_s32(vacc45x45, vreinterpretq_s8_u64(va45x01234567), vb45x01234567);
415 vacc45x67 = vmmlaq_s32(vacc45x67, vreinterpretq_s8_u64(va45x01234567), vb67x01234567);
416 vacc45x89 = vmmlaq_s32(vacc45x89, vreinterpretq_s8_u64(va45x01234567), vb89x01234567);
417 vacc45xAB = vmmlaq_s32(vacc45xAB, vreinterpretq_s8_u64(va45x01234567), vbABx01234567);
418 vacc45xCD = vmmlaq_s32(vacc45xCD, vreinterpretq_s8_u64(va45x01234567), vbCDx01234567);
419 vacc45xEF = vmmlaq_s32(vacc45xEF, vreinterpretq_s8_u64(va45x01234567), vbEFx01234567);
420 vacc45xGH = vmmlaq_s32(vacc45xGH, vreinterpretq_s8_u64(va45x01234567), vbGHx01234567);
421 vacc45xIJ = vmmlaq_s32(vacc45xIJ, vreinterpretq_s8_u64(va45x01234567), vbIJx01234567);
422 vacc45xKL = vmmlaq_s32(vacc45xKL, vreinterpretq_s8_u64(va45x01234567), vbKLx01234567);
423 vacc45xMN = vmmlaq_s32(vacc45xMN, vreinterpretq_s8_u64(va45x01234567), vbMNx01234567);
424 vacc45xOP = vmmlaq_s32(vacc45xOP, vreinterpretq_s8_u64(va45x01234567), vbOPx01234567);
425 vacc45xQR = vmmlaq_s32(vacc45xQR, vreinterpretq_s8_u64(va45x01234567), vbQRx01234567);
426 vacc45xST = vmmlaq_s32(vacc45xST, vreinterpretq_s8_u64(va45x01234567), vbSTx01234567);
427 vacc45xUV = vmmlaq_s32(vacc45xUV, vreinterpretq_s8_u64(va45x01234567), vbUVx01234567);
428 }
429
430 int32x4_t vacc0x0123 = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc01x01), vreinterpretq_u64_s32(vacc01x23)));
431 int32x4_t vacc1x0123 = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vacc01x01), vreinterpretq_u64_s32(vacc01x23)));
432 int32x4_t vacc0x4567 = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc01x45), vreinterpretq_u64_s32(vacc01x67)));
433 int32x4_t vacc1x4567 = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vacc01x45), vreinterpretq_u64_s32(vacc01x67)));
434 int32x4_t vacc0x89AB = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc01x89), vreinterpretq_u64_s32(vacc01xAB)));
435 int32x4_t vacc1x89AB = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vacc01x89), vreinterpretq_u64_s32(vacc01xAB)));
436 int32x4_t vacc0xCDEF = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc01xCD), vreinterpretq_u64_s32(vacc01xEF)));
437 int32x4_t vacc1xCDEF = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vacc01xCD), vreinterpretq_u64_s32(vacc01xEF)));
438 int32x4_t vacc0xGHIJ = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc01xGH), vreinterpretq_u64_s32(vacc01xIJ)));
439 int32x4_t vacc1xGHIJ = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vacc01xGH), vreinterpretq_u64_s32(vacc01xIJ)));
440 int32x4_t vacc0xKLMN = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc01xKL), vreinterpretq_u64_s32(vacc01xMN)));
441 int32x4_t vacc1xKLMN = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vacc01xKL), vreinterpretq_u64_s32(vacc01xMN)));
442 int32x4_t vacc0xOPQR = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc01xOP), vreinterpretq_u64_s32(vacc01xQR)));
443 int32x4_t vacc1xOPQR = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vacc01xOP), vreinterpretq_u64_s32(vacc01xQR)));
444 int32x4_t vacc0xSTUV = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc01xST), vreinterpretq_u64_s32(vacc01xUV)));
445 int32x4_t vacc1xSTUV = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vacc01xST), vreinterpretq_u64_s32(vacc01xUV)));
446 int32x4_t vacc2x0123 = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc23x01), vreinterpretq_u64_s32(vacc23x23)));
447 int32x4_t vacc3x0123 = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vacc23x01), vreinterpretq_u64_s32(vacc23x23)));
448 int32x4_t vacc2x4567 = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc23x45), vreinterpretq_u64_s32(vacc23x67)));
449 int32x4_t vacc3x4567 = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vacc23x45), vreinterpretq_u64_s32(vacc23x67)));
450 int32x4_t vacc2x89AB = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc23x89), vreinterpretq_u64_s32(vacc23xAB)));
451 int32x4_t vacc3x89AB = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vacc23x89), vreinterpretq_u64_s32(vacc23xAB)));
452 int32x4_t vacc2xCDEF = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc23xCD), vreinterpretq_u64_s32(vacc23xEF)));
453 int32x4_t vacc3xCDEF = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vacc23xCD), vreinterpretq_u64_s32(vacc23xEF)));
454 int32x4_t vacc2xGHIJ = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc23xGH), vreinterpretq_u64_s32(vacc23xIJ)));
455 int32x4_t vacc3xGHIJ = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vacc23xGH), vreinterpretq_u64_s32(vacc23xIJ)));
456 int32x4_t vacc2xKLMN = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc23xKL), vreinterpretq_u64_s32(vacc23xMN)));
457 int32x4_t vacc3xKLMN = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vacc23xKL), vreinterpretq_u64_s32(vacc23xMN)));
458 int32x4_t vacc2xOPQR = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc23xOP), vreinterpretq_u64_s32(vacc23xQR)));
459 int32x4_t vacc3xOPQR = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vacc23xOP), vreinterpretq_u64_s32(vacc23xQR)));
460 int32x4_t vacc2xSTUV = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc23xST), vreinterpretq_u64_s32(vacc23xUV)));
461 int32x4_t vacc3xSTUV = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vacc23xST), vreinterpretq_u64_s32(vacc23xUV)));
462 int32x4_t vacc4x0123 = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc45x01), vreinterpretq_u64_s32(vacc45x23)));
463 int32x4_t vacc5x0123 = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vacc45x01), vreinterpretq_u64_s32(vacc45x23)));
464 int32x4_t vacc4x4567 = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc45x45), vreinterpretq_u64_s32(vacc45x67)));
465 int32x4_t vacc5x4567 = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vacc45x45), vreinterpretq_u64_s32(vacc45x67)));
466 int32x4_t vacc4x89AB = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc45x89), vreinterpretq_u64_s32(vacc45xAB)));
467 int32x4_t vacc5x89AB = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vacc45x89), vreinterpretq_u64_s32(vacc45xAB)));
468 int32x4_t vacc4xCDEF = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc45xCD), vreinterpretq_u64_s32(vacc45xEF)));
469 int32x4_t vacc5xCDEF = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vacc45xCD), vreinterpretq_u64_s32(vacc45xEF)));
470 int32x4_t vacc4xGHIJ = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc45xGH), vreinterpretq_u64_s32(vacc45xIJ)));
471 int32x4_t vacc5xGHIJ = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vacc45xGH), vreinterpretq_u64_s32(vacc45xIJ)));
472 int32x4_t vacc4xKLMN = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc45xKL), vreinterpretq_u64_s32(vacc45xMN)));
473 int32x4_t vacc5xKLMN = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vacc45xKL), vreinterpretq_u64_s32(vacc45xMN)));
474 int32x4_t vacc4xOPQR = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc45xOP), vreinterpretq_u64_s32(vacc45xQR)));
475 int32x4_t vacc5xOPQR = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vacc45xOP), vreinterpretq_u64_s32(vacc45xQR)));
476 int32x4_t vacc4xSTUV = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc45xST), vreinterpretq_u64_s32(vacc45xUV)));
477 int32x4_t vacc5xSTUV = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vacc45xST), vreinterpretq_u64_s32(vacc45xUV)));
478 float32x4_t vout0x0123 = vcvtq_f32_s32(vacc0x0123);
479 float32x4_t vout0x4567 = vcvtq_f32_s32(vacc0x4567);
480 float32x4_t vout0x89AB = vcvtq_f32_s32(vacc0x89AB);
481 float32x4_t vout0xCDEF = vcvtq_f32_s32(vacc0xCDEF);
482 float32x4_t vout0xGHIJ = vcvtq_f32_s32(vacc0xGHIJ);
483 float32x4_t vout0xKLMN = vcvtq_f32_s32(vacc0xKLMN);
484 float32x4_t vout0xOPQR = vcvtq_f32_s32(vacc0xOPQR);
485 float32x4_t vout0xSTUV = vcvtq_f32_s32(vacc0xSTUV);
486 float32x4_t vout1x0123 = vcvtq_f32_s32(vacc1x0123);
487 float32x4_t vout1x4567 = vcvtq_f32_s32(vacc1x4567);
488 float32x4_t vout1x89AB = vcvtq_f32_s32(vacc1x89AB);
489 float32x4_t vout1xCDEF = vcvtq_f32_s32(vacc1xCDEF);
490 float32x4_t vout1xGHIJ = vcvtq_f32_s32(vacc1xGHIJ);
491 float32x4_t vout1xKLMN = vcvtq_f32_s32(vacc1xKLMN);
492 float32x4_t vout1xOPQR = vcvtq_f32_s32(vacc1xOPQR);
493 float32x4_t vout1xSTUV = vcvtq_f32_s32(vacc1xSTUV);
494 float32x4_t vout2x0123 = vcvtq_f32_s32(vacc2x0123);
495 float32x4_t vout2x4567 = vcvtq_f32_s32(vacc2x4567);
496 float32x4_t vout2x89AB = vcvtq_f32_s32(vacc2x89AB);
497 float32x4_t vout2xCDEF = vcvtq_f32_s32(vacc2xCDEF);
498 float32x4_t vout2xGHIJ = vcvtq_f32_s32(vacc2xGHIJ);
499 float32x4_t vout2xKLMN = vcvtq_f32_s32(vacc2xKLMN);
500 float32x4_t vout2xOPQR = vcvtq_f32_s32(vacc2xOPQR);
501 float32x4_t vout2xSTUV = vcvtq_f32_s32(vacc2xSTUV);
502 float32x4_t vout3x0123 = vcvtq_f32_s32(vacc3x0123);
503 float32x4_t vout3x4567 = vcvtq_f32_s32(vacc3x4567);
504 float32x4_t vout3x89AB = vcvtq_f32_s32(vacc3x89AB);
505 float32x4_t vout3xCDEF = vcvtq_f32_s32(vacc3xCDEF);
506 float32x4_t vout3xGHIJ = vcvtq_f32_s32(vacc3xGHIJ);
507 float32x4_t vout3xKLMN = vcvtq_f32_s32(vacc3xKLMN);
508 float32x4_t vout3xOPQR = vcvtq_f32_s32(vacc3xOPQR);
509 float32x4_t vout3xSTUV = vcvtq_f32_s32(vacc3xSTUV);
510 float32x4_t vout4x0123 = vcvtq_f32_s32(vacc4x0123);
511 float32x4_t vout4x4567 = vcvtq_f32_s32(vacc4x4567);
512 float32x4_t vout4x89AB = vcvtq_f32_s32(vacc4x89AB);
513 float32x4_t vout4xCDEF = vcvtq_f32_s32(vacc4xCDEF);
514 float32x4_t vout4xGHIJ = vcvtq_f32_s32(vacc4xGHIJ);
515 float32x4_t vout4xKLMN = vcvtq_f32_s32(vacc4xKLMN);
516 float32x4_t vout4xOPQR = vcvtq_f32_s32(vacc4xOPQR);
517 float32x4_t vout4xSTUV = vcvtq_f32_s32(vacc4xSTUV);
518 float32x4_t vout5x0123 = vcvtq_f32_s32(vacc5x0123);
519 float32x4_t vout5x4567 = vcvtq_f32_s32(vacc5x4567);
520 float32x4_t vout5x89AB = vcvtq_f32_s32(vacc5x89AB);
521 float32x4_t vout5xCDEF = vcvtq_f32_s32(vacc5xCDEF);
522 float32x4_t vout5xGHIJ = vcvtq_f32_s32(vacc5xGHIJ);
523 float32x4_t vout5xKLMN = vcvtq_f32_s32(vacc5xKLMN);
524 float32x4_t vout5xOPQR = vcvtq_f32_s32(vacc5xOPQR);
525 float32x4_t vout5xSTUV = vcvtq_f32_s32(vacc5xSTUV);
526
527 const float32x4_t vinput_scale01 = vreinterpretq_f32_s32(vld1q_s32(&quantization_params[0].zero_point));
528 vout0x0123 = vmulq_lane_f32(vout0x0123, vget_low_f32(vinput_scale01), 1);
529 vout1x0123 = vmulq_lane_f32(vout1x0123, vget_high_f32(vinput_scale01), 1);
530 vout0x4567 = vmulq_lane_f32(vout0x4567, vget_low_f32(vinput_scale01), 1);
531 vout1x4567 = vmulq_lane_f32(vout1x4567, vget_high_f32(vinput_scale01), 1);
532 vout0x89AB = vmulq_lane_f32(vout0x89AB, vget_low_f32(vinput_scale01), 1);
533 vout1x89AB = vmulq_lane_f32(vout1x89AB, vget_high_f32(vinput_scale01), 1);
534 vout0xCDEF = vmulq_lane_f32(vout0xCDEF, vget_low_f32(vinput_scale01), 1);
535 vout1xCDEF = vmulq_lane_f32(vout1xCDEF, vget_high_f32(vinput_scale01), 1);
536 vout0xGHIJ = vmulq_lane_f32(vout0xGHIJ, vget_low_f32(vinput_scale01), 1);
537 vout1xGHIJ = vmulq_lane_f32(vout1xGHIJ, vget_high_f32(vinput_scale01), 1);
538 vout0xKLMN = vmulq_lane_f32(vout0xKLMN, vget_low_f32(vinput_scale01), 1);
539 vout1xKLMN = vmulq_lane_f32(vout1xKLMN, vget_high_f32(vinput_scale01), 1);
540 vout0xOPQR = vmulq_lane_f32(vout0xOPQR, vget_low_f32(vinput_scale01), 1);
541 vout1xOPQR = vmulq_lane_f32(vout1xOPQR, vget_high_f32(vinput_scale01), 1);
542 vout0xSTUV = vmulq_lane_f32(vout0xSTUV, vget_low_f32(vinput_scale01), 1);
543 vout1xSTUV = vmulq_lane_f32(vout1xSTUV, vget_high_f32(vinput_scale01), 1);
544 const float32x4_t vinput_scale23 = vreinterpretq_f32_s32(vld1q_s32(&quantization_params[2].zero_point));
545 vout2x0123 = vmulq_lane_f32(vout2x0123, vget_low_f32(vinput_scale23), 1);
546 vout3x0123 = vmulq_lane_f32(vout3x0123, vget_high_f32(vinput_scale23), 1);
547 vout2x4567 = vmulq_lane_f32(vout2x4567, vget_low_f32(vinput_scale23), 1);
548 vout3x4567 = vmulq_lane_f32(vout3x4567, vget_high_f32(vinput_scale23), 1);
549 vout2x89AB = vmulq_lane_f32(vout2x89AB, vget_low_f32(vinput_scale23), 1);
550 vout3x89AB = vmulq_lane_f32(vout3x89AB, vget_high_f32(vinput_scale23), 1);
551 vout2xCDEF = vmulq_lane_f32(vout2xCDEF, vget_low_f32(vinput_scale23), 1);
552 vout3xCDEF = vmulq_lane_f32(vout3xCDEF, vget_high_f32(vinput_scale23), 1);
553 vout2xGHIJ = vmulq_lane_f32(vout2xGHIJ, vget_low_f32(vinput_scale23), 1);
554 vout3xGHIJ = vmulq_lane_f32(vout3xGHIJ, vget_high_f32(vinput_scale23), 1);
555 vout2xKLMN = vmulq_lane_f32(vout2xKLMN, vget_low_f32(vinput_scale23), 1);
556 vout3xKLMN = vmulq_lane_f32(vout3xKLMN, vget_high_f32(vinput_scale23), 1);
557 vout2xOPQR = vmulq_lane_f32(vout2xOPQR, vget_low_f32(vinput_scale23), 1);
558 vout3xOPQR = vmulq_lane_f32(vout3xOPQR, vget_high_f32(vinput_scale23), 1);
559 vout2xSTUV = vmulq_lane_f32(vout2xSTUV, vget_low_f32(vinput_scale23), 1);
560 vout3xSTUV = vmulq_lane_f32(vout3xSTUV, vget_high_f32(vinput_scale23), 1);
561 const float32x4_t vinput_scale45 = vreinterpretq_f32_s32(vld1q_s32(&quantization_params[4].zero_point));
562 vout4x0123 = vmulq_lane_f32(vout4x0123, vget_low_f32(vinput_scale45), 1);
563 vout5x0123 = vmulq_lane_f32(vout5x0123, vget_high_f32(vinput_scale45), 1);
564 vout4x4567 = vmulq_lane_f32(vout4x4567, vget_low_f32(vinput_scale45), 1);
565 vout5x4567 = vmulq_lane_f32(vout5x4567, vget_high_f32(vinput_scale45), 1);
566 vout4x89AB = vmulq_lane_f32(vout4x89AB, vget_low_f32(vinput_scale45), 1);
567 vout5x89AB = vmulq_lane_f32(vout5x89AB, vget_high_f32(vinput_scale45), 1);
568 vout4xCDEF = vmulq_lane_f32(vout4xCDEF, vget_low_f32(vinput_scale45), 1);
569 vout5xCDEF = vmulq_lane_f32(vout5xCDEF, vget_high_f32(vinput_scale45), 1);
570 vout4xGHIJ = vmulq_lane_f32(vout4xGHIJ, vget_low_f32(vinput_scale45), 1);
571 vout5xGHIJ = vmulq_lane_f32(vout5xGHIJ, vget_high_f32(vinput_scale45), 1);
572 vout4xKLMN = vmulq_lane_f32(vout4xKLMN, vget_low_f32(vinput_scale45), 1);
573 vout5xKLMN = vmulq_lane_f32(vout5xKLMN, vget_high_f32(vinput_scale45), 1);
574 vout4xOPQR = vmulq_lane_f32(vout4xOPQR, vget_low_f32(vinput_scale45), 1);
575 vout5xOPQR = vmulq_lane_f32(vout5xOPQR, vget_high_f32(vinput_scale45), 1);
576 vout4xSTUV = vmulq_lane_f32(vout4xSTUV, vget_low_f32(vinput_scale45), 1);
577 vout5xSTUV = vmulq_lane_f32(vout5xSTUV, vget_high_f32(vinput_scale45), 1);
578
579 const float32x4_t vfilter_output_scale0123 = vld1q_f32(w); w = (const float*) w + 4;
580 const float32x4_t vfilter_output_scale4567 = vld1q_f32(w); w = (const float*) w + 4;
581 const float32x4_t vfilter_output_scale89AB = vld1q_f32(w); w = (const float*) w + 4;
582 const float32x4_t vfilter_output_scaleCDEF = vld1q_f32(w); w = (const float*) w + 4;
583 const float32x4_t vfilter_output_scaleGHIJ = vld1q_f32(w); w = (const float*) w + 4;
584 const float32x4_t vfilter_output_scaleKLMN = vld1q_f32(w); w = (const float*) w + 4;
585 const float32x4_t vfilter_output_scaleOPQR = vld1q_f32(w); w = (const float*) w + 4;
586 const float32x4_t vfilter_output_scaleSTUV = vld1q_f32(w); w = (const float*) w + 4;
587
588 const float32x4_t vbias0123 = vld1q_f32(w); w = (const float*) w + 4;
589 vout0x0123 = vfmaq_f32(vbias0123, vout0x0123, vfilter_output_scale0123);
590 vout1x0123 = vfmaq_f32(vbias0123, vout1x0123, vfilter_output_scale0123);
591 vout2x0123 = vfmaq_f32(vbias0123, vout2x0123, vfilter_output_scale0123);
592 vout3x0123 = vfmaq_f32(vbias0123, vout3x0123, vfilter_output_scale0123);
593 vout4x0123 = vfmaq_f32(vbias0123, vout4x0123, vfilter_output_scale0123);
594 vout5x0123 = vfmaq_f32(vbias0123, vout5x0123, vfilter_output_scale0123);
595 const float32x4_t vbias4567 = vld1q_f32(w); w = (const float*) w + 4;
596 vout0x4567 = vfmaq_f32(vbias4567, vout0x4567, vfilter_output_scale4567);
597 vout1x4567 = vfmaq_f32(vbias4567, vout1x4567, vfilter_output_scale4567);
598 vout2x4567 = vfmaq_f32(vbias4567, vout2x4567, vfilter_output_scale4567);
599 vout3x4567 = vfmaq_f32(vbias4567, vout3x4567, vfilter_output_scale4567);
600 vout4x4567 = vfmaq_f32(vbias4567, vout4x4567, vfilter_output_scale4567);
601 vout5x4567 = vfmaq_f32(vbias4567, vout5x4567, vfilter_output_scale4567);
602 const float32x4_t vbias89AB = vld1q_f32(w); w = (const float*) w + 4;
603 vout0x89AB = vfmaq_f32(vbias89AB, vout0x89AB, vfilter_output_scale89AB);
604 vout1x89AB = vfmaq_f32(vbias89AB, vout1x89AB, vfilter_output_scale89AB);
605 vout2x89AB = vfmaq_f32(vbias89AB, vout2x89AB, vfilter_output_scale89AB);
606 vout3x89AB = vfmaq_f32(vbias89AB, vout3x89AB, vfilter_output_scale89AB);
607 vout4x89AB = vfmaq_f32(vbias89AB, vout4x89AB, vfilter_output_scale89AB);
608 vout5x89AB = vfmaq_f32(vbias89AB, vout5x89AB, vfilter_output_scale89AB);
609 const float32x4_t vbiasCDEF = vld1q_f32(w); w = (const float*) w + 4;
610 vout0xCDEF = vfmaq_f32(vbiasCDEF, vout0xCDEF, vfilter_output_scaleCDEF);
611 vout1xCDEF = vfmaq_f32(vbiasCDEF, vout1xCDEF, vfilter_output_scaleCDEF);
612 vout2xCDEF = vfmaq_f32(vbiasCDEF, vout2xCDEF, vfilter_output_scaleCDEF);
613 vout3xCDEF = vfmaq_f32(vbiasCDEF, vout3xCDEF, vfilter_output_scaleCDEF);
614 vout4xCDEF = vfmaq_f32(vbiasCDEF, vout4xCDEF, vfilter_output_scaleCDEF);
615 vout5xCDEF = vfmaq_f32(vbiasCDEF, vout5xCDEF, vfilter_output_scaleCDEF);
616 const float32x4_t vbiasGHIJ = vld1q_f32(w); w = (const float*) w + 4;
617 vout0xGHIJ = vfmaq_f32(vbiasGHIJ, vout0xGHIJ, vfilter_output_scaleGHIJ);
618 vout1xGHIJ = vfmaq_f32(vbiasGHIJ, vout1xGHIJ, vfilter_output_scaleGHIJ);
619 vout2xGHIJ = vfmaq_f32(vbiasGHIJ, vout2xGHIJ, vfilter_output_scaleGHIJ);
620 vout3xGHIJ = vfmaq_f32(vbiasGHIJ, vout3xGHIJ, vfilter_output_scaleGHIJ);
621 vout4xGHIJ = vfmaq_f32(vbiasGHIJ, vout4xGHIJ, vfilter_output_scaleGHIJ);
622 vout5xGHIJ = vfmaq_f32(vbiasGHIJ, vout5xGHIJ, vfilter_output_scaleGHIJ);
623 const float32x4_t vbiasKLMN = vld1q_f32(w); w = (const float*) w + 4;
624 vout0xKLMN = vfmaq_f32(vbiasKLMN, vout0xKLMN, vfilter_output_scaleKLMN);
625 vout1xKLMN = vfmaq_f32(vbiasKLMN, vout1xKLMN, vfilter_output_scaleKLMN);
626 vout2xKLMN = vfmaq_f32(vbiasKLMN, vout2xKLMN, vfilter_output_scaleKLMN);
627 vout3xKLMN = vfmaq_f32(vbiasKLMN, vout3xKLMN, vfilter_output_scaleKLMN);
628 vout4xKLMN = vfmaq_f32(vbiasKLMN, vout4xKLMN, vfilter_output_scaleKLMN);
629 vout5xKLMN = vfmaq_f32(vbiasKLMN, vout5xKLMN, vfilter_output_scaleKLMN);
630 const float32x4_t vbiasOPQR = vld1q_f32(w); w = (const float*) w + 4;
631 vout0xOPQR = vfmaq_f32(vbiasOPQR, vout0xOPQR, vfilter_output_scaleOPQR);
632 vout1xOPQR = vfmaq_f32(vbiasOPQR, vout1xOPQR, vfilter_output_scaleOPQR);
633 vout2xOPQR = vfmaq_f32(vbiasOPQR, vout2xOPQR, vfilter_output_scaleOPQR);
634 vout3xOPQR = vfmaq_f32(vbiasOPQR, vout3xOPQR, vfilter_output_scaleOPQR);
635 vout4xOPQR = vfmaq_f32(vbiasOPQR, vout4xOPQR, vfilter_output_scaleOPQR);
636 vout5xOPQR = vfmaq_f32(vbiasOPQR, vout5xOPQR, vfilter_output_scaleOPQR);
637 const float32x4_t vbiasSTUV = vld1q_f32(w); w = (const float*) w + 4;
638 vout0xSTUV = vfmaq_f32(vbiasSTUV, vout0xSTUV, vfilter_output_scaleSTUV);
639 vout1xSTUV = vfmaq_f32(vbiasSTUV, vout1xSTUV, vfilter_output_scaleSTUV);
640 vout2xSTUV = vfmaq_f32(vbiasSTUV, vout2xSTUV, vfilter_output_scaleSTUV);
641 vout3xSTUV = vfmaq_f32(vbiasSTUV, vout3xSTUV, vfilter_output_scaleSTUV);
642 vout4xSTUV = vfmaq_f32(vbiasSTUV, vout4xSTUV, vfilter_output_scaleSTUV);
643 vout5xSTUV = vfmaq_f32(vbiasSTUV, vout5xSTUV, vfilter_output_scaleSTUV);
644
645 const float32x4_t voutput_min = vld1q_dup_f32(&params->scalar.min);
646 vout0x0123 = vmaxq_f32(vout0x0123, voutput_min);
647 vout0x4567 = vmaxq_f32(vout0x4567, voutput_min);
648 vout0x89AB = vmaxq_f32(vout0x89AB, voutput_min);
649 vout0xCDEF = vmaxq_f32(vout0xCDEF, voutput_min);
650 vout0xGHIJ = vmaxq_f32(vout0xGHIJ, voutput_min);
651 vout0xKLMN = vmaxq_f32(vout0xKLMN, voutput_min);
652 vout0xOPQR = vmaxq_f32(vout0xOPQR, voutput_min);
653 vout0xSTUV = vmaxq_f32(vout0xSTUV, voutput_min);
654 vout1x0123 = vmaxq_f32(vout1x0123, voutput_min);
655 vout1x4567 = vmaxq_f32(vout1x4567, voutput_min);
656 vout1x89AB = vmaxq_f32(vout1x89AB, voutput_min);
657 vout1xCDEF = vmaxq_f32(vout1xCDEF, voutput_min);
658 vout1xGHIJ = vmaxq_f32(vout1xGHIJ, voutput_min);
659 vout1xKLMN = vmaxq_f32(vout1xKLMN, voutput_min);
660 vout1xOPQR = vmaxq_f32(vout1xOPQR, voutput_min);
661 vout1xSTUV = vmaxq_f32(vout1xSTUV, voutput_min);
662 vout2x0123 = vmaxq_f32(vout2x0123, voutput_min);
663 vout2x4567 = vmaxq_f32(vout2x4567, voutput_min);
664 vout2x89AB = vmaxq_f32(vout2x89AB, voutput_min);
665 vout2xCDEF = vmaxq_f32(vout2xCDEF, voutput_min);
666 vout2xGHIJ = vmaxq_f32(vout2xGHIJ, voutput_min);
667 vout2xKLMN = vmaxq_f32(vout2xKLMN, voutput_min);
668 vout2xOPQR = vmaxq_f32(vout2xOPQR, voutput_min);
669 vout2xSTUV = vmaxq_f32(vout2xSTUV, voutput_min);
670 vout3x0123 = vmaxq_f32(vout3x0123, voutput_min);
671 vout3x4567 = vmaxq_f32(vout3x4567, voutput_min);
672 vout3x89AB = vmaxq_f32(vout3x89AB, voutput_min);
673 vout3xCDEF = vmaxq_f32(vout3xCDEF, voutput_min);
674 vout3xGHIJ = vmaxq_f32(vout3xGHIJ, voutput_min);
675 vout3xKLMN = vmaxq_f32(vout3xKLMN, voutput_min);
676 vout3xOPQR = vmaxq_f32(vout3xOPQR, voutput_min);
677 vout3xSTUV = vmaxq_f32(vout3xSTUV, voutput_min);
678 vout4x0123 = vmaxq_f32(vout4x0123, voutput_min);
679 vout4x4567 = vmaxq_f32(vout4x4567, voutput_min);
680 vout4x89AB = vmaxq_f32(vout4x89AB, voutput_min);
681 vout4xCDEF = vmaxq_f32(vout4xCDEF, voutput_min);
682 vout4xGHIJ = vmaxq_f32(vout4xGHIJ, voutput_min);
683 vout4xKLMN = vmaxq_f32(vout4xKLMN, voutput_min);
684 vout4xOPQR = vmaxq_f32(vout4xOPQR, voutput_min);
685 vout4xSTUV = vmaxq_f32(vout4xSTUV, voutput_min);
686 vout5x0123 = vmaxq_f32(vout5x0123, voutput_min);
687 vout5x4567 = vmaxq_f32(vout5x4567, voutput_min);
688 vout5x89AB = vmaxq_f32(vout5x89AB, voutput_min);
689 vout5xCDEF = vmaxq_f32(vout5xCDEF, voutput_min);
690 vout5xGHIJ = vmaxq_f32(vout5xGHIJ, voutput_min);
691 vout5xKLMN = vmaxq_f32(vout5xKLMN, voutput_min);
692 vout5xOPQR = vmaxq_f32(vout5xOPQR, voutput_min);
693 vout5xSTUV = vmaxq_f32(vout5xSTUV, voutput_min);
694
695 const float32x4_t voutput_max = vld1q_dup_f32(&params->scalar.max);
696 vout0x0123 = vminq_f32(vout0x0123, voutput_max);
697 vout0x4567 = vminq_f32(vout0x4567, voutput_max);
698 vout0x89AB = vminq_f32(vout0x89AB, voutput_max);
699 vout0xCDEF = vminq_f32(vout0xCDEF, voutput_max);
700 vout0xGHIJ = vminq_f32(vout0xGHIJ, voutput_max);
701 vout0xKLMN = vminq_f32(vout0xKLMN, voutput_max);
702 vout0xOPQR = vminq_f32(vout0xOPQR, voutput_max);
703 vout0xSTUV = vminq_f32(vout0xSTUV, voutput_max);
704 vout1x0123 = vminq_f32(vout1x0123, voutput_max);
705 vout1x4567 = vminq_f32(vout1x4567, voutput_max);
706 vout1x89AB = vminq_f32(vout1x89AB, voutput_max);
707 vout1xCDEF = vminq_f32(vout1xCDEF, voutput_max);
708 vout1xGHIJ = vminq_f32(vout1xGHIJ, voutput_max);
709 vout1xKLMN = vminq_f32(vout1xKLMN, voutput_max);
710 vout1xOPQR = vminq_f32(vout1xOPQR, voutput_max);
711 vout1xSTUV = vminq_f32(vout1xSTUV, voutput_max);
712 vout2x0123 = vminq_f32(vout2x0123, voutput_max);
713 vout2x4567 = vminq_f32(vout2x4567, voutput_max);
714 vout2x89AB = vminq_f32(vout2x89AB, voutput_max);
715 vout2xCDEF = vminq_f32(vout2xCDEF, voutput_max);
716 vout2xGHIJ = vminq_f32(vout2xGHIJ, voutput_max);
717 vout2xKLMN = vminq_f32(vout2xKLMN, voutput_max);
718 vout2xOPQR = vminq_f32(vout2xOPQR, voutput_max);
719 vout2xSTUV = vminq_f32(vout2xSTUV, voutput_max);
720 vout3x0123 = vminq_f32(vout3x0123, voutput_max);
721 vout3x4567 = vminq_f32(vout3x4567, voutput_max);
722 vout3x89AB = vminq_f32(vout3x89AB, voutput_max);
723 vout3xCDEF = vminq_f32(vout3xCDEF, voutput_max);
724 vout3xGHIJ = vminq_f32(vout3xGHIJ, voutput_max);
725 vout3xKLMN = vminq_f32(vout3xKLMN, voutput_max);
726 vout3xOPQR = vminq_f32(vout3xOPQR, voutput_max);
727 vout3xSTUV = vminq_f32(vout3xSTUV, voutput_max);
728 vout4x0123 = vminq_f32(vout4x0123, voutput_max);
729 vout4x4567 = vminq_f32(vout4x4567, voutput_max);
730 vout4x89AB = vminq_f32(vout4x89AB, voutput_max);
731 vout4xCDEF = vminq_f32(vout4xCDEF, voutput_max);
732 vout4xGHIJ = vminq_f32(vout4xGHIJ, voutput_max);
733 vout4xKLMN = vminq_f32(vout4xKLMN, voutput_max);
734 vout4xOPQR = vminq_f32(vout4xOPQR, voutput_max);
735 vout4xSTUV = vminq_f32(vout4xSTUV, voutput_max);
736 vout5x0123 = vminq_f32(vout5x0123, voutput_max);
737 vout5x4567 = vminq_f32(vout5x4567, voutput_max);
738 vout5x89AB = vminq_f32(vout5x89AB, voutput_max);
739 vout5xCDEF = vminq_f32(vout5xCDEF, voutput_max);
740 vout5xGHIJ = vminq_f32(vout5xGHIJ, voutput_max);
741 vout5xKLMN = vminq_f32(vout5xKLMN, voutput_max);
742 vout5xOPQR = vminq_f32(vout5xOPQR, voutput_max);
743 vout5xSTUV = vminq_f32(vout5xSTUV, voutput_max);
744
745 if XNN_LIKELY(nc >= 32) {
746 vst1q_f32(c0, vout0x0123);
747 vst1q_f32(c0 + 4, vout0x4567);
748 vst1q_f32(c0 + 8, vout0x89AB);
749 vst1q_f32(c0 + 12, vout0xCDEF);
750 vst1q_f32(c0 + 16, vout0xGHIJ);
751 vst1q_f32(c0 + 20, vout0xKLMN);
752 vst1q_f32(c0 + 24, vout0xOPQR);
753 vst1q_f32(c0 + 28, vout0xSTUV);
754 vst1q_f32(c1, vout1x0123);
755 vst1q_f32(c1 + 4, vout1x4567);
756 vst1q_f32(c1 + 8, vout1x89AB);
757 vst1q_f32(c1 + 12, vout1xCDEF);
758 vst1q_f32(c1 + 16, vout1xGHIJ);
759 vst1q_f32(c1 + 20, vout1xKLMN);
760 vst1q_f32(c1 + 24, vout1xOPQR);
761 vst1q_f32(c1 + 28, vout1xSTUV);
762 vst1q_f32(c2, vout2x0123);
763 vst1q_f32(c2 + 4, vout2x4567);
764 vst1q_f32(c2 + 8, vout2x89AB);
765 vst1q_f32(c2 + 12, vout2xCDEF);
766 vst1q_f32(c2 + 16, vout2xGHIJ);
767 vst1q_f32(c2 + 20, vout2xKLMN);
768 vst1q_f32(c2 + 24, vout2xOPQR);
769 vst1q_f32(c2 + 28, vout2xSTUV);
770 vst1q_f32(c3, vout3x0123);
771 vst1q_f32(c3 + 4, vout3x4567);
772 vst1q_f32(c3 + 8, vout3x89AB);
773 vst1q_f32(c3 + 12, vout3xCDEF);
774 vst1q_f32(c3 + 16, vout3xGHIJ);
775 vst1q_f32(c3 + 20, vout3xKLMN);
776 vst1q_f32(c3 + 24, vout3xOPQR);
777 vst1q_f32(c3 + 28, vout3xSTUV);
778 vst1q_f32(c4, vout4x0123);
779 vst1q_f32(c4 + 4, vout4x4567);
780 vst1q_f32(c4 + 8, vout4x89AB);
781 vst1q_f32(c4 + 12, vout4xCDEF);
782 vst1q_f32(c4 + 16, vout4xGHIJ);
783 vst1q_f32(c4 + 20, vout4xKLMN);
784 vst1q_f32(c4 + 24, vout4xOPQR);
785 vst1q_f32(c4 + 28, vout4xSTUV);
786 vst1q_f32(c5, vout5x0123);
787 vst1q_f32(c5 + 4, vout5x4567);
788 vst1q_f32(c5 + 8, vout5x89AB);
789 vst1q_f32(c5 + 12, vout5xCDEF);
790 vst1q_f32(c5 + 16, vout5xGHIJ);
791 vst1q_f32(c5 + 20, vout5xKLMN);
792 vst1q_f32(c5 + 24, vout5xOPQR);
793 vst1q_f32(c5 + 28, vout5xSTUV);
794
795 a0 = (const int8_t*) ((uintptr_t) a0 - kc);
796 a1 = (const int8_t*) ((uintptr_t) a1 - kc);
797 a2 = (const int8_t*) ((uintptr_t) a2 - kc);
798 a3 = (const int8_t*) ((uintptr_t) a3 - kc);
799 a4 = (const int8_t*) ((uintptr_t) a4 - kc);
800 a5 = (const int8_t*) ((uintptr_t) a5 - kc);
801
802 c0 = (float*) ((uintptr_t) c0 + cn_stride);
803 c1 = (float*) ((uintptr_t) c1 + cn_stride);
804 c2 = (float*) ((uintptr_t) c2 + cn_stride);
805 c3 = (float*) ((uintptr_t) c3 + cn_stride);
806 c4 = (float*) ((uintptr_t) c4 + cn_stride);
807 c5 = (float*) ((uintptr_t) c5 + cn_stride);
808
809 nc -= 32;
810 } else {
811 if (nc & 16) {
812 vst1q_f32(c0, vout0x0123); c0 += 4;
813 vout0x0123 = vout0xGHIJ;
814 vst1q_f32(c1, vout1x0123); c1 += 4;
815 vout1x0123 = vout1xGHIJ;
816 vst1q_f32(c2, vout2x0123); c2 += 4;
817 vout2x0123 = vout2xGHIJ;
818 vst1q_f32(c3, vout3x0123); c3 += 4;
819 vout3x0123 = vout3xGHIJ;
820 vst1q_f32(c4, vout4x0123); c4 += 4;
821 vout4x0123 = vout4xGHIJ;
822 vst1q_f32(c5, vout5x0123); c5 += 4;
823 vout5x0123 = vout5xGHIJ;
824 vst1q_f32(c0, vout0x4567); c0 += 4;
825 vout0x4567 = vout0xKLMN;
826 vst1q_f32(c1, vout1x4567); c1 += 4;
827 vout1x4567 = vout1xKLMN;
828 vst1q_f32(c2, vout2x4567); c2 += 4;
829 vout2x4567 = vout2xKLMN;
830 vst1q_f32(c3, vout3x4567); c3 += 4;
831 vout3x4567 = vout3xKLMN;
832 vst1q_f32(c4, vout4x4567); c4 += 4;
833 vout4x4567 = vout4xKLMN;
834 vst1q_f32(c5, vout5x4567); c5 += 4;
835 vout5x4567 = vout5xKLMN;
836 vst1q_f32(c0, vout0x89AB); c0 += 4;
837 vout0x89AB = vout0xOPQR;
838 vst1q_f32(c1, vout1x89AB); c1 += 4;
839 vout1x89AB = vout1xOPQR;
840 vst1q_f32(c2, vout2x89AB); c2 += 4;
841 vout2x89AB = vout2xOPQR;
842 vst1q_f32(c3, vout3x89AB); c3 += 4;
843 vout3x89AB = vout3xOPQR;
844 vst1q_f32(c4, vout4x89AB); c4 += 4;
845 vout4x89AB = vout4xOPQR;
846 vst1q_f32(c5, vout5x89AB); c5 += 4;
847 vout5x89AB = vout5xOPQR;
848 vst1q_f32(c0, vout0xCDEF); c0 += 4;
849 vout0xCDEF = vout0xSTUV;
850 vst1q_f32(c1, vout1xCDEF); c1 += 4;
851 vout1xCDEF = vout1xSTUV;
852 vst1q_f32(c2, vout2xCDEF); c2 += 4;
853 vout2xCDEF = vout2xSTUV;
854 vst1q_f32(c3, vout3xCDEF); c3 += 4;
855 vout3xCDEF = vout3xSTUV;
856 vst1q_f32(c4, vout4xCDEF); c4 += 4;
857 vout4xCDEF = vout4xSTUV;
858 vst1q_f32(c5, vout5xCDEF); c5 += 4;
859 vout5xCDEF = vout5xSTUV;
860 }
861 if (nc & 8) {
862 vst1q_f32(c0, vout0x0123); c0 += 4;
863 vout0x0123 = vout0x89AB;
864 vst1q_f32(c1, vout1x0123); c1 += 4;
865 vout1x0123 = vout1x89AB;
866 vst1q_f32(c2, vout2x0123); c2 += 4;
867 vout2x0123 = vout2x89AB;
868 vst1q_f32(c3, vout3x0123); c3 += 4;
869 vout3x0123 = vout3x89AB;
870 vst1q_f32(c4, vout4x0123); c4 += 4;
871 vout4x0123 = vout4x89AB;
872 vst1q_f32(c5, vout5x0123); c5 += 4;
873 vout5x0123 = vout5x89AB;
874 vst1q_f32(c0, vout0x4567); c0 += 4;
875 vout0x4567 = vout0xCDEF;
876 vst1q_f32(c1, vout1x4567); c1 += 4;
877 vout1x4567 = vout1xCDEF;
878 vst1q_f32(c2, vout2x4567); c2 += 4;
879 vout2x4567 = vout2xCDEF;
880 vst1q_f32(c3, vout3x4567); c3 += 4;
881 vout3x4567 = vout3xCDEF;
882 vst1q_f32(c4, vout4x4567); c4 += 4;
883 vout4x4567 = vout4xCDEF;
884 vst1q_f32(c5, vout5x4567); c5 += 4;
885 vout5x4567 = vout5xCDEF;
886 }
887 if (nc & 4) {
888 vst1q_f32(c0, vout0x0123); c0 += 4;
889 vout0x0123 = vout0x4567;
890 vst1q_f32(c1, vout1x0123); c1 += 4;
891 vout1x0123 = vout1x4567;
892 vst1q_f32(c2, vout2x0123); c2 += 4;
893 vout2x0123 = vout2x4567;
894 vst1q_f32(c3, vout3x0123); c3 += 4;
895 vout3x0123 = vout3x4567;
896 vst1q_f32(c4, vout4x0123); c4 += 4;
897 vout4x0123 = vout4x4567;
898 vst1q_f32(c5, vout5x0123); c5 += 4;
899 vout5x0123 = vout5x4567;
900 }
901 float32x2_t vout0x01 = vget_low_f32(vout0x0123);
902 float32x2_t vout1x01 = vget_low_f32(vout1x0123);
903 float32x2_t vout2x01 = vget_low_f32(vout2x0123);
904 float32x2_t vout3x01 = vget_low_f32(vout3x0123);
905 float32x2_t vout4x01 = vget_low_f32(vout4x0123);
906 float32x2_t vout5x01 = vget_low_f32(vout5x0123);
907 if (nc & 2) {
908 vst1_f32(c0, vout0x01); c0 += 2;
909 vst1_f32(c1, vout1x01); c1 += 2;
910 vst1_f32(c2, vout2x01); c2 += 2;
911 vst1_f32(c3, vout3x01); c3 += 2;
912 vst1_f32(c4, vout4x01); c4 += 2;
913 vst1_f32(c5, vout5x01); c5 += 2;
914 vout0x01 = vget_high_f32(vout0x0123);
915 vout1x01 = vget_high_f32(vout1x0123);
916 vout2x01 = vget_high_f32(vout2x0123);
917 vout3x01 = vget_high_f32(vout3x0123);
918 vout4x01 = vget_high_f32(vout4x0123);
919 vout5x01 = vget_high_f32(vout5x0123);
920 }
921 if (nc & 1) {
922 vst1_lane_f32(c0, vout0x01, 0);
923 vst1_lane_f32(c1, vout1x01, 0);
924 vst1_lane_f32(c2, vout2x01, 0);
925 vst1_lane_f32(c3, vout3x01, 0);
926 vst1_lane_f32(c4, vout4x01, 0);
927 vst1_lane_f32(c5, vout5x01, 0);
928 }
929 nc = 0;
930 }
931 } while (nc != 0);
932 }