Debian Codegraph @

src/qd8-f32-qc8w-gemm/gen/qd8-f32-qc8w-gemm-1x32c8-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_1x32c8__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 <= 1);
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
44 // Loop over groups of 32 columns.
45 do {
46 // Initialize accumulators with bias. 32 bias values are loaded from the
47 // weight matrix, at the start of the group of 32 columns.
48 const int32x4_t vinput_zero_point01 = vld1q_dup_s32(&quantization_params[0].zero_point);
49 const int32x4_t vksum0123 = vld1q_s32(w); w = (const int32_t*) w + 4;
50 const int32x4_t vksumzp0x0123 = vmulq_s32(vksum0123, vinput_zero_point01);
51 const int32x4_t vksum4567 = vld1q_s32(w); w = (const int32_t*) w + 4;
52 const int32x4_t vksumzp0x4567 = vmulq_s32(vksum4567, vinput_zero_point01);
53 const int32x4_t vksum89AB = vld1q_s32(w); w = (const int32_t*) w + 4;
54 const int32x4_t vksumzp0x89AB = vmulq_s32(vksum89AB, vinput_zero_point01);
55 const int32x4_t vksumCDEF = vld1q_s32(w); w = (const int32_t*) w + 4;
56 const int32x4_t vksumzp0xCDEF = vmulq_s32(vksumCDEF, vinput_zero_point01);
57 const int32x4_t vksumGHIJ = vld1q_s32(w); w = (const int32_t*) w + 4;
58 const int32x4_t vksumzp0xGHIJ = vmulq_s32(vksumGHIJ, vinput_zero_point01);
59 const int32x4_t vksumKLMN = vld1q_s32(w); w = (const int32_t*) w + 4;
60 const int32x4_t vksumzp0xKLMN = vmulq_s32(vksumKLMN, vinput_zero_point01);
61 const int32x4_t vksumOPQR = vld1q_s32(w); w = (const int32_t*) w + 4;
62 const int32x4_t vksumzp0xOPQR = vmulq_s32(vksumOPQR, vinput_zero_point01);
63 const int32x4_t vksumSTUV = vld1q_s32(w); w = (const int32_t*) w + 4;
64 const int32x4_t vksumzp0xSTUV = vmulq_s32(vksumSTUV, vinput_zero_point01);
65
66 int32x4_t vacc01x01 = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp0x0123), vreinterpretq_u64_s32(vksumzp0x0123)));
67 int32x4_t vacc01x23 = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp0x0123), vreinterpretq_u64_s32(vksumzp0x0123)));
68 int32x4_t vacc01x45 = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp0x4567), vreinterpretq_u64_s32(vksumzp0x4567)));
69 int32x4_t vacc01x67 = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp0x4567), vreinterpretq_u64_s32(vksumzp0x4567)));
70 int32x4_t vacc01x89 = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp0x89AB), vreinterpretq_u64_s32(vksumzp0x89AB)));
71 int32x4_t vacc01xAB = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp0x89AB), vreinterpretq_u64_s32(vksumzp0x89AB)));
72 int32x4_t vacc01xCD = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp0xCDEF), vreinterpretq_u64_s32(vksumzp0xCDEF)));
73 int32x4_t vacc01xEF = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp0xCDEF), vreinterpretq_u64_s32(vksumzp0xCDEF)));
74 int32x4_t vacc01xGH = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp0xGHIJ), vreinterpretq_u64_s32(vksumzp0xGHIJ)));
75 int32x4_t vacc01xIJ = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp0xGHIJ), vreinterpretq_u64_s32(vksumzp0xGHIJ)));
76 int32x4_t vacc01xKL = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp0xKLMN), vreinterpretq_u64_s32(vksumzp0xKLMN)));
77 int32x4_t vacc01xMN = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp0xKLMN), vreinterpretq_u64_s32(vksumzp0xKLMN)));
78 int32x4_t vacc01xOP = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp0xOPQR), vreinterpretq_u64_s32(vksumzp0xOPQR)));
79 int32x4_t vacc01xQR = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp0xOPQR), vreinterpretq_u64_s32(vksumzp0xOPQR)));
80 int32x4_t vacc01xST = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vksumzp0xSTUV), vreinterpretq_u64_s32(vksumzp0xSTUV)));
81 int32x4_t vacc01xUV = vreinterpretq_s32_u64(vtrn2q_u64(vreinterpretq_u64_s32(vksumzp0xSTUV), vreinterpretq_u64_s32(vksumzp0xSTUV)));
82
83 // Inner accumulation loop along the 32 columns.
84 size_t k = kc;
85 // 2x partial unrolled loop to load 8 bytes at a time.
86
87 uint64x2x2_t va01x0123456789ABCDEF;
88 va01x0123456789ABCDEF.val[0] = vdupq_n_u64(0);
89 va01x0123456789ABCDEF.val[1] = vdupq_n_u64(0);
90
91 while (k >= 16 * sizeof(int8_t)) {
92 // Load a 1x16 block of activations.
93 va01x0123456789ABCDEF = vld2q_lane_u64((const void*) a0, va01x0123456789ABCDEF, 0); a0 += 16;
94
95 const int8x16_t va01x01234567 = vreinterpretq_s8_u64(va01x0123456789ABCDEF.val[0]);
96 const int8x16_t va01x89ABCDEF = vreinterpretq_s8_u64(va01x0123456789ABCDEF.val[1]);
97
98 // Load a 16x32 block of weights.
99 const int8x16_t vb01x01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
100 const int8x16_t vb23x01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
101 const int8x16_t vb45x01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
102 const int8x16_t vb67x01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
103 const int8x16_t vb89x01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
104 const int8x16_t vbABx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
105 const int8x16_t vbCDx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
106 const int8x16_t vbEFx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
107 const int8x16_t vbGHx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
108 const int8x16_t vbIJx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
109 const int8x16_t vbKLx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
110 const int8x16_t vbMNx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
111 const int8x16_t vbOPx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
112 const int8x16_t vbQRx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
113 const int8x16_t vbSTx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
114 const int8x16_t vbUVx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
115 const int8x16_t vb01x89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
116 const int8x16_t vb23x89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
117 const int8x16_t vb45x89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
118 const int8x16_t vb67x89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
119 const int8x16_t vb89x89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
120 const int8x16_t vbABx89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
121 const int8x16_t vbCDx89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
122 const int8x16_t vbEFx89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
123 const int8x16_t vbGHx89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
124 const int8x16_t vbIJx89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
125 const int8x16_t vbKLx89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
126 const int8x16_t vbMNx89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
127 const int8x16_t vbOPx89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
128 const int8x16_t vbQRx89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
129 const int8x16_t vbSTx89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
130 const int8x16_t vbUVx89ABCDEF = vld1q_s8(w); w = (const int8_t*) w + 16;
131
132 // Multiply-accumulate: 1x8 * 8x32 --> 1x32.
133 vacc01x01 = vmmlaq_s32(vacc01x01, va01x01234567, vb01x01234567);
134 vacc01x23 = vmmlaq_s32(vacc01x23, va01x01234567, vb23x01234567);
135 vacc01x45 = vmmlaq_s32(vacc01x45, va01x01234567, vb45x01234567);
136 vacc01x67 = vmmlaq_s32(vacc01x67, va01x01234567, vb67x01234567);
137 vacc01x89 = vmmlaq_s32(vacc01x89, va01x01234567, vb89x01234567);
138 vacc01xAB = vmmlaq_s32(vacc01xAB, va01x01234567, vbABx01234567);
139 vacc01xCD = vmmlaq_s32(vacc01xCD, va01x01234567, vbCDx01234567);
140 vacc01xEF = vmmlaq_s32(vacc01xEF, va01x01234567, vbEFx01234567);
141 vacc01xGH = vmmlaq_s32(vacc01xGH, va01x01234567, vbGHx01234567);
142 vacc01xIJ = vmmlaq_s32(vacc01xIJ, va01x01234567, vbIJx01234567);
143 vacc01xKL = vmmlaq_s32(vacc01xKL, va01x01234567, vbKLx01234567);
144 vacc01xMN = vmmlaq_s32(vacc01xMN, va01x01234567, vbMNx01234567);
145 vacc01xOP = vmmlaq_s32(vacc01xOP, va01x01234567, vbOPx01234567);
146 vacc01xQR = vmmlaq_s32(vacc01xQR, va01x01234567, vbQRx01234567);
147 vacc01xST = vmmlaq_s32(vacc01xST, va01x01234567, vbSTx01234567);
148 vacc01xUV = vmmlaq_s32(vacc01xUV, va01x01234567, vbUVx01234567);
149 vacc01x01 = vmmlaq_s32(vacc01x01, va01x89ABCDEF, vb01x89ABCDEF);
150 vacc01x23 = vmmlaq_s32(vacc01x23, va01x89ABCDEF, vb23x89ABCDEF);
151 vacc01x45 = vmmlaq_s32(vacc01x45, va01x89ABCDEF, vb45x89ABCDEF);
152 vacc01x67 = vmmlaq_s32(vacc01x67, va01x89ABCDEF, vb67x89ABCDEF);
153 vacc01x89 = vmmlaq_s32(vacc01x89, va01x89ABCDEF, vb89x89ABCDEF);
154 vacc01xAB = vmmlaq_s32(vacc01xAB, va01x89ABCDEF, vbABx89ABCDEF);
155 vacc01xCD = vmmlaq_s32(vacc01xCD, va01x89ABCDEF, vbCDx89ABCDEF);
156 vacc01xEF = vmmlaq_s32(vacc01xEF, va01x89ABCDEF, vbEFx89ABCDEF);
157 vacc01xGH = vmmlaq_s32(vacc01xGH, va01x89ABCDEF, vbGHx89ABCDEF);
158 vacc01xIJ = vmmlaq_s32(vacc01xIJ, va01x89ABCDEF, vbIJx89ABCDEF);
159 vacc01xKL = vmmlaq_s32(vacc01xKL, va01x89ABCDEF, vbKLx89ABCDEF);
160 vacc01xMN = vmmlaq_s32(vacc01xMN, va01x89ABCDEF, vbMNx89ABCDEF);
161 vacc01xOP = vmmlaq_s32(vacc01xOP, va01x89ABCDEF, vbOPx89ABCDEF);
162 vacc01xQR = vmmlaq_s32(vacc01xQR, va01x89ABCDEF, vbQRx89ABCDEF);
163 vacc01xST = vmmlaq_s32(vacc01xST, va01x89ABCDEF, vbSTx89ABCDEF);
164 vacc01xUV = vmmlaq_s32(vacc01xUV, va01x89ABCDEF, vbUVx89ABCDEF);
165
166 k -= 16 * sizeof(int8_t);
167 }
168 // Handle up to 8 final positions of `k`
169 if XNN_UNLIKELY(k != 0) {
170 // Load a 1x8 block of activations.
171 uint64x2_t va01x01234567 = vld1q_dup_u64((const void*) a0); a0 += 8;
172
173 // Load a 16x32 block of weights.
174 const int8x16_t vb01x01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
175 const int8x16_t vb23x01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
176 const int8x16_t vb45x01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
177 const int8x16_t vb67x01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
178 const int8x16_t vb89x01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
179 const int8x16_t vbABx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
180 const int8x16_t vbCDx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
181 const int8x16_t vbEFx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
182 const int8x16_t vbGHx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
183 const int8x16_t vbIJx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
184 const int8x16_t vbKLx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
185 const int8x16_t vbMNx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
186 const int8x16_t vbOPx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
187 const int8x16_t vbQRx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
188 const int8x16_t vbSTx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
189 const int8x16_t vbUVx01234567 = vld1q_s8(w); w = (const int8_t*) w + 16;
190
191 // Multiply-accumulate: 1x4 * 4x32 --> 1x32.
192 vacc01x01 = vmmlaq_s32(vacc01x01, vreinterpretq_s8_u64(va01x01234567), vb01x01234567);
193 vacc01x23 = vmmlaq_s32(vacc01x23, vreinterpretq_s8_u64(va01x01234567), vb23x01234567);
194 vacc01x45 = vmmlaq_s32(vacc01x45, vreinterpretq_s8_u64(va01x01234567), vb45x01234567);
195 vacc01x67 = vmmlaq_s32(vacc01x67, vreinterpretq_s8_u64(va01x01234567), vb67x01234567);
196 vacc01x89 = vmmlaq_s32(vacc01x89, vreinterpretq_s8_u64(va01x01234567), vb89x01234567);
197 vacc01xAB = vmmlaq_s32(vacc01xAB, vreinterpretq_s8_u64(va01x01234567), vbABx01234567);
198 vacc01xCD = vmmlaq_s32(vacc01xCD, vreinterpretq_s8_u64(va01x01234567), vbCDx01234567);
199 vacc01xEF = vmmlaq_s32(vacc01xEF, vreinterpretq_s8_u64(va01x01234567), vbEFx01234567);
200 vacc01xGH = vmmlaq_s32(vacc01xGH, vreinterpretq_s8_u64(va01x01234567), vbGHx01234567);
201 vacc01xIJ = vmmlaq_s32(vacc01xIJ, vreinterpretq_s8_u64(va01x01234567), vbIJx01234567);
202 vacc01xKL = vmmlaq_s32(vacc01xKL, vreinterpretq_s8_u64(va01x01234567), vbKLx01234567);
203 vacc01xMN = vmmlaq_s32(vacc01xMN, vreinterpretq_s8_u64(va01x01234567), vbMNx01234567);
204 vacc01xOP = vmmlaq_s32(vacc01xOP, vreinterpretq_s8_u64(va01x01234567), vbOPx01234567);
205 vacc01xQR = vmmlaq_s32(vacc01xQR, vreinterpretq_s8_u64(va01x01234567), vbQRx01234567);
206 vacc01xST = vmmlaq_s32(vacc01xST, vreinterpretq_s8_u64(va01x01234567), vbSTx01234567);
207 vacc01xUV = vmmlaq_s32(vacc01xUV, vreinterpretq_s8_u64(va01x01234567), vbUVx01234567);
208 }
209
210 int32x4_t vacc0x0123 = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc01x01), vreinterpretq_u64_s32(vacc01x23)));
211 int32x4_t vacc0x4567 = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc01x45), vreinterpretq_u64_s32(vacc01x67)));
212 int32x4_t vacc0x89AB = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc01x89), vreinterpretq_u64_s32(vacc01xAB)));
213 int32x4_t vacc0xCDEF = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc01xCD), vreinterpretq_u64_s32(vacc01xEF)));
214 int32x4_t vacc0xGHIJ = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc01xGH), vreinterpretq_u64_s32(vacc01xIJ)));
215 int32x4_t vacc0xKLMN = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc01xKL), vreinterpretq_u64_s32(vacc01xMN)));
216 int32x4_t vacc0xOPQR = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc01xOP), vreinterpretq_u64_s32(vacc01xQR)));
217 int32x4_t vacc0xSTUV = vreinterpretq_s32_u64(vtrn1q_u64(vreinterpretq_u64_s32(vacc01xST), vreinterpretq_u64_s32(vacc01xUV)));
218 float32x4_t vout0x0123 = vcvtq_f32_s32(vacc0x0123);
219 float32x4_t vout0x4567 = vcvtq_f32_s32(vacc0x4567);
220 float32x4_t vout0x89AB = vcvtq_f32_s32(vacc0x89AB);
221 float32x4_t vout0xCDEF = vcvtq_f32_s32(vacc0xCDEF);
222 float32x4_t vout0xGHIJ = vcvtq_f32_s32(vacc0xGHIJ);
223 float32x4_t vout0xKLMN = vcvtq_f32_s32(vacc0xKLMN);
224 float32x4_t vout0xOPQR = vcvtq_f32_s32(vacc0xOPQR);
225 float32x4_t vout0xSTUV = vcvtq_f32_s32(vacc0xSTUV);
226
227 const float32x4_t vinput_scale0 = vld1q_dup_f32(&quantization_params[0].inv_scale);
228 vout0x0123 = vmulq_f32(vout0x0123, vinput_scale0);
229 vout0x4567 = vmulq_f32(vout0x4567, vinput_scale0);
230 vout0x89AB = vmulq_f32(vout0x89AB, vinput_scale0);
231 vout0xCDEF = vmulq_f32(vout0xCDEF, vinput_scale0);
232 vout0xGHIJ = vmulq_f32(vout0xGHIJ, vinput_scale0);
233 vout0xKLMN = vmulq_f32(vout0xKLMN, vinput_scale0);
234 vout0xOPQR = vmulq_f32(vout0xOPQR, vinput_scale0);
235 vout0xSTUV = vmulq_f32(vout0xSTUV, vinput_scale0);
236
237 const float32x4_t vfilter_output_scale0123 = vld1q_f32(w); w = (const float*) w + 4;
238 const float32x4_t vfilter_output_scale4567 = vld1q_f32(w); w = (const float*) w + 4;
239 const float32x4_t vfilter_output_scale89AB = vld1q_f32(w); w = (const float*) w + 4;
240 const float32x4_t vfilter_output_scaleCDEF = vld1q_f32(w); w = (const float*) w + 4;
241 const float32x4_t vfilter_output_scaleGHIJ = vld1q_f32(w); w = (const float*) w + 4;
242 const float32x4_t vfilter_output_scaleKLMN = vld1q_f32(w); w = (const float*) w + 4;
243 const float32x4_t vfilter_output_scaleOPQR = vld1q_f32(w); w = (const float*) w + 4;
244 const float32x4_t vfilter_output_scaleSTUV = vld1q_f32(w); w = (const float*) w + 4;
245
246 const float32x4_t vbias0123 = vld1q_f32(w); w = (const float*) w + 4;
247 vout0x0123 = vfmaq_f32(vbias0123, vout0x0123, vfilter_output_scale0123);
248 const float32x4_t vbias4567 = vld1q_f32(w); w = (const float*) w + 4;
249 vout0x4567 = vfmaq_f32(vbias4567, vout0x4567, vfilter_output_scale4567);
250 const float32x4_t vbias89AB = vld1q_f32(w); w = (const float*) w + 4;
251 vout0x89AB = vfmaq_f32(vbias89AB, vout0x89AB, vfilter_output_scale89AB);
252 const float32x4_t vbiasCDEF = vld1q_f32(w); w = (const float*) w + 4;
253 vout0xCDEF = vfmaq_f32(vbiasCDEF, vout0xCDEF, vfilter_output_scaleCDEF);
254 const float32x4_t vbiasGHIJ = vld1q_f32(w); w = (const float*) w + 4;
255 vout0xGHIJ = vfmaq_f32(vbiasGHIJ, vout0xGHIJ, vfilter_output_scaleGHIJ);
256 const float32x4_t vbiasKLMN = vld1q_f32(w); w = (const float*) w + 4;
257 vout0xKLMN = vfmaq_f32(vbiasKLMN, vout0xKLMN, vfilter_output_scaleKLMN);
258 const float32x4_t vbiasOPQR = vld1q_f32(w); w = (const float*) w + 4;
259 vout0xOPQR = vfmaq_f32(vbiasOPQR, vout0xOPQR, vfilter_output_scaleOPQR);
260 const float32x4_t vbiasSTUV = vld1q_f32(w); w = (const float*) w + 4;
261 vout0xSTUV = vfmaq_f32(vbiasSTUV, vout0xSTUV, vfilter_output_scaleSTUV);
262
263 const float32x4_t voutput_min = vld1q_dup_f32(&params->scalar.min);
264 vout0x0123 = vmaxq_f32(vout0x0123, voutput_min);
265 vout0x4567 = vmaxq_f32(vout0x4567, voutput_min);
266 vout0x89AB = vmaxq_f32(vout0x89AB, voutput_min);
267 vout0xCDEF = vmaxq_f32(vout0xCDEF, voutput_min);
268 vout0xGHIJ = vmaxq_f32(vout0xGHIJ, voutput_min);
269 vout0xKLMN = vmaxq_f32(vout0xKLMN, voutput_min);
270 vout0xOPQR = vmaxq_f32(vout0xOPQR, voutput_min);
271 vout0xSTUV = vmaxq_f32(vout0xSTUV, voutput_min);
272
273 const float32x4_t voutput_max = vld1q_dup_f32(&params->scalar.max);
274 vout0x0123 = vminq_f32(vout0x0123, voutput_max);
275 vout0x4567 = vminq_f32(vout0x4567, voutput_max);
276 vout0x89AB = vminq_f32(vout0x89AB, voutput_max);
277 vout0xCDEF = vminq_f32(vout0xCDEF, voutput_max);
278 vout0xGHIJ = vminq_f32(vout0xGHIJ, voutput_max);
279 vout0xKLMN = vminq_f32(vout0xKLMN, voutput_max);
280 vout0xOPQR = vminq_f32(vout0xOPQR, voutput_max);
281 vout0xSTUV = vminq_f32(vout0xSTUV, voutput_max);
282
283 if XNN_LIKELY(nc >= 32) {
284 vst1q_f32(c0, vout0x0123);
285 vst1q_f32(c0 + 4, vout0x4567);
286 vst1q_f32(c0 + 8, vout0x89AB);
287 vst1q_f32(c0 + 12, vout0xCDEF);
288 vst1q_f32(c0 + 16, vout0xGHIJ);
289 vst1q_f32(c0 + 20, vout0xKLMN);
290 vst1q_f32(c0 + 24, vout0xOPQR);
291 vst1q_f32(c0 + 28, vout0xSTUV);
292
293 a0 = (const int8_t*) ((uintptr_t) a0 - kc);
294
295 c0 = (float*) ((uintptr_t) c0 + cn_stride);
296
297 nc -= 32;
298 } else {
299 if (nc & 16) {
300 vst1q_f32(c0, vout0x0123); c0 += 4;
301 vout0x0123 = vout0xGHIJ;
302 vst1q_f32(c0, vout0x4567); c0 += 4;
303 vout0x4567 = vout0xKLMN;
304 vst1q_f32(c0, vout0x89AB); c0 += 4;
305 vout0x89AB = vout0xOPQR;
306 vst1q_f32(c0, vout0xCDEF); c0 += 4;
307 vout0xCDEF = vout0xSTUV;
308 }
309 if (nc & 8) {
310 vst1q_f32(c0, vout0x0123); c0 += 4;
311 vout0x0123 = vout0x89AB;
312 vst1q_f32(c0, vout0x4567); c0 += 4;
313 vout0x4567 = vout0xCDEF;
314 }
315 if (nc & 4) {
316 vst1q_f32(c0, vout0x0123); c0 += 4;
317 vout0x0123 = vout0x4567;
318 }
319 float32x2_t vout0x01 = vget_low_f32(vout0x0123);
320 if (nc & 2) {
321 vst1_f32(c0, vout0x01); c0 += 2;
322 vout0x01 = vget_high_f32(vout0x0123);
323 }
324 if (nc & 1) {
325 vst1_lane_f32(c0, vout0x01, 0);
326 }
327 nc = 0;
328 }
329 } while (nc != 0);
330 }