27 #if defined(__aarch64__)
31 void a64_transpose_interleave_24(uint16_t *out,
const uint16_t *in,
size_t width,
size_t in_stride,
size_t height)
33 size_t out_stride = 12 * height *
sizeof(uint16_t);
36 "cmp %x[height], #0x4\n"
40 "mov x24, %x[width]\n"
41 "add x23, x25, %x[in_stride]\n"
42 "add x22, x23, %x[in_stride]\n"
43 "add x20, x22, %x[in_stride]\n"
45 "add %x[in], x20, %x[in_stride]\n"
47 "sub %x[height], %x[height], #0x4\n"
50 "ldr q1, [x25], #0x10\n"
51 "ldr q0, [x22], #0x10\n"
52 "sub x24, x24, #0x18\n"
54 "ldr q17, [x25], #0x10\n"
55 "ldr q31, [x23], #0x10\n"
56 "dup v30.2d, v17.d[0]\n"
57 "dup v29.2d, v31.d[1]\n"
58 "ldr q16, [x22], #0x10\n"
59 "ldr q28, [x20], #0x10\n"
60 "dup v27.2d, v16.d[0]\n"
61 "dup v26.2d, v28.d[1]\n"
62 "ldr q25, [x25], #0x10\n"
63 "ldr q24, [x22], #0x10\n"
64 "dup v23.2d, v17.d[1]\n"
65 "dup v22.2d, v25.d[1]\n"
66 "ldr q21, [x23], #0x10\n"
67 "ldr q20, [x20], #0x10\n"
68 "dup v19.2d, v16.d[1]\n"
69 "dup v18.2d, v24.d[1]\n"
70 "ldr q17, [x23], #0x10\n"
71 "ldr q16, [x20], #0x10\n"
72 "mov v30.d[1], v31.d[0]\n"
73 "mov v29.d[1], v21.d[0]\n"
74 "mov v27.d[1], v28.d[0]\n"
75 "mov v26.d[1], v20.d[0]\n"
76 "str q1, [x21, #0x0]\n"
77 "str q30, [x21, #0x10]\n"
78 "mov v23.d[1], v25.d[0]\n"
79 "mov v22.d[1], v21.d[1]\n"
80 "str q29, [x21, #0x20]\n"
81 "mov v19.d[1], v24.d[0]\n"
82 "mov v18.d[1], v20.d[1]\n"
83 "str q0, [x21, #0x30]\n"
84 "str q27, [x21, #0x40]\n"
85 "str q26, [x21, #0x50]\n"
86 "add x21, x21, %x[out_stride]\n"
87 "str q23, [x21, #0x0]\n"
88 "str q22, [x21, #0x10]\n"
89 "str q17, [x21, #0x20]\n"
90 "str q19, [x21, #0x30]\n"
91 "str q18, [x21, #0x40]\n"
92 "str q16, [x21, #0x50]\n"
93 "add x21, x21, %x[out_stride]\n"
99 "ldr q17, [x23], #0x10\n"
100 "ldr q23, [x20], #0x10\n"
101 "dup v22.2d, v17.d[1]\n"
102 "dup v21.2d, v23.d[1]\n"
103 "ldr q20, [x25], #0x10\n"
104 "ldr q19, [x22], #0x10\n"
105 "sub x24, x24, #0xc\n"
107 "ldr d18, [x25], #0x8\n"
108 "ldr d16, [x23], #0x8\n"
109 "mov v18.d[1], v17.d[0]\n"
110 "mov v22.d[1], v16.d[0]\n"
111 "ldr d17, [x22], #0x8\n"
112 "ldr d16, [x20], #0x8\n"
113 "mov v17.d[1], v23.d[0]\n"
114 "mov v21.d[1], v16.d[0]\n"
115 "str q20, [x21, #0x0]\n"
116 "str q18, [x21, #0x10]\n"
117 "str q22, [x21, #0x20]\n"
118 "str q19, [x21, #0x30]\n"
119 "str q17, [x21, #0x40]\n"
120 "str q21, [x21, #0x50]\n"
121 "add x21, x21, %x[out_stride]\n"
127 "ldr d19, [x25], #0x8\n"
128 "ldr d18, [x23], #0x8\n"
129 "sub x24, x24, #0x4\n"
131 "ldr d17, [x22], #0x8\n"
132 "ldr d16, [x20], #0x8\n"
133 "str d19, [x21, #0x0]\n"
134 "str d18, [x21, #0x18]\n"
135 "str d17, [x21, #0x30]\n"
136 "str d16, [x21, #0x48]\n"
137 "add x21, x21, #0x8\n"
143 "ldr h19, [x25], #0x2\n"
144 "ldr h18, [x23], #0x2\n"
145 "sub x24, x24, #0x1\n"
147 "ldr h17, [x22], #0x2\n"
148 "ldr h16, [x20], #0x2\n"
149 "str h19, [x21, #0x0]\n"
150 "str h18, [x21, #0x18]\n"
151 "str h17, [x21, #0x30]\n"
152 "str h16, [x21, #0x48]\n"
153 "add x21, x21, #0x2\n"
156 "cmp %x[height], #0x4\n"
157 "add %x[out], %x[out], #0x60\n"
159 "cbz %x[height], 20f\n"
162 "mov x20, %x[width]\n"
165 "add %x[in], x25, %x[in_stride]\n"
167 "sub %x[height], %x[height], #0x1\n"
170 "ldr q19, [x25], #0x10\n"
171 "ldr q16, [x25], #0x10\n"
172 "dup v18.2d, v16.d[1]\n"
173 "sub x20, x20, #0x18\n"
174 "ldr q17, [x25], #0x10\n"
175 "dup v16.2d, v16.d[0]\n"
176 "str q19, [x21, #0x0]\n"
178 "str d16, [x21, #0x10]\n"
179 "add x21, x21, %x[out_stride]\n"
180 "mov v18.d[1], v17.d[0]\n"
181 "dup v16.2d, v17.d[1]\n"
182 "str q18, [x21, #0x0]\n"
183 "str d16, [x21, #0x10]\n"
184 "add x21, x21, %x[out_stride]\n"
190 "ldr q17, [x25], #0x10\n"
191 "ldr d16, [x25], #0x8\n"
192 "sub x20, x20, #0xc\n"
194 "str q17, [x21, #0x0]\n"
195 "str d16, [x21, #0x10]\n"
196 "add x21, x21, %x[out_stride]\n"
202 "ldr d16, [x25], #0x8\n"
203 "sub x20, x20, #0x4\n"
205 "str d16, [x21, #0x0]\n"
206 "add x21, x21, #0x8\n"
212 "ldr h16, [x25], #0x2\n"
213 "sub x20, x20, #0x1\n"
215 "str h16, [x21, #0x0]\n"
216 "add x21, x21, #0x2\n"
219 "cmp %x[height], #0x1\n"
220 "add %x[out], %x[out], #0x18\n"
223 : [height]
"+&r" (height), [in]
"+&r" (in), [out]
"+&r" (out)
224 : [in_stride]
"r" (in_stride), [out_stride]
"r" (out_stride), [width]
"r" (width)
225 :
"cc",
"memory",
"v0",
"v1",
"v16",
"v17",
"v18",
"v19",
"v20",
"v21",
"v22",
"v23",
"v24",
"v25",
"v26",
"v27",
"v28",
"v29",
"v30",
"v31",
"x20",
"x21",
"x22",
"x23",
"x24",
"x25"
232 void Transform<6, 1, true, VLType::None>(
233 float *out,
const float *in,
int stride,
int x0,
int xmax,
int k0,
int kmax)
235 a64_transpose_interleave_24(
236 reinterpret_cast<uint16_t *
>(out),
237 reinterpret_cast<const uint16_t *
>(in + k0 * stride + x0),
238 (xmax-x0) *
sizeof(
float) / 2,
239 stride *
sizeof(
float),
245 void Transform<12, 1, true, VLType::None>(
246 int16_t *out,
const int16_t *in,
int stride,
int x0,
int xmax,
int k0,
int kmax)
248 a64_transpose_interleave_24(
249 reinterpret_cast<uint16_t *
>(out),
250 reinterpret_cast<const uint16_t *
>(in + k0 * stride + x0),
251 (xmax-x0) *
sizeof(int16_t) / 2,
252 stride *
sizeof(int16_t),
258 void Transform<12, 1, true, VLType::None>(
259 uint16_t *out,
const uint16_t *in,
int stride,
int x0,
int xmax,
int k0,
int kmax)
261 a64_transpose_interleave_24(
262 reinterpret_cast<uint16_t *
>(out),
263 reinterpret_cast<const uint16_t *
>(in + k0 * stride + x0),
264 (xmax-x0) *
sizeof(uint16_t) / 2,
265 stride *
sizeof(uint16_t),
271 #endif // defined(__aarch64__)