Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 1 | // Auto-generated file. Do not edit! |
| 2 | // Template: src/qs8-igemm/neon-mlal-lane.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/common.h> |
| 15 | #include <xnnpack/igemm.h> |
| 16 | #include <xnnpack/intrinsics-polyfill.h> |
| 17 | |
| 18 | |
| 19 | void xnn_qc8_igemm_minmax_fp32_ukernel_4x16__neonv8_mlal_lane( |
| 20 | size_t mr, |
| 21 | size_t nc, |
| 22 | size_t kc, |
| 23 | size_t ks, |
| 24 | const int8_t** restrict a, |
| 25 | const void* restrict w, |
| 26 | int8_t* restrict c, |
| 27 | size_t cm_stride, |
| 28 | size_t cn_stride, |
| 29 | size_t a_offset, |
| 30 | const int8_t* zero, |
| 31 | const union xnn_qs8_minmax_params params[restrict XNN_MIN_ELEMENTS(1)]) XNN_DISABLE_TSAN |
| 32 | { |
| 33 | assert(mr != 0); |
| 34 | assert(mr <= 4); |
| 35 | assert(nc != 0); |
| 36 | assert(kc != 0); |
| 37 | assert(ks != 0); |
| 38 | assert(ks % (4 * sizeof(void*)) == 0); |
| 39 | assert(a_offset % sizeof(int8_t) == 0); |
| 40 | assert(a != NULL); |
| 41 | assert(w != NULL); |
| 42 | assert(c != NULL); |
| 43 | |
| 44 | int8_t* c0 = c; |
| 45 | int8_t* c1 = (int8_t*) ((uintptr_t) c0 + cm_stride); |
| 46 | if XNN_UNPREDICTABLE(mr < 2) { |
| 47 | c1 = c0; |
| 48 | } |
| 49 | int8_t* c2 = (int8_t*) ((uintptr_t) c1 + cm_stride); |
| 50 | if XNN_UNPREDICTABLE(mr <= 2) { |
| 51 | c2 = c1; |
| 52 | } |
| 53 | int8_t* c3 = (int8_t*) ((uintptr_t) c2 + cm_stride); |
| 54 | if XNN_UNPREDICTABLE(mr != 4) { |
| 55 | c3 = c2; |
| 56 | } |
| 57 | |
| 58 | do { |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 59 | int32x4_t vacc0x0123 = vld1q_s32(w); w = (const void*) ((const int32_t*) w + 4); |
| 60 | int32x4_t vacc0x4567 = vld1q_s32(w); w = (const void*) ((const int32_t*) w + 4); |
| 61 | int32x4_t vacc0x89AB = vld1q_s32(w); w = (const void*) ((const int32_t*) w + 4); |
| 62 | int32x4_t vacc0xCDEF = vld1q_s32(w); w = (const void*) ((const int32_t*) w + 4); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 63 | int32x4_t vacc1x0123 = vacc0x0123; |
| 64 | int32x4_t vacc1x4567 = vacc0x4567; |
| 65 | int32x4_t vacc1x89AB = vacc0x89AB; |
| 66 | int32x4_t vacc1xCDEF = vacc0xCDEF; |
| 67 | int32x4_t vacc2x0123 = vacc0x0123; |
| 68 | int32x4_t vacc2x4567 = vacc0x4567; |
| 69 | int32x4_t vacc2x89AB = vacc0x89AB; |
| 70 | int32x4_t vacc2xCDEF = vacc0xCDEF; |
| 71 | int32x4_t vacc3x0123 = vacc0x0123; |
| 72 | int32x4_t vacc3x4567 = vacc0x4567; |
| 73 | int32x4_t vacc3x89AB = vacc0x89AB; |
| 74 | int32x4_t vacc3xCDEF = vacc0xCDEF; |
| 75 | |
| 76 | size_t p = ks; |
| 77 | do { |
| 78 | const int8_t* restrict a0 = a[0]; |
| 79 | if XNN_UNPREDICTABLE(a0 != zero) { |
| 80 | a0 = (const int8_t*) ((uintptr_t) a0 + a_offset); |
| 81 | } |
| 82 | const int8_t* restrict a1 = a[1]; |
| 83 | if XNN_UNPREDICTABLE(a1 != zero) { |
| 84 | a1 = (const int8_t*) ((uintptr_t) a1 + a_offset); |
| 85 | } |
| 86 | const int8_t* restrict a2 = a[2]; |
| 87 | if XNN_UNPREDICTABLE(a2 != zero) { |
| 88 | a2 = (const int8_t*) ((uintptr_t) a2 + a_offset); |
| 89 | } |
| 90 | const int8_t* restrict a3 = a[3]; |
| 91 | if XNN_UNPREDICTABLE(a3 != zero) { |
| 92 | a3 = (const int8_t*) ((uintptr_t) a3 + a_offset); |
| 93 | } |
| 94 | a += 4; |
| 95 | |
| 96 | size_t k = kc; |
| 97 | while (k >= 8 * sizeof(int8_t)) { |
| 98 | const int8x8_t va0 = vld1_s8(a0); a0 += 8; |
| 99 | const int16x8_t vxa0 = vmovl_s8(va0); |
| 100 | const int8x8_t va1 = vld1_s8(a1); a1 += 8; |
| 101 | const int16x8_t vxa1 = vmovl_s8(va1); |
| 102 | const int8x8_t va2 = vld1_s8(a2); a2 += 8; |
| 103 | const int16x8_t vxa2 = vmovl_s8(va2); |
| 104 | const int8x8_t va3 = vld1_s8(a3); a3 += 8; |
| 105 | const int16x8_t vxa3 = vmovl_s8(va3); |
| 106 | |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 107 | const int8x8_t vb01234567c0 = vld1_s8(w); w = (const void*) ((const int8_t*) w + 8); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 108 | const int16x8_t vxb01234567c0 = vmovl_s8(vb01234567c0); |
| 109 | |
| 110 | vacc0x0123 = vmlal_lane_s16(vacc0x0123, vget_low_s16(vxb01234567c0), vget_low_s16(vxa0), 0); |
| 111 | vacc0x4567 = vmlal_lane_s16(vacc0x4567, vget_high_s16(vxb01234567c0), vget_low_s16(vxa0), 0); |
| 112 | vacc1x0123 = vmlal_lane_s16(vacc1x0123, vget_low_s16(vxb01234567c0), vget_low_s16(vxa1), 0); |
| 113 | vacc1x4567 = vmlal_lane_s16(vacc1x4567, vget_high_s16(vxb01234567c0), vget_low_s16(vxa1), 0); |
| 114 | vacc2x0123 = vmlal_lane_s16(vacc2x0123, vget_low_s16(vxb01234567c0), vget_low_s16(vxa2), 0); |
| 115 | vacc2x4567 = vmlal_lane_s16(vacc2x4567, vget_high_s16(vxb01234567c0), vget_low_s16(vxa2), 0); |
| 116 | vacc3x0123 = vmlal_lane_s16(vacc3x0123, vget_low_s16(vxb01234567c0), vget_low_s16(vxa3), 0); |
| 117 | vacc3x4567 = vmlal_lane_s16(vacc3x4567, vget_high_s16(vxb01234567c0), vget_low_s16(vxa3), 0); |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 118 | const int8x8_t vb89ABCDEFc0 = vld1_s8(w); w = (const void*) ((const int8_t*) w + 8); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 119 | const int16x8_t vxb89ABCDEFc0 = vmovl_s8(vb89ABCDEFc0); |
| 120 | |
| 121 | vacc0x89AB = vmlal_lane_s16(vacc0x89AB, vget_low_s16(vxb89ABCDEFc0), vget_low_s16(vxa0), 0); |
| 122 | vacc0xCDEF = vmlal_lane_s16(vacc0xCDEF, vget_high_s16(vxb89ABCDEFc0), vget_low_s16(vxa0), 0); |
| 123 | vacc1x89AB = vmlal_lane_s16(vacc1x89AB, vget_low_s16(vxb89ABCDEFc0), vget_low_s16(vxa1), 0); |
| 124 | vacc1xCDEF = vmlal_lane_s16(vacc1xCDEF, vget_high_s16(vxb89ABCDEFc0), vget_low_s16(vxa1), 0); |
| 125 | vacc2x89AB = vmlal_lane_s16(vacc2x89AB, vget_low_s16(vxb89ABCDEFc0), vget_low_s16(vxa2), 0); |
| 126 | vacc2xCDEF = vmlal_lane_s16(vacc2xCDEF, vget_high_s16(vxb89ABCDEFc0), vget_low_s16(vxa2), 0); |
| 127 | vacc3x89AB = vmlal_lane_s16(vacc3x89AB, vget_low_s16(vxb89ABCDEFc0), vget_low_s16(vxa3), 0); |
| 128 | vacc3xCDEF = vmlal_lane_s16(vacc3xCDEF, vget_high_s16(vxb89ABCDEFc0), vget_low_s16(vxa3), 0); |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 129 | const int8x8_t vb01234567c1 = vld1_s8(w); w = (const void*) ((const int8_t*) w + 8); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 130 | const int16x8_t vxb01234567c1 = vmovl_s8(vb01234567c1); |
| 131 | |
| 132 | vacc0x0123 = vmlal_lane_s16(vacc0x0123, vget_low_s16(vxb01234567c1), vget_low_s16(vxa0), 1); |
| 133 | vacc0x4567 = vmlal_lane_s16(vacc0x4567, vget_high_s16(vxb01234567c1), vget_low_s16(vxa0), 1); |
| 134 | vacc1x0123 = vmlal_lane_s16(vacc1x0123, vget_low_s16(vxb01234567c1), vget_low_s16(vxa1), 1); |
| 135 | vacc1x4567 = vmlal_lane_s16(vacc1x4567, vget_high_s16(vxb01234567c1), vget_low_s16(vxa1), 1); |
| 136 | vacc2x0123 = vmlal_lane_s16(vacc2x0123, vget_low_s16(vxb01234567c1), vget_low_s16(vxa2), 1); |
| 137 | vacc2x4567 = vmlal_lane_s16(vacc2x4567, vget_high_s16(vxb01234567c1), vget_low_s16(vxa2), 1); |
| 138 | vacc3x0123 = vmlal_lane_s16(vacc3x0123, vget_low_s16(vxb01234567c1), vget_low_s16(vxa3), 1); |
| 139 | vacc3x4567 = vmlal_lane_s16(vacc3x4567, vget_high_s16(vxb01234567c1), vget_low_s16(vxa3), 1); |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 140 | const int8x8_t vb89ABCDEFc1 = vld1_s8(w); w = (const void*) ((const int8_t*) w + 8); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 141 | const int16x8_t vxb89ABCDEFc1 = vmovl_s8(vb89ABCDEFc1); |
| 142 | |
| 143 | vacc0x89AB = vmlal_lane_s16(vacc0x89AB, vget_low_s16(vxb89ABCDEFc1), vget_low_s16(vxa0), 1); |
| 144 | vacc0xCDEF = vmlal_lane_s16(vacc0xCDEF, vget_high_s16(vxb89ABCDEFc1), vget_low_s16(vxa0), 1); |
| 145 | vacc1x89AB = vmlal_lane_s16(vacc1x89AB, vget_low_s16(vxb89ABCDEFc1), vget_low_s16(vxa1), 1); |
| 146 | vacc1xCDEF = vmlal_lane_s16(vacc1xCDEF, vget_high_s16(vxb89ABCDEFc1), vget_low_s16(vxa1), 1); |
| 147 | vacc2x89AB = vmlal_lane_s16(vacc2x89AB, vget_low_s16(vxb89ABCDEFc1), vget_low_s16(vxa2), 1); |
| 148 | vacc2xCDEF = vmlal_lane_s16(vacc2xCDEF, vget_high_s16(vxb89ABCDEFc1), vget_low_s16(vxa2), 1); |
| 149 | vacc3x89AB = vmlal_lane_s16(vacc3x89AB, vget_low_s16(vxb89ABCDEFc1), vget_low_s16(vxa3), 1); |
| 150 | vacc3xCDEF = vmlal_lane_s16(vacc3xCDEF, vget_high_s16(vxb89ABCDEFc1), vget_low_s16(vxa3), 1); |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 151 | const int8x8_t vb01234567c2 = vld1_s8(w); w = (const void*) ((const int8_t*) w + 8); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 152 | const int16x8_t vxb01234567c2 = vmovl_s8(vb01234567c2); |
| 153 | |
| 154 | vacc0x0123 = vmlal_lane_s16(vacc0x0123, vget_low_s16(vxb01234567c2), vget_low_s16(vxa0), 2); |
| 155 | vacc0x4567 = vmlal_lane_s16(vacc0x4567, vget_high_s16(vxb01234567c2), vget_low_s16(vxa0), 2); |
| 156 | vacc1x0123 = vmlal_lane_s16(vacc1x0123, vget_low_s16(vxb01234567c2), vget_low_s16(vxa1), 2); |
| 157 | vacc1x4567 = vmlal_lane_s16(vacc1x4567, vget_high_s16(vxb01234567c2), vget_low_s16(vxa1), 2); |
| 158 | vacc2x0123 = vmlal_lane_s16(vacc2x0123, vget_low_s16(vxb01234567c2), vget_low_s16(vxa2), 2); |
| 159 | vacc2x4567 = vmlal_lane_s16(vacc2x4567, vget_high_s16(vxb01234567c2), vget_low_s16(vxa2), 2); |
| 160 | vacc3x0123 = vmlal_lane_s16(vacc3x0123, vget_low_s16(vxb01234567c2), vget_low_s16(vxa3), 2); |
| 161 | vacc3x4567 = vmlal_lane_s16(vacc3x4567, vget_high_s16(vxb01234567c2), vget_low_s16(vxa3), 2); |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 162 | const int8x8_t vb89ABCDEFc2 = vld1_s8(w); w = (const void*) ((const int8_t*) w + 8); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 163 | const int16x8_t vxb89ABCDEFc2 = vmovl_s8(vb89ABCDEFc2); |
| 164 | |
| 165 | vacc0x89AB = vmlal_lane_s16(vacc0x89AB, vget_low_s16(vxb89ABCDEFc2), vget_low_s16(vxa0), 2); |
| 166 | vacc0xCDEF = vmlal_lane_s16(vacc0xCDEF, vget_high_s16(vxb89ABCDEFc2), vget_low_s16(vxa0), 2); |
| 167 | vacc1x89AB = vmlal_lane_s16(vacc1x89AB, vget_low_s16(vxb89ABCDEFc2), vget_low_s16(vxa1), 2); |
| 168 | vacc1xCDEF = vmlal_lane_s16(vacc1xCDEF, vget_high_s16(vxb89ABCDEFc2), vget_low_s16(vxa1), 2); |
| 169 | vacc2x89AB = vmlal_lane_s16(vacc2x89AB, vget_low_s16(vxb89ABCDEFc2), vget_low_s16(vxa2), 2); |
| 170 | vacc2xCDEF = vmlal_lane_s16(vacc2xCDEF, vget_high_s16(vxb89ABCDEFc2), vget_low_s16(vxa2), 2); |
| 171 | vacc3x89AB = vmlal_lane_s16(vacc3x89AB, vget_low_s16(vxb89ABCDEFc2), vget_low_s16(vxa3), 2); |
| 172 | vacc3xCDEF = vmlal_lane_s16(vacc3xCDEF, vget_high_s16(vxb89ABCDEFc2), vget_low_s16(vxa3), 2); |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 173 | const int8x8_t vb01234567c3 = vld1_s8(w); w = (const void*) ((const int8_t*) w + 8); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 174 | const int16x8_t vxb01234567c3 = vmovl_s8(vb01234567c3); |
| 175 | |
| 176 | vacc0x0123 = vmlal_lane_s16(vacc0x0123, vget_low_s16(vxb01234567c3), vget_low_s16(vxa0), 3); |
| 177 | vacc0x4567 = vmlal_lane_s16(vacc0x4567, vget_high_s16(vxb01234567c3), vget_low_s16(vxa0), 3); |
| 178 | vacc1x0123 = vmlal_lane_s16(vacc1x0123, vget_low_s16(vxb01234567c3), vget_low_s16(vxa1), 3); |
| 179 | vacc1x4567 = vmlal_lane_s16(vacc1x4567, vget_high_s16(vxb01234567c3), vget_low_s16(vxa1), 3); |
| 180 | vacc2x0123 = vmlal_lane_s16(vacc2x0123, vget_low_s16(vxb01234567c3), vget_low_s16(vxa2), 3); |
| 181 | vacc2x4567 = vmlal_lane_s16(vacc2x4567, vget_high_s16(vxb01234567c3), vget_low_s16(vxa2), 3); |
| 182 | vacc3x0123 = vmlal_lane_s16(vacc3x0123, vget_low_s16(vxb01234567c3), vget_low_s16(vxa3), 3); |
| 183 | vacc3x4567 = vmlal_lane_s16(vacc3x4567, vget_high_s16(vxb01234567c3), vget_low_s16(vxa3), 3); |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 184 | const int8x8_t vb89ABCDEFc3 = vld1_s8(w); w = (const void*) ((const int8_t*) w + 8); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 185 | const int16x8_t vxb89ABCDEFc3 = vmovl_s8(vb89ABCDEFc3); |
| 186 | |
| 187 | vacc0x89AB = vmlal_lane_s16(vacc0x89AB, vget_low_s16(vxb89ABCDEFc3), vget_low_s16(vxa0), 3); |
| 188 | vacc0xCDEF = vmlal_lane_s16(vacc0xCDEF, vget_high_s16(vxb89ABCDEFc3), vget_low_s16(vxa0), 3); |
| 189 | vacc1x89AB = vmlal_lane_s16(vacc1x89AB, vget_low_s16(vxb89ABCDEFc3), vget_low_s16(vxa1), 3); |
| 190 | vacc1xCDEF = vmlal_lane_s16(vacc1xCDEF, vget_high_s16(vxb89ABCDEFc3), vget_low_s16(vxa1), 3); |
| 191 | vacc2x89AB = vmlal_lane_s16(vacc2x89AB, vget_low_s16(vxb89ABCDEFc3), vget_low_s16(vxa2), 3); |
| 192 | vacc2xCDEF = vmlal_lane_s16(vacc2xCDEF, vget_high_s16(vxb89ABCDEFc3), vget_low_s16(vxa2), 3); |
| 193 | vacc3x89AB = vmlal_lane_s16(vacc3x89AB, vget_low_s16(vxb89ABCDEFc3), vget_low_s16(vxa3), 3); |
| 194 | vacc3xCDEF = vmlal_lane_s16(vacc3xCDEF, vget_high_s16(vxb89ABCDEFc3), vget_low_s16(vxa3), 3); |
| 195 | |
| 196 | |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 197 | const int8x8_t vb01234567c4 = vld1_s8(w); w = (const void*) ((const int8_t*) w + 8); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 198 | const int16x8_t vxb01234567c4 = vmovl_s8(vb01234567c4); |
| 199 | |
| 200 | vacc0x0123 = vmlal_lane_s16(vacc0x0123, vget_low_s16(vxb01234567c4), vget_high_s16(vxa0), 0); |
| 201 | vacc0x4567 = vmlal_lane_s16(vacc0x4567, vget_high_s16(vxb01234567c4), vget_high_s16(vxa0), 0); |
| 202 | vacc1x0123 = vmlal_lane_s16(vacc1x0123, vget_low_s16(vxb01234567c4), vget_high_s16(vxa1), 0); |
| 203 | vacc1x4567 = vmlal_lane_s16(vacc1x4567, vget_high_s16(vxb01234567c4), vget_high_s16(vxa1), 0); |
| 204 | vacc2x0123 = vmlal_lane_s16(vacc2x0123, vget_low_s16(vxb01234567c4), vget_high_s16(vxa2), 0); |
| 205 | vacc2x4567 = vmlal_lane_s16(vacc2x4567, vget_high_s16(vxb01234567c4), vget_high_s16(vxa2), 0); |
| 206 | vacc3x0123 = vmlal_lane_s16(vacc3x0123, vget_low_s16(vxb01234567c4), vget_high_s16(vxa3), 0); |
| 207 | vacc3x4567 = vmlal_lane_s16(vacc3x4567, vget_high_s16(vxb01234567c4), vget_high_s16(vxa3), 0); |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 208 | const int8x8_t vb89ABCDEFc4 = vld1_s8(w); w = (const void*) ((const int8_t*) w + 8); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 209 | const int16x8_t vxb89ABCDEFc4 = vmovl_s8(vb89ABCDEFc4); |
| 210 | |
| 211 | vacc0x89AB = vmlal_lane_s16(vacc0x89AB, vget_low_s16(vxb89ABCDEFc4), vget_high_s16(vxa0), 0); |
| 212 | vacc0xCDEF = vmlal_lane_s16(vacc0xCDEF, vget_high_s16(vxb89ABCDEFc4), vget_high_s16(vxa0), 0); |
| 213 | vacc1x89AB = vmlal_lane_s16(vacc1x89AB, vget_low_s16(vxb89ABCDEFc4), vget_high_s16(vxa1), 0); |
| 214 | vacc1xCDEF = vmlal_lane_s16(vacc1xCDEF, vget_high_s16(vxb89ABCDEFc4), vget_high_s16(vxa1), 0); |
| 215 | vacc2x89AB = vmlal_lane_s16(vacc2x89AB, vget_low_s16(vxb89ABCDEFc4), vget_high_s16(vxa2), 0); |
| 216 | vacc2xCDEF = vmlal_lane_s16(vacc2xCDEF, vget_high_s16(vxb89ABCDEFc4), vget_high_s16(vxa2), 0); |
| 217 | vacc3x89AB = vmlal_lane_s16(vacc3x89AB, vget_low_s16(vxb89ABCDEFc4), vget_high_s16(vxa3), 0); |
| 218 | vacc3xCDEF = vmlal_lane_s16(vacc3xCDEF, vget_high_s16(vxb89ABCDEFc4), vget_high_s16(vxa3), 0); |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 219 | const int8x8_t vb01234567c5 = vld1_s8(w); w = (const void*) ((const int8_t*) w + 8); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 220 | const int16x8_t vxb01234567c5 = vmovl_s8(vb01234567c5); |
| 221 | |
| 222 | vacc0x0123 = vmlal_lane_s16(vacc0x0123, vget_low_s16(vxb01234567c5), vget_high_s16(vxa0), 1); |
| 223 | vacc0x4567 = vmlal_lane_s16(vacc0x4567, vget_high_s16(vxb01234567c5), vget_high_s16(vxa0), 1); |
| 224 | vacc1x0123 = vmlal_lane_s16(vacc1x0123, vget_low_s16(vxb01234567c5), vget_high_s16(vxa1), 1); |
| 225 | vacc1x4567 = vmlal_lane_s16(vacc1x4567, vget_high_s16(vxb01234567c5), vget_high_s16(vxa1), 1); |
| 226 | vacc2x0123 = vmlal_lane_s16(vacc2x0123, vget_low_s16(vxb01234567c5), vget_high_s16(vxa2), 1); |
| 227 | vacc2x4567 = vmlal_lane_s16(vacc2x4567, vget_high_s16(vxb01234567c5), vget_high_s16(vxa2), 1); |
| 228 | vacc3x0123 = vmlal_lane_s16(vacc3x0123, vget_low_s16(vxb01234567c5), vget_high_s16(vxa3), 1); |
| 229 | vacc3x4567 = vmlal_lane_s16(vacc3x4567, vget_high_s16(vxb01234567c5), vget_high_s16(vxa3), 1); |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 230 | const int8x8_t vb89ABCDEFc5 = vld1_s8(w); w = (const void*) ((const int8_t*) w + 8); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 231 | const int16x8_t vxb89ABCDEFc5 = vmovl_s8(vb89ABCDEFc5); |
| 232 | |
| 233 | vacc0x89AB = vmlal_lane_s16(vacc0x89AB, vget_low_s16(vxb89ABCDEFc5), vget_high_s16(vxa0), 1); |
| 234 | vacc0xCDEF = vmlal_lane_s16(vacc0xCDEF, vget_high_s16(vxb89ABCDEFc5), vget_high_s16(vxa0), 1); |
| 235 | vacc1x89AB = vmlal_lane_s16(vacc1x89AB, vget_low_s16(vxb89ABCDEFc5), vget_high_s16(vxa1), 1); |
| 236 | vacc1xCDEF = vmlal_lane_s16(vacc1xCDEF, vget_high_s16(vxb89ABCDEFc5), vget_high_s16(vxa1), 1); |
| 237 | vacc2x89AB = vmlal_lane_s16(vacc2x89AB, vget_low_s16(vxb89ABCDEFc5), vget_high_s16(vxa2), 1); |
| 238 | vacc2xCDEF = vmlal_lane_s16(vacc2xCDEF, vget_high_s16(vxb89ABCDEFc5), vget_high_s16(vxa2), 1); |
| 239 | vacc3x89AB = vmlal_lane_s16(vacc3x89AB, vget_low_s16(vxb89ABCDEFc5), vget_high_s16(vxa3), 1); |
| 240 | vacc3xCDEF = vmlal_lane_s16(vacc3xCDEF, vget_high_s16(vxb89ABCDEFc5), vget_high_s16(vxa3), 1); |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 241 | const int8x8_t vb01234567c6 = vld1_s8(w); w = (const void*) ((const int8_t*) w + 8); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 242 | const int16x8_t vxb01234567c6 = vmovl_s8(vb01234567c6); |
| 243 | |
| 244 | vacc0x0123 = vmlal_lane_s16(vacc0x0123, vget_low_s16(vxb01234567c6), vget_high_s16(vxa0), 2); |
| 245 | vacc0x4567 = vmlal_lane_s16(vacc0x4567, vget_high_s16(vxb01234567c6), vget_high_s16(vxa0), 2); |
| 246 | vacc1x0123 = vmlal_lane_s16(vacc1x0123, vget_low_s16(vxb01234567c6), vget_high_s16(vxa1), 2); |
| 247 | vacc1x4567 = vmlal_lane_s16(vacc1x4567, vget_high_s16(vxb01234567c6), vget_high_s16(vxa1), 2); |
| 248 | vacc2x0123 = vmlal_lane_s16(vacc2x0123, vget_low_s16(vxb01234567c6), vget_high_s16(vxa2), 2); |
| 249 | vacc2x4567 = vmlal_lane_s16(vacc2x4567, vget_high_s16(vxb01234567c6), vget_high_s16(vxa2), 2); |
| 250 | vacc3x0123 = vmlal_lane_s16(vacc3x0123, vget_low_s16(vxb01234567c6), vget_high_s16(vxa3), 2); |
| 251 | vacc3x4567 = vmlal_lane_s16(vacc3x4567, vget_high_s16(vxb01234567c6), vget_high_s16(vxa3), 2); |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 252 | const int8x8_t vb89ABCDEFc6 = vld1_s8(w); w = (const void*) ((const int8_t*) w + 8); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 253 | const int16x8_t vxb89ABCDEFc6 = vmovl_s8(vb89ABCDEFc6); |
| 254 | |
| 255 | vacc0x89AB = vmlal_lane_s16(vacc0x89AB, vget_low_s16(vxb89ABCDEFc6), vget_high_s16(vxa0), 2); |
| 256 | vacc0xCDEF = vmlal_lane_s16(vacc0xCDEF, vget_high_s16(vxb89ABCDEFc6), vget_high_s16(vxa0), 2); |
| 257 | vacc1x89AB = vmlal_lane_s16(vacc1x89AB, vget_low_s16(vxb89ABCDEFc6), vget_high_s16(vxa1), 2); |
| 258 | vacc1xCDEF = vmlal_lane_s16(vacc1xCDEF, vget_high_s16(vxb89ABCDEFc6), vget_high_s16(vxa1), 2); |
| 259 | vacc2x89AB = vmlal_lane_s16(vacc2x89AB, vget_low_s16(vxb89ABCDEFc6), vget_high_s16(vxa2), 2); |
| 260 | vacc2xCDEF = vmlal_lane_s16(vacc2xCDEF, vget_high_s16(vxb89ABCDEFc6), vget_high_s16(vxa2), 2); |
| 261 | vacc3x89AB = vmlal_lane_s16(vacc3x89AB, vget_low_s16(vxb89ABCDEFc6), vget_high_s16(vxa3), 2); |
| 262 | vacc3xCDEF = vmlal_lane_s16(vacc3xCDEF, vget_high_s16(vxb89ABCDEFc6), vget_high_s16(vxa3), 2); |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 263 | const int8x8_t vb01234567c7 = vld1_s8(w); w = (const void*) ((const int8_t*) w + 8); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 264 | const int16x8_t vxb01234567c7 = vmovl_s8(vb01234567c7); |
| 265 | |
| 266 | vacc0x0123 = vmlal_lane_s16(vacc0x0123, vget_low_s16(vxb01234567c7), vget_high_s16(vxa0), 3); |
| 267 | vacc0x4567 = vmlal_lane_s16(vacc0x4567, vget_high_s16(vxb01234567c7), vget_high_s16(vxa0), 3); |
| 268 | vacc1x0123 = vmlal_lane_s16(vacc1x0123, vget_low_s16(vxb01234567c7), vget_high_s16(vxa1), 3); |
| 269 | vacc1x4567 = vmlal_lane_s16(vacc1x4567, vget_high_s16(vxb01234567c7), vget_high_s16(vxa1), 3); |
| 270 | vacc2x0123 = vmlal_lane_s16(vacc2x0123, vget_low_s16(vxb01234567c7), vget_high_s16(vxa2), 3); |
| 271 | vacc2x4567 = vmlal_lane_s16(vacc2x4567, vget_high_s16(vxb01234567c7), vget_high_s16(vxa2), 3); |
| 272 | vacc3x0123 = vmlal_lane_s16(vacc3x0123, vget_low_s16(vxb01234567c7), vget_high_s16(vxa3), 3); |
| 273 | vacc3x4567 = vmlal_lane_s16(vacc3x4567, vget_high_s16(vxb01234567c7), vget_high_s16(vxa3), 3); |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 274 | const int8x8_t vb89ABCDEFc7 = vld1_s8(w); w = (const void*) ((const int8_t*) w + 8); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 275 | const int16x8_t vxb89ABCDEFc7 = vmovl_s8(vb89ABCDEFc7); |
| 276 | |
| 277 | vacc0x89AB = vmlal_lane_s16(vacc0x89AB, vget_low_s16(vxb89ABCDEFc7), vget_high_s16(vxa0), 3); |
| 278 | vacc0xCDEF = vmlal_lane_s16(vacc0xCDEF, vget_high_s16(vxb89ABCDEFc7), vget_high_s16(vxa0), 3); |
| 279 | vacc1x89AB = vmlal_lane_s16(vacc1x89AB, vget_low_s16(vxb89ABCDEFc7), vget_high_s16(vxa1), 3); |
| 280 | vacc1xCDEF = vmlal_lane_s16(vacc1xCDEF, vget_high_s16(vxb89ABCDEFc7), vget_high_s16(vxa1), 3); |
| 281 | vacc2x89AB = vmlal_lane_s16(vacc2x89AB, vget_low_s16(vxb89ABCDEFc7), vget_high_s16(vxa2), 3); |
| 282 | vacc2xCDEF = vmlal_lane_s16(vacc2xCDEF, vget_high_s16(vxb89ABCDEFc7), vget_high_s16(vxa2), 3); |
| 283 | vacc3x89AB = vmlal_lane_s16(vacc3x89AB, vget_low_s16(vxb89ABCDEFc7), vget_high_s16(vxa3), 3); |
| 284 | vacc3xCDEF = vmlal_lane_s16(vacc3xCDEF, vget_high_s16(vxb89ABCDEFc7), vget_high_s16(vxa3), 3); |
| 285 | |
| 286 | k -= 8 * sizeof(int8_t); |
| 287 | } |
| 288 | if XNN_UNLIKELY(k != 0) { |
| 289 | const int8x8_t va0 = vld1_s8(a0); a0 = (const int8_t*) ((uintptr_t) a0 + k); |
| 290 | const int16x8_t vxa0 = vmovl_s8(va0); |
| 291 | const int8x8_t va1 = vld1_s8(a1); a1 = (const int8_t*) ((uintptr_t) a1 + k); |
| 292 | const int16x8_t vxa1 = vmovl_s8(va1); |
| 293 | const int8x8_t va2 = vld1_s8(a2); a2 = (const int8_t*) ((uintptr_t) a2 + k); |
| 294 | const int16x8_t vxa2 = vmovl_s8(va2); |
| 295 | const int8x8_t va3 = vld1_s8(a3); a3 = (const int8_t*) ((uintptr_t) a3 + k); |
| 296 | const int16x8_t vxa3 = vmovl_s8(va3); |
| 297 | |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 298 | const int8x8_t vb01234567c0 = vld1_s8(w); w = (const void*) ((const int8_t*) w + 8); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 299 | const int16x8_t vxb01234567c0 = vmovl_s8(vb01234567c0); |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 300 | const int8x8_t vb89ABCDEFc0 = vld1_s8(w); w = (const void*) ((const int8_t*) w + 8); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 301 | const int16x8_t vxb89ABCDEFc0 = vmovl_s8(vb89ABCDEFc0); |
| 302 | |
| 303 | vacc0x0123 = vmlal_lane_s16(vacc0x0123, vget_low_s16(vxb01234567c0), vget_low_s16(vxa0), 0); |
| 304 | vacc0x4567 = vmlal_lane_s16(vacc0x4567, vget_high_s16(vxb01234567c0), vget_low_s16(vxa0), 0); |
| 305 | vacc0x89AB = vmlal_lane_s16(vacc0x89AB, vget_low_s16(vxb89ABCDEFc0), vget_low_s16(vxa0), 0); |
| 306 | vacc0xCDEF = vmlal_lane_s16(vacc0xCDEF, vget_high_s16(vxb89ABCDEFc0), vget_low_s16(vxa0), 0); |
| 307 | vacc1x0123 = vmlal_lane_s16(vacc1x0123, vget_low_s16(vxb01234567c0), vget_low_s16(vxa1), 0); |
| 308 | vacc1x4567 = vmlal_lane_s16(vacc1x4567, vget_high_s16(vxb01234567c0), vget_low_s16(vxa1), 0); |
| 309 | vacc1x89AB = vmlal_lane_s16(vacc1x89AB, vget_low_s16(vxb89ABCDEFc0), vget_low_s16(vxa1), 0); |
| 310 | vacc1xCDEF = vmlal_lane_s16(vacc1xCDEF, vget_high_s16(vxb89ABCDEFc0), vget_low_s16(vxa1), 0); |
| 311 | vacc2x0123 = vmlal_lane_s16(vacc2x0123, vget_low_s16(vxb01234567c0), vget_low_s16(vxa2), 0); |
| 312 | vacc2x4567 = vmlal_lane_s16(vacc2x4567, vget_high_s16(vxb01234567c0), vget_low_s16(vxa2), 0); |
| 313 | vacc2x89AB = vmlal_lane_s16(vacc2x89AB, vget_low_s16(vxb89ABCDEFc0), vget_low_s16(vxa2), 0); |
| 314 | vacc2xCDEF = vmlal_lane_s16(vacc2xCDEF, vget_high_s16(vxb89ABCDEFc0), vget_low_s16(vxa2), 0); |
| 315 | vacc3x0123 = vmlal_lane_s16(vacc3x0123, vget_low_s16(vxb01234567c0), vget_low_s16(vxa3), 0); |
| 316 | vacc3x4567 = vmlal_lane_s16(vacc3x4567, vget_high_s16(vxb01234567c0), vget_low_s16(vxa3), 0); |
| 317 | vacc3x89AB = vmlal_lane_s16(vacc3x89AB, vget_low_s16(vxb89ABCDEFc0), vget_low_s16(vxa3), 0); |
| 318 | vacc3xCDEF = vmlal_lane_s16(vacc3xCDEF, vget_high_s16(vxb89ABCDEFc0), vget_low_s16(vxa3), 0); |
| 319 | |
| 320 | if (k >= 2 * sizeof(int8_t)) { |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 321 | const int8x8_t vb01234567c1 = vld1_s8(w); w = (const void*) ((const int8_t*) w + 8); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 322 | const int16x8_t vxb01234567c1 = vmovl_s8(vb01234567c1); |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 323 | const int8x8_t vb89ABCDEFc1 = vld1_s8(w); w = (const void*) ((const int8_t*) w + 8); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 324 | const int16x8_t vxb89ABCDEFc1 = vmovl_s8(vb89ABCDEFc1); |
| 325 | |
| 326 | vacc0x0123 = vmlal_lane_s16(vacc0x0123, vget_low_s16(vxb01234567c1), vget_low_s16(vxa0), 1); |
| 327 | vacc0x4567 = vmlal_lane_s16(vacc0x4567, vget_high_s16(vxb01234567c1), vget_low_s16(vxa0), 1); |
| 328 | vacc0x89AB = vmlal_lane_s16(vacc0x89AB, vget_low_s16(vxb89ABCDEFc1), vget_low_s16(vxa0), 1); |
| 329 | vacc0xCDEF = vmlal_lane_s16(vacc0xCDEF, vget_high_s16(vxb89ABCDEFc1), vget_low_s16(vxa0), 1); |
| 330 | vacc1x0123 = vmlal_lane_s16(vacc1x0123, vget_low_s16(vxb01234567c1), vget_low_s16(vxa1), 1); |
| 331 | vacc1x4567 = vmlal_lane_s16(vacc1x4567, vget_high_s16(vxb01234567c1), vget_low_s16(vxa1), 1); |
| 332 | vacc1x89AB = vmlal_lane_s16(vacc1x89AB, vget_low_s16(vxb89ABCDEFc1), vget_low_s16(vxa1), 1); |
| 333 | vacc1xCDEF = vmlal_lane_s16(vacc1xCDEF, vget_high_s16(vxb89ABCDEFc1), vget_low_s16(vxa1), 1); |
| 334 | vacc2x0123 = vmlal_lane_s16(vacc2x0123, vget_low_s16(vxb01234567c1), vget_low_s16(vxa2), 1); |
| 335 | vacc2x4567 = vmlal_lane_s16(vacc2x4567, vget_high_s16(vxb01234567c1), vget_low_s16(vxa2), 1); |
| 336 | vacc2x89AB = vmlal_lane_s16(vacc2x89AB, vget_low_s16(vxb89ABCDEFc1), vget_low_s16(vxa2), 1); |
| 337 | vacc2xCDEF = vmlal_lane_s16(vacc2xCDEF, vget_high_s16(vxb89ABCDEFc1), vget_low_s16(vxa2), 1); |
| 338 | vacc3x0123 = vmlal_lane_s16(vacc3x0123, vget_low_s16(vxb01234567c1), vget_low_s16(vxa3), 1); |
| 339 | vacc3x4567 = vmlal_lane_s16(vacc3x4567, vget_high_s16(vxb01234567c1), vget_low_s16(vxa3), 1); |
| 340 | vacc3x89AB = vmlal_lane_s16(vacc3x89AB, vget_low_s16(vxb89ABCDEFc1), vget_low_s16(vxa3), 1); |
| 341 | vacc3xCDEF = vmlal_lane_s16(vacc3xCDEF, vget_high_s16(vxb89ABCDEFc1), vget_low_s16(vxa3), 1); |
| 342 | |
| 343 | if (k > 2 * sizeof(int8_t)) { |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 344 | const int8x8_t vb01234567c2 = vld1_s8(w); w = (const void*) ((const int8_t*) w + 8); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 345 | const int16x8_t vxb01234567c2 = vmovl_s8(vb01234567c2); |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 346 | const int8x8_t vb89ABCDEFc2 = vld1_s8(w); w = (const void*) ((const int8_t*) w + 8); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 347 | const int16x8_t vxb89ABCDEFc2 = vmovl_s8(vb89ABCDEFc2); |
| 348 | |
| 349 | vacc0x0123 = vmlal_lane_s16(vacc0x0123, vget_low_s16(vxb01234567c2), vget_low_s16(vxa0), 2); |
| 350 | vacc0x4567 = vmlal_lane_s16(vacc0x4567, vget_high_s16(vxb01234567c2), vget_low_s16(vxa0), 2); |
| 351 | vacc0x89AB = vmlal_lane_s16(vacc0x89AB, vget_low_s16(vxb89ABCDEFc2), vget_low_s16(vxa0), 2); |
| 352 | vacc0xCDEF = vmlal_lane_s16(vacc0xCDEF, vget_high_s16(vxb89ABCDEFc2), vget_low_s16(vxa0), 2); |
| 353 | vacc1x0123 = vmlal_lane_s16(vacc1x0123, vget_low_s16(vxb01234567c2), vget_low_s16(vxa1), 2); |
| 354 | vacc1x4567 = vmlal_lane_s16(vacc1x4567, vget_high_s16(vxb01234567c2), vget_low_s16(vxa1), 2); |
| 355 | vacc1x89AB = vmlal_lane_s16(vacc1x89AB, vget_low_s16(vxb89ABCDEFc2), vget_low_s16(vxa1), 2); |
| 356 | vacc1xCDEF = vmlal_lane_s16(vacc1xCDEF, vget_high_s16(vxb89ABCDEFc2), vget_low_s16(vxa1), 2); |
| 357 | vacc2x0123 = vmlal_lane_s16(vacc2x0123, vget_low_s16(vxb01234567c2), vget_low_s16(vxa2), 2); |
| 358 | vacc2x4567 = vmlal_lane_s16(vacc2x4567, vget_high_s16(vxb01234567c2), vget_low_s16(vxa2), 2); |
| 359 | vacc2x89AB = vmlal_lane_s16(vacc2x89AB, vget_low_s16(vxb89ABCDEFc2), vget_low_s16(vxa2), 2); |
| 360 | vacc2xCDEF = vmlal_lane_s16(vacc2xCDEF, vget_high_s16(vxb89ABCDEFc2), vget_low_s16(vxa2), 2); |
| 361 | vacc3x0123 = vmlal_lane_s16(vacc3x0123, vget_low_s16(vxb01234567c2), vget_low_s16(vxa3), 2); |
| 362 | vacc3x4567 = vmlal_lane_s16(vacc3x4567, vget_high_s16(vxb01234567c2), vget_low_s16(vxa3), 2); |
| 363 | vacc3x89AB = vmlal_lane_s16(vacc3x89AB, vget_low_s16(vxb89ABCDEFc2), vget_low_s16(vxa3), 2); |
| 364 | vacc3xCDEF = vmlal_lane_s16(vacc3xCDEF, vget_high_s16(vxb89ABCDEFc2), vget_low_s16(vxa3), 2); |
| 365 | |
| 366 | if (k >= 4 * sizeof(int8_t)) { |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 367 | const int8x8_t vb01234567c3 = vld1_s8(w); w = (const void*) ((const int8_t*) w + 8); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 368 | const int16x8_t vxb01234567c3 = vmovl_s8(vb01234567c3); |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 369 | const int8x8_t vb89ABCDEFc3 = vld1_s8(w); w = (const void*) ((const int8_t*) w + 8); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 370 | const int16x8_t vxb89ABCDEFc3 = vmovl_s8(vb89ABCDEFc3); |
| 371 | |
| 372 | vacc0x0123 = vmlal_lane_s16(vacc0x0123, vget_low_s16(vxb01234567c3), vget_low_s16(vxa0), 3); |
| 373 | vacc0x4567 = vmlal_lane_s16(vacc0x4567, vget_high_s16(vxb01234567c3), vget_low_s16(vxa0), 3); |
| 374 | vacc0x89AB = vmlal_lane_s16(vacc0x89AB, vget_low_s16(vxb89ABCDEFc3), vget_low_s16(vxa0), 3); |
| 375 | vacc0xCDEF = vmlal_lane_s16(vacc0xCDEF, vget_high_s16(vxb89ABCDEFc3), vget_low_s16(vxa0), 3); |
| 376 | vacc1x0123 = vmlal_lane_s16(vacc1x0123, vget_low_s16(vxb01234567c3), vget_low_s16(vxa1), 3); |
| 377 | vacc1x4567 = vmlal_lane_s16(vacc1x4567, vget_high_s16(vxb01234567c3), vget_low_s16(vxa1), 3); |
| 378 | vacc1x89AB = vmlal_lane_s16(vacc1x89AB, vget_low_s16(vxb89ABCDEFc3), vget_low_s16(vxa1), 3); |
| 379 | vacc1xCDEF = vmlal_lane_s16(vacc1xCDEF, vget_high_s16(vxb89ABCDEFc3), vget_low_s16(vxa1), 3); |
| 380 | vacc2x0123 = vmlal_lane_s16(vacc2x0123, vget_low_s16(vxb01234567c3), vget_low_s16(vxa2), 3); |
| 381 | vacc2x4567 = vmlal_lane_s16(vacc2x4567, vget_high_s16(vxb01234567c3), vget_low_s16(vxa2), 3); |
| 382 | vacc2x89AB = vmlal_lane_s16(vacc2x89AB, vget_low_s16(vxb89ABCDEFc3), vget_low_s16(vxa2), 3); |
| 383 | vacc2xCDEF = vmlal_lane_s16(vacc2xCDEF, vget_high_s16(vxb89ABCDEFc3), vget_low_s16(vxa2), 3); |
| 384 | vacc3x0123 = vmlal_lane_s16(vacc3x0123, vget_low_s16(vxb01234567c3), vget_low_s16(vxa3), 3); |
| 385 | vacc3x4567 = vmlal_lane_s16(vacc3x4567, vget_high_s16(vxb01234567c3), vget_low_s16(vxa3), 3); |
| 386 | vacc3x89AB = vmlal_lane_s16(vacc3x89AB, vget_low_s16(vxb89ABCDEFc3), vget_low_s16(vxa3), 3); |
| 387 | vacc3xCDEF = vmlal_lane_s16(vacc3xCDEF, vget_high_s16(vxb89ABCDEFc3), vget_low_s16(vxa3), 3); |
| 388 | |
| 389 | if (k > 4 * sizeof(int8_t)) { |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 390 | const int8x8_t vb01234567c4 = vld1_s8(w); w = (const void*) ((const int8_t*) w + 8); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 391 | const int16x8_t vxb01234567c4 = vmovl_s8(vb01234567c4); |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 392 | const int8x8_t vb89ABCDEFc4 = vld1_s8(w); w = (const void*) ((const int8_t*) w + 8); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 393 | const int16x8_t vxb89ABCDEFc4 = vmovl_s8(vb89ABCDEFc4); |
| 394 | |
| 395 | vacc0x0123 = vmlal_lane_s16(vacc0x0123, vget_low_s16(vxb01234567c4), vget_high_s16(vxa0), 0); |
| 396 | vacc0x4567 = vmlal_lane_s16(vacc0x4567, vget_high_s16(vxb01234567c4), vget_high_s16(vxa0), 0); |
| 397 | vacc0x89AB = vmlal_lane_s16(vacc0x89AB, vget_low_s16(vxb89ABCDEFc4), vget_high_s16(vxa0), 0); |
| 398 | vacc0xCDEF = vmlal_lane_s16(vacc0xCDEF, vget_high_s16(vxb89ABCDEFc4), vget_high_s16(vxa0), 0); |
| 399 | vacc1x0123 = vmlal_lane_s16(vacc1x0123, vget_low_s16(vxb01234567c4), vget_high_s16(vxa1), 0); |
| 400 | vacc1x4567 = vmlal_lane_s16(vacc1x4567, vget_high_s16(vxb01234567c4), vget_high_s16(vxa1), 0); |
| 401 | vacc1x89AB = vmlal_lane_s16(vacc1x89AB, vget_low_s16(vxb89ABCDEFc4), vget_high_s16(vxa1), 0); |
| 402 | vacc1xCDEF = vmlal_lane_s16(vacc1xCDEF, vget_high_s16(vxb89ABCDEFc4), vget_high_s16(vxa1), 0); |
| 403 | vacc2x0123 = vmlal_lane_s16(vacc2x0123, vget_low_s16(vxb01234567c4), vget_high_s16(vxa2), 0); |
| 404 | vacc2x4567 = vmlal_lane_s16(vacc2x4567, vget_high_s16(vxb01234567c4), vget_high_s16(vxa2), 0); |
| 405 | vacc2x89AB = vmlal_lane_s16(vacc2x89AB, vget_low_s16(vxb89ABCDEFc4), vget_high_s16(vxa2), 0); |
| 406 | vacc2xCDEF = vmlal_lane_s16(vacc2xCDEF, vget_high_s16(vxb89ABCDEFc4), vget_high_s16(vxa2), 0); |
| 407 | vacc3x0123 = vmlal_lane_s16(vacc3x0123, vget_low_s16(vxb01234567c4), vget_high_s16(vxa3), 0); |
| 408 | vacc3x4567 = vmlal_lane_s16(vacc3x4567, vget_high_s16(vxb01234567c4), vget_high_s16(vxa3), 0); |
| 409 | vacc3x89AB = vmlal_lane_s16(vacc3x89AB, vget_low_s16(vxb89ABCDEFc4), vget_high_s16(vxa3), 0); |
| 410 | vacc3xCDEF = vmlal_lane_s16(vacc3xCDEF, vget_high_s16(vxb89ABCDEFc4), vget_high_s16(vxa3), 0); |
| 411 | |
| 412 | if (k >= 6 * sizeof(int8_t)) { |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 413 | const int8x8_t vb01234567c5 = vld1_s8(w); w = (const void*) ((const int8_t*) w + 8); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 414 | const int16x8_t vxb01234567c5 = vmovl_s8(vb01234567c5); |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 415 | const int8x8_t vb89ABCDEFc5 = vld1_s8(w); w = (const void*) ((const int8_t*) w + 8); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 416 | const int16x8_t vxb89ABCDEFc5 = vmovl_s8(vb89ABCDEFc5); |
| 417 | |
| 418 | vacc0x0123 = vmlal_lane_s16(vacc0x0123, vget_low_s16(vxb01234567c5), vget_high_s16(vxa0), 1); |
| 419 | vacc0x4567 = vmlal_lane_s16(vacc0x4567, vget_high_s16(vxb01234567c5), vget_high_s16(vxa0), 1); |
| 420 | vacc0x89AB = vmlal_lane_s16(vacc0x89AB, vget_low_s16(vxb89ABCDEFc5), vget_high_s16(vxa0), 1); |
| 421 | vacc0xCDEF = vmlal_lane_s16(vacc0xCDEF, vget_high_s16(vxb89ABCDEFc5), vget_high_s16(vxa0), 1); |
| 422 | vacc1x0123 = vmlal_lane_s16(vacc1x0123, vget_low_s16(vxb01234567c5), vget_high_s16(vxa1), 1); |
| 423 | vacc1x4567 = vmlal_lane_s16(vacc1x4567, vget_high_s16(vxb01234567c5), vget_high_s16(vxa1), 1); |
| 424 | vacc1x89AB = vmlal_lane_s16(vacc1x89AB, vget_low_s16(vxb89ABCDEFc5), vget_high_s16(vxa1), 1); |
| 425 | vacc1xCDEF = vmlal_lane_s16(vacc1xCDEF, vget_high_s16(vxb89ABCDEFc5), vget_high_s16(vxa1), 1); |
| 426 | vacc2x0123 = vmlal_lane_s16(vacc2x0123, vget_low_s16(vxb01234567c5), vget_high_s16(vxa2), 1); |
| 427 | vacc2x4567 = vmlal_lane_s16(vacc2x4567, vget_high_s16(vxb01234567c5), vget_high_s16(vxa2), 1); |
| 428 | vacc2x89AB = vmlal_lane_s16(vacc2x89AB, vget_low_s16(vxb89ABCDEFc5), vget_high_s16(vxa2), 1); |
| 429 | vacc2xCDEF = vmlal_lane_s16(vacc2xCDEF, vget_high_s16(vxb89ABCDEFc5), vget_high_s16(vxa2), 1); |
| 430 | vacc3x0123 = vmlal_lane_s16(vacc3x0123, vget_low_s16(vxb01234567c5), vget_high_s16(vxa3), 1); |
| 431 | vacc3x4567 = vmlal_lane_s16(vacc3x4567, vget_high_s16(vxb01234567c5), vget_high_s16(vxa3), 1); |
| 432 | vacc3x89AB = vmlal_lane_s16(vacc3x89AB, vget_low_s16(vxb89ABCDEFc5), vget_high_s16(vxa3), 1); |
| 433 | vacc3xCDEF = vmlal_lane_s16(vacc3xCDEF, vget_high_s16(vxb89ABCDEFc5), vget_high_s16(vxa3), 1); |
| 434 | |
| 435 | if (k > 6 * sizeof(int8_t)) { |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 436 | const int8x8_t vb01234567c6 = vld1_s8(w); w = (const void*) ((const int8_t*) w + 8); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 437 | const int16x8_t vxb01234567c6 = vmovl_s8(vb01234567c6); |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 438 | const int8x8_t vb89ABCDEFc6 = vld1_s8(w); w = (const void*) ((const int8_t*) w + 8); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 439 | const int16x8_t vxb89ABCDEFc6 = vmovl_s8(vb89ABCDEFc6); |
| 440 | |
| 441 | vacc0x0123 = vmlal_lane_s16(vacc0x0123, vget_low_s16(vxb01234567c6), vget_high_s16(vxa0), 2); |
| 442 | vacc0x4567 = vmlal_lane_s16(vacc0x4567, vget_high_s16(vxb01234567c6), vget_high_s16(vxa0), 2); |
| 443 | vacc0x89AB = vmlal_lane_s16(vacc0x89AB, vget_low_s16(vxb89ABCDEFc6), vget_high_s16(vxa0), 2); |
| 444 | vacc0xCDEF = vmlal_lane_s16(vacc0xCDEF, vget_high_s16(vxb89ABCDEFc6), vget_high_s16(vxa0), 2); |
| 445 | vacc1x0123 = vmlal_lane_s16(vacc1x0123, vget_low_s16(vxb01234567c6), vget_high_s16(vxa1), 2); |
| 446 | vacc1x4567 = vmlal_lane_s16(vacc1x4567, vget_high_s16(vxb01234567c6), vget_high_s16(vxa1), 2); |
| 447 | vacc1x89AB = vmlal_lane_s16(vacc1x89AB, vget_low_s16(vxb89ABCDEFc6), vget_high_s16(vxa1), 2); |
| 448 | vacc1xCDEF = vmlal_lane_s16(vacc1xCDEF, vget_high_s16(vxb89ABCDEFc6), vget_high_s16(vxa1), 2); |
| 449 | vacc2x0123 = vmlal_lane_s16(vacc2x0123, vget_low_s16(vxb01234567c6), vget_high_s16(vxa2), 2); |
| 450 | vacc2x4567 = vmlal_lane_s16(vacc2x4567, vget_high_s16(vxb01234567c6), vget_high_s16(vxa2), 2); |
| 451 | vacc2x89AB = vmlal_lane_s16(vacc2x89AB, vget_low_s16(vxb89ABCDEFc6), vget_high_s16(vxa2), 2); |
| 452 | vacc2xCDEF = vmlal_lane_s16(vacc2xCDEF, vget_high_s16(vxb89ABCDEFc6), vget_high_s16(vxa2), 2); |
| 453 | vacc3x0123 = vmlal_lane_s16(vacc3x0123, vget_low_s16(vxb01234567c6), vget_high_s16(vxa3), 2); |
| 454 | vacc3x4567 = vmlal_lane_s16(vacc3x4567, vget_high_s16(vxb01234567c6), vget_high_s16(vxa3), 2); |
| 455 | vacc3x89AB = vmlal_lane_s16(vacc3x89AB, vget_low_s16(vxb89ABCDEFc6), vget_high_s16(vxa3), 2); |
| 456 | vacc3xCDEF = vmlal_lane_s16(vacc3xCDEF, vget_high_s16(vxb89ABCDEFc6), vget_high_s16(vxa3), 2); |
| 457 | } |
| 458 | } |
| 459 | } |
| 460 | } |
| 461 | } |
| 462 | } |
| 463 | } |
| 464 | p -= 4 * sizeof(void*); |
| 465 | } while (p != 0); |
| 466 | |
| 467 | float32x4_t vfpacc0x0123 = vcvtq_f32_s32(vacc0x0123); |
| 468 | float32x4_t vfpacc0x4567 = vcvtq_f32_s32(vacc0x4567); |
| 469 | float32x4_t vfpacc0x89AB = vcvtq_f32_s32(vacc0x89AB); |
| 470 | float32x4_t vfpacc0xCDEF = vcvtq_f32_s32(vacc0xCDEF); |
| 471 | float32x4_t vfpacc1x0123 = vcvtq_f32_s32(vacc1x0123); |
| 472 | float32x4_t vfpacc1x4567 = vcvtq_f32_s32(vacc1x4567); |
| 473 | float32x4_t vfpacc1x89AB = vcvtq_f32_s32(vacc1x89AB); |
| 474 | float32x4_t vfpacc1xCDEF = vcvtq_f32_s32(vacc1xCDEF); |
| 475 | float32x4_t vfpacc2x0123 = vcvtq_f32_s32(vacc2x0123); |
| 476 | float32x4_t vfpacc2x4567 = vcvtq_f32_s32(vacc2x4567); |
| 477 | float32x4_t vfpacc2x89AB = vcvtq_f32_s32(vacc2x89AB); |
| 478 | float32x4_t vfpacc2xCDEF = vcvtq_f32_s32(vacc2xCDEF); |
| 479 | float32x4_t vfpacc3x0123 = vcvtq_f32_s32(vacc3x0123); |
| 480 | float32x4_t vfpacc3x4567 = vcvtq_f32_s32(vacc3x4567); |
| 481 | float32x4_t vfpacc3x89AB = vcvtq_f32_s32(vacc3x89AB); |
| 482 | float32x4_t vfpacc3xCDEF = vcvtq_f32_s32(vacc3xCDEF); |
| 483 | |
| 484 | const float32x4_t vscale0123 = vld1q_f32((const float*) w); w = (const void*) ((const float*) w + 4); |
| 485 | vfpacc0x0123 = vmulq_f32(vfpacc0x0123, vscale0123); |
| 486 | vfpacc1x0123 = vmulq_f32(vfpacc1x0123, vscale0123); |
| 487 | vfpacc2x0123 = vmulq_f32(vfpacc2x0123, vscale0123); |
| 488 | vfpacc3x0123 = vmulq_f32(vfpacc3x0123, vscale0123); |
| 489 | const float32x4_t vscale4567 = vld1q_f32((const float*) w); w = (const void*) ((const float*) w + 4); |
| 490 | vfpacc0x4567 = vmulq_f32(vfpacc0x4567, vscale4567); |
| 491 | vfpacc1x4567 = vmulq_f32(vfpacc1x4567, vscale4567); |
| 492 | vfpacc2x4567 = vmulq_f32(vfpacc2x4567, vscale4567); |
| 493 | vfpacc3x4567 = vmulq_f32(vfpacc3x4567, vscale4567); |
| 494 | const float32x4_t vscale89AB = vld1q_f32((const float*) w); w = (const void*) ((const float*) w + 4); |
| 495 | vfpacc0x89AB = vmulq_f32(vfpacc0x89AB, vscale89AB); |
| 496 | vfpacc1x89AB = vmulq_f32(vfpacc1x89AB, vscale89AB); |
| 497 | vfpacc2x89AB = vmulq_f32(vfpacc2x89AB, vscale89AB); |
| 498 | vfpacc3x89AB = vmulq_f32(vfpacc3x89AB, vscale89AB); |
| 499 | const float32x4_t vscaleCDEF = vld1q_f32((const float*) w); w = (const void*) ((const float*) w + 4); |
| 500 | vfpacc0xCDEF = vmulq_f32(vfpacc0xCDEF, vscaleCDEF); |
| 501 | vfpacc1xCDEF = vmulq_f32(vfpacc1xCDEF, vscaleCDEF); |
| 502 | vfpacc2xCDEF = vmulq_f32(vfpacc2xCDEF, vscaleCDEF); |
| 503 | vfpacc3xCDEF = vmulq_f32(vfpacc3xCDEF, vscaleCDEF); |
| 504 | |
| 505 | vacc0x0123 = vcvtnq_s32_f32(vfpacc0x0123); |
| 506 | vacc0x4567 = vcvtnq_s32_f32(vfpacc0x4567); |
| 507 | vacc0x89AB = vcvtnq_s32_f32(vfpacc0x89AB); |
| 508 | vacc0xCDEF = vcvtnq_s32_f32(vfpacc0xCDEF); |
| 509 | vacc1x0123 = vcvtnq_s32_f32(vfpacc1x0123); |
| 510 | vacc1x4567 = vcvtnq_s32_f32(vfpacc1x4567); |
| 511 | vacc1x89AB = vcvtnq_s32_f32(vfpacc1x89AB); |
| 512 | vacc1xCDEF = vcvtnq_s32_f32(vfpacc1xCDEF); |
| 513 | vacc2x0123 = vcvtnq_s32_f32(vfpacc2x0123); |
| 514 | vacc2x4567 = vcvtnq_s32_f32(vfpacc2x4567); |
| 515 | vacc2x89AB = vcvtnq_s32_f32(vfpacc2x89AB); |
| 516 | vacc2xCDEF = vcvtnq_s32_f32(vfpacc2xCDEF); |
| 517 | vacc3x0123 = vcvtnq_s32_f32(vfpacc3x0123); |
| 518 | vacc3x4567 = vcvtnq_s32_f32(vfpacc3x4567); |
| 519 | vacc3x89AB = vcvtnq_s32_f32(vfpacc3x89AB); |
| 520 | vacc3xCDEF = vcvtnq_s32_f32(vfpacc3xCDEF); |
| 521 | |
| 522 | const int16x8_t voutput_zero_point = vld1q_dup_s16(¶ms->neon.output_zero_point); |
| 523 | #if XNN_ARCH_ARM64 |
| 524 | const int16x8_t vacc0x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc0x0123), vacc0x4567), voutput_zero_point); |
| 525 | const int16x8_t vacc0x89ABCDEF = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc0x89AB), vacc0xCDEF), voutput_zero_point); |
| 526 | const int16x8_t vacc1x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc1x0123), vacc1x4567), voutput_zero_point); |
| 527 | const int16x8_t vacc1x89ABCDEF = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc1x89AB), vacc1xCDEF), voutput_zero_point); |
| 528 | const int16x8_t vacc2x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc2x0123), vacc2x4567), voutput_zero_point); |
| 529 | const int16x8_t vacc2x89ABCDEF = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc2x89AB), vacc2xCDEF), voutput_zero_point); |
| 530 | const int16x8_t vacc3x01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc3x0123), vacc3x4567), voutput_zero_point); |
| 531 | const int16x8_t vacc3x89ABCDEF = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc3x89AB), vacc3xCDEF), voutput_zero_point); |
| 532 | |
| 533 | int8x16_t vout0x0123456789ABCDEF = vqmovn_high_s16(vqmovn_s16(vacc0x01234567), vacc0x89ABCDEF); |
| 534 | int8x16_t vout1x0123456789ABCDEF = vqmovn_high_s16(vqmovn_s16(vacc1x01234567), vacc1x89ABCDEF); |
| 535 | int8x16_t vout2x0123456789ABCDEF = vqmovn_high_s16(vqmovn_s16(vacc2x01234567), vacc2x89ABCDEF); |
| 536 | int8x16_t vout3x0123456789ABCDEF = vqmovn_high_s16(vqmovn_s16(vacc3x01234567), vacc3x89ABCDEF); |
| 537 | #else |
| 538 | const int16x8_t vacc0x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc0x0123), vqmovn_s32(vacc0x4567)), voutput_zero_point); |
| 539 | const int16x8_t vacc0x89ABCDEF = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc0x89AB), vqmovn_s32(vacc0xCDEF)), voutput_zero_point); |
| 540 | const int16x8_t vacc1x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc1x0123), vqmovn_s32(vacc1x4567)), voutput_zero_point); |
| 541 | const int16x8_t vacc1x89ABCDEF = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc1x89AB), vqmovn_s32(vacc1xCDEF)), voutput_zero_point); |
| 542 | const int16x8_t vacc2x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc2x0123), vqmovn_s32(vacc2x4567)), voutput_zero_point); |
| 543 | const int16x8_t vacc2x89ABCDEF = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc2x89AB), vqmovn_s32(vacc2xCDEF)), voutput_zero_point); |
| 544 | const int16x8_t vacc3x01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc3x0123), vqmovn_s32(vacc3x4567)), voutput_zero_point); |
| 545 | const int16x8_t vacc3x89ABCDEF = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc3x89AB), vqmovn_s32(vacc3xCDEF)), voutput_zero_point); |
| 546 | |
| 547 | int8x16_t vout0x0123456789ABCDEF = vcombine_s8(vqmovn_s16(vacc0x01234567), vqmovn_s16(vacc0x89ABCDEF)); |
| 548 | int8x16_t vout1x0123456789ABCDEF = vcombine_s8(vqmovn_s16(vacc1x01234567), vqmovn_s16(vacc1x89ABCDEF)); |
| 549 | int8x16_t vout2x0123456789ABCDEF = vcombine_s8(vqmovn_s16(vacc2x01234567), vqmovn_s16(vacc2x89ABCDEF)); |
| 550 | int8x16_t vout3x0123456789ABCDEF = vcombine_s8(vqmovn_s16(vacc3x01234567), vqmovn_s16(vacc3x89ABCDEF)); |
| 551 | #endif |
| 552 | const int8x16_t voutput_min = vld1q_dup_s8(¶ms->neon.output_min); |
| 553 | const int8x16_t voutput_max = vld1q_dup_s8(¶ms->neon.output_max); |
| 554 | |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 555 | vout0x0123456789ABCDEF = vmaxq_s8(vout0x0123456789ABCDEF, voutput_min); |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 556 | vout1x0123456789ABCDEF = vmaxq_s8(vout1x0123456789ABCDEF, voutput_min); |
| 557 | vout2x0123456789ABCDEF = vmaxq_s8(vout2x0123456789ABCDEF, voutput_min); |
| 558 | vout3x0123456789ABCDEF = vmaxq_s8(vout3x0123456789ABCDEF, voutput_min); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 559 | |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 560 | vout0x0123456789ABCDEF = vminq_s8(vout0x0123456789ABCDEF, voutput_max); |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 561 | vout1x0123456789ABCDEF = vminq_s8(vout1x0123456789ABCDEF, voutput_max); |
| 562 | vout2x0123456789ABCDEF = vminq_s8(vout2x0123456789ABCDEF, voutput_max); |
| 563 | vout3x0123456789ABCDEF = vminq_s8(vout3x0123456789ABCDEF, voutput_max); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 564 | |
| 565 | if (nc >= 16) { |
| 566 | vst1q_s8(c3 + 0, vout3x0123456789ABCDEF); |
| 567 | vst1q_s8(c2 + 0, vout2x0123456789ABCDEF); |
| 568 | vst1q_s8(c1 + 0, vout1x0123456789ABCDEF); |
| 569 | vst1q_s8(c0 + 0, vout0x0123456789ABCDEF); |
| 570 | |
| 571 | c3 = (int8_t*) ((uintptr_t) c3 + cn_stride); |
| 572 | c2 = (int8_t*) ((uintptr_t) c2 + cn_stride); |
| 573 | c1 = (int8_t*) ((uintptr_t) c1 + cn_stride); |
| 574 | c0 = (int8_t*) ((uintptr_t) c0 + cn_stride); |
| 575 | |
| 576 | a = (const int8_t**restrict) ((uintptr_t) a - ks); |
| 577 | |
| 578 | nc -= 16; |
| 579 | } else { |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 580 | int8x16_t vout2x01234567_3x01234567 = vcombine_s8(vget_low_s8(vout2x0123456789ABCDEF), vget_low_s8(vout3x0123456789ABCDEF)); |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 581 | int8x16_t vout0x01234567_1x01234567 = vcombine_s8(vget_low_s8(vout0x0123456789ABCDEF), vget_low_s8(vout1x0123456789ABCDEF)); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 582 | if (nc & 8) { |
| 583 | vst1_s8(c3, vget_high_s8(vout2x01234567_3x01234567)); c3 += 8; |
| 584 | vst1_s8(c2, vget_low_s8(vout2x01234567_3x01234567)); c2 += 8; |
| 585 | vst1_s8(c1, vget_high_s8(vout0x01234567_1x01234567)); c1 += 8; |
| 586 | vst1_s8(c0, vget_low_s8(vout0x01234567_1x01234567)); c0 += 8; |
| 587 | vout2x01234567_3x01234567 = vcombine_s8(vget_high_s8(vout2x0123456789ABCDEF), vget_high_s8(vout3x0123456789ABCDEF)); |
| 588 | vout0x01234567_1x01234567 = vcombine_s8(vget_high_s8(vout0x0123456789ABCDEF), vget_high_s8(vout1x0123456789ABCDEF)); |
| 589 | } |
| 590 | if (nc & 4) { |
| 591 | vst1q_lane_u32(__builtin_assume_aligned(c3, 1), vreinterpretq_u32_s8(vout2x01234567_3x01234567), 2); c3 += 4; |
| 592 | vst1q_lane_u32(__builtin_assume_aligned(c2, 1), vreinterpretq_u32_s8(vout2x01234567_3x01234567), 0); c2 += 4; |
| 593 | vst1q_lane_u32(__builtin_assume_aligned(c1, 1), vreinterpretq_u32_s8(vout0x01234567_1x01234567), 2); c1 += 4; |
| 594 | vst1q_lane_u32(__builtin_assume_aligned(c0, 1), vreinterpretq_u32_s8(vout0x01234567_1x01234567), 0); c0 += 4; |
| 595 | vout2x01234567_3x01234567 = vextq_s8(vout2x01234567_3x01234567, vout2x01234567_3x01234567, 4); |
| 596 | vout0x01234567_1x01234567 = vextq_s8(vout0x01234567_1x01234567, vout0x01234567_1x01234567, 4); |
| 597 | } |
| 598 | if (nc & 2) { |
| 599 | vst1q_lane_u16(__builtin_assume_aligned(c3, 1), vreinterpretq_u16_s8(vout2x01234567_3x01234567), 4); c3 += 2; |
| 600 | vst1q_lane_u16(__builtin_assume_aligned(c2, 1), vreinterpretq_u16_s8(vout2x01234567_3x01234567), 0); c2 += 2; |
| 601 | vst1q_lane_u16(__builtin_assume_aligned(c1, 1), vreinterpretq_u16_s8(vout0x01234567_1x01234567), 4); c1 += 2; |
| 602 | vst1q_lane_u16(__builtin_assume_aligned(c0, 1), vreinterpretq_u16_s8(vout0x01234567_1x01234567), 0); c0 += 2; |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 603 | vout0x01234567_1x01234567 = vextq_s8(vout0x01234567_1x01234567, vout0x01234567_1x01234567, 2); |
Marat Dukhan | 69c8a29 | 2021-07-14 19:34:56 -0700 | [diff] [blame^] | 604 | vout2x01234567_3x01234567 = vextq_s8(vout2x01234567_3x01234567, vout2x01234567_3x01234567, 2); |
Marat Dukhan | e76478b | 2021-06-28 16:35:40 -0700 | [diff] [blame] | 605 | } |
| 606 | if (nc & 1) { |
| 607 | vst1q_lane_s8(c3, vout2x01234567_3x01234567, 8); |
| 608 | vst1q_lane_s8(c2, vout2x01234567_3x01234567, 0); |
| 609 | vst1q_lane_s8(c1, vout0x01234567_1x01234567, 8); |
| 610 | vst1q_lane_s8(c0, vout0x01234567_1x01234567, 0); |
| 611 | } |
| 612 | |
| 613 | nc = 0; |
| 614 | } |
| 615 | } while (nc != 0); |
| 616 | } |