Debian Codegraph @

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