]>
Commit | Line | Data |
---|---|---|
0bf4aa26 XL |
1 | //! Tests for ARM+v7+neon table lookup (vtbl, vtbx) intrinsics. |
2 | //! | |
3 | //! These are included in `{arm, aarch64}::neon`. | |
4 | ||
5 | use super::*; | |
6 | ||
7 | #[cfg(target_arch = "aarch64")] | |
532ac7d7 | 8 | use crate::core_arch::aarch64::*; |
0bf4aa26 XL |
9 | |
10 | #[cfg(target_arch = "arm")] | |
532ac7d7 | 11 | use crate::core_arch::arm::*; |
0bf4aa26 | 12 | |
532ac7d7 | 13 | use crate::core_arch::simd::*; |
0bf4aa26 | 14 | use std::mem; |
416331ca | 15 | use stdarch_test::simd_test; |
0bf4aa26 XL |
16 | |
17 | macro_rules! test_vtbl { | |
18 | ($test_name:ident => $fn_id:ident: | |
19 | - table[$table_t:ident]: [$($table_v:expr),*] | | |
20 | $(- ctrl[$ctrl_t:ident]: [$($ctrl_v:expr),*] => [$($exp_v:expr),*])|* | |
21 | ) => { | |
22 | #[simd_test(enable = "neon")] | |
23 | unsafe fn $test_name() { | |
24 | // create table as array, and transmute it to | |
25 | // arm's table type | |
48663c56 | 26 | let table: $table_t = mem::transmute([$($table_v),*]); |
0bf4aa26 XL |
27 | |
28 | // For each control vector, perform a table lookup and | |
29 | // verify the result: | |
30 | $( | |
31 | { | |
48663c56 XL |
32 | let ctrl: $ctrl_t = mem::transmute([$($ctrl_v),*]); |
33 | let result = $fn_id(table, mem::transmute(ctrl)); | |
34 | let result: $ctrl_t = mem::transmute(result); | |
35 | let expected: $ctrl_t = mem::transmute([$($exp_v),*]); | |
0bf4aa26 XL |
36 | assert_eq!(result, expected); |
37 | } | |
38 | )* | |
39 | } | |
40 | } | |
41 | } | |
42 | ||
43 | // ARM+v7+neon and AArch64+neon tests | |
44 | ||
45 | test_vtbl!( | |
46 | test_vtbl1_s8 => vtbl1_s8: | |
47 | - table[int8x8_t]: [0_i8, -11, 2, 3, 4, 5, 6, 7] | | |
48 | - ctrl[i8x8]: [3_i8, 4, 1, 6, 0, 2, 7, 5] => [3_i8, 4, -11, 6, 0, 2, 7, 5] | | |
49 | - ctrl[i8x8]: [3_i8, 8, 1, -9, 10, 2, 15, 5] => [3_i8, 0, -11, 0, 0, 2, 0, 5] | |
50 | ); | |
51 | ||
52 | test_vtbl!( | |
53 | test_vtbl1_u8 => vtbl1_u8: | |
54 | - table[uint8x8_t]: [0_u8, 1, 2, 3, 4, 5, 6, 7] | | |
55 | - ctrl[u8x8]: [3_u8, 4, 1, 6, 0, 2, 7, 5] => [3_u8, 4, 1, 6, 0, 2, 7, 5] | | |
56 | - ctrl[u8x8]: [3_u8, 8, 1, 9, 10, 2, 15, 5] => [3_u8, 0, 1, 0, 0, 2, 0, 5] | |
57 | ); | |
58 | ||
59 | test_vtbl!( | |
60 | test_vtbl1_p8 => vtbl1_p8: | |
61 | - table[poly8x8_t]: [0_u8, 1, 2, 3, 4, 5, 6, 7] | | |
62 | - ctrl[u8x8]: [3_u8, 4, 1, 6, 0, 2, 7, 5] => [3_u8, 4, 1, 6, 0, 2, 7, 5] | | |
63 | - ctrl[u8x8]: [3_u8, 8, 1, 9, 10, 2, 15, 5] => [3_u8, 0, 1, 0, 0, 2, 0, 5] | |
64 | ); | |
65 | ||
66 | test_vtbl!( | |
67 | test_vtbl2_s8 => vtbl2_s8: | |
68 | - table[int8x8x2_t]: [ | |
69 | 0_i8, -17, 34, 51, 68, 85, 102, 119, | |
70 | -106, -93, -84, -117, -104, -116, -72, -121 | |
71 | ] | | |
72 | - ctrl[i8x8]: [127_i8, 15, 1, 14, 2, 13, 3, 12] => [0_i8, -121, -17, -72, 34, -116, 51, -104] | | |
73 | - ctrl[i8x8]: [4_i8, 11, 16, 10, 6, -19, 7, 18] => [68_i8, -117, 0, -84, 102, 0, 119, 0] | |
74 | ); | |
75 | ||
76 | test_vtbl!( | |
77 | test_vtbl2_u8 => vtbl2_u8: | |
78 | - table[uint8x8x2_t]: [ | |
79 | 0_u8, 17, 34, 51, 68, 85, 102, 119, | |
80 | 136, 153, 170, 187, 204, 221, 238, 255 | |
81 | ] | | |
82 | - ctrl[u8x8]: [127_u8, 15, 1, 14, 2, 13, 3, 12] => [0_u8, 255, 17, 238, 34, 221, 51, 204] | | |
83 | - ctrl[u8x8]: [4_u8, 11, 16, 10, 6, 19, 7, 18] => [68_u8, 187, 0, 170, 102, 0, 119, 0] | |
84 | ); | |
85 | ||
86 | test_vtbl!( | |
87 | test_vtbl2_p8 => vtbl2_p8: | |
88 | - table[poly8x8x2_t]: [ | |
89 | 0_u8, 17, 34, 51, 68, 85, 102, 119, | |
90 | 136, 153, 170, 187, 204, 221, 238, 255 | |
91 | ] | | |
92 | - ctrl[u8x8]: [127_u8, 15, 1, 14, 2, 13, 3, 12] => [0_u8, 255, 17, 238, 34, 221, 51, 204] | | |
93 | - ctrl[u8x8]: [4_u8, 11, 16, 10, 6, 19, 7, 18] => [68_u8, 187, 0, 170, 102, 0, 119, 0] | |
94 | ); | |
95 | ||
96 | test_vtbl!( | |
97 | test_vtbl3_s8 => vtbl3_s8: | |
98 | - table[int8x8x3_t]: [ | |
99 | 0_i8, -17, 34, 51, 68, 85, 102, 119, | |
100 | -106, -93, -84, -117, -104, -116, -72, -121, | |
101 | 0, 1, -2, 3, 4, -5, 6, 7 | |
102 | ] | | |
103 | - ctrl[i8x8]: [127_i8, 15, 1, 19, 2, 13, 21, 12] => [0_i8, -121, -17, 3, 34, -116, -5, -104] | | |
104 | - ctrl[i8x8]: [4_i8, 11, 16, 10, 6, -27, 7, 18] => [68_i8, -117, 0, -84, 102, 0, 119, -2] | |
105 | ); | |
106 | ||
107 | test_vtbl!( | |
108 | test_vtbl3_u8 => vtbl3_u8: | |
109 | - table[uint8x8x3_t]: [ | |
110 | 0_u8, 17, 34, 51, 68, 85, 102, 119, | |
111 | 136, 153, 170, 187, 204, 221, 238, 255, | |
112 | 0, 1, 2, 3, 4, 5, 6, 7 | |
113 | ] | | |
114 | - ctrl[u8x8]: [127_u8, 15, 1, 19, 2, 13, 21, 12] => [0_u8, 255, 17, 3, 34, 221, 5, 204] | | |
115 | - ctrl[u8x8]: [4_u8, 11, 16, 10, 6, 27, 7, 18] => [68_u8, 187, 0, 170, 102, 0, 119, 2] | |
116 | ); | |
117 | ||
118 | test_vtbl!( | |
119 | test_vtbl3_p8 => vtbl3_p8: | |
120 | - table[poly8x8x3_t]: [ | |
121 | 0_u8, 17, 34, 51, 68, 85, 102, 119, | |
122 | 136, 153, 170, 187, 204, 221, 238, 255, | |
123 | 0, 1, 2, 3, 4, 5, 6, 7 | |
124 | ] | | |
125 | - ctrl[u8x8]: [127_u8, 15, 1, 19, 2, 13, 21, 12] => [0_u8, 255, 17, 3, 34, 221, 5, 204] | | |
126 | - ctrl[u8x8]: [4_u8, 11, 16, 10, 6, 27, 7, 18] => [68_u8, 187, 0, 170, 102, 0, 119, 2] | |
127 | ); | |
128 | ||
129 | test_vtbl!( | |
130 | test_vtbl4_s8 => vtbl4_s8: | |
131 | - table[int8x8x4_t]: [ | |
132 | 0_i8, -17, 34, 51, 68, 85, 102, 119, | |
133 | -106, -93, -84, -117, -104, -116, -72, -121, | |
134 | 0, 1, -2, 3, 4, -5, 6, 7, | |
135 | 8, -9, 10, 11, 12, -13, 14, 15 | |
136 | ] | | |
137 | - ctrl[i8x8]: [127_i8, 15, 1, 19, 2, 13, 25, 12] => [0_i8, -121, -17, 3, 34, -116, -9, -104] | | |
138 | - ctrl[i8x8]: [4_i8, 11, 32, 10, -33, 27, 7, 18] => [68_i8, -117, 0, -84, 0, 11, 119, -2] | |
139 | ); | |
140 | ||
141 | test_vtbl!( | |
142 | test_vtbl4_u8 => vtbl4_u8: | |
143 | - table[uint8x8x4_t]: [ | |
144 | 0_u8, 17, 34, 51, 68, 85, 102, 119, | |
145 | 136, 153, 170, 187, 204, 221, 238, 255, | |
146 | 0, 1, 2, 3, 4, 5, 6, 7, | |
147 | 8, 9, 10, 11, 12, 13, 14, 15 | |
148 | ] | | |
149 | - ctrl[u8x8]: [127_u8, 15, 1, 19, 2, 13, 21, 12] => [0_u8, 255, 17, 3, 34, 221, 5, 204] | | |
150 | - ctrl[u8x8]: [4_u8, 11, 16, 10, 6, 27, 7, 18] => [68_u8, 187, 0, 170, 102, 11, 119, 2] | |
151 | ); | |
152 | ||
153 | test_vtbl!( | |
154 | test_vtbl4_p8 => vtbl4_p8: | |
155 | - table[poly8x8x4_t]: [ | |
156 | 0_u8, 17, 34, 51, 68, 85, 102, 119, | |
157 | 136, 153, 170, 187, 204, 221, 238, 255, | |
158 | 0, 1, 2, 3, 4, 5, 6, 7, | |
159 | 8, 9, 10, 11, 12, 13, 14, 15 | |
160 | ] | | |
161 | - ctrl[u8x8]: [127_u8, 15, 1, 19, 2, 13, 21, 12] => [0_u8, 255, 17, 3, 34, 221, 5, 204] | | |
162 | - ctrl[u8x8]: [4_u8, 11, 16, 10, 6, 27, 7, 18] => [68_u8, 187, 0, 170, 102, 11, 119, 2] | |
163 | ); | |
164 | ||
165 | macro_rules! test_vtbx { | |
166 | ($test_name:ident => $fn_id:ident: | |
167 | - table[$table_t:ident]: [$($table_v:expr),*] | | |
168 | - ext[$ext_t:ident]: [$($ext_v:expr),*] | | |
169 | $(- ctrl[$ctrl_t:ident]: [$($ctrl_v:expr),*] => [$($exp_v:expr),*])|* | |
170 | ) => { | |
171 | #[simd_test(enable = "neon")] | |
172 | unsafe fn $test_name() { | |
173 | // create table as array, and transmute it to | |
174 | // arm's table type | |
48663c56 XL |
175 | let table: $table_t = mem::transmute([$($table_v),*]); |
176 | let ext: $ext_t = mem::transmute([$($ext_v),*]); | |
0bf4aa26 XL |
177 | |
178 | // For each control vector, perform a table lookup and | |
179 | // verify the result: | |
180 | $( | |
181 | { | |
48663c56 XL |
182 | let ctrl: $ctrl_t = mem::transmute([$($ctrl_v),*]); |
183 | let result = $fn_id(ext, table, mem::transmute(ctrl)); | |
184 | let result: $ctrl_t = mem::transmute(result); | |
185 | let expected: $ctrl_t = mem::transmute([$($exp_v),*]); | |
0bf4aa26 XL |
186 | assert_eq!(result, expected); |
187 | } | |
188 | )* | |
189 | } | |
190 | } | |
191 | } | |
192 | ||
193 | test_vtbx!( | |
194 | test_vtbx1_s8 => vtbx1_s8: | |
195 | - table[int8x8_t]: [0_i8, 1, 2, -3, 4, 5, 6, 7] | | |
196 | - ext[int8x8_t]: [50_i8, 51, 52, 53, 54, 55, 56, 57] | | |
197 | - ctrl[i8x8]: [3_i8, 4, 1, 6, 0, 2, 7, 5] => [-3_i8, 4, 1, 6, 0, 2, 7, 5] | | |
198 | - ctrl[i8x8]: [3_i8, 8, 1, 9, 10, 2, -15, 5] => [-3_i8, 51, 1, 53, 54, 2, 56, 5] | |
199 | ); | |
200 | ||
201 | test_vtbx!( | |
202 | test_vtbx1_u8 => vtbx1_u8: | |
203 | - table[uint8x8_t]: [0_u8, 1, 2, 3, 4, 5, 6, 7] | | |
204 | - ext[uint8x8_t]: [50_u8, 51, 52, 53, 54, 55, 56, 57] | | |
205 | - ctrl[u8x8]: [3_u8, 4, 1, 6, 0, 2, 7, 5] => [3_u8, 4, 1, 6, 0, 2, 7, 5] | | |
206 | - ctrl[u8x8]: [3_u8, 8, 1, 9, 10, 2, 15, 5] => [3_u8, 51, 1, 53, 54, 2, 56, 5] | |
207 | ); | |
208 | ||
209 | test_vtbx!( | |
210 | test_vtbx1_p8 => vtbx1_p8: | |
211 | - table[poly8x8_t]: [0_u8, 1, 2, 3, 4, 5, 6, 7] | | |
212 | - ext[poly8x8_t]: [50_u8, 51, 52, 53, 54, 55, 56, 57] | | |
213 | - ctrl[u8x8]: [3_u8, 4, 1, 6, 0, 2, 7, 5] => [3_u8, 4, 1, 6, 0, 2, 7, 5] | | |
214 | - ctrl[u8x8]: [3_u8, 8, 1, 9, 10, 2, 15, 5] => [3_u8, 51, 1, 53, 54, 2, 56, 5] | |
215 | ); | |
216 | ||
217 | test_vtbx!( | |
218 | test_vtbx2_s8 => vtbx2_s8: | |
219 | - table[int8x8x2_t]: [0_i8, 1, 2, -3, 4, 5, 6, 7, 8, 9, -10, 11, 12, -13, 14, 15] | | |
220 | - ext[int8x8_t]: [50_i8, 51, 52, 53, 54, 55, 56, 57] | | |
221 | - ctrl[i8x8]: [3_i8, 4, 1, 6, 10, 2, 7, 15] => [-3_i8, 4, 1, 6, -10, 2, 7, 15] | | |
222 | - ctrl[i8x8]: [3_i8, 8, 1, 10, 17, 2, 15, -19] => [-3_i8, 8, 1, -10, 54, 2, 15, 57] | |
223 | ); | |
224 | ||
225 | test_vtbx!( | |
226 | test_vtbx2_u8 => vtbx2_u8: | |
227 | - table[uint8x8x2_t]: [0_i8, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] | | |
228 | - ext[uint8x8_t]: [50_i8, 51, 52, 53, 54, 55, 56, 57] | | |
229 | - ctrl[u8x8]: [3_u8, 4, 1, 6, 10, 2, 7, 15] => [3_i8, 4, 1, 6, 10, 2, 7, 15] | | |
230 | - ctrl[u8x8]: [3_u8, 8, 1, 10, 17, 2, 15, 19] => [3_i8, 8, 1, 10, 54, 2, 15, 57] | |
231 | ); | |
232 | ||
233 | test_vtbx!( | |
234 | test_vtbx2_p8 => vtbx2_p8: | |
235 | - table[poly8x8x2_t]: [0_i8, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] | | |
236 | - ext[poly8x8_t]: [50_i8, 51, 52, 53, 54, 55, 56, 57] | | |
237 | - ctrl[u8x8]: [3_u8, 4, 1, 6, 10, 2, 7, 15] => [3_i8, 4, 1, 6, 10, 2, 7, 15] | | |
238 | - ctrl[u8x8]: [3_u8, 8, 1, 10, 17, 2, 15, 19] => [3_i8, 8, 1, 10, 54, 2, 15, 57] | |
239 | ); | |
240 | ||
241 | test_vtbx!( | |
242 | test_vtbx3_s8 => vtbx3_s8: | |
243 | - table[int8x8x3_t]: [ | |
244 | 0_i8, 1, 2, -3, 4, 5, 6, 7, | |
245 | 8, 9, -10, 11, 12, -13, 14, 15, | |
246 | 16, -17, 18, 19, 20, 21, 22, 23 ] | | |
247 | - ext[int8x8_t]: [50_i8, 51, 52, 53, 54, 55, 56, 57] | | |
248 | - ctrl[i8x8]: [3_i8, 4, 17, 22, 10, 2, 7, 15] => [-3_i8, 4, -17, 22, -10, 2, 7, 15] | | |
249 | - ctrl[i8x8]: [3_i8, 8, 17, 10, 37, 2, 19, -29] => [-3_i8, 8, -17, -10, 54, 2, 19, 57] | |
250 | ); | |
251 | ||
252 | test_vtbx!( | |
253 | test_vtbx3_u8 => vtbx3_u8: | |
254 | - table[uint8x8x3_t]: [ | |
255 | 0_i8, 1, 2, 3, 4, 5, 6, 7, | |
256 | 8, 9, 10, 11, 12, 13, 14, 15, | |
257 | 16, 17, 18, 19, 20, 21, 22, 23 ] | | |
258 | - ext[uint8x8_t]: [50_i8, 51, 52, 53, 54, 55, 56, 57] | | |
259 | - ctrl[u8x8]: [3_u8, 4, 17, 22, 10, 2, 7, 15] => [3_i8, 4, 17, 22, 10, 2, 7, 15] | | |
260 | - ctrl[u8x8]: [3_u8, 8, 17, 10, 37, 2, 19, 29] => [3_i8, 8, 17, 10, 54, 2, 19, 57] | |
261 | ); | |
262 | ||
263 | test_vtbx!( | |
264 | test_vtbx3_p8 => vtbx3_p8: | |
265 | - table[poly8x8x3_t]: [ | |
266 | 0_i8, 1, 2, 3, 4, 5, 6, 7, | |
267 | 8, 9, 10, 11, 12, 13, 14, 15, | |
268 | 16, 17, 18, 19, 20, 21, 22, 23 ] | | |
269 | - ext[poly8x8_t]: [50_i8, 51, 52, 53, 54, 55, 56, 57] | | |
270 | - ctrl[u8x8]: [3_u8, 4, 17, 22, 10, 2, 7, 15] => [3_i8, 4, 17, 22, 10, 2, 7, 15] | | |
271 | - ctrl[u8x8]: [3_u8, 8, 17, 10, 37, 2, 19, 29] => [3_i8, 8, 17, 10, 54, 2, 19, 57] | |
272 | ); | |
273 | ||
274 | test_vtbx!( | |
275 | test_vtbx4_s8 => vtbx4_s8: | |
276 | - table[int8x8x4_t]: [ | |
277 | 0_i8, 1, 2, -3, 4, 5, 6, 7, | |
278 | 8, 9, -10, 11, 12, -13, 14, 15, | |
279 | 16, -17, 18, 19, 20, 21, 22, 23, | |
280 | -24, 25, 26, -27, 28, -29, 30, 31] | | |
281 | - ext[int8x8_t]: [50_i8, 51, 52, 53, 54, 55, 56, 57] | | |
282 | - ctrl[i8x8]: [3_i8, 31, 17, 22, 10, 29, 7, 15] => [-3_i8, 31, -17, 22, -10, -29, 7, 15] | | |
283 | - ctrl[i8x8]: [3_i8, 8, 17, 10, 37, 2, 19, -42] => [-3_i8, 8, -17, -10, 54, 2, 19, 57] | |
284 | ); | |
285 | ||
286 | test_vtbx!( | |
287 | test_vtbx4_u8 => vtbx4_u8: | |
288 | - table[uint8x8x4_t]: [ | |
289 | 0_i8, 1, 2, 3, 4, 5, 6, 7, | |
290 | 8, 9, 10, 11, 12, 13, 14, 15, | |
291 | 16, 17, 18, 19, 20, 21, 22, 23, | |
292 | 24, 25, 26, 27, 28, 29, 30, 31] | | |
293 | - ext[uint8x8_t]: [50_i8, 51, 52, 53, 54, 55, 56, 57] | | |
294 | - ctrl[u8x8]: [3_u8, 31, 17, 22, 10, 29, 7, 15] => [3_i8, 31, 17, 22, 10, 29, 7, 15] | | |
295 | - ctrl[u8x8]: [3_u8, 8, 17, 10, 37, 2, 19, 42] => [3_i8, 8, 17, 10, 54, 2, 19, 57] | |
296 | ); | |
297 | ||
298 | test_vtbx!( | |
299 | test_vtbx4_p8 => vtbx4_p8: | |
300 | - table[poly8x8x4_t]: [ | |
301 | 0_i8, 1, 2, 3, 4, 5, 6, 7, | |
302 | 8, 9, 10, 11, 12, 13, 14, 15, | |
303 | 16, 17, 18, 19, 20, 21, 22, 23, | |
304 | 24, 25, 26, 27, 28, 29, 30, 31] | | |
305 | - ext[poly8x8_t]: [50_i8, 51, 52, 53, 54, 55, 56, 57] | | |
306 | - ctrl[u8x8]: [3_u8, 31, 17, 22, 10, 29, 7, 15] => [3_i8, 31, 17, 22, 10, 29, 7, 15] | | |
307 | - ctrl[u8x8]: [3_u8, 8, 17, 10, 37, 2, 19, 42] => [3_i8, 8, 17, 10, 54, 2, 19, 57] | |
308 | ); | |
309 | ||
310 | // Aarch64 tests | |
311 | ||
312 | #[cfg(target_arch = "aarch64")] | |
313 | test_vtbl!( | |
314 | test_vqtbl1_s8 => vqtbl1_s8: | |
315 | - table[int8x16_t]: [ | |
316 | 0_i8, -17, 34, 51, 68, 85, 102, 119, | |
317 | -106, -93, -84, -117, -104, -116, -72, -121 | |
318 | ] | | |
319 | - ctrl[i8x8]: [127_i8, 15, 1, 14, 2, 13, 3, 12] => [0_i8, -121, -17, -72, 34, -116, 51, -104] | | |
320 | - ctrl[i8x8]: [4_i8, 11, 16, 10, 6, 19, 7, 18] => [68_i8, -117, 0, -84, 102, 0, 119, 0] | |
321 | ); | |
322 | ||
323 | #[cfg(target_arch = "aarch64")] | |
324 | test_vtbl!( | |
325 | test_vqtbl1q_s8 => vqtbl1q_s8: | |
326 | - table[int8x16_t]: [ | |
327 | 0_i8, -17, 34, 51, 68, 85, 102, 119, | |
328 | -106, -93, -84, -117, -104, -116, -72, -121 | |
329 | ] | | |
330 | - ctrl[i8x16]: [127_i8, 15, 1, 14, 2, 13, 3, 12, 4_i8, 11, 16, 10, 6, 19, 7, 18] | |
331 | => [0_i8, -121, -17, -72, 34, -116, 51, -104, 68, -117, 0, -84, 102, 0, 119, 0] | |
332 | ); | |
333 | ||
334 | #[cfg(target_arch = "aarch64")] | |
335 | test_vtbl!( | |
336 | test_vqtbl1_u8 => vqtbl1_u8: | |
337 | - table[uint8x16_t]: [ | |
338 | 0_u8, 17, 34, 51, 68, 85, 102, 119, | |
339 | 106, 93, 84, 117, 104, 116, 72, 121 | |
340 | ] | | |
341 | - ctrl[u8x8]: [127_u8, 15, 1, 14, 2, 13, 3, 12] => [0_u8, 121, 17, 72, 34, 116, 51, 104] | | |
342 | - ctrl[u8x8]: [4_u8, 11, 16, 10, 6, 19, 7, 18] => [68_u8, 117, 0, 84, 102, 0, 119, 0] | |
343 | ); | |
344 | ||
345 | #[cfg(target_arch = "aarch64")] | |
346 | test_vtbl!( | |
347 | test_vqtbl1q_u8 => vqtbl1q_u8: | |
348 | - table[uint8x16_t]: [ | |
349 | 0_u8, 17, 34, 51, 68, 85, 102, 119, | |
350 | 106, 93, 84, 117, 104, 116, 72, 121 | |
351 | ] | | |
352 | - ctrl[u8x16]: [127_u8, 15, 1, 14, 2, 13, 3, 12, 4_u8, 11, 16, 10, 6, 19, 7, 18] | |
353 | => [0_u8, 121, 17, 72, 34, 116, 51, 104, 68, 117, 0, 84, 102, 0, 119, 0] | |
354 | ); | |
355 | ||
356 | #[cfg(target_arch = "aarch64")] | |
357 | test_vtbl!( | |
358 | test_vqtbl1_p8 => vqtbl1_p8: | |
359 | - table[poly8x16_t]: [ | |
360 | 0_u8, 17, 34, 51, 68, 85, 102, 119, | |
361 | 106, 93, 84, 117, 104, 116, 72, 121 | |
362 | ] | | |
363 | - ctrl[u8x8]: [127_u8, 15, 1, 14, 2, 13, 3, 12] => [0_u8, 121, 17, 72, 34, 116, 51, 104] | | |
364 | - ctrl[u8x8]: [4_u8, 11, 16, 10, 6, 19, 7, 18] => [68_u8, 117, 0, 84, 102, 0, 119, 0] | |
365 | ); | |
366 | ||
367 | #[cfg(target_arch = "aarch64")] | |
368 | test_vtbl!( | |
369 | test_vqtbl1q_p8 => vqtbl1q_p8: | |
370 | - table[poly8x16_t]: [ | |
371 | 0_u8, 17, 34, 51, 68, 85, 102, 119, | |
372 | 106, 93, 84, 117, 104, 116, 72, 121 | |
373 | ] | | |
374 | - ctrl[u8x16]: [127_u8, 15, 1, 14, 2, 13, 3, 12, 4_u8, 11, 16, 10, 6, 19, 7, 18] | |
375 | => [0_u8, 121, 17, 72, 34, 116, 51, 104, 68, 117, 0, 84, 102, 0, 119, 0] | |
376 | ); | |
377 | ||
378 | #[cfg(target_arch = "aarch64")] | |
379 | test_vtbl!( | |
380 | test_vqtbl2_s8 => vqtbl2_s8: | |
381 | - table[int8x16x2_t]: [ | |
382 | 0_i8, -1, 2, -3, 4, -5, 6, -7, | |
383 | 8, -9, 10, -11, 12, -13, 14, -15, | |
384 | 16, -17, 18, -19, 20, -21, 22, -23, | |
385 | 24, -25, 26, -27, 28, -29, 30, -31 | |
386 | ] | | |
387 | - ctrl[i8x8]: [80_i8, 15, 1, 24, 2, 13, 3, 29] => [0_i8, -15, -1, 24, 2, -13, -3, -29] | | |
388 | - ctrl[i8x8]: [4_i8, 31, 32, 10, 6, 49, 7, 18] => [4_i8, -31, 0, 10, 6, 0, -7, 18] | |
389 | ); | |
390 | ||
391 | #[cfg(target_arch = "aarch64")] | |
392 | test_vtbl!( | |
393 | test_vqtbl2q_s8 => vqtbl2q_s8: | |
394 | - table[int8x16x2_t]: [ | |
395 | 0_i8, -1, 2, -3, 4, -5, 6, -7, | |
396 | 8, -9, 10, -11, 12, -13, 14, -15, | |
397 | 16, -17, 18, -19, 20, -21, 22, -23, | |
398 | 24, -25, 26, -27, 28, -29, 30, -31 | |
399 | ] | | |
400 | - ctrl[i8x16]: [80_i8, 15, 1, 24, 2, 13, 3, 29, 4_i8, 31, 32, 10, 6, 49, 7, 18] | |
401 | => [0_i8, -15, -1, 24, 2, -13, -3, -29, 4, -31, 0, 10, 6, 0, -7, 18] | |
402 | ); | |
403 | ||
404 | #[cfg(target_arch = "aarch64")] | |
405 | test_vtbl!( | |
406 | test_vqtbl2_u8 => vqtbl2_u8: | |
407 | - table[uint8x16x2_t]: [ | |
408 | 0_u8, 1, 2, 3, 4, 5, 6, 7, | |
409 | 8, 9, 10, 11, 12, 13, 14, 15, | |
410 | 16, 17, 18, 19, 20, 21, 22, 23, | |
411 | 24, 25, 26, 27, 28, 29, 30, 31 | |
412 | ] | | |
413 | - ctrl[u8x8]: [80_u8, 15, 1, 24, 2, 13, 3, 29] => [0_u8, 15, 1, 24, 2, 13, 3, 29] | | |
414 | - ctrl[u8x8]: [4_u8, 31, 32, 10, 6, 49, 7, 18] => [4_u8, 31, 0, 10, 6, 0, 7, 18] | |
415 | ); | |
416 | ||
417 | #[cfg(target_arch = "aarch64")] | |
418 | test_vtbl!( | |
419 | test_vqtbl2q_u8 => vqtbl2q_u8: | |
420 | - table[uint8x16x2_t]: [ | |
421 | 0_u8, 1, 2, 3, 4, 5, 6, 7, | |
422 | 8, 9, 10, 11, 12, 13, 14, 15, | |
423 | 16, 17, 18, 19, 20, 21, 22, 23, | |
424 | 24, 25, 26, 27, 28, 29, 30, 31 | |
425 | ] | | |
426 | - ctrl[u8x16]: [80_u8, 15, 1, 24, 2, 13, 3, 29, 4_u8, 31, 32, 10, 6, 49, 7, 18] | |
427 | => [0_u8, 15, 1, 24, 2, 13, 3, 29, 4, 31, 0, 10, 6, 0, 7, 18] | |
428 | ); | |
429 | ||
430 | #[cfg(target_arch = "aarch64")] | |
431 | test_vtbl!( | |
432 | test_vqtbl2_p8 => vqtbl2_p8: | |
433 | - table[poly8x16x2_t]: [ | |
434 | 0_u8, 1, 2, 3, 4, 5, 6, 7, | |
435 | 8, 9, 10, 11, 12, 13, 14, 15, | |
436 | 16, 17, 18, 19, 20, 21, 22, 23, | |
437 | 24, 25, 26, 27, 28, 29, 30, 31 | |
438 | ] | | |
439 | - ctrl[u8x8]: [80_u8, 15, 1, 24, 2, 13, 3, 29] => [0_u8, 15, 1, 24, 2, 13, 3, 29] | | |
440 | - ctrl[u8x8]: [4_u8, 31, 32, 10, 6, 49, 7, 18] => [4_u8, 31, 0, 10, 6, 0, 7, 18] | |
441 | ); | |
442 | ||
443 | #[cfg(target_arch = "aarch64")] | |
444 | test_vtbl!( | |
445 | test_vqtbl2q_p8 => vqtbl2q_p8: | |
446 | - table[poly8x16x2_t]: [ | |
447 | 0_u8, 1, 2, 3, 4, 5, 6, 7, | |
448 | 8, 9, 10, 11, 12, 13, 14, 15, | |
449 | 16, 17, 18, 19, 20, 21, 22, 23, | |
450 | 24, 25, 26, 27, 28, 29, 30, 31 | |
451 | ] | | |
452 | - ctrl[u8x16]: [80_u8, 15, 1, 24, 2, 13, 3, 29, 4_u8, 31, 32, 10, 6, 49, 7, 18] | |
453 | => [0_u8, 15, 1, 24, 2, 13, 3, 29, 4, 31, 0, 10, 6, 0, 7, 18] | |
454 | ); | |
455 | ||
456 | #[cfg(target_arch = "aarch64")] | |
457 | test_vtbl!( | |
458 | test_vqtbl3_s8 => vqtbl3_s8: | |
459 | - table[int8x16x3_t]: [ | |
460 | 0_i8, -1, 2, -3, 4, -5, 6, -7, | |
461 | 8, -9, 10, -11, 12, -13, 14, -15, | |
462 | 16, -17, 18, -19, 20, -21, 22, -23, | |
463 | 24, -25, 26, -27, 28, -29, 30, -31, | |
464 | 32, -33, 34, -35, 36, -37, 38, -39, | |
465 | 40, -41, 42, -43, 44, -45, 46, -47 | |
466 | ] | | |
467 | - ctrl[i8x8]: [80_i8, 15, 1, 24, 2, 13, 3, 29] => [0_i8, -15, -1, 24, 2, -13, -3, -29] | | |
468 | - ctrl[i8x8]: [4_i8, 32, 46, 51, 6, 49, 7, 18] => [4_i8, 32, 46, 0, 6, 0, -7, 18] | |
469 | ); | |
470 | ||
471 | #[cfg(target_arch = "aarch64")] | |
472 | test_vtbl!( | |
473 | test_vqtbl3q_s8 => vqtbl3q_s8: | |
474 | - table[int8x16x3_t]: [ | |
475 | 0_i8, -1, 2, -3, 4, -5, 6, -7, | |
476 | 8, -9, 10, -11, 12, -13, 14, -15, | |
477 | 16, -17, 18, -19, 20, -21, 22, -23, | |
478 | 24, -25, 26, -27, 28, -29, 30, -31, | |
479 | 32, -33, 34, -35, 36, -37, 38, -39, | |
480 | 40, -41, 42, -43, 44, -45, 46, -47 | |
481 | ] | | |
482 | - ctrl[i8x16]: [80_i8, 15, 1, 24, 2, 13, 3, 29, 4_i8, 32, 46, 51, 6, 49, 7, 18] | |
483 | => [0_i8, -15, -1, 24, 2, -13, -3, -29, 4, 32, 46, 0, 6, 0, -7, 18] | |
484 | ); | |
485 | ||
486 | #[cfg(target_arch = "aarch64")] | |
487 | test_vtbl!( | |
488 | test_vqtbl3_u8 => vqtbl3_u8: | |
489 | - table[uint8x16x3_t]: [ | |
490 | 0_u8, 1, 2, 3, 4, 5, 6, 7, | |
491 | 8, 9, 10, 11, 12, 13, 14, 15, | |
492 | 16, 17, 18, 19, 20, 21, 22, 23, | |
493 | 24, 25, 26, 27, 28, 29, 30, 31, | |
494 | 32, 33, 34, 35, 36, 37, 38, 39, | |
495 | 40, 41, 42, 43, 44, 45, 46, 47 | |
496 | ] | | |
497 | - ctrl[u8x8]: [80_u8, 15, 1, 24, 2, 13, 3, 29] => [0_u8, 15, 1, 24, 2, 13, 3, 29] | | |
498 | - ctrl[u8x8]: [4_u8, 32, 46, 51, 6, 49, 7, 18] => [4_u8, 32, 46, 0, 6, 0, 7, 18] | |
499 | ); | |
500 | ||
501 | #[cfg(target_arch = "aarch64")] | |
502 | test_vtbl!( | |
503 | test_vqtbl3q_u8 => vqtbl3q_u8: | |
504 | - table[uint8x16x3_t]: [ | |
505 | 0_u8, 1, 2, 3, 4, 5, 6, 7, | |
506 | 8, 9, 10, 11, 12, 13, 14, 15, | |
507 | 16, 17, 18, 19, 20, 21, 22, 23, | |
508 | 24, 25, 26, 27, 28, 29, 30, 31, | |
509 | 32, 33, 34, 35, 36, 37, 38, 39, | |
510 | 40, 41, 42, 43, 44, 45, 46, 47 | |
511 | ] | | |
512 | - ctrl[u8x16]: [80_u8, 15, 1, 24, 2, 13, 3, 29, 4_u8, 32, 46, 51, 6, 49, 7, 18] | |
513 | => [0_u8, 15, 1, 24, 2, 13, 3, 29, 4, 32, 46, 0, 6, 0, 7, 18] | |
514 | ); | |
515 | ||
516 | #[cfg(target_arch = "aarch64")] | |
517 | test_vtbl!( | |
518 | test_vqtbl3_p8 => vqtbl3_p8: | |
519 | - table[poly8x16x3_t]: [ | |
520 | 0_u8, 1, 2, 3, 4, 5, 6, 7, | |
521 | 8, 9, 10, 11, 12, 13, 14, 15, | |
522 | 16, 17, 18, 19, 20, 21, 22, 23, | |
523 | 24, 25, 26, 27, 28, 29, 30, 31, | |
524 | 32, 33, 34, 35, 36, 37, 38, 39, | |
525 | 40, 41, 42, 43, 44, 45, 46, 47 | |
526 | ] | | |
527 | - ctrl[u8x8]: [80_u8, 15, 1, 24, 2, 13, 3, 29] => [0_u8, 15, 1, 24, 2, 13, 3, 29] | | |
528 | - ctrl[u8x8]: [4_u8, 32, 46, 51, 6, 49, 7, 18] => [4_u8, 32, 46, 0, 6, 0, 7, 18] | |
529 | ); | |
530 | ||
531 | #[cfg(target_arch = "aarch64")] | |
532 | test_vtbl!( | |
533 | test_vqtbl3q_p8 => vqtbl3q_p8: | |
534 | - table[poly8x16x3_t]: [ | |
535 | 0_u8, 1, 2, 3, 4, 5, 6, 7, | |
536 | 8, 9, 10, 11, 12, 13, 14, 15, | |
537 | 16, 17, 18, 19, 20, 21, 22, 23, | |
538 | 24, 25, 26, 27, 28, 29, 30, 31, | |
539 | 32, 33, 34, 35, 36, 37, 38, 39, | |
540 | 40, 41, 42, 43, 44, 45, 46, 47 | |
541 | ] | | |
542 | - ctrl[u8x16]: [80_u8, 15, 1, 24, 2, 13, 3, 29, 4_u8, 32, 46, 51, 6, 49, 7, 18] | |
543 | => [0_u8, 15, 1, 24, 2, 13, 3, 29, 4, 32, 46, 0, 6, 0, 7, 18] | |
544 | ); | |
545 | ||
546 | #[cfg(target_arch = "aarch64")] | |
547 | test_vtbl!( | |
548 | test_vqtbl4_s8 => vqtbl4_s8: | |
549 | - table[int8x16x4_t]: [ | |
550 | 0_i8, -1, 2, -3, 4, -5, 6, -7, | |
551 | 8, -9, 10, -11, 12, -13, 14, -15, | |
552 | 16, -17, 18, -19, 20, -21, 22, -23, | |
553 | 24, -25, 26, -27, 28, -29, 30, -31, | |
554 | 32, -33, 34, -35, 36, -37, 38, -39, | |
555 | 40, -41, 42, -43, 44, -45, 46, -47, | |
556 | 48, -49, 50, -51, 52, -53, 54, -55, | |
557 | 56, -57, 58, -59, 60, -61, 62, -63 | |
558 | ] | | |
559 | - ctrl[i8x8]: [80_i8, 15, 1, 24, 2, 13, 3, 29] => [0_i8, -15, -1, 24, 2, -13, -3, -29] | | |
560 | - ctrl[i8x8]: [4_i8, 46, 64, 51, 6, 71, 7, 18] => [4_i8, 46, 0, -51, 6, 0, -7, 18] | |
561 | ); | |
562 | ||
563 | #[cfg(target_arch = "aarch64")] | |
564 | test_vtbl!( | |
565 | test_vqtbl4q_s8 => vqtbl4q_s8: | |
566 | - table[int8x16x4_t]: [ | |
567 | 0_i8, -1, 2, -3, 4, -5, 6, -7, | |
568 | 8, -9, 10, -11, 12, -13, 14, -15, | |
569 | 16, -17, 18, -19, 20, -21, 22, -23, | |
570 | 24, -25, 26, -27, 28, -29, 30, -31, | |
571 | 32, -33, 34, -35, 36, -37, 38, -39, | |
572 | 40, -41, 42, -43, 44, -45, 46, -47, | |
573 | 48, -49, 50, -51, 52, -53, 54, -55, | |
574 | 56, -57, 58, -59, 60, -61, 62, -63 | |
575 | ] | | |
576 | - ctrl[i8x16]: [80_i8, 15, 1, 24, 2, 13, 3, 29, 4_i8, 46, 64, 51, 6, 71, 7, 18] | |
577 | => [0_i8, -15, -1, 24, 2, -13, -3, -29, 4, 46, 0, -51, 6, 0, -7, 18] | |
578 | ); | |
579 | ||
580 | #[cfg(target_arch = "aarch64")] | |
581 | test_vtbl!( | |
582 | test_vqtbl4_u8 => vqtbl4_u8: | |
583 | - table[uint8x16x4_t]: [ | |
584 | 0_u8, 1, 2, 3, 4, 5, 6, 7, | |
585 | 8, 9, 10, 11, 12, 13, 14, 15, | |
586 | 16, 17, 18, 19, 20, 21, 22, 23, | |
587 | 24, 25, 26, 27, 28, 29, 30, 31, | |
588 | 32, 33, 34, 35, 36, 37, 38, 39, | |
589 | 40, 41, 42, 43, 44, 45, 46, 47, | |
590 | 48, 49, 50, 51, 52, 53, 54, 55, | |
591 | 56, 57, 58, 59, 60, 61, 62, 63 | |
592 | ] | | |
593 | - ctrl[u8x8]: [80_u8, 15, 1, 24, 2, 13, 3, 29] => [0_u8, 15, 1, 24, 2, 13, 3, 29] | | |
594 | - ctrl[u8x8]: [4_u8, 46, 64, 51, 6, 71, 7, 18] => [4_u8, 46, 0, 51, 6, 0, 7, 18] | |
595 | ); | |
596 | ||
597 | #[cfg(target_arch = "aarch64")] | |
598 | test_vtbl!( | |
599 | test_vqtbl4q_u8 => vqtbl4q_u8: | |
600 | - table[uint8x16x4_t]: [ | |
601 | 0_u8, 1, 2, 3, 4, 5, 6, 7, | |
602 | 8, 9, 10, 11, 12, 13, 14, 15, | |
603 | 16, 17, 18, 19, 20, 21, 22, 23, | |
604 | 24, 25, 26, 27, 28, 29, 30, 31, | |
605 | 32, 33, 34, 35, 36, 37, 38, 39, | |
606 | 40, 41, 42, 43, 44, 45, 46, 47, | |
607 | 48, 49, 50, 51, 52, 53, 54, 55, | |
608 | 56, 57, 58, 59, 60, 61, 62, 63 | |
609 | ] | | |
610 | - ctrl[u8x16]: [80_u8, 15, 1, 24, 2, 13, 3, 29, 4_u8, 46, 64, 51, 6, 71, 7, 18] | |
611 | => [0_u8, 15, 1, 24, 2, 13, 3, 29, 4, 46, 0, 51, 6, 0, 7, 18] | |
612 | ); | |
613 | ||
614 | #[cfg(target_arch = "aarch64")] | |
615 | test_vtbl!( | |
616 | test_vqtbl4_p8 => vqtbl4_p8: | |
617 | - table[poly8x16x4_t]: [ | |
618 | 0_u8, 1, 2, 3, 4, 5, 6, 7, | |
619 | 8, 9, 10, 11, 12, 13, 14, 15, | |
620 | 16, 17, 18, 19, 20, 21, 22, 23, | |
621 | 24, 25, 26, 27, 28, 29, 30, 31, | |
622 | 32, 33, 34, 35, 36, 37, 38, 39, | |
623 | 40, 41, 42, 43, 44, 45, 46, 47, | |
624 | 48, 49, 50, 51, 52, 53, 54, 55, | |
625 | 56, 57, 58, 59, 60, 61, 62, 63 | |
626 | ] | | |
627 | - ctrl[u8x8]: [80_u8, 15, 1, 24, 2, 13, 3, 29] => [0_u8, 15, 1, 24, 2, 13, 3, 29] | | |
628 | - ctrl[u8x8]: [4_u8, 46, 64, 51, 6, 71, 7, 18] => [4_u8, 46, 0, 51, 6, 0, 7, 18] | |
629 | ); | |
630 | ||
631 | #[cfg(target_arch = "aarch64")] | |
632 | test_vtbl!( | |
633 | test_vqtbl4q_p8 => vqtbl4q_p8: | |
634 | - table[poly8x16x4_t]: [ | |
635 | 0_u8, 1, 2, 3, 4, 5, 6, 7, | |
636 | 8, 9, 10, 11, 12, 13, 14, 15, | |
637 | 16, 17, 18, 19, 20, 21, 22, 23, | |
638 | 24, 25, 26, 27, 28, 29, 30, 31, | |
639 | 32, 33, 34, 35, 36, 37, 38, 39, | |
640 | 40, 41, 42, 43, 44, 45, 46, 47, | |
641 | 48, 49, 50, 51, 52, 53, 54, 55, | |
642 | 56, 57, 58, 59, 60, 61, 62, 63 | |
643 | ] | | |
644 | - ctrl[u8x16]: [80_u8, 15, 1, 24, 2, 13, 3, 29, 4_u8, 46, 64, 51, 6, 71, 7, 18] | |
645 | => [0_u8, 15, 1, 24, 2, 13, 3, 29, 4, 46, 0, 51, 6, 0, 7, 18] | |
646 | ); | |
647 | ||
648 | #[cfg(target_arch = "aarch64")] | |
649 | test_vtbx!( | |
650 | test_vqtbx1_s8 => vqtbx1_s8: | |
651 | - table[int8x16_t]: [ | |
652 | 0_i8, -17, 34, 51, 68, 85, 102, 119, | |
653 | -106, -93, -84, -117, -104, -116, -72, -121 | |
654 | ] | | |
655 | - ext[int8x8_t]: [100_i8, -101, 102, -103, 104, -105, 106, -107] | | |
656 | - ctrl[i8x8]: [127_i8, 15, 1, 14, 2, 13, 3, 12] => [100_i8, -121, -17, -72, 34, -116, 51, -104] | | |
657 | - ctrl[i8x8]: [4_i8, 11, 16, 10, 6, 19, 7, 18] => [68_i8, -117, 102, -84, 102, -105, 119, -107] | |
658 | ); | |
659 | ||
660 | #[cfg(target_arch = "aarch64")] | |
661 | test_vtbx!( | |
662 | test_vqtbx1q_s8 => vqtbx1q_s8: | |
663 | - table[int8x16_t]: [ | |
664 | 0_i8, -17, 34, 51, 68, 85, 102, 119, | |
665 | -106, -93, -84, -117, -104, -116, -72, -121 | |
666 | ] | | |
667 | - ext[int8x16_t]: [ | |
668 | 100_i8, -101, 102, -103, 104, -105, 106, -107, | |
669 | 108, -109, 110, -111, 112, -113, 114, -115 | |
670 | ] | | |
671 | - ctrl[i8x16]: [127_i8, 15, 1, 14, 2, 13, 3, 12, 4_i8, 11, 16, 10, 6, 19, 7, 18] | |
672 | => [100_i8, -121, -17, -72, 34, -116, 51, -104, 68, -117, 110, -84, 102, -113, 119, -115] | |
673 | ); | |
674 | ||
675 | #[cfg(target_arch = "aarch64")] | |
676 | test_vtbx!( | |
677 | test_vqtbx1_u8 => vqtbx1_u8: | |
678 | - table[uint8x16_t]: [ | |
679 | 0_u8, 17, 34, 51, 68, 85, 102, 119, | |
680 | 106, 93, 84, 117, 104, 116, 72, 121 | |
681 | ] | | |
682 | - ext[uint8x8_t]: [100_u8, 101, 102, 103, 104, 105, 106, 107] | | |
683 | - ctrl[u8x8]: [127_u8, 15, 1, 14, 2, 13, 3, 12] => [100_u8, 121, 17, 72, 34, 116, 51, 104] | | |
684 | - ctrl[u8x8]: [4_u8, 11, 16, 10, 6, 19, 7, 18] => [68_u8, 117, 102, 84, 102, 105, 119, 107] | |
685 | ); | |
686 | ||
687 | #[cfg(target_arch = "aarch64")] | |
688 | test_vtbx!( | |
689 | test_vqtbx1q_u8 => vqtbx1q_u8: | |
690 | - table[uint8x16_t]: [ | |
691 | 0_u8, 17, 34, 51, 68, 85, 102, 119, | |
692 | 106, 93, 84, 117, 104, 116, 72, 121 | |
693 | ] | | |
694 | - ext[uint8x16_t]: [ | |
695 | 100_u8, 101, 102, 103, 104, 105, 106, 107, | |
696 | 108, 109, 110, 111, 112, 113, 114, 115 | |
697 | ] | | |
698 | - ctrl[u8x16]: [127_u8, 15, 1, 14, 2, 13, 3, 12, 4_u8, 11, 16, 10, 6, 19, 7, 18] | |
699 | => [100_u8, 121, 17, 72, 34, 116, 51, 104, 68, 117, 110, 84, 102, 113, 119, 115] | |
700 | ); | |
701 | ||
702 | #[cfg(target_arch = "aarch64")] | |
703 | test_vtbx!( | |
704 | test_vqtbx1_p8 => vqtbx1_p8: | |
705 | - table[poly8x16_t]: [ | |
706 | 0_u8, 17, 34, 51, 68, 85, 102, 119, | |
707 | 106, 93, 84, 117, 104, 116, 72, 121 | |
708 | ] | | |
709 | - ext[poly8x8_t]: [100_u8, 101, 102, 103, 104, 105, 106, 107] | | |
710 | - ctrl[u8x8]: [127_u8, 15, 1, 14, 2, 13, 3, 12] => [100_u8, 121, 17, 72, 34, 116, 51, 104] | | |
711 | - ctrl[u8x8]: [4_u8, 11, 16, 10, 6, 19, 7, 18] => [68_u8, 117, 102, 84, 102, 105, 119, 107] | |
712 | ); | |
713 | ||
714 | #[cfg(target_arch = "aarch64")] | |
715 | test_vtbx!( | |
716 | test_vqtbx1q_p8 => vqtbx1q_p8: | |
717 | - table[poly8x16_t]: [ | |
718 | 0_u8, 17, 34, 51, 68, 85, 102, 119, | |
719 | 106, 93, 84, 117, 104, 116, 72, 121 | |
720 | ] | | |
721 | - ext[poly8x16_t]: [ | |
722 | 100_u8, 101, 102, 103, 104, 105, 106, 107, | |
723 | 108, 109, 110, 111, 112, 113, 114, 115 | |
724 | ] | | |
725 | - ctrl[u8x16]: [127_u8, 15, 1, 14, 2, 13, 3, 12, 4_u8, 11, 16, 10, 6, 19, 7, 18] | |
726 | => [100_u8, 121, 17, 72, 34, 116, 51, 104, 68, 117, 110, 84, 102, 113, 119, 115] | |
727 | ); | |
728 | ||
729 | #[cfg(target_arch = "aarch64")] | |
730 | test_vtbx!( | |
731 | test_vqtbx2_s8 => vqtbx2_s8: | |
732 | - table[int8x16x2_t]: [ | |
733 | 0_i8, -1, 2, -3, 4, -5, 6, -7, | |
734 | 8, -9, 10, -11, 12, -13, 14, -15, | |
735 | 16, -17, 18, -19, 20, -21, 22, -23, | |
736 | 24, -25, 26, -27, 28, -29, 30, -31 | |
737 | ] | | |
738 | - ext[int8x8_t]: [100_i8, -101, 102, -103, 104, -105, 106, -107] | | |
739 | - ctrl[i8x8]: [80_i8, 15, 1, 24, 2, 13, 3, 29] => [100_i8, -15, -1, 24, 2, -13, -3, -29] | | |
740 | - ctrl[i8x8]: [4_i8, 31, 32, 10, 6, 49, 7, 18] => [4_i8, -31, 102, 10, 6, -105, -7, 18] | |
741 | ); | |
742 | ||
743 | #[cfg(target_arch = "aarch64")] | |
744 | test_vtbx!( | |
745 | test_vqtbx2q_s8 => vqtbx2q_s8: | |
746 | - table[int8x16x2_t]: [ | |
747 | 0_i8, -1, 2, -3, 4, -5, 6, -7, | |
748 | 8, -9, 10, -11, 12, -13, 14, -15, | |
749 | 16, -17, 18, -19, 20, -21, 22, -23, | |
750 | 24, -25, 26, -27, 28, -29, 30, -31 | |
751 | ] | | |
752 | - ext[int8x16_t]: [ | |
753 | 100_i8, -101, 102, -103, 104, -105, 106, -107, | |
754 | 108, -109, 110, -111, 112, -113, 114, -115 | |
755 | ] | | |
756 | - ctrl[i8x16]: [80_i8, 15, 1, 24, 2, 13, 3, 29, 4_i8, 31, 32, 10, 6, 49, 7, 18] | |
757 | => [100_i8, -15, -1, 24, 2, -13, -3, -29, 4, -31, 110, 10, 6, -113, -7, 18] | |
758 | ); | |
759 | ||
760 | #[cfg(target_arch = "aarch64")] | |
761 | test_vtbx!( | |
762 | test_vqtbx2_u8 => vqtbx2_u8: | |
763 | - table[uint8x16x2_t]: [ | |
764 | 0_u8, 1, 2, 3, 4, 5, 6, 7, | |
765 | 8, 9, 10, 11, 12, 13, 14, 15, | |
766 | 16, 17, 18, 19, 20, 21, 22, 23, | |
767 | 24, 25, 26, 27, 28, 29, 30, 31 | |
768 | ] | | |
769 | - ext[uint8x8_t]: [100_u8, 101, 102, 103, 104, 105, 106, 107] | | |
770 | - ctrl[u8x8]: [80_u8, 15, 1, 24, 2, 13, 3, 29] => [100_u8, 15, 1, 24, 2, 13, 3, 29] | | |
771 | - ctrl[u8x8]: [4_u8, 31, 32, 10, 6, 49, 7, 18] => [4_u8, 31, 102, 10, 6, 105, 7, 18] | |
772 | ); | |
773 | ||
774 | #[cfg(target_arch = "aarch64")] | |
775 | test_vtbx!( | |
776 | test_vqtbx2q_u8 => vqtbx2q_u8: | |
777 | - table[uint8x16x2_t]: [ | |
778 | 0_u8, 1, 2, 3, 4, 5, 6, 7, | |
779 | 8, 9, 10, 11, 12, 13, 14, 15, | |
780 | 16, 17, 18, 19, 20, 21, 22, 23, | |
781 | 24, 25, 26, 27, 28, 29, 30, 31 | |
782 | ] | | |
783 | - ext[uint8x16_t]: [ | |
784 | 100_u8, 101, 102, 103, 104, 105, 106, 107, | |
785 | 108, 109, 110, 111, 112, 113, 114, 115 | |
786 | ] | | |
787 | - ctrl[u8x16]: [80_u8, 15, 1, 24, 2, 13, 3, 29, 4_u8, 31, 32, 10, 6, 49, 7, 18] | |
788 | => [100_u8, 15, 1, 24, 2, 13, 3, 29, 4, 31, 110, 10, 6, 113, 7, 18] | |
789 | ); | |
790 | ||
791 | #[cfg(target_arch = "aarch64")] | |
792 | test_vtbx!( | |
793 | test_vqtbx2_p8 => vqtbx2_p8: | |
794 | - table[poly8x16x2_t]: [ | |
795 | 0_u8, 1, 2, 3, 4, 5, 6, 7, | |
796 | 8, 9, 10, 11, 12, 13, 14, 15, | |
797 | 16, 17, 18, 19, 20, 21, 22, 23, | |
798 | 24, 25, 26, 27, 28, 29, 30, 31 | |
799 | ] | | |
800 | - ext[poly8x8_t]: [100_u8, 101, 102, 103, 104, 105, 106, 107] | | |
801 | - ctrl[u8x8]: [80_u8, 15, 1, 24, 2, 13, 3, 29] => [100_u8, 15, 1, 24, 2, 13, 3, 29] | | |
802 | - ctrl[u8x8]: [4_u8, 31, 32, 10, 6, 49, 7, 18] => [4_u8, 31, 102, 10, 6, 105, 7, 18] | |
803 | ); | |
804 | ||
805 | #[cfg(target_arch = "aarch64")] | |
806 | test_vtbx!( | |
807 | test_vqtbx2q_p8 => vqtbx2q_p8: | |
808 | - table[poly8x16x2_t]: [ | |
809 | 0_u8, 1, 2, 3, 4, 5, 6, 7, | |
810 | 8, 9, 10, 11, 12, 13, 14, 15, | |
811 | 16, 17, 18, 19, 20, 21, 22, 23, | |
812 | 24, 25, 26, 27, 28, 29, 30, 31 | |
813 | ] | | |
814 | - ext[poly8x16_t]: [ | |
815 | 100_u8, 101, 102, 103, 104, 105, 106, 107, | |
816 | 108, 109, 110, 111, 112, 113, 114, 115 | |
817 | ] | | |
818 | - ctrl[u8x16]: [80_u8, 15, 1, 24, 2, 13, 3, 29, 4_u8, 31, 32, 10, 6, 49, 7, 18] | |
819 | => [100_u8, 15, 1, 24, 2, 13, 3, 29, 4, 31, 110, 10, 6, 113, 7, 18] | |
820 | ); | |
821 | ||
822 | #[cfg(target_arch = "aarch64")] | |
823 | test_vtbx!( | |
824 | test_vqtbx3_s8 => vqtbx3_s8: | |
825 | - table[int8x16x3_t]: [ | |
826 | 0_i8, -1, 2, -3, 4, -5, 6, -7, | |
827 | 8, -9, 10, -11, 12, -13, 14, -15, | |
828 | 16, -17, 18, -19, 20, -21, 22, -23, | |
829 | 24, -25, 26, -27, 28, -29, 30, -31, | |
830 | 32, -33, 34, -35, 36, -37, 38, -39, | |
831 | 40, -41, 42, -43, 44, -45, 46, -47 | |
832 | ] | | |
833 | - ext[int8x8_t]: [100_i8, -101, 102, -103, 104, -105, 106, -107] | | |
834 | - ctrl[i8x8]: [80_i8, 15, 1, 24, 2, 13, 3, 29] => [100_i8, -15, -1, 24, 2, -13, -3, -29] | | |
835 | - ctrl[i8x8]: [4_i8, 32, 46, 51, 6, 49, 7, 18] => [4_i8, 32, 46, -103, 6, -105, -7, 18] | |
836 | ); | |
837 | ||
838 | #[cfg(target_arch = "aarch64")] | |
839 | test_vtbx!( | |
840 | test_vqtbx3q_s8 => vqtbx3q_s8: | |
841 | - table[int8x16x3_t]: [ | |
842 | 0_i8, -1, 2, -3, 4, -5, 6, -7, | |
843 | 8, -9, 10, -11, 12, -13, 14, -15, | |
844 | 16, -17, 18, -19, 20, -21, 22, -23, | |
845 | 24, -25, 26, -27, 28, -29, 30, -31, | |
846 | 32, -33, 34, -35, 36, -37, 38, -39, | |
847 | 40, -41, 42, -43, 44, -45, 46, -47 | |
848 | ] | | |
849 | - ext[int8x16_t]: [ | |
850 | 100_i8, -101, 102, -103, 104, -105, 106, -107, | |
851 | 108, -109, 110, -111, 112, -113, 114, -115 | |
852 | ] | | |
853 | - ctrl[i8x16]: [80_i8, 15, 1, 24, 2, 13, 3, 29, 4_i8, 32, 46, 51, 6, 49, 7, 18] | |
854 | => [100_i8, -15, -1, 24, 2, -13, -3, -29, 4, 32, 46, -111, 6, -113, -7, 18] | |
855 | ); | |
856 | ||
857 | #[cfg(target_arch = "aarch64")] | |
858 | test_vtbx!( | |
859 | test_vqtbx3_u8 => vqtbx3_u8: | |
860 | - table[uint8x16x3_t]: [ | |
861 | 0_u8, 1, 2, 3, 4, 5, 6, 7, | |
862 | 8, 9, 10, 11, 12, 13, 14, 15, | |
863 | 16, 17, 18, 19, 20, 21, 22, 23, | |
864 | 24, 25, 26, 27, 28, 29, 30, 31, | |
865 | 32, 33, 34, 35, 36, 37, 38, 39, | |
866 | 40, 41, 42, 43, 44, 45, 46, 47 | |
867 | ] | | |
868 | - ext[uint8x8_t]: [100_u8, 101, 102, 103, 104, 105, 106, 107] | | |
869 | - ctrl[u8x8]: [80_u8, 15, 1, 24, 2, 13, 3, 29] => [100_u8, 15, 1, 24, 2, 13, 3, 29] | | |
870 | - ctrl[u8x8]: [4_u8, 32, 46, 51, 6, 49, 7, 18] => [4_u8, 32, 46, 103, 6, 105, 7, 18] | |
871 | ); | |
872 | ||
873 | #[cfg(target_arch = "aarch64")] | |
874 | test_vtbx!( | |
875 | test_vqtbx3q_u8 => vqtbx3q_u8: | |
876 | - table[uint8x16x3_t]: [ | |
877 | 0_u8, 1, 2, 3, 4, 5, 6, 7, | |
878 | 8, 9, 10, 11, 12, 13, 14, 15, | |
879 | 16, 17, 18, 19, 20, 21, 22, 23, | |
880 | 24, 25, 26, 27, 28, 29, 30, 31, | |
881 | 32, 33, 34, 35, 36, 37, 38, 39, | |
882 | 40, 41, 42, 43, 44, 45, 46, 47 | |
883 | ] | | |
884 | - ext[uint8x16_t]: [ | |
885 | 100_u8, 101, 102, 103, 104, 105, 106, 107, | |
886 | 108, 109, 110, 111, 112, 113, 114, 115 | |
887 | ] | | |
888 | - ctrl[u8x16]: [80_u8, 15, 1, 24, 2, 13, 3, 29, 4_u8, 32, 46, 51, 6, 49, 7, 18] | |
889 | => [100_u8, 15, 1, 24, 2, 13, 3, 29, 4, 32, 46, 111, 6, 113, 7, 18] | |
890 | ); | |
891 | ||
892 | #[cfg(target_arch = "aarch64")] | |
893 | test_vtbx!( | |
894 | test_vqtbx3_p8 => vqtbx3_p8: | |
895 | - table[poly8x16x3_t]: [ | |
896 | 0_u8, 1, 2, 3, 4, 5, 6, 7, | |
897 | 8, 9, 10, 11, 12, 13, 14, 15, | |
898 | 16, 17, 18, 19, 20, 21, 22, 23, | |
899 | 24, 25, 26, 27, 28, 29, 30, 31, | |
900 | 32, 33, 34, 35, 36, 37, 38, 39, | |
901 | 40, 41, 42, 43, 44, 45, 46, 47 | |
902 | ] | | |
903 | - ext[poly8x8_t]: [100_u8, 101, 102, 103, 104, 105, 106, 107] | | |
904 | - ctrl[u8x8]: [80_u8, 15, 1, 24, 2, 13, 3, 29] => [100_u8, 15, 1, 24, 2, 13, 3, 29] | | |
905 | - ctrl[u8x8]: [4_u8, 32, 46, 51, 6, 49, 7, 18] => [4_u8, 32, 46, 103, 6, 105, 7, 18] | |
906 | ); | |
907 | ||
908 | #[cfg(target_arch = "aarch64")] | |
909 | test_vtbx!( | |
910 | test_vqtbx3q_p8 => vqtbx3q_p8: | |
911 | - table[poly8x16x3_t]: [ | |
912 | 0_u8, 1, 2, 3, 4, 5, 6, 7, | |
913 | 8, 9, 10, 11, 12, 13, 14, 15, | |
914 | 16, 17, 18, 19, 20, 21, 22, 23, | |
915 | 24, 25, 26, 27, 28, 29, 30, 31, | |
916 | 32, 33, 34, 35, 36, 37, 38, 39, | |
917 | 40, 41, 42, 43, 44, 45, 46, 47 | |
918 | ] | | |
919 | - ext[poly8x16_t]: [ | |
920 | 100_u8, 101, 102, 103, 104, 105, 106, 107, | |
921 | 108, 109, 110, 111, 112, 113, 114, 115 | |
922 | ] | | |
923 | - ctrl[u8x16]: [80_u8, 15, 1, 24, 2, 13, 3, 29, 4_u8, 32, 46, 51, 6, 49, 7, 18] | |
924 | => [100_u8, 15, 1, 24, 2, 13, 3, 29, 4, 32, 46, 111, 6, 113, 7, 18] | |
925 | ); | |
926 | ||
927 | #[cfg(target_arch = "aarch64")] | |
928 | test_vtbx!( | |
929 | test_vqtbx4_s8 => vqtbx4_s8: | |
930 | - table[int8x16x4_t]: [ | |
931 | 0_i8, -1, 2, -3, 4, -5, 6, -7, | |
932 | 8, -9, 10, -11, 12, -13, 14, -15, | |
933 | 16, -17, 18, -19, 20, -21, 22, -23, | |
934 | 24, -25, 26, -27, 28, -29, 30, -31, | |
935 | 32, -33, 34, -35, 36, -37, 38, -39, | |
936 | 40, -41, 42, -43, 44, -45, 46, -47, | |
937 | 48, -49, 50, -51, 52, -53, 54, -55, | |
938 | 56, -57, 58, -59, 60, -61, 62, -63 | |
939 | ] | | |
940 | - ext[int8x8_t]: [100_i8, -101, 102, -103, 104, -105, 106, -107] | | |
941 | - ctrl[i8x8]: [80_i8, 15, 1, 24, 2, 13, 3, 29] => [100_i8, -15, -1, 24, 2, -13, -3, -29] | | |
942 | - ctrl[i8x8]: [4_i8, 46, 64, 51, 6, 71, 7, 18] => [4_i8, 46, 102, -51, 6, -105, -7, 18] | |
943 | ); | |
944 | ||
945 | #[cfg(target_arch = "aarch64")] | |
946 | test_vtbx!( | |
947 | test_vqtbx4q_s8 => vqtbx4q_s8: | |
948 | - table[int8x16x4_t]: [ | |
949 | 0_i8, -1, 2, -3, 4, -5, 6, -7, | |
950 | 8, -9, 10, -11, 12, -13, 14, -15, | |
951 | 16, -17, 18, -19, 20, -21, 22, -23, | |
952 | 24, -25, 26, -27, 28, -29, 30, -31, | |
953 | 32, -33, 34, -35, 36, -37, 38, -39, | |
954 | 40, -41, 42, -43, 44, -45, 46, -47, | |
955 | 48, -49, 50, -51, 52, -53, 54, -55, | |
956 | 56, -57, 58, -59, 60, -61, 62, -63 | |
957 | ] | | |
958 | - ext[int8x16_t]: [ | |
959 | 100_i8, -101, 102, -103, 104, -105, 106, -107, | |
960 | 108, -109, 110, -111, 112, -113, 114, -115 | |
961 | ] | | |
962 | - ctrl[i8x16]: [80_i8, 15, 1, 24, 2, 13, 3, 29, 4_i8, 46, 64, 51, 6, 71, 7, 18] | |
963 | => [100_i8, -15, -1, 24, 2, -13, -3, -29, 4, 46, 110, -51, 6, -113, -7, 18] | |
964 | ); | |
965 | ||
966 | #[cfg(target_arch = "aarch64")] | |
967 | test_vtbx!( | |
968 | test_vqtbx4_u8 => vqtbx4_u8: | |
969 | - table[uint8x16x4_t]: [ | |
970 | 0_u8, 1, 2, 3, 4, 5, 6, 7, | |
971 | 8, 9, 10, 11, 12, 13, 14, 15, | |
972 | 16, 17, 18, 19, 20, 21, 22, 23, | |
973 | 24, 25, 26, 27, 28, 29, 30, 31, | |
974 | 32, 33, 34, 35, 36, 37, 38, 39, | |
975 | 40, 41, 42, 43, 44, 45, 46, 47, | |
976 | 48, 49, 50, 51, 52, 53, 54, 55, | |
977 | 56, 57, 58, 59, 60, 61, 62, 63 | |
978 | ] | | |
979 | - ext[uint8x8_t]: [100_u8, 101, 102, 103, 104, 105, 106, 107] | | |
980 | - ctrl[u8x8]: [80_u8, 15, 1, 24, 2, 13, 3, 29] => [100_u8, 15, 1, 24, 2, 13, 3, 29] | | |
981 | - ctrl[u8x8]: [4_u8, 46, 64, 51, 6, 71, 7, 18] => [4_u8, 46, 102, 51, 6, 105, 7, 18] | |
982 | ); | |
983 | ||
984 | #[cfg(target_arch = "aarch64")] | |
985 | test_vtbx!( | |
986 | test_vqtbx4q_u8 => vqtbx4q_u8: | |
987 | - table[uint8x16x4_t]: [ | |
988 | 0_u8, 1, 2, 3, 4, 5, 6, 7, | |
989 | 8, 9, 10, 11, 12, 13, 14, 15, | |
990 | 16, 17, 18, 19, 20, 21, 22, 23, | |
991 | 24, 25, 26, 27, 28, 29, 30, 31, | |
992 | 32, 33, 34, 35, 36, 37, 38, 39, | |
993 | 40, 41, 42, 43, 44, 45, 46, 47, | |
994 | 48, 49, 50, 51, 52, 53, 54, 55, | |
995 | 56, 57, 58, 59, 60, 61, 62, 63 | |
996 | ] | | |
997 | - ext[uint8x16_t]: [ | |
998 | 100_u8, 101, 102, 103, 104, 105, 106, 107, | |
999 | 108, 109, 110, 111, 112, 113, 114, 115 | |
1000 | ] | | |
1001 | - ctrl[u8x16]: [80_u8, 15, 1, 24, 2, 13, 3, 29, 4_u8, 46, 64, 51, 6, 71, 7, 18] | |
1002 | => [100_u8, 15, 1, 24, 2, 13, 3, 29, 4, 46, 110, 51, 6, 113, 7, 18] | |
1003 | ); | |
1004 | ||
1005 | #[cfg(target_arch = "aarch64")] | |
1006 | test_vtbx!( | |
1007 | test_vqtbx4_p8 => vqtbx4_p8: | |
1008 | - table[poly8x16x4_t]: [ | |
1009 | 0_u8, 1, 2, 3, 4, 5, 6, 7, | |
1010 | 8, 9, 10, 11, 12, 13, 14, 15, | |
1011 | 16, 17, 18, 19, 20, 21, 22, 23, | |
1012 | 24, 25, 26, 27, 28, 29, 30, 31, | |
1013 | 32, 33, 34, 35, 36, 37, 38, 39, | |
1014 | 40, 41, 42, 43, 44, 45, 46, 47, | |
1015 | 48, 49, 50, 51, 52, 53, 54, 55, | |
1016 | 56, 57, 58, 59, 60, 61, 62, 63 | |
1017 | ] | | |
1018 | - ext[poly8x8_t]: [100_u8, 101, 102, 103, 104, 105, 106, 107] | | |
1019 | - ctrl[u8x8]: [80_u8, 15, 1, 24, 2, 13, 3, 29] => [100_u8, 15, 1, 24, 2, 13, 3, 29] | | |
1020 | - ctrl[u8x8]: [4_u8, 46, 64, 51, 6, 71, 7, 18] => [4_u8, 46, 102, 51, 6, 105, 7, 18] | |
1021 | ); | |
1022 | ||
1023 | #[cfg(target_arch = "aarch64")] | |
1024 | test_vtbx!( | |
1025 | test_vqtbx4q_p8 => vqtbx4q_p8: | |
1026 | - table[poly8x16x4_t]: [ | |
1027 | 0_u8, 1, 2, 3, 4, 5, 6, 7, | |
1028 | 8, 9, 10, 11, 12, 13, 14, 15, | |
1029 | 16, 17, 18, 19, 20, 21, 22, 23, | |
1030 | 24, 25, 26, 27, 28, 29, 30, 31, | |
1031 | 32, 33, 34, 35, 36, 37, 38, 39, | |
1032 | 40, 41, 42, 43, 44, 45, 46, 47, | |
1033 | 48, 49, 50, 51, 52, 53, 54, 55, | |
1034 | 56, 57, 58, 59, 60, 61, 62, 63 | |
1035 | ] | | |
1036 | - ext[poly8x16_t]: [ | |
1037 | 100_u8, 101, 102, 103, 104, 105, 106, 107, | |
1038 | 108, 109, 110, 111, 112, 113, 114, 115 | |
1039 | ] | | |
1040 | - ctrl[u8x16]: [80_u8, 15, 1, 24, 2, 13, 3, 29, 4_u8, 46, 64, 51, 6, 71, 7, 18] | |
1041 | => [100_u8, 15, 1, 24, 2, 13, 3, 29, 4, 46, 110, 51, 6, 113, 7, 18] | |
1042 | ); |