| 1 |
// Auto-generated file. Do not edit! |
| 2 |
// Template: src/qs8-igemm/c4-neondot.c.in |
| 3 |
// Generator: tools/xngen |
| 4 |
// |
| 5 |
// Copyright 2020 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/igemm.h" |
| 15 |
#include "xnnpack/math.h" |
| 16 |
|
| 17 |
|
| 18 |
void xnn_qd8_f16_qc8w_igemm_minmax_ukernel_6x32c4__neondotfp16arith( |
| 19 |
size_t mr, |
| 20 |
size_t nc, |
| 21 |
size_t kc, |
| 22 |
size_t ks, |
| 23 |
const int8_t** restrict a, |
| 24 |
const void* restrict w, |
| 25 |
xnn_float16* restrict c, |
| 26 |
size_t cm_stride, |
| 27 |
size_t cn_stride, |
| 28 |
size_t a_offset, |
| 29 |
const int8_t* zero, |
| 30 |
const int8_t* zero_data, |
| 31 |
const union xnn_f16_minmax_params params[restrict XNN_MIN_ELEMENTS(1)], |
| 32 |
const struct xnn_qd8_quantization_params quantization_params[restrict XNN_MIN_ELEMENTS(1)]) XNN_OOB_READS |
| 33 |
{ |
| 34 |
assert(mr != 0); |
| 35 |
assert(mr <= 6); |
| 36 |
assert(nc != 0); |
| 37 |
assert(kc != 0); |
| 38 |
assert(ks != 0); |
| 39 |
assert(ks % (6 * sizeof(void*)) == 0); |
| 40 |
assert(a_offset % sizeof(int8_t) == 0); |
| 41 |
assert(a != NULL); |
| 42 |
assert(w != NULL); |
| 43 |
assert(c != NULL); |
| 44 |
|
| 45 |
kc = round_up_po2(kc, 4 * sizeof(int8_t)); |
| 46 |
uint16_t* c0 = (uint16_t*) c; |
| 47 |
uint16_t* c1 = (uint16_t*) ((uintptr_t) c0 + cm_stride); |
| 48 |
if XNN_UNPREDICTABLE(mr < 2) { |
| 49 |
c1 = c0; |
| 50 |
} |
| 51 |
uint16_t* c2 = (uint16_t*) ((uintptr_t) c1 + cm_stride); |
| 52 |
if XNN_UNPREDICTABLE(mr <= 2) { |
| 53 |
c2 = c1; |
| 54 |
} |
| 55 |
uint16_t* c3 = (uint16_t*) ((uintptr_t) c2 + cm_stride); |
| 56 |
if XNN_UNPREDICTABLE(mr < 4) { |
| 57 |
c3 = c2; |
| 58 |
} |
| 59 |
uint16_t* c4 = (uint16_t*) ((uintptr_t) c3 + cm_stride); |
| 60 |
if XNN_UNPREDICTABLE(mr <= 4) { |
| 61 |
c4 = c3; |
| 62 |
} |
| 63 |
uint16_t* c5 = (uint16_t*) ((uintptr_t) c4 + cm_stride); |
| 64 |
if XNN_UNPREDICTABLE(mr != 6) { |
| 65 |
c5 = c4; |
| 66 |
} |
| 67 |
|
| 68 |
do { |
| 69 |
const int32x4_t vinput_zero_point = vld1q_dup_s32(&quantization_params->zero_point); |
| 70 |
const int32x4_t vksum0123 = vld1q_s32(w); w = (const int32_t*) w + 4; |
| 71 |
int32x4_t vacc0x0123 = vmulq_s32(vksum0123, vinput_zero_point); |
| 72 |
const int32x4_t vksum4567 = vld1q_s32(w); w = (const int32_t*) w + 4; |
| 73 |
int32x4_t vacc0x4567 = vmulq_s32(vksum4567, vinput_zero_point); |
| 74 |
const int32x4_t vksum89AB = vld1q_s32(w); w = (const int32_t*) w + 4; |
| 75 |
int32x4_t vacc0x89AB = vmulq_s32(vksum89AB, vinput_zero_point); |
| 76 |
const int32x4_t vksumCDEF = vld1q_s32(w); w = (const int32_t*) w + 4; |
| 77 |
int32x4_t vacc0xCDEF = vmulq_s32(vksumCDEF, vinput_zero_point); |
| 78 |
const int32x4_t vksumGHIJ = vld1q_s32(w); w = (const int32_t*) w + 4; |
| 79 |
int32x4_t vacc0xGHIJ = vmulq_s32(vksumGHIJ, vinput_zero_point); |
| 80 |
const int32x4_t vksumKLMN = vld1q_s32(w); w = (const int32_t*) w + 4; |
| 81 |
int32x4_t vacc0xKLMN = vmulq_s32(vksumKLMN, vinput_zero_point); |
| 82 |
const int32x4_t vksumOPQR = vld1q_s32(w); w = (const int32_t*) w + 4; |
| 83 |
int32x4_t vacc0xOPQR = vmulq_s32(vksumOPQR, vinput_zero_point); |
| 84 |
const int32x4_t vksumSTUV = vld1q_s32(w); w = (const int32_t*) w + 4; |
| 85 |
int32x4_t vacc0xSTUV = vmulq_s32(vksumSTUV, vinput_zero_point); |
| 86 |
int32x4_t vacc1x0123 = vacc0x0123; |
| 87 |
int32x4_t vacc1x4567 = vacc0x4567; |
| 88 |
int32x4_t vacc1x89AB = vacc0x89AB; |
| 89 |
int32x4_t vacc1xCDEF = vacc0xCDEF; |
| 90 |
int32x4_t vacc1xGHIJ = vacc0xGHIJ; |
| 91 |
int32x4_t vacc1xKLMN = vacc0xKLMN; |
| 92 |
int32x4_t vacc1xOPQR = vacc0xOPQR; |
| 93 |
int32x4_t vacc1xSTUV = vacc0xSTUV; |
| 94 |
int32x4_t vacc2x0123 = vacc0x0123; |
| 95 |
int32x4_t vacc2x4567 = vacc0x4567; |
| 96 |
int32x4_t vacc2x89AB = vacc0x89AB; |
| 97 |
int32x4_t vacc2xCDEF = vacc0xCDEF; |
| 98 |
int32x4_t vacc2xGHIJ = vacc0xGHIJ; |
| 99 |
int32x4_t vacc2xKLMN = vacc0xKLMN; |
| 100 |
int32x4_t vacc2xOPQR = vacc0xOPQR; |
| 101 |
int32x4_t vacc2xSTUV = vacc0xSTUV; |
| 102 |
int32x4_t vacc3x0123 = vacc0x0123; |
| 103 |
int32x4_t vacc3x4567 = vacc0x4567; |
| 104 |
int32x4_t vacc3x89AB = vacc0x89AB; |
| 105 |
int32x4_t vacc3xCDEF = vacc0xCDEF; |
| 106 |
int32x4_t vacc3xGHIJ = vacc0xGHIJ; |
| 107 |
int32x4_t vacc3xKLMN = vacc0xKLMN; |
| 108 |
int32x4_t vacc3xOPQR = vacc0xOPQR; |
| 109 |
int32x4_t vacc3xSTUV = vacc0xSTUV; |
| 110 |
int32x4_t vacc4x0123 = vacc0x0123; |
| 111 |
int32x4_t vacc4x4567 = vacc0x4567; |
| 112 |
int32x4_t vacc4x89AB = vacc0x89AB; |
| 113 |
int32x4_t vacc4xCDEF = vacc0xCDEF; |
| 114 |
int32x4_t vacc4xGHIJ = vacc0xGHIJ; |
| 115 |
int32x4_t vacc4xKLMN = vacc0xKLMN; |
| 116 |
int32x4_t vacc4xOPQR = vacc0xOPQR; |
| 117 |
int32x4_t vacc4xSTUV = vacc0xSTUV; |
| 118 |
int32x4_t vacc5x0123 = vacc0x0123; |
| 119 |
int32x4_t vacc5x4567 = vacc0x4567; |
| 120 |
int32x4_t vacc5x89AB = vacc0x89AB; |
| 121 |
int32x4_t vacc5xCDEF = vacc0xCDEF; |
| 122 |
int32x4_t vacc5xGHIJ = vacc0xGHIJ; |
| 123 |
int32x4_t vacc5xKLMN = vacc0xKLMN; |
| 124 |
int32x4_t vacc5xOPQR = vacc0xOPQR; |
| 125 |
int32x4_t vacc5xSTUV = vacc0xSTUV; |
| 126 |
|
| 127 |
size_t p = ks; |
| 128 |
do { |
| 129 |
const int8_t* restrict a0 = a[0]; |
| 130 |
if XNN_UNPREDICTABLE(a0 != zero) { |
| 131 |
a0 = (const int8_t*) ((uintptr_t) a0 + a_offset); |
| 132 |
} else { |
| 133 |
a0 = zero_data; |
| 134 |
} |
| 135 |
const int8_t* restrict a1 = a[1]; |
| 136 |
if XNN_UNPREDICTABLE(a1 != zero) { |
| 137 |
a1 = (const int8_t*) ((uintptr_t) a1 + a_offset); |
| 138 |
} else { |
| 139 |
a1 = zero_data; |
| 140 |
} |
| 141 |
const int8_t* restrict a2 = a[2]; |
| 142 |
if XNN_UNPREDICTABLE(a2 != zero) { |
| 143 |
a2 = (const int8_t*) ((uintptr_t) a2 + a_offset); |
| 144 |
} else { |
| 145 |
a2 = zero_data; |
| 146 |
} |
| 147 |
const int8_t* restrict a3 = a[3]; |
| 148 |
if XNN_UNPREDICTABLE(a3 != zero) { |
| 149 |
a3 = (const int8_t*) ((uintptr_t) a3 + a_offset); |
| 150 |
} else { |
| 151 |
a3 = zero_data; |
| 152 |
} |
| 153 |
const int8_t* restrict a4 = a[4]; |
| 154 |
if XNN_UNPREDICTABLE(a4 != zero) { |
| 155 |
a4 = (const int8_t*) ((uintptr_t) a4 + a_offset); |
| 156 |
} else { |
| 157 |
a4 = zero_data; |
| 158 |
} |
| 159 |
const int8_t* restrict a5 = a[5]; |
| 160 |
if XNN_UNPREDICTABLE(a5 != zero) { |
| 161 |
a5 = (const int8_t*) ((uintptr_t) a5 + a_offset); |
| 162 |
} else { |
| 163 |
a5 = zero_data; |
| 164 |
} |
| 165 |
a += 6; |
| 166 |
|
| 167 |
// Inner accumulation loop along the 32 columns. |
| 168 |
size_t k = kc; |
| 169 |
// 2x partial unrolled loop to load 8 bytes at a time. |
| 170 |
while (k >= 8 * sizeof(int8_t)) { |
| 171 |
// Load a 6x8 block of activations. |
| 172 |
const int8x8_t va0x01234567 = vld1_s8(a0); a0 += 8; |
| 173 |
const int8x8_t va1x01234567 = vld1_s8(a1); a1 += 8; |
| 174 |
const int8x8_t va2x01234567 = vld1_s8(a2); a2 += 8; |
| 175 |
const int8x8_t va3x01234567 = vld1_s8(a3); a3 += 8; |
| 176 |
const int8x8_t va4x01234567 = vld1_s8(a4); a4 += 8; |
| 177 |
const int8x8_t va5x01234567 = vld1_s8(a5); a5 += 8; |
| 178 |
|
| 179 |
// Load a 8x32 block of weights. |
| 180 |
const int8x16_t vb0123x0123 = vld1q_s8(w); w = (const int8_t*) w + 16; |
| 181 |
const int8x16_t vb0123x4567 = vld1q_s8(w); w = (const int8_t*) w + 16; |
| 182 |
const int8x16_t vb0123x89AB = vld1q_s8(w); w = (const int8_t*) w + 16; |
| 183 |
const int8x16_t vb0123xCDEF = vld1q_s8(w); w = (const int8_t*) w + 16; |
| 184 |
const int8x16_t vb0123xGHIJ = vld1q_s8(w); w = (const int8_t*) w + 16; |
| 185 |
const int8x16_t vb0123xKLMN = vld1q_s8(w); w = (const int8_t*) w + 16; |
| 186 |
const int8x16_t vb0123xOPQR = vld1q_s8(w); w = (const int8_t*) w + 16; |
| 187 |
const int8x16_t vb0123xSTUV = vld1q_s8(w); w = (const int8_t*) w + 16; |
| 188 |
const int8x16_t vb4567x0123 = vld1q_s8(w); w = (const int8_t*) w + 16; |
| 189 |
const int8x16_t vb4567x4567 = vld1q_s8(w); w = (const int8_t*) w + 16; |
| 190 |
const int8x16_t vb4567x89AB = vld1q_s8(w); w = (const int8_t*) w + 16; |
| 191 |
const int8x16_t vb4567xCDEF = vld1q_s8(w); w = (const int8_t*) w + 16; |
| 192 |
const int8x16_t vb4567xGHIJ = vld1q_s8(w); w = (const int8_t*) w + 16; |
| 193 |
const int8x16_t vb4567xKLMN = vld1q_s8(w); w = (const int8_t*) w + 16; |
| 194 |
const int8x16_t vb4567xOPQR = vld1q_s8(w); w = (const int8_t*) w + 16; |
| 195 |
const int8x16_t vb4567xSTUV = vld1q_s8(w); w = (const int8_t*) w + 16; |
| 196 |
|
| 197 |
// Multiply-accumulate: 6x8 * 8x32 --> 6x32. |
| 198 |
vacc0x0123 = vdotq_lane_s32(vacc0x0123, vb0123x0123, va0x01234567, 0); |
| 199 |
vacc0x4567 = vdotq_lane_s32(vacc0x4567, vb0123x4567, va0x01234567, 0); |
| 200 |
vacc0x89AB = vdotq_lane_s32(vacc0x89AB, vb0123x89AB, va0x01234567, 0); |
| 201 |
vacc0xCDEF = vdotq_lane_s32(vacc0xCDEF, vb0123xCDEF, va0x01234567, 0); |
| 202 |
vacc0xGHIJ = vdotq_lane_s32(vacc0xGHIJ, vb0123xGHIJ, va0x01234567, 0); |
| 203 |
vacc0xKLMN = vdotq_lane_s32(vacc0xKLMN, vb0123xKLMN, va0x01234567, 0); |
| 204 |
vacc0xOPQR = vdotq_lane_s32(vacc0xOPQR, vb0123xOPQR, va0x01234567, 0); |
| 205 |
vacc0xSTUV = vdotq_lane_s32(vacc0xSTUV, vb0123xSTUV, va0x01234567, 0); |
| 206 |
vacc1x0123 = vdotq_lane_s32(vacc1x0123, vb0123x0123, va1x01234567, 0); |
| 207 |
vacc1x4567 = vdotq_lane_s32(vacc1x4567, vb0123x4567, va1x01234567, 0); |
| 208 |
vacc1x89AB = vdotq_lane_s32(vacc1x89AB, vb0123x89AB, va1x01234567, 0); |
| 209 |
vacc1xCDEF = vdotq_lane_s32(vacc1xCDEF, vb0123xCDEF, va1x01234567, 0); |
| 210 |
vacc1xGHIJ = vdotq_lane_s32(vacc1xGHIJ, vb0123xGHIJ, va1x01234567, 0); |
| 211 |
vacc1xKLMN = vdotq_lane_s32(vacc1xKLMN, vb0123xKLMN, va1x01234567, 0); |
| 212 |
vacc1xOPQR = vdotq_lane_s32(vacc1xOPQR, vb0123xOPQR, va1x01234567, 0); |
| 213 |
vacc1xSTUV = vdotq_lane_s32(vacc1xSTUV, vb0123xSTUV, va1x01234567, 0); |
| 214 |
vacc2x0123 = vdotq_lane_s32(vacc2x0123, vb0123x0123, va2x01234567, 0); |
| 215 |
vacc2x4567 = vdotq_lane_s32(vacc2x4567, vb0123x4567, va2x01234567, 0); |
| 216 |
vacc2x89AB = vdotq_lane_s32(vacc2x89AB, vb0123x89AB, va2x01234567, 0); |
| 217 |
vacc2xCDEF = vdotq_lane_s32(vacc2xCDEF, vb0123xCDEF, va2x01234567, 0); |
| 218 |
vacc2xGHIJ = vdotq_lane_s32(vacc2xGHIJ, vb0123xGHIJ, va2x01234567, 0); |
| 219 |
vacc2xKLMN = vdotq_lane_s32(vacc2xKLMN, vb0123xKLMN, va2x01234567, 0); |
| 220 |
vacc2xOPQR = vdotq_lane_s32(vacc2xOPQR, vb0123xOPQR, va2x01234567, 0); |
| 221 |
vacc2xSTUV = vdotq_lane_s32(vacc2xSTUV, vb0123xSTUV, va2x01234567, 0); |
| 222 |
vacc3x0123 = vdotq_lane_s32(vacc3x0123, vb0123x0123, va3x01234567, 0); |
| 223 |
vacc3x4567 = vdotq_lane_s32(vacc3x4567, vb0123x4567, va3x01234567, 0); |
| 224 |
vacc3x89AB = vdotq_lane_s32(vacc3x89AB, vb0123x89AB, va3x01234567, 0); |
| 225 |
vacc3xCDEF = vdotq_lane_s32(vacc3xCDEF, vb0123xCDEF, va3x01234567, 0); |
| 226 |
vacc3xGHIJ = vdotq_lane_s32(vacc3xGHIJ, vb0123xGHIJ, va3x01234567, 0); |
| 227 |
vacc3xKLMN = vdotq_lane_s32(vacc3xKLMN, vb0123xKLMN, va3x01234567, 0); |
| 228 |
vacc3xOPQR = vdotq_lane_s32(vacc3xOPQR, vb0123xOPQR, va3x01234567, 0); |
| 229 |
vacc3xSTUV = vdotq_lane_s32(vacc3xSTUV, vb0123xSTUV, va3x01234567, 0); |
| 230 |
vacc4x0123 = vdotq_lane_s32(vacc4x0123, vb0123x0123, va4x01234567, 0); |
| 231 |
vacc4x4567 = vdotq_lane_s32(vacc4x4567, vb0123x4567, va4x01234567, 0); |
| 232 |
vacc4x89AB = vdotq_lane_s32(vacc4x89AB, vb0123x89AB, va4x01234567, 0); |
| 233 |
vacc4xCDEF = vdotq_lane_s32(vacc4xCDEF, vb0123xCDEF, va4x01234567, 0); |
| 234 |
vacc4xGHIJ = vdotq_lane_s32(vacc4xGHIJ, vb0123xGHIJ, va4x01234567, 0); |
| 235 |
vacc4xKLMN = vdotq_lane_s32(vacc4xKLMN, vb0123xKLMN, va4x01234567, 0); |
| 236 |
vacc4xOPQR = vdotq_lane_s32(vacc4xOPQR, vb0123xOPQR, va4x01234567, 0); |
| 237 |
vacc4xSTUV = vdotq_lane_s32(vacc4xSTUV, vb0123xSTUV, va4x01234567, 0); |
| 238 |
vacc5x0123 = vdotq_lane_s32(vacc5x0123, vb0123x0123, va5x01234567, 0); |
| 239 |
vacc5x4567 = vdotq_lane_s32(vacc5x4567, vb0123x4567, va5x01234567, 0); |
| 240 |
vacc5x89AB = vdotq_lane_s32(vacc5x89AB, vb0123x89AB, va5x01234567, 0); |
| 241 |
vacc5xCDEF = vdotq_lane_s32(vacc5xCDEF, vb0123xCDEF, va5x01234567, 0); |
| 242 |
vacc5xGHIJ = vdotq_lane_s32(vacc5xGHIJ, vb0123xGHIJ, va5x01234567, 0); |
| 243 |
vacc5xKLMN = vdotq_lane_s32(vacc5xKLMN, vb0123xKLMN, va5x01234567, 0); |
| 244 |
vacc5xOPQR = vdotq_lane_s32(vacc5xOPQR, vb0123xOPQR, va5x01234567, 0); |
| 245 |
vacc5xSTUV = vdotq_lane_s32(vacc5xSTUV, vb0123xSTUV, va5x01234567, 0); |
| 246 |
vacc0x0123 = vdotq_lane_s32(vacc0x0123, vb4567x0123, va0x01234567, 1); |
| 247 |
vacc0x4567 = vdotq_lane_s32(vacc0x4567, vb4567x4567, va0x01234567, 1); |
| 248 |
vacc0x89AB = vdotq_lane_s32(vacc0x89AB, vb4567x89AB, va0x01234567, 1); |
| 249 |
vacc0xCDEF = vdotq_lane_s32(vacc0xCDEF, vb4567xCDEF, va0x01234567, 1); |
| 250 |
vacc0xGHIJ = vdotq_lane_s32(vacc0xGHIJ, vb4567xGHIJ, va0x01234567, 1); |
| 251 |
vacc0xKLMN = vdotq_lane_s32(vacc0xKLMN, vb4567xKLMN, va0x01234567, 1); |
| 252 |
vacc0xOPQR = vdotq_lane_s32(vacc0xOPQR, vb4567xOPQR, va0x01234567, 1); |
| 253 |
vacc0xSTUV = vdotq_lane_s32(vacc0xSTUV, vb4567xSTUV, va0x01234567, 1); |
| 254 |
vacc1x0123 = vdotq_lane_s32(vacc1x0123, vb4567x0123, va1x01234567, 1); |
| 255 |
vacc1x4567 = vdotq_lane_s32(vacc1x4567, vb4567x4567, va1x01234567, 1); |
| 256 |
vacc1x89AB = vdotq_lane_s32(vacc1x89AB, vb4567x89AB, va1x01234567, 1); |
| 257 |
vacc1xCDEF = vdotq_lane_s32(vacc1xCDEF, vb4567xCDEF, va1x01234567, 1); |
| 258 |
vacc1xGHIJ = vdotq_lane_s32(vacc1xGHIJ, vb4567xGHIJ, va1x01234567, 1); |
| 259 |
vacc1xKLMN = vdotq_lane_s32(vacc1xKLMN, vb4567xKLMN, va1x01234567, 1); |
| 260 |
vacc1xOPQR = vdotq_lane_s32(vacc1xOPQR, vb4567xOPQR, va1x01234567, 1); |
| 261 |
vacc1xSTUV = vdotq_lane_s32(vacc1xSTUV, vb4567xSTUV, va1x01234567, 1); |
| 262 |
vacc2x0123 = vdotq_lane_s32(vacc2x0123, vb4567x0123, va2x01234567, 1); |
| 263 |
vacc2x4567 = vdotq_lane_s32(vacc2x4567, vb4567x4567, va2x01234567, 1); |
| 264 |
vacc2x89AB = vdotq_lane_s32(vacc2x89AB, vb4567x89AB, va2x01234567, 1); |
| 265 |
vacc2xCDEF = vdotq_lane_s32(vacc2xCDEF, vb4567xCDEF, va2x01234567, 1); |
| 266 |
vacc2xGHIJ = vdotq_lane_s32(vacc2xGHIJ, vb4567xGHIJ, va2x01234567, 1); |
| 267 |
vacc2xKLMN = vdotq_lane_s32(vacc2xKLMN, vb4567xKLMN, va2x01234567, 1); |
| 268 |
vacc2xOPQR = vdotq_lane_s32(vacc2xOPQR, vb4567xOPQR, va2x01234567, 1); |
| 269 |
vacc2xSTUV = vdotq_lane_s32(vacc2xSTUV, vb4567xSTUV, va2x01234567, 1); |
| 270 |
vacc3x0123 = vdotq_lane_s32(vacc3x0123, vb4567x0123, va3x01234567, 1); |
| 271 |
vacc3x4567 = vdotq_lane_s32(vacc3x4567, vb4567x4567, va3x01234567, 1); |
| 272 |
vacc3x89AB = vdotq_lane_s32(vacc3x89AB, vb4567x89AB, va3x01234567, 1); |
| 273 |
vacc3xCDEF = vdotq_lane_s32(vacc3xCDEF, vb4567xCDEF, va3x01234567, 1); |
| 274 |
vacc3xGHIJ = vdotq_lane_s32(vacc3xGHIJ, vb4567xGHIJ, va3x01234567, 1); |
| 275 |
vacc3xKLMN = vdotq_lane_s32(vacc3xKLMN, vb4567xKLMN, va3x01234567, 1); |
| 276 |
vacc3xOPQR = vdotq_lane_s32(vacc3xOPQR, vb4567xOPQR, va3x01234567, 1); |
| 277 |
vacc3xSTUV = vdotq_lane_s32(vacc3xSTUV, vb4567xSTUV, va3x01234567, 1); |
| 278 |
vacc4x0123 = vdotq_lane_s32(vacc4x0123, vb4567x0123, va4x01234567, 1); |
| 279 |
vacc4x4567 = vdotq_lane_s32(vacc4x4567, vb4567x4567, va4x01234567, 1); |
| 280 |
vacc4x89AB = vdotq_lane_s32(vacc4x89AB, vb4567x89AB, va4x01234567, 1); |
| 281 |
vacc4xCDEF = vdotq_lane_s32(vacc4xCDEF, vb4567xCDEF, va4x01234567, 1); |
| 282 |
vacc4xGHIJ = vdotq_lane_s32(vacc4xGHIJ, vb4567xGHIJ, va4x01234567, 1); |
| 283 |
vacc4xKLMN = vdotq_lane_s32(vacc4xKLMN, vb4567xKLMN, va4x01234567, 1); |
| 284 |
vacc4xOPQR = vdotq_lane_s32(vacc4xOPQR, vb4567xOPQR, va4x01234567, 1); |
| 285 |
vacc4xSTUV = vdotq_lane_s32(vacc4xSTUV, vb4567xSTUV, va4x01234567, 1); |
| 286 |
vacc5x0123 = vdotq_lane_s32(vacc5x0123, vb4567x0123, va5x01234567, 1); |
| 287 |
vacc5x4567 = vdotq_lane_s32(vacc5x4567, vb4567x4567, va5x01234567, 1); |
| 288 |
vacc5x89AB = vdotq_lane_s32(vacc5x89AB, vb4567x89AB, va5x01234567, 1); |
| 289 |
vacc5xCDEF = vdotq_lane_s32(vacc5xCDEF, vb4567xCDEF, va5x01234567, 1); |
| 290 |
vacc5xGHIJ = vdotq_lane_s32(vacc5xGHIJ, vb4567xGHIJ, va5x01234567, 1); |
| 291 |
vacc5xKLMN = vdotq_lane_s32(vacc5xKLMN, vb4567xKLMN, va5x01234567, 1); |
| 292 |
vacc5xOPQR = vdotq_lane_s32(vacc5xOPQR, vb4567xOPQR, va5x01234567, 1); |
| 293 |
vacc5xSTUV = vdotq_lane_s32(vacc5xSTUV, vb4567xSTUV, va5x01234567, 1); |
| 294 |
|
| 295 |
k -= 8 * sizeof(int8_t); |
| 296 |
} |
| 297 |
// Handle up to 4 final positions of `k` |
| 298 |
if XNN_UNLIKELY(k != 0) { |
| 299 |
// Load a 6x4 block of activations. |
| 300 |
const int8x8_t va0x01234567 = vld1_s8(a0); |
| 301 |
const int8x8_t va1x01234567 = vld1_s8(a1); |
| 302 |
const int8x8_t va2x01234567 = vld1_s8(a2); |
| 303 |
const int8x8_t va3x01234567 = vld1_s8(a3); |
| 304 |
const int8x8_t va4x01234567 = vld1_s8(a4); |
| 305 |
const int8x8_t va5x01234567 = vld1_s8(a5); |
| 306 |
|
| 307 |
// Load a 4x32 block of weights. |
| 308 |
const int8x16_t vb0123x0123 = vld1q_s8(w); w = (const int8_t*) w + 16; |
| 309 |
const int8x16_t vb0123x4567 = vld1q_s8(w); w = (const int8_t*) w + 16; |
| 310 |
const int8x16_t vb0123x89AB = vld1q_s8(w); w = (const int8_t*) w + 16; |
| 311 |
const int8x16_t vb0123xCDEF = vld1q_s8(w); w = (const int8_t*) w + 16; |
| 312 |
const int8x16_t vb0123xGHIJ = vld1q_s8(w); w = (const int8_t*) w + 16; |
| 313 |
const int8x16_t vb0123xKLMN = vld1q_s8(w); w = (const int8_t*) w + 16; |
| 314 |
const int8x16_t vb0123xOPQR = vld1q_s8(w); w = (const int8_t*) w + 16; |
| 315 |
const int8x16_t vb0123xSTUV = vld1q_s8(w); w = (const int8_t*) w + 16; |
| 316 |
|
| 317 |
// Multiply-accumulate: 6x4 * 4x32 --> 6x32. |
| 318 |
vacc0x0123 = vdotq_lane_s32(vacc0x0123, vb0123x0123, va0x01234567, 0); |
| 319 |
vacc0x4567 = vdotq_lane_s32(vacc0x4567, vb0123x4567, va0x01234567, 0); |
| 320 |
vacc0x89AB = vdotq_lane_s32(vacc0x89AB, vb0123x89AB, va0x01234567, 0); |
| 321 |
vacc0xCDEF = vdotq_lane_s32(vacc0xCDEF, vb0123xCDEF, va0x01234567, 0); |
| 322 |
vacc0xGHIJ = vdotq_lane_s32(vacc0xGHIJ, vb0123xGHIJ, va0x01234567, 0); |
| 323 |
vacc0xKLMN = vdotq_lane_s32(vacc0xKLMN, vb0123xKLMN, va0x01234567, 0); |
| 324 |
vacc0xOPQR = vdotq_lane_s32(vacc0xOPQR, vb0123xOPQR, va0x01234567, 0); |
| 325 |
vacc0xSTUV = vdotq_lane_s32(vacc0xSTUV, vb0123xSTUV, va0x01234567, 0); |
| 326 |
vacc1x0123 = vdotq_lane_s32(vacc1x0123, vb0123x0123, va1x01234567, 0); |
| 327 |
vacc1x4567 = vdotq_lane_s32(vacc1x4567, vb0123x4567, va1x01234567, 0); |
| 328 |
vacc1x89AB = vdotq_lane_s32(vacc1x89AB, vb0123x89AB, va1x01234567, 0); |
| 329 |
vacc1xCDEF = vdotq_lane_s32(vacc1xCDEF, vb0123xCDEF, va1x01234567, 0); |
| 330 |
vacc1xGHIJ = vdotq_lane_s32(vacc1xGHIJ, vb0123xGHIJ, va1x01234567, 0); |
| 331 |
vacc1xKLMN = vdotq_lane_s32(vacc1xKLMN, vb0123xKLMN, va1x01234567, 0); |
| 332 |
vacc1xOPQR = vdotq_lane_s32(vacc1xOPQR, vb0123xOPQR, va1x01234567, 0); |
| 333 |
vacc1xSTUV = vdotq_lane_s32(vacc1xSTUV, vb0123xSTUV, va1x01234567, 0); |
| 334 |
vacc2x0123 = vdotq_lane_s32(vacc2x0123, vb0123x0123, va2x01234567, 0); |
| 335 |
vacc2x4567 = vdotq_lane_s32(vacc2x4567, vb0123x4567, va2x01234567, 0); |
| 336 |
vacc2x89AB = vdotq_lane_s32(vacc2x89AB, vb0123x89AB, va2x01234567, 0); |
| 337 |
vacc2xCDEF = vdotq_lane_s32(vacc2xCDEF, vb0123xCDEF, va2x01234567, 0); |
| 338 |
vacc2xGHIJ = vdotq_lane_s32(vacc2xGHIJ, vb0123xGHIJ, va2x01234567, 0); |
| 339 |
vacc2xKLMN = vdotq_lane_s32(vacc2xKLMN, vb0123xKLMN, va2x01234567, 0); |
| 340 |
vacc2xOPQR = vdotq_lane_s32(vacc2xOPQR, vb0123xOPQR, va2x01234567, 0); |
| 341 |
vacc2xSTUV = vdotq_lane_s32(vacc2xSTUV, vb0123xSTUV, va2x01234567, 0); |
| 342 |
vacc3x0123 = vdotq_lane_s32(vacc3x0123, vb0123x0123, va3x01234567, 0); |
| 343 |
vacc3x4567 = vdotq_lane_s32(vacc3x4567, vb0123x4567, va3x01234567, 0); |
| 344 |
vacc3x89AB = vdotq_lane_s32(vacc3x89AB, vb0123x89AB, va3x01234567, 0); |
| 345 |
vacc3xCDEF = vdotq_lane_s32(vacc3xCDEF, vb0123xCDEF, va3x01234567, 0); |
| 346 |
vacc3xGHIJ = vdotq_lane_s32(vacc3xGHIJ, vb0123xGHIJ, va3x01234567, 0); |
| 347 |
vacc3xKLMN = vdotq_lane_s32(vacc3xKLMN, vb0123xKLMN, va3x01234567, 0); |
| 348 |
vacc3xOPQR = vdotq_lane_s32(vacc3xOPQR, vb0123xOPQR, va3x01234567, 0); |
| 349 |
vacc3xSTUV = vdotq_lane_s32(vacc3xSTUV, vb0123xSTUV, va3x01234567, 0); |
| 350 |
vacc4x0123 = vdotq_lane_s32(vacc4x0123, vb0123x0123, va4x01234567, 0); |
| 351 |
vacc4x4567 = vdotq_lane_s32(vacc4x4567, vb0123x4567, va4x01234567, 0); |
| 352 |
vacc4x89AB = vdotq_lane_s32(vacc4x89AB, vb0123x89AB, va4x01234567, 0); |
| 353 |
vacc4xCDEF = vdotq_lane_s32(vacc4xCDEF, vb0123xCDEF, va4x01234567, 0); |
| 354 |
vacc4xGHIJ = vdotq_lane_s32(vacc4xGHIJ, vb0123xGHIJ, va4x01234567, 0); |
| 355 |
vacc4xKLMN = vdotq_lane_s32(vacc4xKLMN, vb0123xKLMN, va4x01234567, 0); |
| 356 |
vacc4xOPQR = vdotq_lane_s32(vacc4xOPQR, vb0123xOPQR, va4x01234567, 0); |
| 357 |
vacc4xSTUV = vdotq_lane_s32(vacc4xSTUV, vb0123xSTUV, va4x01234567, 0); |
| 358 |
vacc5x0123 = vdotq_lane_s32(vacc5x0123, vb0123x0123, va5x01234567, 0); |
| 359 |
vacc5x4567 = vdotq_lane_s32(vacc5x4567, vb0123x4567, va5x01234567, 0); |
| 360 |
vacc5x89AB = vdotq_lane_s32(vacc5x89AB, vb0123x89AB, va5x01234567, 0); |
| 361 |
vacc5xCDEF = vdotq_lane_s32(vacc5xCDEF, vb0123xCDEF, va5x01234567, 0); |
| 362 |
vacc5xGHIJ = vdotq_lane_s32(vacc5xGHIJ, vb0123xGHIJ, va5x01234567, 0); |
| 363 |
vacc5xKLMN = vdotq_lane_s32(vacc5xKLMN, vb0123xKLMN, va5x01234567, 0); |
| 364 |
vacc5xOPQR = vdotq_lane_s32(vacc5xOPQR, vb0123xOPQR, va5x01234567, 0); |
| 365 |
vacc5xSTUV = vdotq_lane_s32(vacc5xSTUV, vb0123xSTUV, va5x01234567, 0); |
| 366 |
} |
| 367 |
p -= 6 * sizeof(void*); |
| 368 |
} while (p != 0); |
| 369 |
|
| 370 |
float32x4_t vout0x0123 = vcvtq_f32_s32(vacc0x0123); |
| 371 |
float32x4_t vout0x4567 = vcvtq_f32_s32(vacc0x4567); |
| 372 |
float32x4_t vout0x89AB = vcvtq_f32_s32(vacc0x89AB); |
| 373 |
float32x4_t vout0xCDEF = vcvtq_f32_s32(vacc0xCDEF); |
| 374 |
float32x4_t vout0xGHIJ = vcvtq_f32_s32(vacc0xGHIJ); |
| 375 |
float32x4_t vout0xKLMN = vcvtq_f32_s32(vacc0xKLMN); |
| 376 |
float32x4_t vout0xOPQR = vcvtq_f32_s32(vacc0xOPQR); |
| 377 |
float32x4_t vout0xSTUV = vcvtq_f32_s32(vacc0xSTUV); |
| 378 |
float32x4_t vout1x0123 = vcvtq_f32_s32(vacc1x0123); |
| 379 |
float32x4_t vout1x4567 = vcvtq_f32_s32(vacc1x4567); |
| 380 |
float32x4_t vout1x89AB = vcvtq_f32_s32(vacc1x89AB); |
| 381 |
float32x4_t vout1xCDEF = vcvtq_f32_s32(vacc1xCDEF); |
| 382 |
float32x4_t vout1xGHIJ = vcvtq_f32_s32(vacc1xGHIJ); |
| 383 |
float32x4_t vout1xKLMN = vcvtq_f32_s32(vacc1xKLMN); |
| 384 |
float32x4_t vout1xOPQR = vcvtq_f32_s32(vacc1xOPQR); |
| 385 |
float32x4_t vout1xSTUV = vcvtq_f32_s32(vacc1xSTUV); |
| 386 |
float32x4_t vout2x0123 = vcvtq_f32_s32(vacc2x0123); |
| 387 |
float32x4_t vout2x4567 = vcvtq_f32_s32(vacc2x4567); |
| 388 |
float32x4_t vout2x89AB = vcvtq_f32_s32(vacc2x89AB); |
| 389 |
float32x4_t vout2xCDEF = vcvtq_f32_s32(vacc2xCDEF); |
| 390 |
float32x4_t vout2xGHIJ = vcvtq_f32_s32(vacc2xGHIJ); |
| 391 |
float32x4_t vout2xKLMN = vcvtq_f32_s32(vacc2xKLMN); |
| 392 |
float32x4_t vout2xOPQR = vcvtq_f32_s32(vacc2xOPQR); |
| 393 |
float32x4_t vout2xSTUV = vcvtq_f32_s32(vacc2xSTUV); |
| 394 |
float32x4_t vout3x0123 = vcvtq_f32_s32(vacc3x0123); |
| 395 |
float32x4_t vout3x4567 = vcvtq_f32_s32(vacc3x4567); |
| 396 |
float32x4_t vout3x89AB = vcvtq_f32_s32(vacc3x89AB); |
| 397 |
float32x4_t vout3xCDEF = vcvtq_f32_s32(vacc3xCDEF); |
| 398 |
float32x4_t vout3xGHIJ = vcvtq_f32_s32(vacc3xGHIJ); |
| 399 |
float32x4_t vout3xKLMN = vcvtq_f32_s32(vacc3xKLMN); |
| 400 |
float32x4_t vout3xOPQR = vcvtq_f32_s32(vacc3xOPQR); |
| 401 |
float32x4_t vout3xSTUV = vcvtq_f32_s32(vacc3xSTUV); |
| 402 |
float32x4_t vout4x0123 = vcvtq_f32_s32(vacc4x0123); |
| 403 |
float32x4_t vout4x4567 = vcvtq_f32_s32(vacc4x4567); |
| 404 |
float32x4_t vout4x89AB = vcvtq_f32_s32(vacc4x89AB); |
| 405 |
float32x4_t vout4xCDEF = vcvtq_f32_s32(vacc4xCDEF); |
| 406 |
float32x4_t vout4xGHIJ = vcvtq_f32_s32(vacc4xGHIJ); |
| 407 |
float32x4_t vout4xKLMN = vcvtq_f32_s32(vacc4xKLMN); |
| 408 |
float32x4_t vout4xOPQR = vcvtq_f32_s32(vacc4xOPQR); |
| 409 |
float32x4_t vout4xSTUV = vcvtq_f32_s32(vacc4xSTUV); |
| 410 |
float32x4_t vout5x0123 = vcvtq_f32_s32(vacc5x0123); |
| 411 |
float32x4_t vout5x4567 = vcvtq_f32_s32(vacc5x4567); |
| 412 |
float32x4_t vout5x89AB = vcvtq_f32_s32(vacc5x89AB); |
| 413 |
float32x4_t vout5xCDEF = vcvtq_f32_s32(vacc5xCDEF); |
| 414 |
float32x4_t vout5xGHIJ = vcvtq_f32_s32(vacc5xGHIJ); |
| 415 |
float32x4_t vout5xKLMN = vcvtq_f32_s32(vacc5xKLMN); |
| 416 |
float32x4_t vout5xOPQR = vcvtq_f32_s32(vacc5xOPQR); |
| 417 |
float32x4_t vout5xSTUV = vcvtq_f32_s32(vacc5xSTUV); |
| 418 |
const float32x4_t vinput_scale = vld1q_dup_f32(&quantization_params->inv_scale); |
| 419 |
vout0x0123 = vmulq_f32(vout0x0123, vinput_scale); |
| 420 |
vout0x4567 = vmulq_f32(vout0x4567, vinput_scale); |
| 421 |
vout0x89AB = vmulq_f32(vout0x89AB, vinput_scale); |
| 422 |
vout0xCDEF = vmulq_f32(vout0xCDEF, vinput_scale); |
| 423 |
vout0xGHIJ = vmulq_f32(vout0xGHIJ, vinput_scale); |
| 424 |
vout0xKLMN = vmulq_f32(vout0xKLMN, vinput_scale); |
| 425 |
vout0xOPQR = vmulq_f32(vout0xOPQR, vinput_scale); |
| 426 |
vout0xSTUV = vmulq_f32(vout0xSTUV, vinput_scale); |
| 427 |
vout1x0123 = vmulq_f32(vout1x0123, vinput_scale); |
| 428 |
vout1x4567 = vmulq_f32(vout1x4567, vinput_scale); |
| 429 |
vout1x89AB = vmulq_f32(vout1x89AB, vinput_scale); |
| 430 |
vout1xCDEF = vmulq_f32(vout1xCDEF, vinput_scale); |
| 431 |
vout1xGHIJ = vmulq_f32(vout1xGHIJ, vinput_scale); |
| 432 |
vout1xKLMN = vmulq_f32(vout1xKLMN, vinput_scale); |
| 433 |
vout1xOPQR = vmulq_f32(vout1xOPQR, vinput_scale); |
| 434 |
vout1xSTUV = vmulq_f32(vout1xSTUV, vinput_scale); |
| 435 |
vout2x0123 = vmulq_f32(vout2x0123, vinput_scale); |
| 436 |
vout2x4567 = vmulq_f32(vout2x4567, vinput_scale); |
| 437 |
vout2x89AB = vmulq_f32(vout2x89AB, vinput_scale); |
| 438 |
vout2xCDEF = vmulq_f32(vout2xCDEF, vinput_scale); |
| 439 |
vout2xGHIJ = vmulq_f32(vout2xGHIJ, vinput_scale); |
| 440 |
vout2xKLMN = vmulq_f32(vout2xKLMN, vinput_scale); |
| 441 |
vout2xOPQR = vmulq_f32(vout2xOPQR, vinput_scale); |
| 442 |
vout2xSTUV = vmulq_f32(vout2xSTUV, vinput_scale); |
| 443 |
vout3x0123 = vmulq_f32(vout3x0123, vinput_scale); |
| 444 |
vout3x4567 = vmulq_f32(vout3x4567, vinput_scale); |
| 445 |
vout3x89AB = vmulq_f32(vout3x89AB, vinput_scale); |
| 446 |
vout3xCDEF = vmulq_f32(vout3xCDEF, vinput_scale); |
| 447 |
vout3xGHIJ = vmulq_f32(vout3xGHIJ, vinput_scale); |
| 448 |
vout3xKLMN = vmulq_f32(vout3xKLMN, vinput_scale); |
| 449 |
vout3xOPQR = vmulq_f32(vout3xOPQR, vinput_scale); |
| 450 |
vout3xSTUV = vmulq_f32(vout3xSTUV, vinput_scale); |
| 451 |
vout4x0123 = vmulq_f32(vout4x0123, vinput_scale); |
| 452 |
vout4x4567 = vmulq_f32(vout4x4567, vinput_scale); |
| 453 |
vout4x89AB = vmulq_f32(vout4x89AB, vinput_scale); |
| 454 |
vout4xCDEF = vmulq_f32(vout4xCDEF, vinput_scale); |
| 455 |
vout4xGHIJ = vmulq_f32(vout4xGHIJ, vinput_scale); |
| 456 |
vout4xKLMN = vmulq_f32(vout4xKLMN, vinput_scale); |
| 457 |
vout4xOPQR = vmulq_f32(vout4xOPQR, vinput_scale); |
| 458 |
vout4xSTUV = vmulq_f32(vout4xSTUV, vinput_scale); |
| 459 |
vout5x0123 = vmulq_f32(vout5x0123, vinput_scale); |
| 460 |
vout5x4567 = vmulq_f32(vout5x4567, vinput_scale); |
| 461 |
vout5x89AB = vmulq_f32(vout5x89AB, vinput_scale); |
| 462 |
vout5xCDEF = vmulq_f32(vout5xCDEF, vinput_scale); |
| 463 |
vout5xGHIJ = vmulq_f32(vout5xGHIJ, vinput_scale); |
| 464 |
vout5xKLMN = vmulq_f32(vout5xKLMN, vinput_scale); |
| 465 |
vout5xOPQR = vmulq_f32(vout5xOPQR, vinput_scale); |
| 466 |
vout5xSTUV = vmulq_f32(vout5xSTUV, vinput_scale); |
| 467 |
|
| 468 |
const float32x4_t vfilter_output_scale0123 = vld1q_f32(w); w = (const float*) w + 4; |
| 469 |
const float32x4_t vfilter_output_scale4567 = vld1q_f32(w); w = (const float*) w + 4; |
| 470 |
const float32x4_t vfilter_output_scale89AB = vld1q_f32(w); w = (const float*) w + 4; |
| 471 |
const float32x4_t vfilter_output_scaleCDEF = vld1q_f32(w); w = (const float*) w + 4; |
| 472 |
const float32x4_t vfilter_output_scaleGHIJ = vld1q_f32(w); w = (const float*) w + 4; |
| 473 |
const float32x4_t vfilter_output_scaleKLMN = vld1q_f32(w); w = (const float*) w + 4; |
| 474 |
const float32x4_t vfilter_output_scaleOPQR = vld1q_f32(w); w = (const float*) w + 4; |
| 475 |
const float32x4_t vfilter_output_scaleSTUV = vld1q_f32(w); w = (const float*) w + 4; |
| 476 |
|
| 477 |
const float32x4_t vbias0123 = vld1q_f32(w); w = (const float*) w + 4; |
| 478 |
#if XNN_ARCH_ARM64 |
| 479 |
vout0x0123 = vfmaq_f32(vbias0123, vout0x0123, vfilter_output_scale0123); |
| 480 |
vout1x0123 = vfmaq_f32(vbias0123, vout1x0123, vfilter_output_scale0123); |
| 481 |
vout2x0123 = vfmaq_f32(vbias0123, vout2x0123, vfilter_output_scale0123); |
| 482 |
vout3x0123 = vfmaq_f32(vbias0123, vout3x0123, vfilter_output_scale0123); |
| 483 |
vout4x0123 = vfmaq_f32(vbias0123, vout4x0123, vfilter_output_scale0123); |
| 484 |
vout5x0123 = vfmaq_f32(vbias0123, vout5x0123, vfilter_output_scale0123); |
| 485 |
#else |
| 486 |
vout0x0123 = vmlaq_f32(vbias0123, vout0x0123, vfilter_output_scale0123); |
| 487 |
vout1x0123 = vmlaq_f32(vbias0123, vout1x0123, vfilter_output_scale0123); |
| 488 |
vout2x0123 = vmlaq_f32(vbias0123, vout2x0123, vfilter_output_scale0123); |
| 489 |
vout3x0123 = vmlaq_f32(vbias0123, vout3x0123, vfilter_output_scale0123); |
| 490 |
vout4x0123 = vmlaq_f32(vbias0123, vout4x0123, vfilter_output_scale0123); |
| 491 |
vout5x0123 = vmlaq_f32(vbias0123, vout5x0123, vfilter_output_scale0123); |
| 492 |
#endif |
| 493 |
const float32x4_t vbias4567 = vld1q_f32(w); w = (const float*) w + 4; |
| 494 |
#if XNN_ARCH_ARM64 |
| 495 |
vout0x4567 = vfmaq_f32(vbias4567, vout0x4567, vfilter_output_scale4567); |
| 496 |
vout1x4567 = vfmaq_f32(vbias4567, vout1x4567, vfilter_output_scale4567); |
| 497 |
vout2x4567 = vfmaq_f32(vbias4567, vout2x4567, vfilter_output_scale4567); |
| 498 |
vout3x4567 = vfmaq_f32(vbias4567, vout3x4567, vfilter_output_scale4567); |
| 499 |
vout4x4567 = vfmaq_f32(vbias4567, vout4x4567, vfilter_output_scale4567); |
| 500 |
vout5x4567 = vfmaq_f32(vbias4567, vout5x4567, vfilter_output_scale4567); |
| 501 |
#else |
| 502 |
vout0x4567 = vmlaq_f32(vbias4567, vout0x4567, vfilter_output_scale4567); |
| 503 |
vout1x4567 = vmlaq_f32(vbias4567, vout1x4567, vfilter_output_scale4567); |
| 504 |
vout2x4567 = vmlaq_f32(vbias4567, vout2x4567, vfilter_output_scale4567); |
| 505 |
vout3x4567 = vmlaq_f32(vbias4567, vout3x4567, vfilter_output_scale4567); |
| 506 |
vout4x4567 = vmlaq_f32(vbias4567, vout4x4567, vfilter_output_scale4567); |
| 507 |
vout5x4567 = vmlaq_f32(vbias4567, vout5x4567, vfilter_output_scale4567); |
| 508 |
#endif |
| 509 |
const float32x4_t vbias89AB = vld1q_f32(w); w = (const float*) w + 4; |
| 510 |
#if XNN_ARCH_ARM64 |
| 511 |
vout0x89AB = vfmaq_f32(vbias89AB, vout0x89AB, vfilter_output_scale89AB); |
| 512 |
vout1x89AB = vfmaq_f32(vbias89AB, vout1x89AB, vfilter_output_scale89AB); |
| 513 |
vout2x89AB = vfmaq_f32(vbias89AB, vout2x89AB, vfilter_output_scale89AB); |
| 514 |
vout3x89AB = vfmaq_f32(vbias89AB, vout3x89AB, vfilter_output_scale89AB); |
| 515 |
vout4x89AB = vfmaq_f32(vbias89AB, vout4x89AB, vfilter_output_scale89AB); |
| 516 |
vout5x89AB = vfmaq_f32(vbias89AB, vout5x89AB, vfilter_output_scale89AB); |
| 517 |
#else |
| 518 |
vout0x89AB = vmlaq_f32(vbias89AB, vout0x89AB, vfilter_output_scale89AB); |
| 519 |
vout1x89AB = vmlaq_f32(vbias89AB, vout1x89AB, vfilter_output_scale89AB); |
| 520 |
vout2x89AB = vmlaq_f32(vbias89AB, vout2x89AB, vfilter_output_scale89AB); |
| 521 |
vout3x89AB = vmlaq_f32(vbias89AB, vout3x89AB, vfilter_output_scale89AB); |
| 522 |
vout4x89AB = vmlaq_f32(vbias89AB, vout4x89AB, vfilter_output_scale89AB); |
| 523 |
vout5x89AB = vmlaq_f32(vbias89AB, vout5x89AB, vfilter_output_scale89AB); |
| 524 |
#endif |
| 525 |
const float32x4_t vbiasCDEF = vld1q_f32(w); w = (const float*) w + 4; |
| 526 |
#if XNN_ARCH_ARM64 |
| 527 |
vout0xCDEF = vfmaq_f32(vbiasCDEF, vout0xCDEF, vfilter_output_scaleCDEF); |
| 528 |
vout1xCDEF = vfmaq_f32(vbiasCDEF, vout1xCDEF, vfilter_output_scaleCDEF); |
| 529 |
vout2xCDEF = vfmaq_f32(vbiasCDEF, vout2xCDEF, vfilter_output_scaleCDEF); |
| 530 |
vout3xCDEF = vfmaq_f32(vbiasCDEF, vout3xCDEF, vfilter_output_scaleCDEF); |
| 531 |
vout4xCDEF = vfmaq_f32(vbiasCDEF, vout4xCDEF, vfilter_output_scaleCDEF); |
| 532 |
vout5xCDEF = vfmaq_f32(vbiasCDEF, vout5xCDEF, vfilter_output_scaleCDEF); |
| 533 |
#else |
| 534 |
vout0xCDEF = vmlaq_f32(vbiasCDEF, vout0xCDEF, vfilter_output_scaleCDEF); |
| 535 |
vout1xCDEF = vmlaq_f32(vbiasCDEF, vout1xCDEF, vfilter_output_scaleCDEF); |
| 536 |
vout2xCDEF = vmlaq_f32(vbiasCDEF, vout2xCDEF, vfilter_output_scaleCDEF); |
| 537 |
vout3xCDEF = vmlaq_f32(vbiasCDEF, vout3xCDEF, vfilter_output_scaleCDEF); |
| 538 |
vout4xCDEF = vmlaq_f32(vbiasCDEF, vout4xCDEF, vfilter_output_scaleCDEF); |
| 539 |
vout5xCDEF = vmlaq_f32(vbiasCDEF, vout5xCDEF, vfilter_output_scaleCDEF); |
| 540 |
#endif |
| 541 |
const float32x4_t vbiasGHIJ = vld1q_f32(w); w = (const float*) w + 4; |
| 542 |
#if XNN_ARCH_ARM64 |
| 543 |
vout0xGHIJ = vfmaq_f32(vbiasGHIJ, vout0xGHIJ, vfilter_output_scaleGHIJ); |
| 544 |
vout1xGHIJ = vfmaq_f32(vbiasGHIJ, vout1xGHIJ, vfilter_output_scaleGHIJ); |
| 545 |
vout2xGHIJ = vfmaq_f32(vbiasGHIJ, vout2xGHIJ, vfilter_output_scaleGHIJ); |
| 546 |
vout3xGHIJ = vfmaq_f32(vbiasGHIJ, vout3xGHIJ, vfilter_output_scaleGHIJ); |
| 547 |
vout4xGHIJ = vfmaq_f32(vbiasGHIJ, vout4xGHIJ, vfilter_output_scaleGHIJ); |
| 548 |
vout5xGHIJ = vfmaq_f32(vbiasGHIJ, vout5xGHIJ, vfilter_output_scaleGHIJ); |
| 549 |
#else |
| 550 |
vout0xGHIJ = vmlaq_f32(vbiasGHIJ, vout0xGHIJ, vfilter_output_scaleGHIJ); |
| 551 |
vout1xGHIJ = vmlaq_f32(vbiasGHIJ, vout1xGHIJ, vfilter_output_scaleGHIJ); |
| 552 |
vout2xGHIJ = vmlaq_f32(vbiasGHIJ, vout2xGHIJ, vfilter_output_scaleGHIJ); |
| 553 |
vout3xGHIJ = vmlaq_f32(vbiasGHIJ, vout3xGHIJ, vfilter_output_scaleGHIJ); |
| 554 |
vout4xGHIJ = vmlaq_f32(vbiasGHIJ, vout4xGHIJ, vfilter_output_scaleGHIJ); |
| 555 |
vout5xGHIJ = vmlaq_f32(vbiasGHIJ, vout5xGHIJ, vfilter_output_scaleGHIJ); |
| 556 |
#endif |
| 557 |
const float32x4_t vbiasKLMN = vld1q_f32(w); w = (const float*) w + 4; |
| 558 |
#if XNN_ARCH_ARM64 |
| 559 |
vout0xKLMN = vfmaq_f32(vbiasKLMN, vout0xKLMN, vfilter_output_scaleKLMN); |
| 560 |
vout1xKLMN = vfmaq_f32(vbiasKLMN, vout1xKLMN, vfilter_output_scaleKLMN); |
| 561 |
vout2xKLMN = vfmaq_f32(vbiasKLMN, vout2xKLMN, vfilter_output_scaleKLMN); |
| 562 |
vout3xKLMN = vfmaq_f32(vbiasKLMN, vout3xKLMN, vfilter_output_scaleKLMN); |
| 563 |
vout4xKLMN = vfmaq_f32(vbiasKLMN, vout4xKLMN, vfilter_output_scaleKLMN); |
| 564 |
vout5xKLMN = vfmaq_f32(vbiasKLMN, vout5xKLMN, vfilter_output_scaleKLMN); |
| 565 |
#else |
| 566 |
vout0xKLMN = vmlaq_f32(vbiasKLMN, vout0xKLMN, vfilter_output_scaleKLMN); |
| 567 |
vout1xKLMN = vmlaq_f32(vbiasKLMN, vout1xKLMN, vfilter_output_scaleKLMN); |
| 568 |
vout2xKLMN = vmlaq_f32(vbiasKLMN, vout2xKLMN, vfilter_output_scaleKLMN); |
| 569 |
vout3xKLMN = vmlaq_f32(vbiasKLMN, vout3xKLMN, vfilter_output_scaleKLMN); |
| 570 |
vout4xKLMN = vmlaq_f32(vbiasKLMN, vout4xKLMN, vfilter_output_scaleKLMN); |
| 571 |
vout5xKLMN = vmlaq_f32(vbiasKLMN, vout5xKLMN, vfilter_output_scaleKLMN); |
| 572 |
#endif |
| 573 |
const float32x4_t vbiasOPQR = vld1q_f32(w); w = (const float*) w + 4; |
| 574 |
#if XNN_ARCH_ARM64 |
| 575 |
vout0xOPQR = vfmaq_f32(vbiasOPQR, vout0xOPQR, vfilter_output_scaleOPQR); |
| 576 |
vout1xOPQR = vfmaq_f32(vbiasOPQR, vout1xOPQR, vfilter_output_scaleOPQR); |
| 577 |
vout2xOPQR = vfmaq_f32(vbiasOPQR, vout2xOPQR, vfilter_output_scaleOPQR); |
| 578 |
vout3xOPQR = vfmaq_f32(vbiasOPQR, vout3xOPQR, vfilter_output_scaleOPQR); |
| 579 |
vout4xOPQR = vfmaq_f32(vbiasOPQR, vout4xOPQR, vfilter_output_scaleOPQR); |
| 580 |
vout5xOPQR = vfmaq_f32(vbiasOPQR, vout5xOPQR, vfilter_output_scaleOPQR); |
| 581 |
#else |
| 582 |
vout0xOPQR = vmlaq_f32(vbiasOPQR, vout0xOPQR, vfilter_output_scaleOPQR); |
| 583 |
vout1xOPQR = vmlaq_f32(vbiasOPQR, vout1xOPQR, vfilter_output_scaleOPQR); |
| 584 |
vout2xOPQR = vmlaq_f32(vbiasOPQR, vout2xOPQR, vfilter_output_scaleOPQR); |
| 585 |
vout3xOPQR = vmlaq_f32(vbiasOPQR, vout3xOPQR, vfilter_output_scaleOPQR); |
| 586 |
vout4xOPQR = vmlaq_f32(vbiasOPQR, vout4xOPQR, vfilter_output_scaleOPQR); |
| 587 |
vout5xOPQR = vmlaq_f32(vbiasOPQR, vout5xOPQR, vfilter_output_scaleOPQR); |
| 588 |
#endif |
| 589 |
const float32x4_t vbiasSTUV = vld1q_f32(w); w = (const float*) w + 4; |
| 590 |
#if XNN_ARCH_ARM64 |
| 591 |
vout0xSTUV = vfmaq_f32(vbiasSTUV, vout0xSTUV, vfilter_output_scaleSTUV); |
| 592 |
vout1xSTUV = vfmaq_f32(vbiasSTUV, vout1xSTUV, vfilter_output_scaleSTUV); |
| 593 |
vout2xSTUV = vfmaq_f32(vbiasSTUV, vout2xSTUV, vfilter_output_scaleSTUV); |
| 594 |
vout3xSTUV = vfmaq_f32(vbiasSTUV, vout3xSTUV, vfilter_output_scaleSTUV); |
| 595 |
vout4xSTUV = vfmaq_f32(vbiasSTUV, vout4xSTUV, vfilter_output_scaleSTUV); |
| 596 |
vout5xSTUV = vfmaq_f32(vbiasSTUV, vout5xSTUV, vfilter_output_scaleSTUV); |
| 597 |
#else |
| 598 |
vout0xSTUV = vmlaq_f32(vbiasSTUV, vout0xSTUV, vfilter_output_scaleSTUV); |
| 599 |
vout1xSTUV = vmlaq_f32(vbiasSTUV, vout1xSTUV, vfilter_output_scaleSTUV); |
| 600 |
vout2xSTUV = vmlaq_f32(vbiasSTUV, vout2xSTUV, vfilter_output_scaleSTUV); |
| 601 |
vout3xSTUV = vmlaq_f32(vbiasSTUV, vout3xSTUV, vfilter_output_scaleSTUV); |
| 602 |
vout4xSTUV = vmlaq_f32(vbiasSTUV, vout4xSTUV, vfilter_output_scaleSTUV); |
| 603 |
vout5xSTUV = vmlaq_f32(vbiasSTUV, vout5xSTUV, vfilter_output_scaleSTUV); |
| 604 |
#endif |
| 605 |
|
| 606 |
float16x8_t vfp16out0x01234567 = vcombine_f16(vcvt_f16_f32(vout0x0123), vcvt_f16_f32(vout0x4567)); |
| 607 |
float16x8_t vfp16out0x89ABCDEF = vcombine_f16(vcvt_f16_f32(vout0x89AB), vcvt_f16_f32(vout0xCDEF)); |
| 608 |
float16x8_t vfp16out0xGHIJKLMN = vcombine_f16(vcvt_f16_f32(vout0xGHIJ), vcvt_f16_f32(vout0xKLMN)); |
| 609 |
float16x8_t vfp16out0xOPQRSTUV = vcombine_f16(vcvt_f16_f32(vout0xOPQR), vcvt_f16_f32(vout0xSTUV)); |
| 610 |
float16x8_t vfp16out1x01234567 = vcombine_f16(vcvt_f16_f32(vout1x0123), vcvt_f16_f32(vout1x4567)); |
| 611 |
float16x8_t vfp16out1x89ABCDEF = vcombine_f16(vcvt_f16_f32(vout1x89AB), vcvt_f16_f32(vout1xCDEF)); |
| 612 |
float16x8_t vfp16out1xGHIJKLMN = vcombine_f16(vcvt_f16_f32(vout1xGHIJ), vcvt_f16_f32(vout1xKLMN)); |
| 613 |
float16x8_t vfp16out1xOPQRSTUV = vcombine_f16(vcvt_f16_f32(vout1xOPQR), vcvt_f16_f32(vout1xSTUV)); |
| 614 |
float16x8_t vfp16out2x01234567 = vcombine_f16(vcvt_f16_f32(vout2x0123), vcvt_f16_f32(vout2x4567)); |
| 615 |
float16x8_t vfp16out2x89ABCDEF = vcombine_f16(vcvt_f16_f32(vout2x89AB), vcvt_f16_f32(vout2xCDEF)); |
| 616 |
float16x8_t vfp16out2xGHIJKLMN = vcombine_f16(vcvt_f16_f32(vout2xGHIJ), vcvt_f16_f32(vout2xKLMN)); |
| 617 |
float16x8_t vfp16out2xOPQRSTUV = vcombine_f16(vcvt_f16_f32(vout2xOPQR), vcvt_f16_f32(vout2xSTUV)); |
| 618 |
float16x8_t vfp16out3x01234567 = vcombine_f16(vcvt_f16_f32(vout3x0123), vcvt_f16_f32(vout3x4567)); |
| 619 |
float16x8_t vfp16out3x89ABCDEF = vcombine_f16(vcvt_f16_f32(vout3x89AB), vcvt_f16_f32(vout3xCDEF)); |
| 620 |
float16x8_t vfp16out3xGHIJKLMN = vcombine_f16(vcvt_f16_f32(vout3xGHIJ), vcvt_f16_f32(vout3xKLMN)); |
| 621 |
float16x8_t vfp16out3xOPQRSTUV = vcombine_f16(vcvt_f16_f32(vout3xOPQR), vcvt_f16_f32(vout3xSTUV)); |
| 622 |
float16x8_t vfp16out4x01234567 = vcombine_f16(vcvt_f16_f32(vout4x0123), vcvt_f16_f32(vout4x4567)); |
| 623 |
float16x8_t vfp16out4x89ABCDEF = vcombine_f16(vcvt_f16_f32(vout4x89AB), vcvt_f16_f32(vout4xCDEF)); |
| 624 |
float16x8_t vfp16out4xGHIJKLMN = vcombine_f16(vcvt_f16_f32(vout4xGHIJ), vcvt_f16_f32(vout4xKLMN)); |
| 625 |
float16x8_t vfp16out4xOPQRSTUV = vcombine_f16(vcvt_f16_f32(vout4xOPQR), vcvt_f16_f32(vout4xSTUV)); |
| 626 |
float16x8_t vfp16out5x01234567 = vcombine_f16(vcvt_f16_f32(vout5x0123), vcvt_f16_f32(vout5x4567)); |
| 627 |
float16x8_t vfp16out5x89ABCDEF = vcombine_f16(vcvt_f16_f32(vout5x89AB), vcvt_f16_f32(vout5xCDEF)); |
| 628 |
float16x8_t vfp16out5xGHIJKLMN = vcombine_f16(vcvt_f16_f32(vout5xGHIJ), vcvt_f16_f32(vout5xKLMN)); |
| 629 |
float16x8_t vfp16out5xOPQRSTUV = vcombine_f16(vcvt_f16_f32(vout5xOPQR), vcvt_f16_f32(vout5xSTUV)); |
| 630 |
|
| 631 |
const float16x8_t voutput_min = vreinterpretq_f16_u16(vld1q_dup_u16((const uint16_t*) ¶ms->scalar.min)); |
| 632 |
vfp16out0x01234567 = vmaxq_f16(vfp16out0x01234567, voutput_min); |
| 633 |
vfp16out0x89ABCDEF = vmaxq_f16(vfp16out0x89ABCDEF, voutput_min); |
| 634 |
vfp16out0xGHIJKLMN = vmaxq_f16(vfp16out0xGHIJKLMN, voutput_min); |
| 635 |
vfp16out0xOPQRSTUV = vmaxq_f16(vfp16out0xOPQRSTUV, voutput_min); |
| 636 |
vfp16out1x01234567 = vmaxq_f16(vfp16out1x01234567, voutput_min); |
| 637 |
vfp16out1x89ABCDEF = vmaxq_f16(vfp16out1x89ABCDEF, voutput_min); |
| 638 |
vfp16out1xGHIJKLMN = vmaxq_f16(vfp16out1xGHIJKLMN, voutput_min); |
| 639 |
vfp16out1xOPQRSTUV = vmaxq_f16(vfp16out1xOPQRSTUV, voutput_min); |
| 640 |
vfp16out2x01234567 = vmaxq_f16(vfp16out2x01234567, voutput_min); |
| 641 |
vfp16out2x89ABCDEF = vmaxq_f16(vfp16out2x89ABCDEF, voutput_min); |
| 642 |
vfp16out2xGHIJKLMN = vmaxq_f16(vfp16out2xGHIJKLMN, voutput_min); |
| 643 |
vfp16out2xOPQRSTUV = vmaxq_f16(vfp16out2xOPQRSTUV, voutput_min); |
| 644 |
vfp16out3x01234567 = vmaxq_f16(vfp16out3x01234567, voutput_min); |
| 645 |
vfp16out3x89ABCDEF = vmaxq_f16(vfp16out3x89ABCDEF, voutput_min); |
| 646 |
vfp16out3xGHIJKLMN = vmaxq_f16(vfp16out3xGHIJKLMN, voutput_min); |
| 647 |
vfp16out3xOPQRSTUV = vmaxq_f16(vfp16out3xOPQRSTUV, voutput_min); |
| 648 |
vfp16out4x01234567 = vmaxq_f16(vfp16out4x01234567, voutput_min); |
| 649 |
vfp16out4x89ABCDEF = vmaxq_f16(vfp16out4x89ABCDEF, voutput_min); |
| 650 |
vfp16out4xGHIJKLMN = vmaxq_f16(vfp16out4xGHIJKLMN, voutput_min); |
| 651 |
vfp16out4xOPQRSTUV = vmaxq_f16(vfp16out4xOPQRSTUV, voutput_min); |
| 652 |
vfp16out5x01234567 = vmaxq_f16(vfp16out5x01234567, voutput_min); |
| 653 |
vfp16out5x89ABCDEF = vmaxq_f16(vfp16out5x89ABCDEF, voutput_min); |
| 654 |
vfp16out5xGHIJKLMN = vmaxq_f16(vfp16out5xGHIJKLMN, voutput_min); |
| 655 |
vfp16out5xOPQRSTUV = vmaxq_f16(vfp16out5xOPQRSTUV, voutput_min); |
| 656 |
const float16x8_t voutput_max = vreinterpretq_f16_u16(vld1q_dup_u16((const uint16_t*) ¶ms->scalar.max)); |
| 657 |
vfp16out0x01234567 = vminq_f16(vfp16out0x01234567, voutput_max); |
| 658 |
vfp16out0x89ABCDEF = vminq_f16(vfp16out0x89ABCDEF, voutput_max); |
| 659 |
vfp16out0xGHIJKLMN = vminq_f16(vfp16out0xGHIJKLMN, voutput_max); |
| 660 |
vfp16out0xOPQRSTUV = vminq_f16(vfp16out0xOPQRSTUV, voutput_max); |
| 661 |
vfp16out1x01234567 = vminq_f16(vfp16out1x01234567, voutput_max); |
| 662 |
vfp16out1x89ABCDEF = vminq_f16(vfp16out1x89ABCDEF, voutput_max); |
| 663 |
vfp16out1xGHIJKLMN = vminq_f16(vfp16out1xGHIJKLMN, voutput_max); |
| 664 |
vfp16out1xOPQRSTUV = vminq_f16(vfp16out1xOPQRSTUV, voutput_max); |
| 665 |
vfp16out2x01234567 = vminq_f16(vfp16out2x01234567, voutput_max); |
| 666 |
vfp16out2x89ABCDEF = vminq_f16(vfp16out2x89ABCDEF, voutput_max); |
| 667 |
vfp16out2xGHIJKLMN = vminq_f16(vfp16out2xGHIJKLMN, voutput_max); |
| 668 |
vfp16out2xOPQRSTUV = vminq_f16(vfp16out2xOPQRSTUV, voutput_max); |
| 669 |
vfp16out3x01234567 = vminq_f16(vfp16out3x01234567, voutput_max); |
| 670 |
vfp16out3x89ABCDEF = vminq_f16(vfp16out3x89ABCDEF, voutput_max); |
| 671 |
vfp16out3xGHIJKLMN = vminq_f16(vfp16out3xGHIJKLMN, voutput_max); |
| 672 |
vfp16out3xOPQRSTUV = vminq_f16(vfp16out3xOPQRSTUV, voutput_max); |
| 673 |
vfp16out4x01234567 = vminq_f16(vfp16out4x01234567, voutput_max); |
| 674 |
vfp16out4x89ABCDEF = vminq_f16(vfp16out4x89ABCDEF, voutput_max); |
| 675 |
vfp16out4xGHIJKLMN = vminq_f16(vfp16out4xGHIJKLMN, voutput_max); |
| 676 |
vfp16out4xOPQRSTUV = vminq_f16(vfp16out4xOPQRSTUV, voutput_max); |
| 677 |
vfp16out5x01234567 = vminq_f16(vfp16out5x01234567, voutput_max); |
| 678 |
vfp16out5x89ABCDEF = vminq_f16(vfp16out5x89ABCDEF, voutput_max); |
| 679 |
vfp16out5xGHIJKLMN = vminq_f16(vfp16out5xGHIJKLMN, voutput_max); |
| 680 |
vfp16out5xOPQRSTUV = vminq_f16(vfp16out5xOPQRSTUV, voutput_max); |
| 681 |
if XNN_LIKELY(nc >= 32) { |
| 682 |
vst1q_u16(c5, vreinterpretq_u16_f16(vfp16out5x01234567)); |
| 683 |
vst1q_u16(c5 + 8, vreinterpretq_u16_f16(vfp16out5x89ABCDEF)); |
| 684 |
vst1q_u16(c5 + 16, vreinterpretq_u16_f16(vfp16out5xGHIJKLMN)); |
| 685 |
vst1q_u16(c5 + 24, vreinterpretq_u16_f16(vfp16out5xOPQRSTUV)); |
| 686 |
vst1q_u16(c4, vreinterpretq_u16_f16(vfp16out4x01234567)); |
| 687 |
vst1q_u16(c4 + 8, vreinterpretq_u16_f16(vfp16out4x89ABCDEF)); |
| 688 |
vst1q_u16(c4 + 16, vreinterpretq_u16_f16(vfp16out4xGHIJKLMN)); |
| 689 |
vst1q_u16(c4 + 24, vreinterpretq_u16_f16(vfp16out4xOPQRSTUV)); |
| 690 |
vst1q_u16(c3, vreinterpretq_u16_f16(vfp16out3x01234567)); |
| 691 |
vst1q_u16(c3 + 8, vreinterpretq_u16_f16(vfp16out3x89ABCDEF)); |
| 692 |
vst1q_u16(c3 + 16, vreinterpretq_u16_f16(vfp16out3xGHIJKLMN)); |
| 693 |
vst1q_u16(c3 + 24, vreinterpretq_u16_f16(vfp16out3xOPQRSTUV)); |
| 694 |
vst1q_u16(c2, vreinterpretq_u16_f16(vfp16out2x01234567)); |
| 695 |
vst1q_u16(c2 + 8, vreinterpretq_u16_f16(vfp16out2x89ABCDEF)); |
| 696 |
vst1q_u16(c2 + 16, vreinterpretq_u16_f16(vfp16out2xGHIJKLMN)); |
| 697 |
vst1q_u16(c2 + 24, vreinterpretq_u16_f16(vfp16out2xOPQRSTUV)); |
| 698 |
vst1q_u16(c1, vreinterpretq_u16_f16(vfp16out1x01234567)); |
| 699 |
vst1q_u16(c1 + 8, vreinterpretq_u16_f16(vfp16out1x89ABCDEF)); |
| 700 |
vst1q_u16(c1 + 16, vreinterpretq_u16_f16(vfp16out1xGHIJKLMN)); |
| 701 |
vst1q_u16(c1 + 24, vreinterpretq_u16_f16(vfp16out1xOPQRSTUV)); |
| 702 |
vst1q_u16(c0, vreinterpretq_u16_f16(vfp16out0x01234567)); |
| 703 |
vst1q_u16(c0 + 8, vreinterpretq_u16_f16(vfp16out0x89ABCDEF)); |
| 704 |
vst1q_u16(c0 + 16, vreinterpretq_u16_f16(vfp16out0xGHIJKLMN)); |
| 705 |
vst1q_u16(c0 + 24, vreinterpretq_u16_f16(vfp16out0xOPQRSTUV)); |
| 706 |
|
| 707 |
a = (const int8_t**restrict) ((uintptr_t) a - ks); |
| 708 |
|
| 709 |
c0 = (uint16_t*) ((uintptr_t) c0 + cn_stride); |
| 710 |
c1 = (uint16_t*) ((uintptr_t) c1 + cn_stride); |
| 711 |
c2 = (uint16_t*) ((uintptr_t) c2 + cn_stride); |
| 712 |
c3 = (uint16_t*) ((uintptr_t) c3 + cn_stride); |
| 713 |
c4 = (uint16_t*) ((uintptr_t) c4 + cn_stride); |
| 714 |
c5 = (uint16_t*) ((uintptr_t) c5 + cn_stride); |
| 715 |
|
| 716 |
nc -= 32; |
| 717 |
} else { |
| 718 |
if (nc & 16) { |
| 719 |
vst1q_u16(c5, vreinterpretq_u16_f16(vfp16out5x01234567)); c5 += 8; |
| 720 |
vfp16out5x01234567 = vfp16out5xGHIJKLMN; |
| 721 |
vst1q_u16(c4, vreinterpretq_u16_f16(vfp16out4x01234567)); c4 += 8; |
| 722 |
vfp16out4x01234567 = vfp16out4xGHIJKLMN; |
| 723 |
vst1q_u16(c3, vreinterpretq_u16_f16(vfp16out3x01234567)); c3 += 8; |
| 724 |
vfp16out3x01234567 = vfp16out3xGHIJKLMN; |
| 725 |
vst1q_u16(c2, vreinterpretq_u16_f16(vfp16out2x01234567)); c2 += 8; |
| 726 |
vfp16out2x01234567 = vfp16out2xGHIJKLMN; |
| 727 |
vst1q_u16(c1, vreinterpretq_u16_f16(vfp16out1x01234567)); c1 += 8; |
| 728 |
vfp16out1x01234567 = vfp16out1xGHIJKLMN; |
| 729 |
vst1q_u16(c0, vreinterpretq_u16_f16(vfp16out0x01234567)); c0 += 8; |
| 730 |
vfp16out0x01234567 = vfp16out0xGHIJKLMN; |
| 731 |
vst1q_u16(c5, vreinterpretq_u16_f16(vfp16out5x89ABCDEF)); c5 += 8; |
| 732 |
vfp16out5x89ABCDEF = vfp16out5xOPQRSTUV; |
| 733 |
vst1q_u16(c4, vreinterpretq_u16_f16(vfp16out4x89ABCDEF)); c4 += 8; |
| 734 |
vfp16out4x89ABCDEF = vfp16out4xOPQRSTUV; |
| 735 |
vst1q_u16(c3, vreinterpretq_u16_f16(vfp16out3x89ABCDEF)); c3 += 8; |
| 736 |
vfp16out3x89ABCDEF = vfp16out3xOPQRSTUV; |
| 737 |
vst1q_u16(c2, vreinterpretq_u16_f16(vfp16out2x89ABCDEF)); c2 += 8; |
| 738 |
vfp16out2x89ABCDEF = vfp16out2xOPQRSTUV; |
| 739 |
vst1q_u16(c1, vreinterpretq_u16_f16(vfp16out1x89ABCDEF)); c1 += 8; |
| 740 |
vfp16out1x89ABCDEF = vfp16out1xOPQRSTUV; |
| 741 |
vst1q_u16(c0, vreinterpretq_u16_f16(vfp16out0x89ABCDEF)); c0 += 8; |
| 742 |
vfp16out0x89ABCDEF = vfp16out0xOPQRSTUV; |
| 743 |
} |
| 744 |
if (nc & 8) { |
| 745 |
vst1q_u16(c5, vreinterpretq_u16_f16(vfp16out5x01234567)); c5 += 8; |
| 746 |
vfp16out5x01234567 = vfp16out5x89ABCDEF; |
| 747 |
vst1q_u16(c4, vreinterpretq_u16_f16(vfp16out4x01234567)); c4 += 8; |
| 748 |
vfp16out4x01234567 = vfp16out4x89ABCDEF; |
| 749 |
vst1q_u16(c3, vreinterpretq_u16_f16(vfp16out3x01234567)); c3 += 8; |
| 750 |
vfp16out3x01234567 = vfp16out3x89ABCDEF; |
| 751 |
vst1q_u16(c2, vreinterpretq_u16_f16(vfp16out2x01234567)); c2 += 8; |
| 752 |
vfp16out2x01234567 = vfp16out2x89ABCDEF; |
| 753 |
vst1q_u16(c1, vreinterpretq_u16_f16(vfp16out1x01234567)); c1 += 8; |
| 754 |
vfp16out1x01234567 = vfp16out1x89ABCDEF; |
| 755 |
vst1q_u16(c0, vreinterpretq_u16_f16(vfp16out0x01234567)); c0 += 8; |
| 756 |
vfp16out0x01234567 = vfp16out0x89ABCDEF; |
| 757 |
} |
| 758 |
float16x4_t vfp16out5x0123 = vget_low_f16(vfp16out5x01234567); |
| 759 |
float16x4_t vfp16out4x0123 = vget_low_f16(vfp16out4x01234567); |
| 760 |
float16x4_t vfp16out3x0123 = vget_low_f16(vfp16out3x01234567); |
| 761 |
float16x4_t vfp16out2x0123 = vget_low_f16(vfp16out2x01234567); |
| 762 |
float16x4_t vfp16out1x0123 = vget_low_f16(vfp16out1x01234567); |
| 763 |
float16x4_t vfp16out0x0123 = vget_low_f16(vfp16out0x01234567); |
| 764 |
if (nc & 4) { |
| 765 |
vst1_u16(c5, vreinterpret_u16_f16(vfp16out5x0123)); c5 += 4; |
| 766 |
vst1_u16(c4, vreinterpret_u16_f16(vfp16out4x0123)); c4 += 4; |
| 767 |
vst1_u16(c3, vreinterpret_u16_f16(vfp16out3x0123)); c3 += 4; |
| 768 |
vst1_u16(c2, vreinterpret_u16_f16(vfp16out2x0123)); c2 += 4; |
| 769 |
vst1_u16(c1, vreinterpret_u16_f16(vfp16out1x0123)); c1 += 4; |
| 770 |
vst1_u16(c0, vreinterpret_u16_f16(vfp16out0x0123)); c0 += 4; |
| 771 |
vfp16out5x0123 = vget_high_f16(vfp16out5x01234567); |
| 772 |
vfp16out4x0123 = vget_high_f16(vfp16out4x01234567); |
| 773 |
vfp16out3x0123 = vget_high_f16(vfp16out3x01234567); |
| 774 |
vfp16out2x0123 = vget_high_f16(vfp16out2x01234567); |
| 775 |
vfp16out1x0123 = vget_high_f16(vfp16out1x01234567); |
| 776 |
vfp16out0x0123 = vget_high_f16(vfp16out0x01234567); |
| 777 |
} |
| 778 |
if (nc & 2) { |
| 779 |
vst1_lane_u32((void*) c5, vreinterpret_u32_f16(vfp16out5x0123), 0); c5 += 2; |
| 780 |
vst1_lane_u32((void*) c4, vreinterpret_u32_f16(vfp16out4x0123), 0); c4 += 2; |
| 781 |
vst1_lane_u32((void*) c3, vreinterpret_u32_f16(vfp16out3x0123), 0); c3 += 2; |
| 782 |
vst1_lane_u32((void*) c2, vreinterpret_u32_f16(vfp16out2x0123), 0); c2 += 2; |
| 783 |
vst1_lane_u32((void*) c1, vreinterpret_u32_f16(vfp16out1x0123), 0); c1 += 2; |
| 784 |
vst1_lane_u32((void*) c0, vreinterpret_u32_f16(vfp16out0x0123), 0); c0 += 2; |
| 785 |
vfp16out5x0123 = vext_f16(vfp16out5x0123, vfp16out5x0123, 2); |
| 786 |
vfp16out4x0123 = vext_f16(vfp16out4x0123, vfp16out4x0123, 2); |
| 787 |
vfp16out3x0123 = vext_f16(vfp16out3x0123, vfp16out3x0123, 2); |
| 788 |
vfp16out2x0123 = vext_f16(vfp16out2x0123, vfp16out2x0123, 2); |
| 789 |
vfp16out1x0123 = vext_f16(vfp16out1x0123, vfp16out1x0123, 2); |
| 790 |
vfp16out0x0123 = vext_f16(vfp16out0x0123, vfp16out0x0123, 2); |
| 791 |
} |
| 792 |
if (nc & 1) { |
| 793 |
vst1_lane_u16(c5, vreinterpret_u16_f16(vfp16out5x0123), 0); |
| 794 |
vst1_lane_u16(c4, vreinterpret_u16_f16(vfp16out4x0123), 0); |
| 795 |
vst1_lane_u16(c3, vreinterpret_u16_f16(vfp16out3x0123), 0); |
| 796 |
vst1_lane_u16(c2, vreinterpret_u16_f16(vfp16out2x0123), 0); |
| 797 |
vst1_lane_u16(c1, vreinterpret_u16_f16(vfp16out1x0123), 0); |
| 798 |
vst1_lane_u16(c0, vreinterpret_u16_f16(vfp16out0x0123), 0); |
| 799 |
} |
| 800 |
nc = 0; |
| 801 |
} |
| 802 |
} while (nc != 0); |
| 803 |
} |