blob: 292a38f4014f8bcaf7a815bb9be1f27d0e1f3c95 [file] [log] [blame]
Georgios Pinitasc0b6f762020-11-02 01:37:17 +00001/*
Michael Tylerbe13cea2023-01-17 11:04:14 +00002 * Copyright (c) 2019-2021 Arm Limited.
Georgios Pinitasc0b6f762020-11-02 01:37:17 +00003 *
4 * SPDX-License-Identifier: MIT
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
Michael Tylerbe13cea2023-01-17 11:04:14 +000013 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
Georgios Pinitasc0b6f762020-11-02 01:37:17 +000015 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
Michael Tylerbe13cea2023-01-17 11:04:14 +000020 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22 * IN THE SOFTWARE.
Georgios Pinitasc0b6f762020-11-02 01:37:17 +000023 */
24
25#ifdef __aarch64__
26
27template<>
28void interleave_block<8, 1, VLType::None, true>(
29 int16_t * &out_ptr, const int16_t * const * in, size_t width, size_t height,
30 size_t row_offset, bool first
31)
32{
33 __asm__ __volatile__(
Michael Tylerbe13cea2023-01-17 11:04:14 +000034 "movi v1.8h, #0x0\n"
35 "ldr x27, [%x[in], #0x0]\n"
36 "mov x19, #0x0\n"
Michael Tylerba209752022-12-15 12:39:29 +000037 "movi v0.4s, #0x0\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +000038 "ldr x26, [%x[in], #0x8]\n"
39 "cmp %x[height], #0x8\n"
40 "movi v31.4s, #0x0\n"
41 "ldr x25, [%x[in], #0x10]\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +000042 "add x27, x27, %x[row_offset], LSL #1\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +000043 "ldr x24, [%x[in], #0x18]\n"
44 "ldr x23, [%x[in], #0x20]\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +000045 "add x26, x26, %x[row_offset], LSL #1\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +000046 "ldr x22, [%x[in], #0x28]\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +000047 "add x25, x25, %x[row_offset], LSL #1\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +000048 "ldr x21, [%x[in], #0x30]\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +000049 "add x24, x24, %x[row_offset], LSL #1\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +000050 "ldr x20, [%x[in], #0x38]\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +000051 "add x23, x23, %x[row_offset], LSL #1\n"
52 "add x22, x22, %x[row_offset], LSL #1\n"
53 "add x21, x21, %x[row_offset], LSL #1\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +000054 "add x20, x20, %x[row_offset], LSL #1\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +000055 "beq 1f\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +000056 "mov x20, x27\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +000057 "cmp %x[height], #0x2\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +000058 "csel x26, x26, x27, GE\n"
59 "csel x25, x25, x27, GT\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +000060 "cmp %x[height], #0x4\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +000061 "csel x24, x24, x27, GE\n"
62 "csel x23, x23, x27, GT\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +000063 "cmp %x[height], #0x6\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +000064 "csel x22, x22, x27, GE\n"
65 "csel x21, x21, x27, GT\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +000066 "1:" // no_pointer_adj
67 "prfm pldl1keep, [x27, #0x0]\n"
68 "prfm pldl1keep, [x26, #0x0]\n"
69 "prfm pldl1keep, [x25, #0x0]\n"
70 "prfm pldl1keep, [x24, #0x0]\n"
71 "prfm pldl1keep, [x23, #0x0]\n"
72 "prfm pldl1keep, [x22, #0x0]\n"
73 "prfm pldl1keep, [x21, #0x0]\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +000074 "prfm pldl1keep, [x20, #0x0]\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +000075 "prfm pldl1keep, [x27, #0x40]\n"
76 "prfm pldl1keep, [x26, #0x40]\n"
77 "prfm pldl1keep, [x25, #0x40]\n"
78 "prfm pldl1keep, [x24, #0x40]\n"
79 "prfm pldl1keep, [x23, #0x40]\n"
80 "prfm pldl1keep, [x22, #0x40]\n"
81 "prfm pldl1keep, [x21, #0x40]\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +000082 "prfm pldl1keep, [x20, #0x40]\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +000083 "cbnz %w[first], 2f\n"
84 "sub %x[out_ptr], %x[out_ptr], #0x20\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +000085 "ld1 { v0.4s }, [%x[out_ptr]]\n"
86 "ldr q31, [%x[out_ptr], #0x10]\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +000087 "2:" // first_pass
88 "cmp %x[width], #0x8\n"
89 "blt 5f\n"
90 "3:" // Main loop head
Michael Tylerbe13cea2023-01-17 11:04:14 +000091 "cmp x19, #0xe\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +000092 "ble 4f\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +000093 "saddw v0.4s, v0.4s, v1.4h\n"
94 "saddw2 v31.4s, v31.4s, v1.8h\n"
95 "mov x19, #0x0\n"
96 "movi v1.8h, #0x0\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +000097 "4:" // no_accumulate_16
98 "ldr q30, [x27], #0x10\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +000099 "add x19, x19, #0x1\n"
Michael Tylerba209752022-12-15 12:39:29 +0000100 "ldr q29, [x26], #0x10\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000101 "subs %x[width], %x[width], #0x8\n"
Michael Tylerba209752022-12-15 12:39:29 +0000102 "ldr q28, [x25], #0x10\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000103 "cmp %x[width], #0x8\n"
Georgios Pinitase28cf392021-01-31 05:18:43 +0000104 "ldr q27, [x24], #0x10\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000105 "ldr q25, [x23], #0x10\n"
106 "zip1 v26.8h, v30.8h, v25.8h\n"
107 "ldr q21, [x22], #0x10\n"
108 "zip2 v25.8h, v30.8h, v25.8h\n"
109 "ldr q24, [x21], #0x10\n"
110 "ldr q23, [x20], #0x10\n"
111 "zip1 v22.8h, v29.8h, v21.8h\n"
Georgios Pinitase28cf392021-01-31 05:18:43 +0000112 "prfm pldl1keep, [x27, #0x70]\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000113 "zip2 v21.8h, v29.8h, v21.8h\n"
Georgios Pinitase28cf392021-01-31 05:18:43 +0000114 "prfm pldl1keep, [x26, #0x70]\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000115 "zip1 v20.8h, v28.8h, v24.8h\n"
Georgios Pinitase28cf392021-01-31 05:18:43 +0000116 "prfm pldl1keep, [x25, #0x70]\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000117 "zip1 v18.8h, v26.8h, v20.8h\n"
Georgios Pinitase28cf392021-01-31 05:18:43 +0000118 "prfm pldl1keep, [x24, #0x70]\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000119 "zip1 v19.8h, v27.8h, v23.8h\n"
Georgios Pinitase28cf392021-01-31 05:18:43 +0000120 "prfm pldl1keep, [x23, #0x70]\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000121 "zip1 v16.8h, v22.8h, v19.8h\n"
Georgios Pinitase28cf392021-01-31 05:18:43 +0000122 "prfm pldl1keep, [x22, #0x70]\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000123 "zip1 v17.8h, v18.8h, v16.8h\n"
Georgios Pinitase28cf392021-01-31 05:18:43 +0000124 "prfm pldl1keep, [x21, #0x70]\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000125 "add v1.8h, v1.8h, v17.8h\n"
126 "prfm pldl1keep, [x20, #0x70]\n"
127 "zip2 v16.8h, v18.8h, v16.8h\n"
128 "str q17, [%x[out_ptr], #0x0]\n"
129 "zip2 v18.8h, v26.8h, v20.8h\n"
130 "str q16, [%x[out_ptr], #0x10]\n"
131 "add v1.8h, v1.8h, v16.8h\n"
132 "zip2 v17.8h, v22.8h, v19.8h\n"
Georgios Pinitase28cf392021-01-31 05:18:43 +0000133 "zip1 v16.8h, v18.8h, v17.8h\n"
134 "str q16, [%x[out_ptr], #0x20]\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000135 "add v1.8h, v1.8h, v16.8h\n"
Georgios Pinitase28cf392021-01-31 05:18:43 +0000136 "zip2 v16.8h, v18.8h, v17.8h\n"
137 "str q16, [%x[out_ptr], #0x30]\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000138 "zip2 v20.8h, v28.8h, v24.8h\n"
139 "add v1.8h, v1.8h, v16.8h\n"
140 "zip1 v18.8h, v25.8h, v20.8h\n"
141 "zip2 v19.8h, v27.8h, v23.8h\n"
142 "zip1 v17.8h, v21.8h, v19.8h\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +0000143 "zip1 v16.8h, v18.8h, v17.8h\n"
144 "str q16, [%x[out_ptr], #0x40]\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000145 "add v1.8h, v1.8h, v16.8h\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +0000146 "zip2 v16.8h, v18.8h, v17.8h\n"
147 "str q16, [%x[out_ptr], #0x50]\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000148 "zip2 v18.8h, v25.8h, v20.8h\n"
149 "add v1.8h, v1.8h, v16.8h\n"
150 "zip2 v17.8h, v21.8h, v19.8h\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +0000151 "zip1 v16.8h, v18.8h, v17.8h\n"
152 "str q16, [%x[out_ptr], #0x60]\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000153 "add v1.8h, v1.8h, v16.8h\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +0000154 "zip2 v16.8h, v18.8h, v17.8h\n"
155 "str q16, [%x[out_ptr], #0x70]\n"
156 "add %x[out_ptr], %x[out_ptr], #0x80\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000157 "add v1.8h, v1.8h, v16.8h\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +0000158 "bge 3b\n"
159 "5:" // Main loop skip
160 "cbz %x[width], 10f\n"
161 "tbz %x[width], #2, 7f\n"
162 "ldr d30, [x27], #0x8\n"
163 "ldr d29, [x26], #0x8\n"
164 "ldr d28, [x25], #0x8\n"
165 "ldr d27, [x24], #0x8\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000166 "ldr d25, [x23], #0x8\n"
167 "ldr d21, [x22], #0x8\n"
168 "ldr d24, [x21], #0x8\n"
169 "ldr d23, [x20], #0x8\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +0000170 "tbz %x[width], #1, 6f\n"
171 "ld1 { v30.s }[2], [x27], #0x4\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000172 "mov x19, #0x6\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +0000173 "ld1 { v29.s }[2], [x26], #0x4\n"
174 "ld1 { v28.s }[2], [x25], #0x4\n"
175 "ld1 { v27.s }[2], [x24], #0x4\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000176 "ld1 { v25.s }[2], [x23], #0x4\n"
177 "ld1 { v21.s }[2], [x22], #0x4\n"
178 "ld1 { v24.s }[2], [x21], #0x4\n"
179 "ld1 { v23.s }[2], [x20], #0x4\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +0000180 "tbz %x[width], #0, 9f\n"
181 "ld1 { v30.h }[6], [x27]\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000182 "mov x19, #0x7\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +0000183 "ld1 { v29.h }[6], [x26]\n"
184 "ld1 { v28.h }[6], [x25]\n"
185 "ld1 { v27.h }[6], [x24]\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000186 "ld1 { v25.h }[6], [x23]\n"
187 "ld1 { v21.h }[6], [x22]\n"
188 "ld1 { v24.h }[6], [x21]\n"
189 "ld1 { v23.h }[6], [x20]\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +0000190 "b 9f\n"
191 "6:" // odd_loads_1_4
Michael Tylerbe13cea2023-01-17 11:04:14 +0000192 "mov x19, #0x4\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +0000193 "tbz %x[width], #0, 9f\n"
194 "ld1 { v30.h }[4], [x27]\n"
195 "ld1 { v29.h }[4], [x26]\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000196 "mov x19, #0x5\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +0000197 "ld1 { v28.h }[4], [x25]\n"
198 "ld1 { v27.h }[4], [x24]\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000199 "ld1 { v25.h }[4], [x23]\n"
200 "ld1 { v21.h }[4], [x22]\n"
201 "ld1 { v24.h }[4], [x21]\n"
202 "ld1 { v23.h }[4], [x20]\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +0000203 "b 9f\n"
204 "7:" // odd_loads_2_0
205 "tbz %x[width], #1, 8f\n"
206 "ldr s30, [x27], #0x4\n"
207 "ldr s29, [x26], #0x4\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000208 "mov x19, #0x2\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +0000209 "ldr s28, [x25], #0x4\n"
210 "ldr s27, [x24], #0x4\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000211 "ldr s25, [x23], #0x4\n"
212 "ldr s21, [x22], #0x4\n"
213 "ldr s24, [x21], #0x4\n"
214 "ldr s23, [x20], #0x4\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +0000215 "tbz %x[width], #0, 9f\n"
216 "ld1 { v30.h }[2], [x27]\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000217 "mov x19, #0x3\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +0000218 "ld1 { v29.h }[2], [x26]\n"
219 "ld1 { v28.h }[2], [x25]\n"
220 "ld1 { v27.h }[2], [x24]\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000221 "ld1 { v25.h }[2], [x23]\n"
222 "ld1 { v21.h }[2], [x22]\n"
223 "ld1 { v24.h }[2], [x21]\n"
224 "ld1 { v23.h }[2], [x20]\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +0000225 "b 9f\n"
226 "8:" // odd_loads_1_0
227 "ldr h30, [x27, #0x0]\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000228 "mov x19, #0x1\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +0000229 "ldr h29, [x26, #0x0]\n"
230 "ldr h28, [x25, #0x0]\n"
231 "ldr h27, [x24, #0x0]\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000232 "ldr h25, [x23, #0x0]\n"
233 "ldr h21, [x22, #0x0]\n"
234 "ldr h24, [x21, #0x0]\n"
235 "ldr h23, [x20, #0x0]\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +0000236 "9:" // Odd load end
Michael Tylerbe13cea2023-01-17 11:04:14 +0000237 "zip1 v26.8h, v30.8h, v25.8h\n"
238 "subs x19, x19, #0x1\n"
239 "zip1 v20.8h, v28.8h, v24.8h\n"
240 "zip1 v18.8h, v26.8h, v20.8h\n"
241 "zip1 v22.8h, v29.8h, v21.8h\n"
242 "zip1 v19.8h, v27.8h, v23.8h\n"
243 "zip1 v16.8h, v22.8h, v19.8h\n"
244 "zip1 v17.8h, v18.8h, v16.8h\n"
245 "str q17, [%x[out_ptr], #0x0]\n"
246 "add %x[out_ptr], %x[out_ptr], #0x10\n"
247 "add v1.8h, v1.8h, v17.8h\n"
248 "beq 10f\n"
249 "zip2 v16.8h, v18.8h, v16.8h\n"
250 "str q16, [%x[out_ptr], #0x0]\n"
251 "subs x19, x19, #0x1\n"
252 "add v1.8h, v1.8h, v16.8h\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +0000253 "add %x[out_ptr], %x[out_ptr], #0x10\n"
254 "beq 10f\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000255 "zip2 v18.8h, v26.8h, v20.8h\n"
256 "zip2 v17.8h, v22.8h, v19.8h\n"
257 "subs x19, x19, #0x1\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +0000258 "zip1 v16.8h, v18.8h, v17.8h\n"
259 "str q16, [%x[out_ptr], #0x0]\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +0000260 "add %x[out_ptr], %x[out_ptr], #0x10\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000261 "add v1.8h, v1.8h, v16.8h\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +0000262 "beq 10f\n"
263 "zip2 v16.8h, v18.8h, v17.8h\n"
Georgios Pinitase28cf392021-01-31 05:18:43 +0000264 "str q16, [%x[out_ptr], #0x0]\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000265 "subs x19, x19, #0x1\n"
266 "add v1.8h, v1.8h, v16.8h\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +0000267 "add %x[out_ptr], %x[out_ptr], #0x10\n"
268 "beq 10f\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000269 "zip2 v25.8h, v30.8h, v25.8h\n"
270 "zip2 v20.8h, v28.8h, v24.8h\n"
271 "subs x19, x19, #0x1\n"
272 "zip1 v18.8h, v25.8h, v20.8h\n"
273 "zip2 v21.8h, v29.8h, v21.8h\n"
274 "zip2 v19.8h, v27.8h, v23.8h\n"
275 "zip1 v17.8h, v21.8h, v19.8h\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +0000276 "zip1 v16.8h, v18.8h, v17.8h\n"
277 "str q16, [%x[out_ptr], #0x0]\n"
Georgios Pinitase28cf392021-01-31 05:18:43 +0000278 "add %x[out_ptr], %x[out_ptr], #0x10\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000279 "add v1.8h, v1.8h, v16.8h\n"
Georgios Pinitase28cf392021-01-31 05:18:43 +0000280 "beq 10f\n"
281 "zip2 v16.8h, v18.8h, v17.8h\n"
282 "str q16, [%x[out_ptr], #0x0]\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000283 "subs x19, x19, #0x1\n"
284 "add v1.8h, v1.8h, v16.8h\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +0000285 "add %x[out_ptr], %x[out_ptr], #0x10\n"
Georgios Pinitase28cf392021-01-31 05:18:43 +0000286 "beq 10f\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000287 "zip2 v18.8h, v25.8h, v20.8h\n"
288 "zip2 v17.8h, v21.8h, v19.8h\n"
Georgios Pinitase28cf392021-01-31 05:18:43 +0000289 "zip1 v16.8h, v18.8h, v17.8h\n"
290 "str q16, [%x[out_ptr], #0x0]\n"
291 "add %x[out_ptr], %x[out_ptr], #0x10\n"
Michael Tylerbe13cea2023-01-17 11:04:14 +0000292 "add v1.8h, v1.8h, v16.8h\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +0000293 "10:" // Odds skip
Michael Tylerbe13cea2023-01-17 11:04:14 +0000294 "saddw v0.4s, v0.4s, v1.4h\n"
295 "str q0, [%x[out_ptr], #0x0]\n"
296 "saddw2 v31.4s, v31.4s, v1.8h\n"
297 "str q31, [%x[out_ptr], #0x10]\n"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +0000298 "add %x[out_ptr], %x[out_ptr], #0x20\n"
Georgios Pinitase28cf392021-01-31 05:18:43 +0000299 : [out_ptr] "+&r" (out_ptr), [width] "+&r" (width)
Georgios Pinitasc0b6f762020-11-02 01:37:17 +0000300 : [first] "r" (first), [height] "r" (height), [in] "r" (in), [row_offset] "r" (row_offset)
Michael Tylerbe13cea2023-01-17 11:04:14 +0000301 : "cc", "memory", "v0", "v1", "v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31", "x19", "x20", "x21", "x22", "x23", "x24", "x25", "x26", "x27"
Georgios Pinitasc0b6f762020-11-02 01:37:17 +0000302 );
303}
304
305
306#endif // __aarch64__