27 #if defined(ARM_COMPUTE_ENABLE_SVE)
31 void sve_transpose_interleave_8VL_1x8(uint8_t *out,
const uint8_t *in,
size_t width,
size_t in_stride,
size_t height)
33 uint8_t *pad_row =
reinterpret_cast<uint8_t *
>(alloca(width *
sizeof(uint8_t)));
36 memset(pad_row, 0, width *
sizeof(uint8_t));
39 size_t out_stride = 8 * roundup<size_t>(height, 8) * get_vector_length<uint64_t>();
45 "add x9, x10, %x[in_stride]\n"
46 "add x28, x9, %x[in_stride]\n"
47 "add x27, x28, %x[in_stride]\n"
48 "add x26, x27, %x[in_stride]\n"
49 "add x25, x26, %x[in_stride]\n"
50 "add x24, x25, %x[in_stride]\n"
51 "add x23, x24, %x[in_stride]\n"
52 "cmp %x[height], #0x7\n"
53 "add %x[in], x23, %x[in_stride]\n"
54 "csel x23, x23, %x[pad_row], GT\n"
55 "csel x24, x24, %x[pad_row], GE\n"
56 "cmp %x[height], #0x5\n"
57 "mov x22, %x[width]\n"
58 "cntb x21, ALL, MUL #2\n"
59 "csel x25, x25, %x[pad_row], GT\n"
60 "csel x26, x26, %x[pad_row], GE\n"
61 "cmp %x[height], #0x3\n"
62 "csel x27, x27, %x[pad_row], GT\n"
63 "csel x28, x28, %x[pad_row], GE\n"
64 "cmp %x[height], #0x1\n"
65 "csel x9, x9, %x[pad_row], GT\n"
68 "sub %x[height], %x[height], #0x8\n"
71 "ld1b { z23.b }, p1/Z, [x10]\n"
72 "ld1b { z22.b }, p1/Z, [x9]\n"
75 "ld1b { z20.b }, p1/Z, [x28]\n"
76 "ld1b { z21.b }, p1/Z, [x27]\n"
77 "ld1b { z19.b }, p1/Z, [x26]\n"
78 "ld1b { z18.b }, p1/Z, [x25]\n"
79 "zip1 z5.b, z23.b, z19.b\n"
80 "zip1 z4.b, z22.b, z18.b\n"
81 "ld1b { z17.b }, p1/Z, [x24]\n"
82 "ld1b { z16.b }, p1/Z, [x23]\n"
83 "zip1 z3.b, z20.b, z17.b\n"
84 "zip1 z31.b, z21.b, z16.b\n"
85 "ld1b { z25.b }, p1/Z, [x10, #1, MUL VL]\n"
86 "ld1b { z24.b }, p1/Z, [x9, #1, MUL VL]\n"
87 "zip2 z2.b, z23.b, z19.b\n"
88 "zip2 z30.b, z20.b, z17.b\n"
89 "ld1b { z23.b }, p1/Z, [x28, #1, MUL VL]\n"
90 "ld1b { z20.b }, p1/Z, [x27, #1, MUL VL]\n"
91 "zip2 z22.b, z22.b, z18.b\n"
92 "zip2 z21.b, z21.b, z16.b\n"
93 "ld1b { z19.b }, p1/Z, [x26, #1, MUL VL]\n"
94 "ld1b { z18.b }, p1/Z, [x25, #1, MUL VL]\n"
95 "zip1 z29.b, z25.b, z19.b\n"
96 "zip1 z28.b, z24.b, z18.b\n"
97 "ld1b { z17.b }, p1/Z, [x24, #1, MUL VL]\n"
98 "ld1b { z16.b }, p1/Z, [x23, #1, MUL VL]\n"
99 "zip1 z27.b, z23.b, z17.b\n"
100 "zip1 z26.b, z20.b, z16.b\n"
101 "zip2 z1.b, z25.b, z19.b\n"
102 "zip2 z25.b, z23.b, z17.b\n"
103 "addvl x10, x10, #2\n"
105 "zip2 z24.b, z24.b, z18.b\n"
106 "zip2 z16.b, z20.b, z16.b\n"
107 "addvl x28, x28, #2\n"
108 "addvl x27, x27, #2\n"
109 "zip1 z0.b, z5.b, z3.b\n"
110 "zip1 z17.b, z4.b, z31.b\n"
111 "addvl x26, x26, #2\n"
112 "addvl x25, x25, #2\n"
113 "zip2 z20.b, z5.b, z3.b\n"
114 "zip2 z19.b, z4.b, z31.b\n"
115 "addvl x24, x24, #2\n"
116 "addvl x23, x23, #2\n"
117 "zip1 z31.b, z2.b, z30.b\n"
118 "zip1 z18.b, z22.b, z21.b\n"
119 "zip2 z30.b, z2.b, z30.b\n"
120 "zip2 z23.b, z22.b, z21.b\n"
121 "zip1 z22.b, z29.b, z27.b\n"
122 "zip1 z21.b, z28.b, z26.b\n"
123 "zip2 z29.b, z29.b, z27.b\n"
124 "zip2 z28.b, z28.b, z26.b\n"
125 "zip1 z27.b, z1.b, z25.b\n"
126 "zip1 z26.b, z24.b, z16.b\n"
127 "zip2 z25.b, z1.b, z25.b\n"
128 "zip2 z24.b, z24.b, z16.b\n"
129 "zip1 z16.b, z0.b, z17.b\n"
130 "zip2 z17.b, z0.b, z17.b\n"
131 "st1b { z16.b }, p1, [x20]\n"
132 "zip1 z16.b, z20.b, z19.b\n"
133 "zip2 z20.b, z20.b, z19.b\n"
134 "st1b { z17.b }, p1, [x20, #1, MUL VL]\n"
135 "zip1 z19.b, z31.b, z18.b\n"
136 "zip2 z18.b, z31.b, z18.b\n"
137 "st1b { z16.b }, p1, [x20, #2, MUL VL]\n"
138 "zip1 z17.b, z30.b, z23.b\n"
139 "zip2 z16.b, z30.b, z23.b\n"
140 "st1b { z20.b }, p1, [x20, #3, MUL VL]\n"
141 "st1b { z19.b }, p1, [x20, #4, MUL VL]\n"
142 "zip1 z23.b, z22.b, z21.b\n"
143 "zip2 z22.b, z22.b, z21.b\n"
144 "st1b { z18.b }, p1, [x20, #5, MUL VL]\n"
145 "zip1 z21.b, z29.b, z28.b\n"
146 "zip2 z20.b, z29.b, z28.b\n"
147 "st1b { z17.b }, p1, [x20, #6, MUL VL]\n"
148 "zip1 z19.b, z27.b, z26.b\n"
149 "zip2 z18.b, z27.b, z26.b\n"
150 "st1b { z16.b }, p1, [x20, #7, MUL VL]\n"
151 "add x20, x20, %x[out_stride]\n"
152 "zip1 z17.b, z25.b, z24.b\n"
153 "zip2 z16.b, z25.b, z24.b\n"
154 "st1b { z23.b }, p1, [x20]\n"
155 "st1b { z22.b }, p1, [x20, #1, MUL VL]\n"
156 "st1b { z21.b }, p1, [x20, #2, MUL VL]\n"
157 "st1b { z20.b }, p1, [x20, #3, MUL VL]\n"
158 "st1b { z19.b }, p1, [x20, #4, MUL VL]\n"
159 "st1b { z18.b }, p1, [x20, #5, MUL VL]\n"
160 "st1b { z17.b }, p1, [x20, #6, MUL VL]\n"
161 "st1b { z16.b }, p1, [x20, #7, MUL VL]\n"
162 "add x20, x20, %x[out_stride]\n"
167 "whilelt p0.b, XZR, x22\n"
168 "ld1b { z25.b }, p0/Z, [x10]\n"
169 "ld1b { z27.b }, p0/Z, [x9]\n"
170 "decd x22, ALL, MUL #8\n"
171 "ld1b { z26.b }, p0/Z, [x28]\n"
172 "ld1b { z24.b }, p0/Z, [x27]\n"
174 "addvl x10, x10, #1\n"
175 "ld1b { z22.b }, p0/Z, [x26]\n"
176 "ld1b { z21.b }, p0/Z, [x25]\n"
177 "zip1 z20.b, z25.b, z22.b\n"
178 "zip1 z23.b, z27.b, z21.b\n"
179 "ld1b { z17.b }, p0/Z, [x24]\n"
180 "ld1b { z16.b }, p0/Z, [x23]\n"
181 "zip1 z19.b, z26.b, z17.b\n"
182 "zip1 z18.b, z24.b, z16.b\n"
183 "zip2 z25.b, z25.b, z22.b\n"
184 "zip2 z22.b, z26.b, z17.b\n"
186 "addvl x28, x28, #1\n"
187 "zip2 z21.b, z27.b, z21.b\n"
188 "zip2 z16.b, z24.b, z16.b\n"
189 "addvl x27, x27, #1\n"
190 "addvl x26, x26, #1\n"
191 "zip1 z24.b, z20.b, z19.b\n"
192 "zip1 z17.b, z23.b, z18.b\n"
193 "addvl x25, x25, #1\n"
194 "addvl x24, x24, #1\n"
195 "zip2 z20.b, z20.b, z19.b\n"
196 "zip2 z19.b, z23.b, z18.b\n"
197 "addvl x23, x23, #1\n"
198 "zip1 z23.b, z25.b, z22.b\n"
199 "zip1 z18.b, z21.b, z16.b\n"
200 "zip2 z22.b, z25.b, z22.b\n"
201 "zip2 z21.b, z21.b, z16.b\n"
202 "zip1 z16.b, z24.b, z17.b\n"
203 "zip2 z17.b, z24.b, z17.b\n"
204 "st1b { z16.b }, p1, [x20]\n"
205 "zip1 z16.b, z20.b, z19.b\n"
206 "zip2 z20.b, z20.b, z19.b\n"
207 "st1b { z17.b }, p1, [x20, #1, MUL VL]\n"
208 "zip1 z19.b, z23.b, z18.b\n"
209 "zip2 z18.b, z23.b, z18.b\n"
210 "st1b { z16.b }, p1, [x20, #2, MUL VL]\n"
211 "zip1 z17.b, z22.b, z21.b\n"
212 "zip2 z16.b, z22.b, z21.b\n"
213 "st1b { z20.b }, p1, [x20, #3, MUL VL]\n"
214 "st1b { z19.b }, p1, [x20, #4, MUL VL]\n"
215 "st1b { z18.b }, p1, [x20, #5, MUL VL]\n"
216 "st1b { z17.b }, p1, [x20, #6, MUL VL]\n"
217 "st1b { z16.b }, p1, [x20, #7, MUL VL]\n"
218 "add x20, x20, %x[out_stride]\n"
221 "cmp %x[height], #0x1\n"
222 "addvl %x[out], %x[out], #8\n"
224 : [height]
"+&r" (height), [in]
"+&r" (in), [out]
"+&r" (out)
225 : [in_stride]
"r" (in_stride), [out_stride]
"r" (out_stride), [pad_row]
"r" (pad_row), [width]
"r" (width)
226 :
"cc",
"memory",
"p0",
"p1",
"x9",
"x10",
"x20",
"x21",
"x22",
"x23",
"x24",
"x25",
"x26",
"x27",
"x28",
"z0",
"z1",
"z2",
"z3",
"z4",
"z5",
"z16",
"z17",
"z18",
"z19",
"z20",
"z21",
"z22",
"z23",
"z24",
"z25",
"z26",
"z27",
"z28",
"z29",
"z30",
"z31"
233 void Transform<8, 8, true, VLType::SVE>(
234 uint8_t *out,
const uint8_t *in,
int stride,
int x0,
int xmax,
int k0,
int kmax)
236 sve_transpose_interleave_8VL_1x8(
237 reinterpret_cast<uint8_t *
>(out),
238 reinterpret_cast<const uint8_t *
>(in + k0 * stride + x0),
239 (xmax-x0) *
sizeof(uint8_t) / 1,
240 stride *
sizeof(uint8_t),
246 void Transform<8, 8, true, VLType::SVE>(
247 int8_t *out,
const int8_t *in,
int stride,
int x0,
int xmax,
int k0,
int kmax)
249 sve_transpose_interleave_8VL_1x8(
250 reinterpret_cast<uint8_t *
>(out),
251 reinterpret_cast<const uint8_t *
>(in + k0 * stride + x0),
252 (xmax-x0) *
sizeof(int8_t) / 1,
253 stride *
sizeof(int8_t),
259 #endif // defined(ARM_COMPUTE_ENABLE_SVE)