| 1 |
// Auto-generated file. Do not edit! |
| 2 |
// Template: src/x32-transposec/neon-zip.c.in |
| 3 |
// Generator: tools/xngen |
| 4 |
// |
| 5 |
// Copyright 2021 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 <arm_neon.h> |
| 11 |
|
| 12 |
#include <assert.h> |
| 13 |
|
| 14 |
#include "xnnpack/common.h" |
| 15 |
#include "xnnpack/math.h" |
| 16 |
#include "xnnpack/transpose.h" |
| 17 |
|
| 18 |
void xnn_x8_transposec_ukernel__16x16_reuse_switch_zip_neon( |
| 19 |
const uint8_t* input, |
| 20 |
uint8_t* output, |
| 21 |
size_t input_stride, |
| 22 |
size_t output_stride, |
| 23 |
size_t block_width, |
| 24 |
size_t block_height) XNN_OOB_READS |
| 25 |
{ |
| 26 |
assert(block_width == 1 || output_stride >= block_height * sizeof(uint8_t)); |
| 27 |
assert(block_height == 1 || input_stride >= block_width * sizeof(uint8_t)); |
| 28 |
|
| 29 |
const size_t tile_height = 16; |
| 30 |
const size_t tile_width = 16; |
| 31 |
const size_t tile_hbytes = tile_height * sizeof(uint8_t); |
| 32 |
const size_t tile_wbytes = tile_width * sizeof(uint8_t); |
| 33 |
const size_t input_reset = tile_wbytes - round_down_po2(block_height, tile_height) * input_stride; |
| 34 |
const size_t output_reset = tile_width * output_stride - round_down_po2(block_height, 2) * sizeof(uint8_t); |
| 35 |
|
| 36 |
const uint8_t* i0 = input; |
| 37 |
uint8_t* o = (uint8_t*) output; |
| 38 |
const size_t minus_output_stride = -output_stride; |
| 39 |
|
| 40 |
do { |
| 41 |
const size_t rem = min(block_width - 1, 15); |
| 42 |
const size_t oN_stride = rem * output_stride; |
| 43 |
size_t bh = block_height; |
| 44 |
for (; bh >= 16; bh -= 16) { |
| 45 |
const uint8x16_t v4_0 = vld1q_u8(i0); i0 = (uint8_t*) ((uintptr_t) i0 + input_stride); |
| 46 |
const uint8x16_t v4_1 = vld1q_u8(i0); i0 = (uint8_t*) ((uintptr_t) i0 + input_stride); |
| 47 |
const uint8x16_t v4_2 = vld1q_u8(i0); i0 = (uint8_t*) ((uintptr_t) i0 + input_stride); |
| 48 |
const uint8x16_t v4_3 = vld1q_u8(i0); i0 = (uint8_t*) ((uintptr_t) i0 + input_stride); |
| 49 |
const uint8x16_t v4_4 = vld1q_u8(i0); i0 = (uint8_t*) ((uintptr_t) i0 + input_stride); |
| 50 |
const uint8x16_t v4_5 = vld1q_u8(i0); i0 = (uint8_t*) ((uintptr_t) i0 + input_stride); |
| 51 |
const uint8x16_t v4_6 = vld1q_u8(i0); i0 = (uint8_t*) ((uintptr_t) i0 + input_stride); |
| 52 |
const uint8x16_t v4_7 = vld1q_u8(i0); i0 = (uint8_t*) ((uintptr_t) i0 + input_stride); |
| 53 |
const uint8x16_t v4_8 = vld1q_u8(i0); i0 = (uint8_t*) ((uintptr_t) i0 + input_stride); |
| 54 |
const uint8x16_t v4_9 = vld1q_u8(i0); i0 = (uint8_t*) ((uintptr_t) i0 + input_stride); |
| 55 |
const uint8x16_t v4_10 = vld1q_u8(i0); i0 = (uint8_t*) ((uintptr_t) i0 + input_stride); |
| 56 |
const uint8x16_t v4_11 = vld1q_u8(i0); i0 = (uint8_t*) ((uintptr_t) i0 + input_stride); |
| 57 |
const uint8x16_t v4_12 = vld1q_u8(i0); i0 = (uint8_t*) ((uintptr_t) i0 + input_stride); |
| 58 |
const uint8x16_t v4_13 = vld1q_u8(i0); i0 = (uint8_t*) ((uintptr_t) i0 + input_stride); |
| 59 |
const uint8x16_t v4_14 = vld1q_u8(i0); i0 = (uint8_t*) ((uintptr_t) i0 + input_stride); |
| 60 |
const uint8x16_t v4_15 = vld1q_u8(i0); i0 = (uint8_t*) ((uintptr_t) i0 + input_stride); |
| 61 |
|
| 62 |
const uint8x16x2_t v3_0 = vzipq_u8(v4_0, v4_8); |
| 63 |
const uint8x16x2_t v3_1 = vzipq_u8(v4_1, v4_9); |
| 64 |
const uint8x16x2_t v3_2 = vzipq_u8(v4_2, v4_10); |
| 65 |
const uint8x16x2_t v3_3 = vzipq_u8(v4_3, v4_11); |
| 66 |
const uint8x16x2_t v3_4 = vzipq_u8(v4_4, v4_12); |
| 67 |
const uint8x16x2_t v3_5 = vzipq_u8(v4_5, v4_13); |
| 68 |
const uint8x16x2_t v3_6 = vzipq_u8(v4_6, v4_14); |
| 69 |
const uint8x16x2_t v3_7 = vzipq_u8(v4_7, v4_15); |
| 70 |
|
| 71 |
const uint8x16x2_t v2_0 = vzipq_u8(v3_0.val[0], v3_4.val[0]); |
| 72 |
const uint8x16x2_t v2_1 = vzipq_u8(v3_0.val[1], v3_4.val[1]); |
| 73 |
const uint8x16x2_t v2_2 = vzipq_u8(v3_1.val[0], v3_5.val[0]); |
| 74 |
const uint8x16x2_t v2_3 = vzipq_u8(v3_1.val[1], v3_5.val[1]); |
| 75 |
const uint8x16x2_t v2_4 = vzipq_u8(v3_2.val[0], v3_6.val[0]); |
| 76 |
const uint8x16x2_t v2_5 = vzipq_u8(v3_2.val[1], v3_6.val[1]); |
| 77 |
const uint8x16x2_t v2_6 = vzipq_u8(v3_3.val[0], v3_7.val[0]); |
| 78 |
const uint8x16x2_t v2_7 = vzipq_u8(v3_3.val[1], v3_7.val[1]); |
| 79 |
const uint8x16x2_t v1_0 = vzipq_u8(v2_0.val[0], v2_4.val[0]); |
| 80 |
const uint8x16x2_t v1_1 = vzipq_u8(v2_0.val[1], v2_4.val[1]); |
| 81 |
const uint8x16x2_t v1_2 = vzipq_u8(v2_1.val[0], v2_5.val[0]); |
| 82 |
const uint8x16x2_t v1_3 = vzipq_u8(v2_1.val[1], v2_5.val[1]); |
| 83 |
const uint8x16x2_t v1_4 = vzipq_u8(v2_2.val[0], v2_6.val[0]); |
| 84 |
const uint8x16x2_t v1_5 = vzipq_u8(v2_2.val[1], v2_6.val[1]); |
| 85 |
const uint8x16x2_t v1_6 = vzipq_u8(v2_3.val[0], v2_7.val[0]); |
| 86 |
const uint8x16x2_t v1_7 = vzipq_u8(v2_3.val[1], v2_7.val[1]); |
| 87 |
const uint8x16x2_t v0_0 = vzipq_u8(v1_0.val[0], v1_4.val[0]); |
| 88 |
const uint8x16x2_t v0_1 = vzipq_u8(v1_0.val[1], v1_4.val[1]); |
| 89 |
const uint8x16x2_t v0_2 = vzipq_u8(v1_1.val[0], v1_5.val[0]); |
| 90 |
const uint8x16x2_t v0_3 = vzipq_u8(v1_1.val[1], v1_5.val[1]); |
| 91 |
const uint8x16x2_t v0_4 = vzipq_u8(v1_2.val[0], v1_6.val[0]); |
| 92 |
const uint8x16x2_t v0_5 = vzipq_u8(v1_2.val[1], v1_6.val[1]); |
| 93 |
const uint8x16x2_t v0_6 = vzipq_u8(v1_3.val[0], v1_7.val[0]); |
| 94 |
const uint8x16x2_t v0_7 = vzipq_u8(v1_3.val[1], v1_7.val[1]); |
| 95 |
|
| 96 |
uint8_t *oN = (uint8_t*) ((uintptr_t) o + oN_stride); |
| 97 |
switch (rem) { |
| 98 |
case 15: |
| 99 |
vst1q_u8(oN, v0_7.val[1]); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 100 |
XNN_FALLTHROUGH |
| 101 |
case 14: |
| 102 |
vst1q_u8(oN, v0_7.val[0]); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 103 |
XNN_FALLTHROUGH |
| 104 |
case 13: |
| 105 |
vst1q_u8(oN, v0_6.val[1]); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 106 |
XNN_FALLTHROUGH |
| 107 |
case 12: |
| 108 |
vst1q_u8(oN, v0_6.val[0]); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 109 |
XNN_FALLTHROUGH |
| 110 |
case 11: |
| 111 |
vst1q_u8(oN, v0_5.val[1]); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 112 |
XNN_FALLTHROUGH |
| 113 |
case 10: |
| 114 |
vst1q_u8(oN, v0_5.val[0]); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 115 |
XNN_FALLTHROUGH |
| 116 |
case 9: |
| 117 |
vst1q_u8(oN, v0_4.val[1]); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 118 |
XNN_FALLTHROUGH |
| 119 |
case 8: |
| 120 |
vst1q_u8(oN, v0_4.val[0]); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 121 |
XNN_FALLTHROUGH |
| 122 |
case 7: |
| 123 |
vst1q_u8(oN, v0_3.val[1]); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 124 |
XNN_FALLTHROUGH |
| 125 |
case 6: |
| 126 |
vst1q_u8(oN, v0_3.val[0]); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 127 |
XNN_FALLTHROUGH |
| 128 |
case 5: |
| 129 |
vst1q_u8(oN, v0_2.val[1]); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 130 |
XNN_FALLTHROUGH |
| 131 |
case 4: |
| 132 |
vst1q_u8(oN, v0_2.val[0]); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 133 |
XNN_FALLTHROUGH |
| 134 |
case 3: |
| 135 |
vst1q_u8(oN, v0_1.val[1]); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 136 |
XNN_FALLTHROUGH |
| 137 |
case 2: |
| 138 |
vst1q_u8(oN, v0_1.val[0]); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 139 |
XNN_FALLTHROUGH |
| 140 |
case 1: |
| 141 |
vst1q_u8(oN, v0_0.val[1]); |
| 142 |
XNN_FALLTHROUGH |
| 143 |
case 0: |
| 144 |
vst1q_u8(o, v0_0.val[0]); o = (uint8_t*) ((uintptr_t) o + tile_hbytes); |
| 145 |
break; |
| 146 |
default: |
| 147 |
XNN_UNREACHABLE; |
| 148 |
} |
| 149 |
} |
| 150 |
|
| 151 |
if (bh != 0) { |
| 152 |
const uint8x16_t v4_0 = vld1q_u8(i0); |
| 153 |
const uint8_t *i1 = (const uint8_t*) ((uintptr_t) i0 + input_stride); |
| 154 |
if XNN_UNPREDICTABLE(bh < 2) { |
| 155 |
i1 = i0; |
| 156 |
} |
| 157 |
const uint8x16_t v4_1 = vld1q_u8(i1); |
| 158 |
const uint8_t *i2 = (const uint8_t*) ((uintptr_t) i1 + input_stride); |
| 159 |
if XNN_UNPREDICTABLE(bh <= 2) { |
| 160 |
i2 = i1; |
| 161 |
} |
| 162 |
const uint8x16_t v4_2 = vld1q_u8(i2); |
| 163 |
const uint8_t *i3 = (const uint8_t*) ((uintptr_t) i2 + input_stride); |
| 164 |
if XNN_UNPREDICTABLE(bh < 4) { |
| 165 |
i3 = i2; |
| 166 |
} |
| 167 |
const uint8x16_t v4_3 = vld1q_u8(i3); |
| 168 |
const uint8_t *i4 = (const uint8_t*) ((uintptr_t) i3 + input_stride); |
| 169 |
if XNN_UNPREDICTABLE(bh <= 4) { |
| 170 |
i4 = i3; |
| 171 |
} |
| 172 |
const uint8x16_t v4_4 = vld1q_u8(i4); |
| 173 |
const uint8_t *i5 = (const uint8_t*) ((uintptr_t) i4 + input_stride); |
| 174 |
if XNN_UNPREDICTABLE(bh < 6) { |
| 175 |
i5 = i4; |
| 176 |
} |
| 177 |
const uint8x16_t v4_5 = vld1q_u8(i5); |
| 178 |
const uint8_t *i6 = (const uint8_t*) ((uintptr_t) i5 + input_stride); |
| 179 |
if XNN_UNPREDICTABLE(bh <= 6) { |
| 180 |
i6 = i5; |
| 181 |
} |
| 182 |
const uint8x16_t v4_6 = vld1q_u8(i6); |
| 183 |
const uint8_t *i7 = (const uint8_t*) ((uintptr_t) i6 + input_stride); |
| 184 |
if XNN_UNPREDICTABLE(bh < 8) { |
| 185 |
i7 = i6; |
| 186 |
} |
| 187 |
const uint8x16_t v4_7 = vld1q_u8(i7); |
| 188 |
const uint8_t *i8 = (const uint8_t*) ((uintptr_t) i7 + input_stride); |
| 189 |
if XNN_UNPREDICTABLE(bh <= 8) { |
| 190 |
i8 = i7; |
| 191 |
} |
| 192 |
const uint8x16_t v4_8 = vld1q_u8(i8); |
| 193 |
const uint8_t *i9 = (const uint8_t*) ((uintptr_t) i8 + input_stride); |
| 194 |
if XNN_UNPREDICTABLE(bh < 10) { |
| 195 |
i9 = i8; |
| 196 |
} |
| 197 |
const uint8x16_t v4_9 = vld1q_u8(i9); |
| 198 |
const uint8_t *i10 = (const uint8_t*) ((uintptr_t) i9 + input_stride); |
| 199 |
if XNN_UNPREDICTABLE(bh <= 10) { |
| 200 |
i10 = i9; |
| 201 |
} |
| 202 |
const uint8x16_t v4_10 = vld1q_u8(i10); |
| 203 |
const uint8_t *i11 = (const uint8_t*) ((uintptr_t) i10 + input_stride); |
| 204 |
if XNN_UNPREDICTABLE(bh < 12) { |
| 205 |
i11 = i10; |
| 206 |
} |
| 207 |
const uint8x16_t v4_11 = vld1q_u8(i11); |
| 208 |
const uint8_t *i12 = (const uint8_t*) ((uintptr_t) i11 + input_stride); |
| 209 |
if XNN_UNPREDICTABLE(bh <= 12) { |
| 210 |
i12 = i11; |
| 211 |
} |
| 212 |
const uint8x16_t v4_12 = vld1q_u8(i12); |
| 213 |
const uint8_t *i13 = (const uint8_t*) ((uintptr_t) i12 + input_stride); |
| 214 |
if XNN_UNPREDICTABLE(bh < 14) { |
| 215 |
i13 = i12; |
| 216 |
} |
| 217 |
const uint8x16_t v4_13 = vld1q_u8(i13); |
| 218 |
const uint8_t *i14 = (const uint8_t*) ((uintptr_t) i13 + input_stride); |
| 219 |
if XNN_UNPREDICTABLE(bh <= 14) { |
| 220 |
i14 = i13; |
| 221 |
} |
| 222 |
const uint8x16_t v4_14 = vld1q_u8(i14); |
| 223 |
const uint8x16_t v4_15 = vmovq_n_u8(0); |
| 224 |
|
| 225 |
const uint8x16x2_t v3_0 = vzipq_u8(v4_0, v4_8); |
| 226 |
const uint8x16x2_t v3_1 = vzipq_u8(v4_1, v4_9); |
| 227 |
const uint8x16x2_t v3_2 = vzipq_u8(v4_2, v4_10); |
| 228 |
const uint8x16x2_t v3_3 = vzipq_u8(v4_3, v4_11); |
| 229 |
const uint8x16x2_t v3_4 = vzipq_u8(v4_4, v4_12); |
| 230 |
const uint8x16x2_t v3_5 = vzipq_u8(v4_5, v4_13); |
| 231 |
const uint8x16x2_t v3_6 = vzipq_u8(v4_6, v4_14); |
| 232 |
const uint8x16x2_t v3_7 = vzipq_u8(v4_7, v4_15); |
| 233 |
|
| 234 |
const uint8x16x2_t v2_0 = vzipq_u8(v3_0.val[0], v3_4.val[0]); |
| 235 |
const uint8x16x2_t v2_1 = vzipq_u8(v3_0.val[1], v3_4.val[1]); |
| 236 |
const uint8x16x2_t v2_2 = vzipq_u8(v3_1.val[0], v3_5.val[0]); |
| 237 |
const uint8x16x2_t v2_3 = vzipq_u8(v3_1.val[1], v3_5.val[1]); |
| 238 |
const uint8x16x2_t v2_4 = vzipq_u8(v3_2.val[0], v3_6.val[0]); |
| 239 |
const uint8x16x2_t v2_5 = vzipq_u8(v3_2.val[1], v3_6.val[1]); |
| 240 |
const uint8x16x2_t v2_6 = vzipq_u8(v3_3.val[0], v3_7.val[0]); |
| 241 |
const uint8x16x2_t v2_7 = vzipq_u8(v3_3.val[1], v3_7.val[1]); |
| 242 |
const uint8x16x2_t v1_0 = vzipq_u8(v2_0.val[0], v2_4.val[0]); |
| 243 |
const uint8x16x2_t v1_1 = vzipq_u8(v2_0.val[1], v2_4.val[1]); |
| 244 |
const uint8x16x2_t v1_2 = vzipq_u8(v2_1.val[0], v2_5.val[0]); |
| 245 |
const uint8x16x2_t v1_3 = vzipq_u8(v2_1.val[1], v2_5.val[1]); |
| 246 |
const uint8x16x2_t v1_4 = vzipq_u8(v2_2.val[0], v2_6.val[0]); |
| 247 |
const uint8x16x2_t v1_5 = vzipq_u8(v2_2.val[1], v2_6.val[1]); |
| 248 |
const uint8x16x2_t v1_6 = vzipq_u8(v2_3.val[0], v2_7.val[0]); |
| 249 |
const uint8x16x2_t v1_7 = vzipq_u8(v2_3.val[1], v2_7.val[1]); |
| 250 |
const uint8x16x2_t v0_0 = vzipq_u8(v1_0.val[0], v1_4.val[0]); |
| 251 |
const uint8x16x2_t v0_1 = vzipq_u8(v1_0.val[1], v1_4.val[1]); |
| 252 |
const uint8x16x2_t v0_2 = vzipq_u8(v1_1.val[0], v1_5.val[0]); |
| 253 |
const uint8x16x2_t v0_3 = vzipq_u8(v1_1.val[1], v1_5.val[1]); |
| 254 |
const uint8x16x2_t v0_4 = vzipq_u8(v1_2.val[0], v1_6.val[0]); |
| 255 |
const uint8x16x2_t v0_5 = vzipq_u8(v1_2.val[1], v1_6.val[1]); |
| 256 |
const uint8x16x2_t v0_6 = vzipq_u8(v1_3.val[0], v1_7.val[0]); |
| 257 |
const uint8x16x2_t v0_7 = vzipq_u8(v1_3.val[1], v1_7.val[1]); |
| 258 |
|
| 259 |
uint8x8_t v0_low = vget_low_u8(v0_0.val[0]); |
| 260 |
uint8x8_t v1_low = vget_low_u8(v0_0.val[1]); |
| 261 |
uint8x8_t v2_low = vget_low_u8(v0_1.val[0]); |
| 262 |
uint8x8_t v3_low = vget_low_u8(v0_1.val[1]); |
| 263 |
uint8x8_t v4_low = vget_low_u8(v0_2.val[0]); |
| 264 |
uint8x8_t v5_low = vget_low_u8(v0_2.val[1]); |
| 265 |
uint8x8_t v6_low = vget_low_u8(v0_3.val[0]); |
| 266 |
uint8x8_t v7_low = vget_low_u8(v0_3.val[1]); |
| 267 |
uint8x8_t v8_low = vget_low_u8(v0_4.val[0]); |
| 268 |
uint8x8_t v9_low = vget_low_u8(v0_4.val[1]); |
| 269 |
uint8x8_t v10_low = vget_low_u8(v0_5.val[0]); |
| 270 |
uint8x8_t v11_low = vget_low_u8(v0_5.val[1]); |
| 271 |
uint8x8_t v12_low = vget_low_u8(v0_6.val[0]); |
| 272 |
uint8x8_t v13_low = vget_low_u8(v0_6.val[1]); |
| 273 |
uint8x8_t v14_low = vget_low_u8(v0_7.val[0]); |
| 274 |
uint8x8_t v15_low = vget_low_u8(v0_7.val[1]); |
| 275 |
|
| 276 |
if (bh & 8) { |
| 277 |
uint8_t* oN = (uint8_t*) ((uintptr_t) o + oN_stride); |
| 278 |
switch (rem) { |
| 279 |
case 15: |
| 280 |
vst1_u8(oN, v15_low); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 281 |
XNN_FALLTHROUGH |
| 282 |
case 14: |
| 283 |
vst1_u8(oN, v14_low); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 284 |
XNN_FALLTHROUGH |
| 285 |
case 13: |
| 286 |
vst1_u8(oN, v13_low); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 287 |
XNN_FALLTHROUGH |
| 288 |
case 12: |
| 289 |
vst1_u8(oN, v12_low); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 290 |
XNN_FALLTHROUGH |
| 291 |
case 11: |
| 292 |
vst1_u8(oN, v11_low); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 293 |
XNN_FALLTHROUGH |
| 294 |
case 10: |
| 295 |
vst1_u8(oN, v10_low); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 296 |
XNN_FALLTHROUGH |
| 297 |
case 9: |
| 298 |
vst1_u8(oN, v9_low); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 299 |
XNN_FALLTHROUGH |
| 300 |
case 8: |
| 301 |
vst1_u8(oN, v8_low); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 302 |
XNN_FALLTHROUGH |
| 303 |
case 7: |
| 304 |
vst1_u8(oN, v7_low); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 305 |
XNN_FALLTHROUGH |
| 306 |
case 6: |
| 307 |
vst1_u8(oN, v6_low); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 308 |
XNN_FALLTHROUGH |
| 309 |
case 5: |
| 310 |
vst1_u8(oN, v5_low); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 311 |
XNN_FALLTHROUGH |
| 312 |
case 4: |
| 313 |
vst1_u8(oN, v4_low); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 314 |
XNN_FALLTHROUGH |
| 315 |
case 3: |
| 316 |
vst1_u8(oN, v3_low); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 317 |
XNN_FALLTHROUGH |
| 318 |
case 2: |
| 319 |
vst1_u8(oN, v2_low); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 320 |
XNN_FALLTHROUGH |
| 321 |
case 1: |
| 322 |
vst1_u8(oN, v1_low); |
| 323 |
XNN_FALLTHROUGH |
| 324 |
case 0: |
| 325 |
vst1_u8(o, v0_low); o += 8; |
| 326 |
break; |
| 327 |
default: |
| 328 |
XNN_UNREACHABLE; |
| 329 |
} |
| 330 |
v0_low = vget_high_u8(v0_0.val[0]); |
| 331 |
v1_low = vget_high_u8(v0_0.val[1]); |
| 332 |
v2_low = vget_high_u8(v0_1.val[0]); |
| 333 |
v3_low = vget_high_u8(v0_1.val[1]); |
| 334 |
v4_low = vget_high_u8(v0_2.val[0]); |
| 335 |
v5_low = vget_high_u8(v0_2.val[1]); |
| 336 |
v6_low = vget_high_u8(v0_3.val[0]); |
| 337 |
v7_low = vget_high_u8(v0_3.val[1]); |
| 338 |
v8_low = vget_high_u8(v0_4.val[0]); |
| 339 |
v9_low = vget_high_u8(v0_4.val[1]); |
| 340 |
v10_low = vget_high_u8(v0_5.val[0]); |
| 341 |
v11_low = vget_high_u8(v0_5.val[1]); |
| 342 |
v12_low = vget_high_u8(v0_6.val[0]); |
| 343 |
v13_low = vget_high_u8(v0_6.val[1]); |
| 344 |
v14_low = vget_high_u8(v0_7.val[0]); |
| 345 |
v15_low = vget_high_u8(v0_7.val[1]); |
| 346 |
} |
| 347 |
|
| 348 |
if (bh & 4) { |
| 349 |
uint8_t* oN = (uint8_t*) ((uintptr_t) o + oN_stride); |
| 350 |
switch (rem) { |
| 351 |
case 15: |
| 352 |
vst1_lane_u32((void*) oN, vreinterpret_u32_u8(v15_low), 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 353 |
XNN_FALLTHROUGH |
| 354 |
case 14: |
| 355 |
vst1_lane_u32((void*) oN, vreinterpret_u32_u8(v14_low), 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 356 |
XNN_FALLTHROUGH |
| 357 |
case 13: |
| 358 |
vst1_lane_u32((void*) oN, vreinterpret_u32_u8(v13_low), 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 359 |
XNN_FALLTHROUGH |
| 360 |
case 12: |
| 361 |
vst1_lane_u32((void*) oN, vreinterpret_u32_u8(v12_low), 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 362 |
XNN_FALLTHROUGH |
| 363 |
case 11: |
| 364 |
vst1_lane_u32((void*) oN, vreinterpret_u32_u8(v11_low), 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 365 |
XNN_FALLTHROUGH |
| 366 |
case 10: |
| 367 |
vst1_lane_u32((void*) oN, vreinterpret_u32_u8(v10_low), 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 368 |
XNN_FALLTHROUGH |
| 369 |
case 9: |
| 370 |
vst1_lane_u32((void*) oN, vreinterpret_u32_u8(v9_low), 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 371 |
XNN_FALLTHROUGH |
| 372 |
case 8: |
| 373 |
vst1_lane_u32((void*) oN, vreinterpret_u32_u8(v8_low), 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 374 |
XNN_FALLTHROUGH |
| 375 |
case 7: |
| 376 |
vst1_lane_u32((void*) oN, vreinterpret_u32_u8(v7_low), 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 377 |
XNN_FALLTHROUGH |
| 378 |
case 6: |
| 379 |
vst1_lane_u32((void*) oN, vreinterpret_u32_u8(v6_low), 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 380 |
XNN_FALLTHROUGH |
| 381 |
case 5: |
| 382 |
vst1_lane_u32((void*) oN, vreinterpret_u32_u8(v5_low), 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 383 |
XNN_FALLTHROUGH |
| 384 |
case 4: |
| 385 |
vst1_lane_u32((void*) oN, vreinterpret_u32_u8(v4_low), 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 386 |
XNN_FALLTHROUGH |
| 387 |
case 3: |
| 388 |
vst1_lane_u32((void*) oN, vreinterpret_u32_u8(v3_low), 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 389 |
XNN_FALLTHROUGH |
| 390 |
case 2: |
| 391 |
vst1_lane_u32((void*) oN, vreinterpret_u32_u8(v2_low), 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 392 |
XNN_FALLTHROUGH |
| 393 |
case 1: |
| 394 |
vst1_lane_u32((void*) oN, vreinterpret_u32_u8(v1_low), 0); |
| 395 |
XNN_FALLTHROUGH |
| 396 |
case 0: |
| 397 |
vst1_lane_u32((void*) o, vreinterpret_u32_u8(v0_low), 0); o += 4; |
| 398 |
break; |
| 399 |
default: |
| 400 |
XNN_UNREACHABLE; |
| 401 |
} |
| 402 |
v0_low = vext_u8(v0_low, v0_low, 4); |
| 403 |
v1_low = vext_u8(v1_low, v1_low, 4); |
| 404 |
v2_low = vext_u8(v2_low, v2_low, 4); |
| 405 |
v3_low = vext_u8(v3_low, v3_low, 4); |
| 406 |
v4_low = vext_u8(v4_low, v4_low, 4); |
| 407 |
v5_low = vext_u8(v5_low, v5_low, 4); |
| 408 |
v6_low = vext_u8(v6_low, v6_low, 4); |
| 409 |
v7_low = vext_u8(v7_low, v7_low, 4); |
| 410 |
v8_low = vext_u8(v8_low, v8_low, 4); |
| 411 |
v9_low = vext_u8(v9_low, v9_low, 4); |
| 412 |
v10_low = vext_u8(v10_low, v10_low, 4); |
| 413 |
v11_low = vext_u8(v11_low, v11_low, 4); |
| 414 |
v12_low = vext_u8(v12_low, v12_low, 4); |
| 415 |
v13_low = vext_u8(v13_low, v13_low, 4); |
| 416 |
v14_low = vext_u8(v14_low, v14_low, 4); |
| 417 |
v15_low = vext_u8(v15_low, v15_low, 4); |
| 418 |
} |
| 419 |
if (bh & 2) { |
| 420 |
uint8_t* oN = (uint8_t*) ((uintptr_t) o + oN_stride); |
| 421 |
switch (rem) { |
| 422 |
case 15: |
| 423 |
vst1_lane_u16((void*) oN, vreinterpret_u16_u8(v15_low), 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 424 |
XNN_FALLTHROUGH |
| 425 |
case 14: |
| 426 |
vst1_lane_u16((void*) oN, vreinterpret_u16_u8(v14_low), 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 427 |
XNN_FALLTHROUGH |
| 428 |
case 13: |
| 429 |
vst1_lane_u16((void*) oN, vreinterpret_u16_u8(v13_low), 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 430 |
XNN_FALLTHROUGH |
| 431 |
case 12: |
| 432 |
vst1_lane_u16((void*) oN, vreinterpret_u16_u8(v12_low), 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 433 |
XNN_FALLTHROUGH |
| 434 |
case 11: |
| 435 |
vst1_lane_u16((void*) oN, vreinterpret_u16_u8(v11_low), 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 436 |
XNN_FALLTHROUGH |
| 437 |
case 10: |
| 438 |
vst1_lane_u16((void*) oN, vreinterpret_u16_u8(v10_low), 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 439 |
XNN_FALLTHROUGH |
| 440 |
case 9: |
| 441 |
vst1_lane_u16((void*) oN, vreinterpret_u16_u8(v9_low), 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 442 |
XNN_FALLTHROUGH |
| 443 |
case 8: |
| 444 |
vst1_lane_u16((void*) oN, vreinterpret_u16_u8(v8_low), 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 445 |
XNN_FALLTHROUGH |
| 446 |
case 7: |
| 447 |
vst1_lane_u16((void*) oN, vreinterpret_u16_u8(v7_low), 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 448 |
XNN_FALLTHROUGH |
| 449 |
case 6: |
| 450 |
vst1_lane_u16((void*) oN, vreinterpret_u16_u8(v6_low), 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 451 |
XNN_FALLTHROUGH |
| 452 |
case 5: |
| 453 |
vst1_lane_u16((void*) oN, vreinterpret_u16_u8(v5_low), 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 454 |
XNN_FALLTHROUGH |
| 455 |
case 4: |
| 456 |
vst1_lane_u16((void*) oN, vreinterpret_u16_u8(v4_low), 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 457 |
XNN_FALLTHROUGH |
| 458 |
case 3: |
| 459 |
vst1_lane_u16((void*) oN, vreinterpret_u16_u8(v3_low), 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 460 |
XNN_FALLTHROUGH |
| 461 |
case 2: |
| 462 |
vst1_lane_u16((void*) oN, vreinterpret_u16_u8(v2_low), 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 463 |
XNN_FALLTHROUGH |
| 464 |
case 1: |
| 465 |
vst1_lane_u16((void*) oN, vreinterpret_u16_u8(v1_low), 0); |
| 466 |
XNN_FALLTHROUGH |
| 467 |
case 0: |
| 468 |
vst1_lane_u16((void*) o, vreinterpret_u16_u8(v0_low), 0); o += 2; |
| 469 |
break; |
| 470 |
default: |
| 471 |
XNN_UNREACHABLE; |
| 472 |
} |
| 473 |
v0_low = vext_u8(v0_low, v0_low, 2); |
| 474 |
v1_low = vext_u8(v1_low, v1_low, 2); |
| 475 |
v2_low = vext_u8(v2_low, v2_low, 2); |
| 476 |
v3_low = vext_u8(v3_low, v3_low, 2); |
| 477 |
v4_low = vext_u8(v4_low, v4_low, 2); |
| 478 |
v5_low = vext_u8(v5_low, v5_low, 2); |
| 479 |
v6_low = vext_u8(v6_low, v6_low, 2); |
| 480 |
v7_low = vext_u8(v7_low, v7_low, 2); |
| 481 |
v8_low = vext_u8(v8_low, v8_low, 2); |
| 482 |
v9_low = vext_u8(v9_low, v9_low, 2); |
| 483 |
v10_low = vext_u8(v10_low, v10_low, 2); |
| 484 |
v11_low = vext_u8(v11_low, v11_low, 2); |
| 485 |
v12_low = vext_u8(v12_low, v12_low, 2); |
| 486 |
v13_low = vext_u8(v13_low, v13_low, 2); |
| 487 |
v14_low = vext_u8(v14_low, v14_low, 2); |
| 488 |
v15_low = vext_u8(v15_low, v15_low, 2); |
| 489 |
} |
| 490 |
if (bh & 1) { |
| 491 |
uint8_t* oN = (uint8_t*) ((uintptr_t) o + oN_stride); |
| 492 |
switch (rem) { |
| 493 |
case 15: |
| 494 |
vst1_lane_u8(oN, v15_low, 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 495 |
XNN_FALLTHROUGH |
| 496 |
case 14: |
| 497 |
vst1_lane_u8(oN, v14_low, 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 498 |
XNN_FALLTHROUGH |
| 499 |
case 13: |
| 500 |
vst1_lane_u8(oN, v13_low, 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 501 |
XNN_FALLTHROUGH |
| 502 |
case 12: |
| 503 |
vst1_lane_u8(oN, v12_low, 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 504 |
XNN_FALLTHROUGH |
| 505 |
case 11: |
| 506 |
vst1_lane_u8(oN, v11_low, 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 507 |
XNN_FALLTHROUGH |
| 508 |
case 10: |
| 509 |
vst1_lane_u8(oN, v10_low, 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 510 |
XNN_FALLTHROUGH |
| 511 |
case 9: |
| 512 |
vst1_lane_u8(oN, v9_low, 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 513 |
XNN_FALLTHROUGH |
| 514 |
case 8: |
| 515 |
vst1_lane_u8(oN, v8_low, 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 516 |
XNN_FALLTHROUGH |
| 517 |
case 7: |
| 518 |
vst1_lane_u8(oN, v7_low, 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 519 |
XNN_FALLTHROUGH |
| 520 |
case 6: |
| 521 |
vst1_lane_u8(oN, v6_low, 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 522 |
XNN_FALLTHROUGH |
| 523 |
case 5: |
| 524 |
vst1_lane_u8(oN, v5_low, 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 525 |
XNN_FALLTHROUGH |
| 526 |
case 4: |
| 527 |
vst1_lane_u8(oN, v4_low, 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 528 |
XNN_FALLTHROUGH |
| 529 |
case 3: |
| 530 |
vst1_lane_u8(oN, v3_low, 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 531 |
XNN_FALLTHROUGH |
| 532 |
case 2: |
| 533 |
vst1_lane_u8(oN, v2_low, 0); oN = (uint8_t*) ((uintptr_t) oN + minus_output_stride); |
| 534 |
XNN_FALLTHROUGH |
| 535 |
case 1: |
| 536 |
vst1_lane_u8(oN, v1_low, 0); |
| 537 |
XNN_FALLTHROUGH |
| 538 |
case 0: |
| 539 |
vst1_lane_u8(o, v0_low, 0); |
| 540 |
break; |
| 541 |
default: |
| 542 |
XNN_UNREACHABLE; |
| 543 |
} |
| 544 |
} |
| 545 |
} |
| 546 |
|
| 547 |
i0 = (const uint8_t*) ((uintptr_t) i0 + input_reset); |
| 548 |
o = (uint8_t*) ((uintptr_t) o + output_reset); |
| 549 |
block_width = doz(block_width, tile_width); |
| 550 |
} while (block_width != 0); |
| 551 |
} |