Debian Codegraph @

src/generated/neon.rs

raw symbols SCIP
1 // Copyright 2025 the Fearless_SIMD Authors
2 // SPDX-License-Identifier: Apache-2.0 OR MIT
3
4 // This file is autogenerated by fearless_simd_gen
5
6 use crate::{Level, arch_types::ArchTypes, prelude::*, seal::Seal};
7 use crate::{
8 f32x4, f32x8, f32x16, f64x2, f64x4, f64x8, i8x16, i8x32, i8x64, i16x8, i16x16, i16x32, i32x4,
9 i32x8, i32x16, mask8x16, mask8x32, mask8x64, mask16x8, mask16x16, mask16x32, mask32x4,
10 mask32x8, mask32x16, mask64x2, mask64x4, mask64x8, u8x16, u8x32, u8x64, u16x8, u16x16, u16x32,
11 u32x4, u32x8, u32x16,
12 };
13 use core::arch::aarch64::*;
14 #[doc = "The SIMD token for the \"neon\" level."]
15 #[derive(Clone, Copy, Debug)]
16 pub struct Neon {
17 pub neon: crate::core_arch::aarch64::Neon,
18 }
19 impl Neon {
20 #[inline]
21 pub const unsafe fn new_unchecked() -> Self {
22 Neon {
23 neon: unsafe { crate::core_arch::aarch64::Neon::new_unchecked() },
24 }
25 }
26 }
27 impl Seal for Neon {}
28 impl ArchTypes for Neon {
29 type f32x4 = crate::support::Aligned128<float32x4_t>;
30 type i8x16 = crate::support::Aligned128<int8x16_t>;
31 type u8x16 = crate::support::Aligned128<uint8x16_t>;
32 type mask8x16 = crate::support::Aligned128<int8x16_t>;
33 type i16x8 = crate::support::Aligned128<int16x8_t>;
34 type u16x8 = crate::support::Aligned128<uint16x8_t>;
35 type mask16x8 = crate::support::Aligned128<int16x8_t>;
36 type i32x4 = crate::support::Aligned128<int32x4_t>;
37 type u32x4 = crate::support::Aligned128<uint32x4_t>;
38 type mask32x4 = crate::support::Aligned128<int32x4_t>;
39 type f64x2 = crate::support::Aligned128<float64x2_t>;
40 type mask64x2 = crate::support::Aligned128<int64x2_t>;
41 type f32x8 = crate::support::Aligned256<float32x4x2_t>;
42 type i8x32 = crate::support::Aligned256<int8x16x2_t>;
43 type u8x32 = crate::support::Aligned256<uint8x16x2_t>;
44 type mask8x32 = crate::support::Aligned256<int8x16x2_t>;
45 type i16x16 = crate::support::Aligned256<int16x8x2_t>;
46 type u16x16 = crate::support::Aligned256<uint16x8x2_t>;
47 type mask16x16 = crate::support::Aligned256<int16x8x2_t>;
48 type i32x8 = crate::support::Aligned256<int32x4x2_t>;
49 type u32x8 = crate::support::Aligned256<uint32x4x2_t>;
50 type mask32x8 = crate::support::Aligned256<int32x4x2_t>;
51 type f64x4 = crate::support::Aligned256<float64x2x2_t>;
52 type mask64x4 = crate::support::Aligned256<int64x2x2_t>;
53 type f32x16 = crate::support::Aligned512<float32x4x4_t>;
54 type i8x64 = crate::support::Aligned512<int8x16x4_t>;
55 type u8x64 = crate::support::Aligned512<uint8x16x4_t>;
56 type mask8x64 = crate::support::Aligned512<int8x16x4_t>;
57 type i16x32 = crate::support::Aligned512<int16x8x4_t>;
58 type u16x32 = crate::support::Aligned512<uint16x8x4_t>;
59 type mask16x32 = crate::support::Aligned512<int16x8x4_t>;
60 type i32x16 = crate::support::Aligned512<int32x4x4_t>;
61 type u32x16 = crate::support::Aligned512<uint32x4x4_t>;
62 type mask32x16 = crate::support::Aligned512<int32x4x4_t>;
63 type f64x8 = crate::support::Aligned512<float64x2x4_t>;
64 type mask64x8 = crate::support::Aligned512<int64x2x4_t>;
65 }
66 impl Simd for Neon {
67 type f32s = f32x4<Self>;
68 type f64s = f64x2<Self>;
69 type u8s = u8x16<Self>;
70 type i8s = i8x16<Self>;
71 type u16s = u16x8<Self>;
72 type i16s = i16x8<Self>;
73 type u32s = u32x4<Self>;
74 type i32s = i32x4<Self>;
75 type mask8s = mask8x16<Self>;
76 type mask16s = mask16x8<Self>;
77 type mask32s = mask32x4<Self>;
78 type mask64s = mask64x2<Self>;
79 #[inline(always)]
80 fn level(self) -> Level {
81 Level::Neon(self)
82 }
83 #[inline]
84 fn vectorize<F: FnOnce() -> R, R>(self, f: F) -> R {
85 #[target_feature(enable = "neon")]
86 unsafe fn vectorize_neon<F: FnOnce() -> R, R>(f: F) -> R {
87 f()
88 }
89 unsafe { vectorize_neon(f) }
90 }
91 #[inline(always)]
92 fn splat_f32x4(self, val: f32) -> f32x4<Self> {
93 unsafe { vdupq_n_f32(val).simd_into(self) }
94 }
95 #[inline(always)]
96 fn load_array_f32x4(self, val: [f32; 4usize]) -> f32x4<Self> {
97 f32x4 {
98 val: unsafe { core::mem::transmute_copy(&val) },
99 simd: self,
100 }
101 }
102 #[inline(always)]
103 fn load_array_ref_f32x4(self, val: &[f32; 4usize]) -> f32x4<Self> {
104 f32x4 {
105 val: unsafe { core::mem::transmute_copy(val) },
106 simd: self,
107 }
108 }
109 #[inline(always)]
110 fn as_array_f32x4(self, a: f32x4<Self>) -> [f32; 4usize] {
111 unsafe { core::mem::transmute::<float32x4_t, [f32; 4usize]>(a.val.0) }
112 }
113 #[inline(always)]
114 fn as_array_ref_f32x4(self, a: &f32x4<Self>) -> &[f32; 4usize] {
115 unsafe { core::mem::transmute::<&float32x4_t, &[f32; 4usize]>(&a.val.0) }
116 }
117 #[inline(always)]
118 fn as_array_mut_f32x4(self, a: &mut f32x4<Self>) -> &mut [f32; 4usize] {
119 unsafe { core::mem::transmute::<&mut float32x4_t, &mut [f32; 4usize]>(&mut a.val.0) }
120 }
121 #[inline(always)]
122 fn store_array_f32x4(self, a: f32x4<Self>, dest: &mut [f32; 4usize]) -> () {
123 unsafe {
124 core::ptr::copy_nonoverlapping(
125 (&raw const a.val.0) as *const f32,
126 dest.as_mut_ptr(),
127 4usize,
128 );
129 }
130 }
131 #[inline(always)]
132 fn cvt_from_bytes_f32x4(self, a: u8x16<Self>) -> f32x4<Self> {
133 unsafe {
134 f32x4 {
135 val: core::mem::transmute(a.val),
136 simd: self,
137 }
138 }
139 }
140 #[inline(always)]
141 fn cvt_to_bytes_f32x4(self, a: f32x4<Self>) -> u8x16<Self> {
142 unsafe {
143 u8x16 {
144 val: core::mem::transmute(a.val),
145 simd: self,
146 }
147 }
148 }
149 #[inline(always)]
150 fn slide_f32x4<const SHIFT: usize>(self, a: f32x4<Self>, b: f32x4<Self>) -> f32x4<Self> {
151 if SHIFT >= 4usize {
152 return b;
153 }
154 let result = unsafe {
155 dyn_vext_128(
156 self.cvt_to_bytes_f32x4(a).val.0,
157 self.cvt_to_bytes_f32x4(b).val.0,
158 SHIFT * 4usize,
159 )
160 };
161 self.cvt_from_bytes_f32x4(u8x16 {
162 val: crate::support::Aligned128(result),
163 simd: self,
164 })
165 }
166 #[inline(always)]
167 fn slide_within_blocks_f32x4<const SHIFT: usize>(
168 self,
169 a: f32x4<Self>,
170 b: f32x4<Self>,
171 ) -> f32x4<Self> {
172 self.slide_f32x4::<SHIFT>(a, b)
173 }
174 #[inline(always)]
175 fn abs_f32x4(self, a: f32x4<Self>) -> f32x4<Self> {
176 unsafe { vabsq_f32(a.into()).simd_into(self) }
177 }
178 #[inline(always)]
179 fn neg_f32x4(self, a: f32x4<Self>) -> f32x4<Self> {
180 unsafe { vnegq_f32(a.into()).simd_into(self) }
181 }
182 #[inline(always)]
183 fn sqrt_f32x4(self, a: f32x4<Self>) -> f32x4<Self> {
184 unsafe { vsqrtq_f32(a.into()).simd_into(self) }
185 }
186 #[inline(always)]
187 fn add_f32x4(self, a: f32x4<Self>, b: f32x4<Self>) -> f32x4<Self> {
188 unsafe { vaddq_f32(a.into(), b.into()).simd_into(self) }
189 }
190 #[inline(always)]
191 fn sub_f32x4(self, a: f32x4<Self>, b: f32x4<Self>) -> f32x4<Self> {
192 unsafe { vsubq_f32(a.into(), b.into()).simd_into(self) }
193 }
194 #[inline(always)]
195 fn mul_f32x4(self, a: f32x4<Self>, b: f32x4<Self>) -> f32x4<Self> {
196 unsafe { vmulq_f32(a.into(), b.into()).simd_into(self) }
197 }
198 #[inline(always)]
199 fn div_f32x4(self, a: f32x4<Self>, b: f32x4<Self>) -> f32x4<Self> {
200 unsafe { vdivq_f32(a.into(), b.into()).simd_into(self) }
201 }
202 #[inline(always)]
203 fn copysign_f32x4(self, a: f32x4<Self>, b: f32x4<Self>) -> f32x4<Self> {
204 unsafe {
205 let sign_mask = vdupq_n_u32(1 << 31);
206 vbslq_f32(sign_mask, b.into(), a.into()).simd_into(self)
207 }
208 }
209 #[inline(always)]
210 fn simd_eq_f32x4(self, a: f32x4<Self>, b: f32x4<Self>) -> mask32x4<Self> {
211 unsafe { vreinterpretq_s32_u32(vceqq_f32(a.into(), b.into())).simd_into(self) }
212 }
213 #[inline(always)]
214 fn simd_lt_f32x4(self, a: f32x4<Self>, b: f32x4<Self>) -> mask32x4<Self> {
215 unsafe { vreinterpretq_s32_u32(vcltq_f32(a.into(), b.into())).simd_into(self) }
216 }
217 #[inline(always)]
218 fn simd_le_f32x4(self, a: f32x4<Self>, b: f32x4<Self>) -> mask32x4<Self> {
219 unsafe { vreinterpretq_s32_u32(vcleq_f32(a.into(), b.into())).simd_into(self) }
220 }
221 #[inline(always)]
222 fn simd_ge_f32x4(self, a: f32x4<Self>, b: f32x4<Self>) -> mask32x4<Self> {
223 unsafe { vreinterpretq_s32_u32(vcgeq_f32(a.into(), b.into())).simd_into(self) }
224 }
225 #[inline(always)]
226 fn simd_gt_f32x4(self, a: f32x4<Self>, b: f32x4<Self>) -> mask32x4<Self> {
227 unsafe { vreinterpretq_s32_u32(vcgtq_f32(a.into(), b.into())).simd_into(self) }
228 }
229 #[inline(always)]
230 fn zip_low_f32x4(self, a: f32x4<Self>, b: f32x4<Self>) -> f32x4<Self> {
231 let x = a.into();
232 let y = b.into();
233 unsafe { vzip1q_f32(x, y).simd_into(self) }
234 }
235 #[inline(always)]
236 fn zip_high_f32x4(self, a: f32x4<Self>, b: f32x4<Self>) -> f32x4<Self> {
237 let x = a.into();
238 let y = b.into();
239 unsafe { vzip2q_f32(x, y).simd_into(self) }
240 }
241 #[inline(always)]
242 fn unzip_low_f32x4(self, a: f32x4<Self>, b: f32x4<Self>) -> f32x4<Self> {
243 let x = a.into();
244 let y = b.into();
245 unsafe { vuzp1q_f32(x, y).simd_into(self) }
246 }
247 #[inline(always)]
248 fn unzip_high_f32x4(self, a: f32x4<Self>, b: f32x4<Self>) -> f32x4<Self> {
249 let x = a.into();
250 let y = b.into();
251 unsafe { vuzp2q_f32(x, y).simd_into(self) }
252 }
253 #[inline(always)]
254 fn interleave_f32x4(self, a: f32x4<Self>, b: f32x4<Self>) -> (f32x4<Self>, f32x4<Self>) {
255 (self.zip_low_f32x4(a, b), self.zip_high_f32x4(a, b))
256 }
257 #[inline(always)]
258 fn deinterleave_f32x4(self, a: f32x4<Self>, b: f32x4<Self>) -> (f32x4<Self>, f32x4<Self>) {
259 (self.unzip_low_f32x4(a, b), self.unzip_high_f32x4(a, b))
260 }
261 #[inline(always)]
262 fn max_f32x4(self, a: f32x4<Self>, b: f32x4<Self>) -> f32x4<Self> {
263 unsafe { vmaxq_f32(a.into(), b.into()).simd_into(self) }
264 }
265 #[inline(always)]
266 fn min_f32x4(self, a: f32x4<Self>, b: f32x4<Self>) -> f32x4<Self> {
267 unsafe { vminq_f32(a.into(), b.into()).simd_into(self) }
268 }
269 #[inline(always)]
270 fn max_precise_f32x4(self, a: f32x4<Self>, b: f32x4<Self>) -> f32x4<Self> {
271 unsafe { vmaxnmq_f32(a.into(), b.into()).simd_into(self) }
272 }
273 #[inline(always)]
274 fn min_precise_f32x4(self, a: f32x4<Self>, b: f32x4<Self>) -> f32x4<Self> {
275 unsafe { vminnmq_f32(a.into(), b.into()).simd_into(self) }
276 }
277 #[inline(always)]
278 fn mul_add_f32x4(self, a: f32x4<Self>, b: f32x4<Self>, c: f32x4<Self>) -> f32x4<Self> {
279 unsafe { vfmaq_f32(c.into(), b.into(), a.into()).simd_into(self) }
280 }
281 #[inline(always)]
282 fn mul_sub_f32x4(self, a: f32x4<Self>, b: f32x4<Self>, c: f32x4<Self>) -> f32x4<Self> {
283 unsafe { vnegq_f32(vfmsq_f32(c.into(), b.into(), a.into())).simd_into(self) }
284 }
285 #[inline(always)]
286 fn floor_f32x4(self, a: f32x4<Self>) -> f32x4<Self> {
287 unsafe { vrndmq_f32(a.into()).simd_into(self) }
288 }
289 #[inline(always)]
290 fn ceil_f32x4(self, a: f32x4<Self>) -> f32x4<Self> {
291 unsafe { vrndpq_f32(a.into()).simd_into(self) }
292 }
293 #[inline(always)]
294 fn round_ties_even_f32x4(self, a: f32x4<Self>) -> f32x4<Self> {
295 unsafe { vrndnq_f32(a.into()).simd_into(self) }
296 }
297 #[inline(always)]
298 fn fract_f32x4(self, a: f32x4<Self>) -> f32x4<Self> {
299 unsafe {
300 let c1 = vcvtq_s32_f32(a.into());
301 let c2 = vcvtq_f32_s32(c1);
302 vsubq_f32(a.into(), c2).simd_into(self)
303 }
304 }
305 #[inline(always)]
306 fn trunc_f32x4(self, a: f32x4<Self>) -> f32x4<Self> {
307 unsafe { vrndq_f32(a.into()).simd_into(self) }
308 }
309 #[inline(always)]
310 fn select_f32x4(self, a: mask32x4<Self>, b: f32x4<Self>, c: f32x4<Self>) -> f32x4<Self> {
311 unsafe { vbslq_f32(vreinterpretq_u32_s32(a.into()), b.into(), c.into()).simd_into(self) }
312 }
313 #[inline(always)]
314 fn combine_f32x4(self, a: f32x4<Self>, b: f32x4<Self>) -> f32x8<Self> {
315 f32x8 {
316 val: crate::support::Aligned256(float32x4x2_t(a.val.0, b.val.0)),
317 simd: self,
318 }
319 }
320 #[inline(always)]
321 fn reinterpret_f64_f32x4(self, a: f32x4<Self>) -> f64x2<Self> {
322 unsafe { vreinterpretq_f64_f32(a.into()).simd_into(self) }
323 }
324 #[inline(always)]
325 fn reinterpret_i32_f32x4(self, a: f32x4<Self>) -> i32x4<Self> {
326 unsafe { vreinterpretq_s32_f32(a.into()).simd_into(self) }
327 }
328 #[inline(always)]
329 fn reinterpret_u8_f32x4(self, a: f32x4<Self>) -> u8x16<Self> {
330 unsafe { vreinterpretq_u8_f32(a.into()).simd_into(self) }
331 }
332 #[inline(always)]
333 fn reinterpret_u32_f32x4(self, a: f32x4<Self>) -> u32x4<Self> {
334 unsafe { vreinterpretq_u32_f32(a.into()).simd_into(self) }
335 }
336 #[inline(always)]
337 fn cvt_u32_f32x4(self, a: f32x4<Self>) -> u32x4<Self> {
338 unsafe { vcvtq_u32_f32(a.into()).simd_into(self) }
339 }
340 #[inline(always)]
341 fn cvt_u32_precise_f32x4(self, a: f32x4<Self>) -> u32x4<Self> {
342 self.cvt_u32_f32x4(a)
343 }
344 #[inline(always)]
345 fn cvt_i32_f32x4(self, a: f32x4<Self>) -> i32x4<Self> {
346 unsafe { vcvtq_s32_f32(a.into()).simd_into(self) }
347 }
348 #[inline(always)]
349 fn cvt_i32_precise_f32x4(self, a: f32x4<Self>) -> i32x4<Self> {
350 self.cvt_i32_f32x4(a)
351 }
352 #[inline(always)]
353 fn splat_i8x16(self, val: i8) -> i8x16<Self> {
354 unsafe { vdupq_n_s8(val).simd_into(self) }
355 }
356 #[inline(always)]
357 fn load_array_i8x16(self, val: [i8; 16usize]) -> i8x16<Self> {
358 i8x16 {
359 val: unsafe { core::mem::transmute_copy(&val) },
360 simd: self,
361 }
362 }
363 #[inline(always)]
364 fn load_array_ref_i8x16(self, val: &[i8; 16usize]) -> i8x16<Self> {
365 i8x16 {
366 val: unsafe { core::mem::transmute_copy(val) },
367 simd: self,
368 }
369 }
370 #[inline(always)]
371 fn as_array_i8x16(self, a: i8x16<Self>) -> [i8; 16usize] {
372 unsafe { core::mem::transmute::<int8x16_t, [i8; 16usize]>(a.val.0) }
373 }
374 #[inline(always)]
375 fn as_array_ref_i8x16(self, a: &i8x16<Self>) -> &[i8; 16usize] {
376 unsafe { core::mem::transmute::<&int8x16_t, &[i8; 16usize]>(&a.val.0) }
377 }
378 #[inline(always)]
379 fn as_array_mut_i8x16(self, a: &mut i8x16<Self>) -> &mut [i8; 16usize] {
380 unsafe { core::mem::transmute::<&mut int8x16_t, &mut [i8; 16usize]>(&mut a.val.0) }
381 }
382 #[inline(always)]
383 fn store_array_i8x16(self, a: i8x16<Self>, dest: &mut [i8; 16usize]) -> () {
384 unsafe {
385 core::ptr::copy_nonoverlapping(
386 (&raw const a.val.0) as *const i8,
387 dest.as_mut_ptr(),
388 16usize,
389 );
390 }
391 }
392 #[inline(always)]
393 fn cvt_from_bytes_i8x16(self, a: u8x16<Self>) -> i8x16<Self> {
394 unsafe {
395 i8x16 {
396 val: core::mem::transmute(a.val),
397 simd: self,
398 }
399 }
400 }
401 #[inline(always)]
402 fn cvt_to_bytes_i8x16(self, a: i8x16<Self>) -> u8x16<Self> {
403 unsafe {
404 u8x16 {
405 val: core::mem::transmute(a.val),
406 simd: self,
407 }
408 }
409 }
410 #[inline(always)]
411 fn slide_i8x16<const SHIFT: usize>(self, a: i8x16<Self>, b: i8x16<Self>) -> i8x16<Self> {
412 if SHIFT >= 16usize {
413 return b;
414 }
415 let result = unsafe {
416 dyn_vext_128(
417 self.cvt_to_bytes_i8x16(a).val.0,
418 self.cvt_to_bytes_i8x16(b).val.0,
419 SHIFT,
420 )
421 };
422 self.cvt_from_bytes_i8x16(u8x16 {
423 val: crate::support::Aligned128(result),
424 simd: self,
425 })
426 }
427 #[inline(always)]
428 fn slide_within_blocks_i8x16<const SHIFT: usize>(
429 self,
430 a: i8x16<Self>,
431 b: i8x16<Self>,
432 ) -> i8x16<Self> {
433 self.slide_i8x16::<SHIFT>(a, b)
434 }
435 #[inline(always)]
436 fn add_i8x16(self, a: i8x16<Self>, b: i8x16<Self>) -> i8x16<Self> {
437 unsafe { vaddq_s8(a.into(), b.into()).simd_into(self) }
438 }
439 #[inline(always)]
440 fn sub_i8x16(self, a: i8x16<Self>, b: i8x16<Self>) -> i8x16<Self> {
441 unsafe { vsubq_s8(a.into(), b.into()).simd_into(self) }
442 }
443 #[inline(always)]
444 fn mul_i8x16(self, a: i8x16<Self>, b: i8x16<Self>) -> i8x16<Self> {
445 unsafe { vmulq_s8(a.into(), b.into()).simd_into(self) }
446 }
447 #[inline(always)]
448 fn and_i8x16(self, a: i8x16<Self>, b: i8x16<Self>) -> i8x16<Self> {
449 unsafe { vandq_s8(a.into(), b.into()).simd_into(self) }
450 }
451 #[inline(always)]
452 fn or_i8x16(self, a: i8x16<Self>, b: i8x16<Self>) -> i8x16<Self> {
453 unsafe { vorrq_s8(a.into(), b.into()).simd_into(self) }
454 }
455 #[inline(always)]
456 fn xor_i8x16(self, a: i8x16<Self>, b: i8x16<Self>) -> i8x16<Self> {
457 unsafe { veorq_s8(a.into(), b.into()).simd_into(self) }
458 }
459 #[inline(always)]
460 fn not_i8x16(self, a: i8x16<Self>) -> i8x16<Self> {
461 unsafe { vmvnq_s8(a.into()).simd_into(self) }
462 }
463 #[inline(always)]
464 fn shl_i8x16(self, a: i8x16<Self>, shift: u32) -> i8x16<Self> {
465 unsafe { vshlq_s8(a.into(), vdupq_n_s8(shift as i8)).simd_into(self) }
466 }
467 #[inline(always)]
468 fn shlv_i8x16(self, a: i8x16<Self>, b: i8x16<Self>) -> i8x16<Self> {
469 unsafe { vshlq_s8(a.into(), b.into()).simd_into(self) }
470 }
471 #[inline(always)]
472 fn shr_i8x16(self, a: i8x16<Self>, shift: u32) -> i8x16<Self> {
473 unsafe { vshlq_s8(a.into(), vdupq_n_s8(-(shift as i8))).simd_into(self) }
474 }
475 #[inline(always)]
476 fn shrv_i8x16(self, a: i8x16<Self>, b: i8x16<Self>) -> i8x16<Self> {
477 unsafe { vshlq_s8(a.into(), vnegq_s8(b.into())).simd_into(self) }
478 }
479 #[inline(always)]
480 fn simd_eq_i8x16(self, a: i8x16<Self>, b: i8x16<Self>) -> mask8x16<Self> {
481 unsafe { vreinterpretq_s8_u8(vceqq_s8(a.into(), b.into())).simd_into(self) }
482 }
483 #[inline(always)]
484 fn simd_lt_i8x16(self, a: i8x16<Self>, b: i8x16<Self>) -> mask8x16<Self> {
485 unsafe { vreinterpretq_s8_u8(vcltq_s8(a.into(), b.into())).simd_into(self) }
486 }
487 #[inline(always)]
488 fn simd_le_i8x16(self, a: i8x16<Self>, b: i8x16<Self>) -> mask8x16<Self> {
489 unsafe { vreinterpretq_s8_u8(vcleq_s8(a.into(), b.into())).simd_into(self) }
490 }
491 #[inline(always)]
492 fn simd_ge_i8x16(self, a: i8x16<Self>, b: i8x16<Self>) -> mask8x16<Self> {
493 unsafe { vreinterpretq_s8_u8(vcgeq_s8(a.into(), b.into())).simd_into(self) }
494 }
495 #[inline(always)]
496 fn simd_gt_i8x16(self, a: i8x16<Self>, b: i8x16<Self>) -> mask8x16<Self> {
497 unsafe { vreinterpretq_s8_u8(vcgtq_s8(a.into(), b.into())).simd_into(self) }
498 }
499 #[inline(always)]
500 fn zip_low_i8x16(self, a: i8x16<Self>, b: i8x16<Self>) -> i8x16<Self> {
501 let x = a.into();
502 let y = b.into();
503 unsafe { vzip1q_s8(x, y).simd_into(self) }
504 }
505 #[inline(always)]
506 fn zip_high_i8x16(self, a: i8x16<Self>, b: i8x16<Self>) -> i8x16<Self> {
507 let x = a.into();
508 let y = b.into();
509 unsafe { vzip2q_s8(x, y).simd_into(self) }
510 }
511 #[inline(always)]
512 fn unzip_low_i8x16(self, a: i8x16<Self>, b: i8x16<Self>) -> i8x16<Self> {
513 let x = a.into();
514 let y = b.into();
515 unsafe { vuzp1q_s8(x, y).simd_into(self) }
516 }
517 #[inline(always)]
518 fn unzip_high_i8x16(self, a: i8x16<Self>, b: i8x16<Self>) -> i8x16<Self> {
519 let x = a.into();
520 let y = b.into();
521 unsafe { vuzp2q_s8(x, y).simd_into(self) }
522 }
523 #[inline(always)]
524 fn interleave_i8x16(self, a: i8x16<Self>, b: i8x16<Self>) -> (i8x16<Self>, i8x16<Self>) {
525 (self.zip_low_i8x16(a, b), self.zip_high_i8x16(a, b))
526 }
527 #[inline(always)]
528 fn deinterleave_i8x16(self, a: i8x16<Self>, b: i8x16<Self>) -> (i8x16<Self>, i8x16<Self>) {
529 (self.unzip_low_i8x16(a, b), self.unzip_high_i8x16(a, b))
530 }
531 #[inline(always)]
532 fn select_i8x16(self, a: mask8x16<Self>, b: i8x16<Self>, c: i8x16<Self>) -> i8x16<Self> {
533 unsafe { vbslq_s8(vreinterpretq_u8_s8(a.into()), b.into(), c.into()).simd_into(self) }
534 }
535 #[inline(always)]
536 fn min_i8x16(self, a: i8x16<Self>, b: i8x16<Self>) -> i8x16<Self> {
537 unsafe { vminq_s8(a.into(), b.into()).simd_into(self) }
538 }
539 #[inline(always)]
540 fn max_i8x16(self, a: i8x16<Self>, b: i8x16<Self>) -> i8x16<Self> {
541 unsafe { vmaxq_s8(a.into(), b.into()).simd_into(self) }
542 }
543 #[inline(always)]
544 fn combine_i8x16(self, a: i8x16<Self>, b: i8x16<Self>) -> i8x32<Self> {
545 i8x32 {
546 val: crate::support::Aligned256(int8x16x2_t(a.val.0, b.val.0)),
547 simd: self,
548 }
549 }
550 #[inline(always)]
551 fn neg_i8x16(self, a: i8x16<Self>) -> i8x16<Self> {
552 unsafe { vnegq_s8(a.into()).simd_into(self) }
553 }
554 #[inline(always)]
555 fn reinterpret_u8_i8x16(self, a: i8x16<Self>) -> u8x16<Self> {
556 unsafe { vreinterpretq_u8_s8(a.into()).simd_into(self) }
557 }
558 #[inline(always)]
559 fn reinterpret_u32_i8x16(self, a: i8x16<Self>) -> u32x4<Self> {
560 unsafe { vreinterpretq_u32_s8(a.into()).simd_into(self) }
561 }
562 #[inline(always)]
563 fn splat_u8x16(self, val: u8) -> u8x16<Self> {
564 unsafe { vdupq_n_u8(val).simd_into(self) }
565 }
566 #[inline(always)]
567 fn load_array_u8x16(self, val: [u8; 16usize]) -> u8x16<Self> {
568 u8x16 {
569 val: unsafe { core::mem::transmute_copy(&val) },
570 simd: self,
571 }
572 }
573 #[inline(always)]
574 fn load_array_ref_u8x16(self, val: &[u8; 16usize]) -> u8x16<Self> {
575 u8x16 {
576 val: unsafe { core::mem::transmute_copy(val) },
577 simd: self,
578 }
579 }
580 #[inline(always)]
581 fn as_array_u8x16(self, a: u8x16<Self>) -> [u8; 16usize] {
582 unsafe { core::mem::transmute::<uint8x16_t, [u8; 16usize]>(a.val.0) }
583 }
584 #[inline(always)]
585 fn as_array_ref_u8x16(self, a: &u8x16<Self>) -> &[u8; 16usize] {
586 unsafe { core::mem::transmute::<&uint8x16_t, &[u8; 16usize]>(&a.val.0) }
587 }
588 #[inline(always)]
589 fn as_array_mut_u8x16(self, a: &mut u8x16<Self>) -> &mut [u8; 16usize] {
590 unsafe { core::mem::transmute::<&mut uint8x16_t, &mut [u8; 16usize]>(&mut a.val.0) }
591 }
592 #[inline(always)]
593 fn store_array_u8x16(self, a: u8x16<Self>, dest: &mut [u8; 16usize]) -> () {
594 unsafe {
595 core::ptr::copy_nonoverlapping(
596 (&raw const a.val.0) as *const u8,
597 dest.as_mut_ptr(),
598 16usize,
599 );
600 }
601 }
602 #[inline(always)]
603 fn cvt_from_bytes_u8x16(self, a: u8x16<Self>) -> u8x16<Self> {
604 unsafe {
605 u8x16 {
606 val: core::mem::transmute(a.val),
607 simd: self,
608 }
609 }
610 }
611 #[inline(always)]
612 fn cvt_to_bytes_u8x16(self, a: u8x16<Self>) -> u8x16<Self> {
613 unsafe {
614 u8x16 {
615 val: core::mem::transmute(a.val),
616 simd: self,
617 }
618 }
619 }
620 #[inline(always)]
621 fn slide_u8x16<const SHIFT: usize>(self, a: u8x16<Self>, b: u8x16<Self>) -> u8x16<Self> {
622 if SHIFT >= 16usize {
623 return b;
624 }
625 let result = unsafe {
626 dyn_vext_128(
627 self.cvt_to_bytes_u8x16(a).val.0,
628 self.cvt_to_bytes_u8x16(b).val.0,
629 SHIFT,
630 )
631 };
632 self.cvt_from_bytes_u8x16(u8x16 {
633 val: crate::support::Aligned128(result),
634 simd: self,
635 })
636 }
637 #[inline(always)]
638 fn slide_within_blocks_u8x16<const SHIFT: usize>(
639 self,
640 a: u8x16<Self>,
641 b: u8x16<Self>,
642 ) -> u8x16<Self> {
643 self.slide_u8x16::<SHIFT>(a, b)
644 }
645 #[inline(always)]
646 fn add_u8x16(self, a: u8x16<Self>, b: u8x16<Self>) -> u8x16<Self> {
647 unsafe { vaddq_u8(a.into(), b.into()).simd_into(self) }
648 }
649 #[inline(always)]
650 fn sub_u8x16(self, a: u8x16<Self>, b: u8x16<Self>) -> u8x16<Self> {
651 unsafe { vsubq_u8(a.into(), b.into()).simd_into(self) }
652 }
653 #[inline(always)]
654 fn mul_u8x16(self, a: u8x16<Self>, b: u8x16<Self>) -> u8x16<Self> {
655 unsafe { vmulq_u8(a.into(), b.into()).simd_into(self) }
656 }
657 #[inline(always)]
658 fn and_u8x16(self, a: u8x16<Self>, b: u8x16<Self>) -> u8x16<Self> {
659 unsafe { vandq_u8(a.into(), b.into()).simd_into(self) }
660 }
661 #[inline(always)]
662 fn or_u8x16(self, a: u8x16<Self>, b: u8x16<Self>) -> u8x16<Self> {
663 unsafe { vorrq_u8(a.into(), b.into()).simd_into(self) }
664 }
665 #[inline(always)]
666 fn xor_u8x16(self, a: u8x16<Self>, b: u8x16<Self>) -> u8x16<Self> {
667 unsafe { veorq_u8(a.into(), b.into()).simd_into(self) }
668 }
669 #[inline(always)]
670 fn not_u8x16(self, a: u8x16<Self>) -> u8x16<Self> {
671 unsafe { vmvnq_u8(a.into()).simd_into(self) }
672 }
673 #[inline(always)]
674 fn shl_u8x16(self, a: u8x16<Self>, shift: u32) -> u8x16<Self> {
675 unsafe { vshlq_u8(a.into(), vdupq_n_s8(shift as i8)).simd_into(self) }
676 }
677 #[inline(always)]
678 fn shlv_u8x16(self, a: u8x16<Self>, b: u8x16<Self>) -> u8x16<Self> {
679 unsafe { vshlq_u8(a.into(), vreinterpretq_s8_u8(b.into())).simd_into(self) }
680 }
681 #[inline(always)]
682 fn shr_u8x16(self, a: u8x16<Self>, shift: u32) -> u8x16<Self> {
683 unsafe { vshlq_u8(a.into(), vdupq_n_s8(-(shift as i8))).simd_into(self) }
684 }
685 #[inline(always)]
686 fn shrv_u8x16(self, a: u8x16<Self>, b: u8x16<Self>) -> u8x16<Self> {
687 unsafe { vshlq_u8(a.into(), vnegq_s8(vreinterpretq_s8_u8(b.into()))).simd_into(self) }
688 }
689 #[inline(always)]
690 fn simd_eq_u8x16(self, a: u8x16<Self>, b: u8x16<Self>) -> mask8x16<Self> {
691 unsafe { vreinterpretq_s8_u8(vceqq_u8(a.into(), b.into())).simd_into(self) }
692 }
693 #[inline(always)]
694 fn simd_lt_u8x16(self, a: u8x16<Self>, b: u8x16<Self>) -> mask8x16<Self> {
695 unsafe { vreinterpretq_s8_u8(vcltq_u8(a.into(), b.into())).simd_into(self) }
696 }
697 #[inline(always)]
698 fn simd_le_u8x16(self, a: u8x16<Self>, b: u8x16<Self>) -> mask8x16<Self> {
699 unsafe { vreinterpretq_s8_u8(vcleq_u8(a.into(), b.into())).simd_into(self) }
700 }
701 #[inline(always)]
702 fn simd_ge_u8x16(self, a: u8x16<Self>, b: u8x16<Self>) -> mask8x16<Self> {
703 unsafe { vreinterpretq_s8_u8(vcgeq_u8(a.into(), b.into())).simd_into(self) }
704 }
705 #[inline(always)]
706 fn simd_gt_u8x16(self, a: u8x16<Self>, b: u8x16<Self>) -> mask8x16<Self> {
707 unsafe { vreinterpretq_s8_u8(vcgtq_u8(a.into(), b.into())).simd_into(self) }
708 }
709 #[inline(always)]
710 fn zip_low_u8x16(self, a: u8x16<Self>, b: u8x16<Self>) -> u8x16<Self> {
711 let x = a.into();
712 let y = b.into();
713 unsafe { vzip1q_u8(x, y).simd_into(self) }
714 }
715 #[inline(always)]
716 fn zip_high_u8x16(self, a: u8x16<Self>, b: u8x16<Self>) -> u8x16<Self> {
717 let x = a.into();
718 let y = b.into();
719 unsafe { vzip2q_u8(x, y).simd_into(self) }
720 }
721 #[inline(always)]
722 fn unzip_low_u8x16(self, a: u8x16<Self>, b: u8x16<Self>) -> u8x16<Self> {
723 let x = a.into();
724 let y = b.into();
725 unsafe { vuzp1q_u8(x, y).simd_into(self) }
726 }
727 #[inline(always)]
728 fn unzip_high_u8x16(self, a: u8x16<Self>, b: u8x16<Self>) -> u8x16<Self> {
729 let x = a.into();
730 let y = b.into();
731 unsafe { vuzp2q_u8(x, y).simd_into(self) }
732 }
733 #[inline(always)]
734 fn interleave_u8x16(self, a: u8x16<Self>, b: u8x16<Self>) -> (u8x16<Self>, u8x16<Self>) {
735 (self.zip_low_u8x16(a, b), self.zip_high_u8x16(a, b))
736 }
737 #[inline(always)]
738 fn deinterleave_u8x16(self, a: u8x16<Self>, b: u8x16<Self>) -> (u8x16<Self>, u8x16<Self>) {
739 (self.unzip_low_u8x16(a, b), self.unzip_high_u8x16(a, b))
740 }
741 #[inline(always)]
742 fn select_u8x16(self, a: mask8x16<Self>, b: u8x16<Self>, c: u8x16<Self>) -> u8x16<Self> {
743 unsafe { vbslq_u8(vreinterpretq_u8_s8(a.into()), b.into(), c.into()).simd_into(self) }
744 }
745 #[inline(always)]
746 fn min_u8x16(self, a: u8x16<Self>, b: u8x16<Self>) -> u8x16<Self> {
747 unsafe { vminq_u8(a.into(), b.into()).simd_into(self) }
748 }
749 #[inline(always)]
750 fn max_u8x16(self, a: u8x16<Self>, b: u8x16<Self>) -> u8x16<Self> {
751 unsafe { vmaxq_u8(a.into(), b.into()).simd_into(self) }
752 }
753 #[inline(always)]
754 fn combine_u8x16(self, a: u8x16<Self>, b: u8x16<Self>) -> u8x32<Self> {
755 u8x32 {
756 val: crate::support::Aligned256(uint8x16x2_t(a.val.0, b.val.0)),
757 simd: self,
758 }
759 }
760 #[inline(always)]
761 fn widen_u8x16(self, a: u8x16<Self>) -> u16x16<Self> {
762 unsafe {
763 let low = vmovl_u8(vget_low_u8(a.into()));
764 let high = vmovl_u8(vget_high_u8(a.into()));
765 uint16x8x2_t(low, high).simd_into(self)
766 }
767 }
768 #[inline(always)]
769 fn reinterpret_u32_u8x16(self, a: u8x16<Self>) -> u32x4<Self> {
770 unsafe { vreinterpretq_u32_u8(a.into()).simd_into(self) }
771 }
772 #[inline(always)]
773 fn splat_mask8x16(self, val: i8) -> mask8x16<Self> {
774 unsafe { vdupq_n_s8(val).simd_into(self) }
775 }
776 #[inline(always)]
777 fn load_array_mask8x16(self, val: [i8; 16usize]) -> mask8x16<Self> {
778 mask8x16 {
779 val: unsafe { core::mem::transmute_copy(&val) },
780 simd: self,
781 }
782 }
783 #[inline(always)]
784 fn load_array_ref_mask8x16(self, val: &[i8; 16usize]) -> mask8x16<Self> {
785 mask8x16 {
786 val: unsafe { core::mem::transmute_copy(val) },
787 simd: self,
788 }
789 }
790 #[inline(always)]
791 fn as_array_mask8x16(self, a: mask8x16<Self>) -> [i8; 16usize] {
792 unsafe { core::mem::transmute::<int8x16_t, [i8; 16usize]>(a.val.0) }
793 }
794 #[inline(always)]
795 fn as_array_ref_mask8x16(self, a: &mask8x16<Self>) -> &[i8; 16usize] {
796 unsafe { core::mem::transmute::<&int8x16_t, &[i8; 16usize]>(&a.val.0) }
797 }
798 #[inline(always)]
799 fn as_array_mut_mask8x16(self, a: &mut mask8x16<Self>) -> &mut [i8; 16usize] {
800 unsafe { core::mem::transmute::<&mut int8x16_t, &mut [i8; 16usize]>(&mut a.val.0) }
801 }
802 #[inline(always)]
803 fn store_array_mask8x16(self, a: mask8x16<Self>, dest: &mut [i8; 16usize]) -> () {
804 unsafe {
805 core::ptr::copy_nonoverlapping(
806 (&raw const a.val.0) as *const i8,
807 dest.as_mut_ptr(),
808 16usize,
809 );
810 }
811 }
812 #[inline(always)]
813 fn cvt_from_bytes_mask8x16(self, a: u8x16<Self>) -> mask8x16<Self> {
814 unsafe {
815 mask8x16 {
816 val: core::mem::transmute(a.val),
817 simd: self,
818 }
819 }
820 }
821 #[inline(always)]
822 fn cvt_to_bytes_mask8x16(self, a: mask8x16<Self>) -> u8x16<Self> {
823 unsafe {
824 u8x16 {
825 val: core::mem::transmute(a.val),
826 simd: self,
827 }
828 }
829 }
830 #[inline(always)]
831 fn slide_mask8x16<const SHIFT: usize>(
832 self,
833 a: mask8x16<Self>,
834 b: mask8x16<Self>,
835 ) -> mask8x16<Self> {
836 if SHIFT >= 16usize {
837 return b;
838 }
839 let result = unsafe {
840 dyn_vext_128(
841 self.cvt_to_bytes_mask8x16(a).val.0,
842 self.cvt_to_bytes_mask8x16(b).val.0,
843 SHIFT,
844 )
845 };
846 self.cvt_from_bytes_mask8x16(u8x16 {
847 val: crate::support::Aligned128(result),
848 simd: self,
849 })
850 }
851 #[inline(always)]
852 fn slide_within_blocks_mask8x16<const SHIFT: usize>(
853 self,
854 a: mask8x16<Self>,
855 b: mask8x16<Self>,
856 ) -> mask8x16<Self> {
857 self.slide_mask8x16::<SHIFT>(a, b)
858 }
859 #[inline(always)]
860 fn and_mask8x16(self, a: mask8x16<Self>, b: mask8x16<Self>) -> mask8x16<Self> {
861 unsafe { vandq_s8(a.into(), b.into()).simd_into(self) }
862 }
863 #[inline(always)]
864 fn or_mask8x16(self, a: mask8x16<Self>, b: mask8x16<Self>) -> mask8x16<Self> {
865 unsafe { vorrq_s8(a.into(), b.into()).simd_into(self) }
866 }
867 #[inline(always)]
868 fn xor_mask8x16(self, a: mask8x16<Self>, b: mask8x16<Self>) -> mask8x16<Self> {
869 unsafe { veorq_s8(a.into(), b.into()).simd_into(self) }
870 }
871 #[inline(always)]
872 fn not_mask8x16(self, a: mask8x16<Self>) -> mask8x16<Self> {
873 unsafe { vmvnq_s8(a.into()).simd_into(self) }
874 }
875 #[inline(always)]
876 fn select_mask8x16(
877 self,
878 a: mask8x16<Self>,
879 b: mask8x16<Self>,
880 c: mask8x16<Self>,
881 ) -> mask8x16<Self> {
882 unsafe { vbslq_s8(vreinterpretq_u8_s8(a.into()), b.into(), c.into()).simd_into(self) }
883 }
884 #[inline(always)]
885 fn simd_eq_mask8x16(self, a: mask8x16<Self>, b: mask8x16<Self>) -> mask8x16<Self> {
886 unsafe { vreinterpretq_s8_u8(vceqq_s8(a.into(), b.into())).simd_into(self) }
887 }
888 #[inline(always)]
889 fn any_true_mask8x16(self, a: mask8x16<Self>) -> bool {
890 unsafe { vmaxvq_u32(vreinterpretq_u32_s8(a.into())) != 0 }
891 }
892 #[inline(always)]
893 fn all_true_mask8x16(self, a: mask8x16<Self>) -> bool {
894 unsafe { vminvq_u32(vreinterpretq_u32_s8(a.into())) == 0xffffffff }
895 }
896 #[inline(always)]
897 fn any_false_mask8x16(self, a: mask8x16<Self>) -> bool {
898 unsafe { vminvq_u32(vreinterpretq_u32_s8(a.into())) != 0xffffffff }
899 }
900 #[inline(always)]
901 fn all_false_mask8x16(self, a: mask8x16<Self>) -> bool {
902 unsafe { vmaxvq_u32(vreinterpretq_u32_s8(a.into())) == 0 }
903 }
904 #[inline(always)]
905 fn combine_mask8x16(self, a: mask8x16<Self>, b: mask8x16<Self>) -> mask8x32<Self> {
906 mask8x32 {
907 val: crate::support::Aligned256(int8x16x2_t(a.val.0, b.val.0)),
908 simd: self,
909 }
910 }
911 #[inline(always)]
912 fn splat_i16x8(self, val: i16) -> i16x8<Self> {
913 unsafe { vdupq_n_s16(val).simd_into(self) }
914 }
915 #[inline(always)]
916 fn load_array_i16x8(self, val: [i16; 8usize]) -> i16x8<Self> {
917 i16x8 {
918 val: unsafe { core::mem::transmute_copy(&val) },
919 simd: self,
920 }
921 }
922 #[inline(always)]
923 fn load_array_ref_i16x8(self, val: &[i16; 8usize]) -> i16x8<Self> {
924 i16x8 {
925 val: unsafe { core::mem::transmute_copy(val) },
926 simd: self,
927 }
928 }
929 #[inline(always)]
930 fn as_array_i16x8(self, a: i16x8<Self>) -> [i16; 8usize] {
931 unsafe { core::mem::transmute::<int16x8_t, [i16; 8usize]>(a.val.0) }
932 }
933 #[inline(always)]
934 fn as_array_ref_i16x8(self, a: &i16x8<Self>) -> &[i16; 8usize] {
935 unsafe { core::mem::transmute::<&int16x8_t, &[i16; 8usize]>(&a.val.0) }
936 }
937 #[inline(always)]
938 fn as_array_mut_i16x8(self, a: &mut i16x8<Self>) -> &mut [i16; 8usize] {
939 unsafe { core::mem::transmute::<&mut int16x8_t, &mut [i16; 8usize]>(&mut a.val.0) }
940 }
941 #[inline(always)]
942 fn store_array_i16x8(self, a: i16x8<Self>, dest: &mut [i16; 8usize]) -> () {
943 unsafe {
944 core::ptr::copy_nonoverlapping(
945 (&raw const a.val.0) as *const i16,
946 dest.as_mut_ptr(),
947 8usize,
948 );
949 }
950 }
951 #[inline(always)]
952 fn cvt_from_bytes_i16x8(self, a: u8x16<Self>) -> i16x8<Self> {
953 unsafe {
954 i16x8 {
955 val: core::mem::transmute(a.val),
956 simd: self,
957 }
958 }
959 }
960 #[inline(always)]
961 fn cvt_to_bytes_i16x8(self, a: i16x8<Self>) -> u8x16<Self> {
962 unsafe {
963 u8x16 {
964 val: core::mem::transmute(a.val),
965 simd: self,
966 }
967 }
968 }
969 #[inline(always)]
970 fn slide_i16x8<const SHIFT: usize>(self, a: i16x8<Self>, b: i16x8<Self>) -> i16x8<Self> {
971 if SHIFT >= 8usize {
972 return b;
973 }
974 let result = unsafe {
975 dyn_vext_128(
976 self.cvt_to_bytes_i16x8(a).val.0,
977 self.cvt_to_bytes_i16x8(b).val.0,
978 SHIFT * 2usize,
979 )
980 };
981 self.cvt_from_bytes_i16x8(u8x16 {
982 val: crate::support::Aligned128(result),
983 simd: self,
984 })
985 }
986 #[inline(always)]
987 fn slide_within_blocks_i16x8<const SHIFT: usize>(
988 self,
989 a: i16x8<Self>,
990 b: i16x8<Self>,
991 ) -> i16x8<Self> {
992 self.slide_i16x8::<SHIFT>(a, b)
993 }
994 #[inline(always)]
995 fn add_i16x8(self, a: i16x8<Self>, b: i16x8<Self>) -> i16x8<Self> {
996 unsafe { vaddq_s16(a.into(), b.into()).simd_into(self) }
997 }
998 #[inline(always)]
999 fn sub_i16x8(self, a: i16x8<Self>, b: i16x8<Self>) -> i16x8<Self> {
1000 unsafe { vsubq_s16(a.into(), b.into()).simd_into(self) }
1001 }
1002 #[inline(always)]
1003 fn mul_i16x8(self, a: i16x8<Self>, b: i16x8<Self>) -> i16x8<Self> {
1004 unsafe { vmulq_s16(a.into(), b.into()).simd_into(self) }
1005 }
1006 #[inline(always)]
1007 fn and_i16x8(self, a: i16x8<Self>, b: i16x8<Self>) -> i16x8<Self> {
1008 unsafe { vandq_s16(a.into(), b.into()).simd_into(self) }
1009 }
1010 #[inline(always)]
1011 fn or_i16x8(self, a: i16x8<Self>, b: i16x8<Self>) -> i16x8<Self> {
1012 unsafe { vorrq_s16(a.into(), b.into()).simd_into(self) }
1013 }
1014 #[inline(always)]
1015 fn xor_i16x8(self, a: i16x8<Self>, b: i16x8<Self>) -> i16x8<Self> {
1016 unsafe { veorq_s16(a.into(), b.into()).simd_into(self) }
1017 }
1018 #[inline(always)]
1019 fn not_i16x8(self, a: i16x8<Self>) -> i16x8<Self> {
1020 unsafe { vmvnq_s16(a.into()).simd_into(self) }
1021 }
1022 #[inline(always)]
1023 fn shl_i16x8(self, a: i16x8<Self>, shift: u32) -> i16x8<Self> {
1024 unsafe { vshlq_s16(a.into(), vdupq_n_s16(shift as i16)).simd_into(self) }
1025 }
1026 #[inline(always)]
1027 fn shlv_i16x8(self, a: i16x8<Self>, b: i16x8<Self>) -> i16x8<Self> {
1028 unsafe { vshlq_s16(a.into(), b.into()).simd_into(self) }
1029 }
1030 #[inline(always)]
1031 fn shr_i16x8(self, a: i16x8<Self>, shift: u32) -> i16x8<Self> {
1032 unsafe { vshlq_s16(a.into(), vdupq_n_s16(-(shift as i16))).simd_into(self) }
1033 }
1034 #[inline(always)]
1035 fn shrv_i16x8(self, a: i16x8<Self>, b: i16x8<Self>) -> i16x8<Self> {
1036 unsafe { vshlq_s16(a.into(), vnegq_s16(b.into())).simd_into(self) }
1037 }
1038 #[inline(always)]
1039 fn simd_eq_i16x8(self, a: i16x8<Self>, b: i16x8<Self>) -> mask16x8<Self> {
1040 unsafe { vreinterpretq_s16_u16(vceqq_s16(a.into(), b.into())).simd_into(self) }
1041 }
1042 #[inline(always)]
1043 fn simd_lt_i16x8(self, a: i16x8<Self>, b: i16x8<Self>) -> mask16x8<Self> {
1044 unsafe { vreinterpretq_s16_u16(vcltq_s16(a.into(), b.into())).simd_into(self) }
1045 }
1046 #[inline(always)]
1047 fn simd_le_i16x8(self, a: i16x8<Self>, b: i16x8<Self>) -> mask16x8<Self> {
1048 unsafe { vreinterpretq_s16_u16(vcleq_s16(a.into(), b.into())).simd_into(self) }
1049 }
1050 #[inline(always)]
1051 fn simd_ge_i16x8(self, a: i16x8<Self>, b: i16x8<Self>) -> mask16x8<Self> {
1052 unsafe { vreinterpretq_s16_u16(vcgeq_s16(a.into(), b.into())).simd_into(self) }
1053 }
1054 #[inline(always)]
1055 fn simd_gt_i16x8(self, a: i16x8<Self>, b: i16x8<Self>) -> mask16x8<Self> {
1056 unsafe { vreinterpretq_s16_u16(vcgtq_s16(a.into(), b.into())).simd_into(self) }
1057 }
1058 #[inline(always)]
1059 fn zip_low_i16x8(self, a: i16x8<Self>, b: i16x8<Self>) -> i16x8<Self> {
1060 let x = a.into();
1061 let y = b.into();
1062 unsafe { vzip1q_s16(x, y).simd_into(self) }
1063 }
1064 #[inline(always)]
1065 fn zip_high_i16x8(self, a: i16x8<Self>, b: i16x8<Self>) -> i16x8<Self> {
1066 let x = a.into();
1067 let y = b.into();
1068 unsafe { vzip2q_s16(x, y).simd_into(self) }
1069 }
1070 #[inline(always)]
1071 fn unzip_low_i16x8(self, a: i16x8<Self>, b: i16x8<Self>) -> i16x8<Self> {
1072 let x = a.into();
1073 let y = b.into();
1074 unsafe { vuzp1q_s16(x, y).simd_into(self) }
1075 }
1076 #[inline(always)]
1077 fn unzip_high_i16x8(self, a: i16x8<Self>, b: i16x8<Self>) -> i16x8<Self> {
1078 let x = a.into();
1079 let y = b.into();
1080 unsafe { vuzp2q_s16(x, y).simd_into(self) }
1081 }
1082 #[inline(always)]
1083 fn interleave_i16x8(self, a: i16x8<Self>, b: i16x8<Self>) -> (i16x8<Self>, i16x8<Self>) {
1084 (self.zip_low_i16x8(a, b), self.zip_high_i16x8(a, b))
1085 }
1086 #[inline(always)]
1087 fn deinterleave_i16x8(self, a: i16x8<Self>, b: i16x8<Self>) -> (i16x8<Self>, i16x8<Self>) {
1088 (self.unzip_low_i16x8(a, b), self.unzip_high_i16x8(a, b))
1089 }
1090 #[inline(always)]
1091 fn select_i16x8(self, a: mask16x8<Self>, b: i16x8<Self>, c: i16x8<Self>) -> i16x8<Self> {
1092 unsafe { vbslq_s16(vreinterpretq_u16_s16(a.into()), b.into(), c.into()).simd_into(self) }
1093 }
1094 #[inline(always)]
1095 fn min_i16x8(self, a: i16x8<Self>, b: i16x8<Self>) -> i16x8<Self> {
1096 unsafe { vminq_s16(a.into(), b.into()).simd_into(self) }
1097 }
1098 #[inline(always)]
1099 fn max_i16x8(self, a: i16x8<Self>, b: i16x8<Self>) -> i16x8<Self> {
1100 unsafe { vmaxq_s16(a.into(), b.into()).simd_into(self) }
1101 }
1102 #[inline(always)]
1103 fn combine_i16x8(self, a: i16x8<Self>, b: i16x8<Self>) -> i16x16<Self> {
1104 i16x16 {
1105 val: crate::support::Aligned256(int16x8x2_t(a.val.0, b.val.0)),
1106 simd: self,
1107 }
1108 }
1109 #[inline(always)]
1110 fn neg_i16x8(self, a: i16x8<Self>) -> i16x8<Self> {
1111 unsafe { vnegq_s16(a.into()).simd_into(self) }
1112 }
1113 #[inline(always)]
1114 fn reinterpret_u8_i16x8(self, a: i16x8<Self>) -> u8x16<Self> {
1115 unsafe { vreinterpretq_u8_s16(a.into()).simd_into(self) }
1116 }
1117 #[inline(always)]
1118 fn reinterpret_u32_i16x8(self, a: i16x8<Self>) -> u32x4<Self> {
1119 unsafe { vreinterpretq_u32_s16(a.into()).simd_into(self) }
1120 }
1121 #[inline(always)]
1122 fn splat_u16x8(self, val: u16) -> u16x8<Self> {
1123 unsafe { vdupq_n_u16(val).simd_into(self) }
1124 }
1125 #[inline(always)]
1126 fn load_array_u16x8(self, val: [u16; 8usize]) -> u16x8<Self> {
1127 u16x8 {
1128 val: unsafe { core::mem::transmute_copy(&val) },
1129 simd: self,
1130 }
1131 }
1132 #[inline(always)]
1133 fn load_array_ref_u16x8(self, val: &[u16; 8usize]) -> u16x8<Self> {
1134 u16x8 {
1135 val: unsafe { core::mem::transmute_copy(val) },
1136 simd: self,
1137 }
1138 }
1139 #[inline(always)]
1140 fn as_array_u16x8(self, a: u16x8<Self>) -> [u16; 8usize] {
1141 unsafe { core::mem::transmute::<uint16x8_t, [u16; 8usize]>(a.val.0) }
1142 }
1143 #[inline(always)]
1144 fn as_array_ref_u16x8(self, a: &u16x8<Self>) -> &[u16; 8usize] {
1145 unsafe { core::mem::transmute::<&uint16x8_t, &[u16; 8usize]>(&a.val.0) }
1146 }
1147 #[inline(always)]
1148 fn as_array_mut_u16x8(self, a: &mut u16x8<Self>) -> &mut [u16; 8usize] {
1149 unsafe { core::mem::transmute::<&mut uint16x8_t, &mut [u16; 8usize]>(&mut a.val.0) }
1150 }
1151 #[inline(always)]
1152 fn store_array_u16x8(self, a: u16x8<Self>, dest: &mut [u16; 8usize]) -> () {
1153 unsafe {
1154 core::ptr::copy_nonoverlapping(
1155 (&raw const a.val.0) as *const u16,
1156 dest.as_mut_ptr(),
1157 8usize,
1158 );
1159 }
1160 }
1161 #[inline(always)]
1162 fn cvt_from_bytes_u16x8(self, a: u8x16<Self>) -> u16x8<Self> {
1163 unsafe {
1164 u16x8 {
1165 val: core::mem::transmute(a.val),
1166 simd: self,
1167 }
1168 }
1169 }
1170 #[inline(always)]
1171 fn cvt_to_bytes_u16x8(self, a: u16x8<Self>) -> u8x16<Self> {
1172 unsafe {
1173 u8x16 {
1174 val: core::mem::transmute(a.val),
1175 simd: self,
1176 }
1177 }
1178 }
1179 #[inline(always)]
1180 fn slide_u16x8<const SHIFT: usize>(self, a: u16x8<Self>, b: u16x8<Self>) -> u16x8<Self> {
1181 if SHIFT >= 8usize {
1182 return b;
1183 }
1184 let result = unsafe {
1185 dyn_vext_128(
1186 self.cvt_to_bytes_u16x8(a).val.0,
1187 self.cvt_to_bytes_u16x8(b).val.0,
1188 SHIFT * 2usize,
1189 )
1190 };
1191 self.cvt_from_bytes_u16x8(u8x16 {
1192 val: crate::support::Aligned128(result),
1193 simd: self,
1194 })
1195 }
1196 #[inline(always)]
1197 fn slide_within_blocks_u16x8<const SHIFT: usize>(
1198 self,
1199 a: u16x8<Self>,
1200 b: u16x8<Self>,
1201 ) -> u16x8<Self> {
1202 self.slide_u16x8::<SHIFT>(a, b)
1203 }
1204 #[inline(always)]
1205 fn add_u16x8(self, a: u16x8<Self>, b: u16x8<Self>) -> u16x8<Self> {
1206 unsafe { vaddq_u16(a.into(), b.into()).simd_into(self) }
1207 }
1208 #[inline(always)]
1209 fn sub_u16x8(self, a: u16x8<Self>, b: u16x8<Self>) -> u16x8<Self> {
1210 unsafe { vsubq_u16(a.into(), b.into()).simd_into(self) }
1211 }
1212 #[inline(always)]
1213 fn mul_u16x8(self, a: u16x8<Self>, b: u16x8<Self>) -> u16x8<Self> {
1214 unsafe { vmulq_u16(a.into(), b.into()).simd_into(self) }
1215 }
1216 #[inline(always)]
1217 fn and_u16x8(self, a: u16x8<Self>, b: u16x8<Self>) -> u16x8<Self> {
1218 unsafe { vandq_u16(a.into(), b.into()).simd_into(self) }
1219 }
1220 #[inline(always)]
1221 fn or_u16x8(self, a: u16x8<Self>, b: u16x8<Self>) -> u16x8<Self> {
1222 unsafe { vorrq_u16(a.into(), b.into()).simd_into(self) }
1223 }
1224 #[inline(always)]
1225 fn xor_u16x8(self, a: u16x8<Self>, b: u16x8<Self>) -> u16x8<Self> {
1226 unsafe { veorq_u16(a.into(), b.into()).simd_into(self) }
1227 }
1228 #[inline(always)]
1229 fn not_u16x8(self, a: u16x8<Self>) -> u16x8<Self> {
1230 unsafe { vmvnq_u16(a.into()).simd_into(self) }
1231 }
1232 #[inline(always)]
1233 fn shl_u16x8(self, a: u16x8<Self>, shift: u32) -> u16x8<Self> {
1234 unsafe { vshlq_u16(a.into(), vdupq_n_s16(shift as i16)).simd_into(self) }
1235 }
1236 #[inline(always)]
1237 fn shlv_u16x8(self, a: u16x8<Self>, b: u16x8<Self>) -> u16x8<Self> {
1238 unsafe { vshlq_u16(a.into(), vreinterpretq_s16_u16(b.into())).simd_into(self) }
1239 }
1240 #[inline(always)]
1241 fn shr_u16x8(self, a: u16x8<Self>, shift: u32) -> u16x8<Self> {
1242 unsafe { vshlq_u16(a.into(), vdupq_n_s16(-(shift as i16))).simd_into(self) }
1243 }
1244 #[inline(always)]
1245 fn shrv_u16x8(self, a: u16x8<Self>, b: u16x8<Self>) -> u16x8<Self> {
1246 unsafe { vshlq_u16(a.into(), vnegq_s16(vreinterpretq_s16_u16(b.into()))).simd_into(self) }
1247 }
1248 #[inline(always)]
1249 fn simd_eq_u16x8(self, a: u16x8<Self>, b: u16x8<Self>) -> mask16x8<Self> {
1250 unsafe { vreinterpretq_s16_u16(vceqq_u16(a.into(), b.into())).simd_into(self) }
1251 }
1252 #[inline(always)]
1253 fn simd_lt_u16x8(self, a: u16x8<Self>, b: u16x8<Self>) -> mask16x8<Self> {
1254 unsafe { vreinterpretq_s16_u16(vcltq_u16(a.into(), b.into())).simd_into(self) }
1255 }
1256 #[inline(always)]
1257 fn simd_le_u16x8(self, a: u16x8<Self>, b: u16x8<Self>) -> mask16x8<Self> {
1258 unsafe { vreinterpretq_s16_u16(vcleq_u16(a.into(), b.into())).simd_into(self) }
1259 }
1260 #[inline(always)]
1261 fn simd_ge_u16x8(self, a: u16x8<Self>, b: u16x8<Self>) -> mask16x8<Self> {
1262 unsafe { vreinterpretq_s16_u16(vcgeq_u16(a.into(), b.into())).simd_into(self) }
1263 }
1264 #[inline(always)]
1265 fn simd_gt_u16x8(self, a: u16x8<Self>, b: u16x8<Self>) -> mask16x8<Self> {
1266 unsafe { vreinterpretq_s16_u16(vcgtq_u16(a.into(), b.into())).simd_into(self) }
1267 }
1268 #[inline(always)]
1269 fn zip_low_u16x8(self, a: u16x8<Self>, b: u16x8<Self>) -> u16x8<Self> {
1270 let x = a.into();
1271 let y = b.into();
1272 unsafe { vzip1q_u16(x, y).simd_into(self) }
1273 }
1274 #[inline(always)]
1275 fn zip_high_u16x8(self, a: u16x8<Self>, b: u16x8<Self>) -> u16x8<Self> {
1276 let x = a.into();
1277 let y = b.into();
1278 unsafe { vzip2q_u16(x, y).simd_into(self) }
1279 }
1280 #[inline(always)]
1281 fn unzip_low_u16x8(self, a: u16x8<Self>, b: u16x8<Self>) -> u16x8<Self> {
1282 let x = a.into();
1283 let y = b.into();
1284 unsafe { vuzp1q_u16(x, y).simd_into(self) }
1285 }
1286 #[inline(always)]
1287 fn unzip_high_u16x8(self, a: u16x8<Self>, b: u16x8<Self>) -> u16x8<Self> {
1288 let x = a.into();
1289 let y = b.into();
1290 unsafe { vuzp2q_u16(x, y).simd_into(self) }
1291 }
1292 #[inline(always)]
1293 fn interleave_u16x8(self, a: u16x8<Self>, b: u16x8<Self>) -> (u16x8<Self>, u16x8<Self>) {
1294 (self.zip_low_u16x8(a, b), self.zip_high_u16x8(a, b))
1295 }
1296 #[inline(always)]
1297 fn deinterleave_u16x8(self, a: u16x8<Self>, b: u16x8<Self>) -> (u16x8<Self>, u16x8<Self>) {
1298 (self.unzip_low_u16x8(a, b), self.unzip_high_u16x8(a, b))
1299 }
1300 #[inline(always)]
1301 fn select_u16x8(self, a: mask16x8<Self>, b: u16x8<Self>, c: u16x8<Self>) -> u16x8<Self> {
1302 unsafe { vbslq_u16(vreinterpretq_u16_s16(a.into()), b.into(), c.into()).simd_into(self) }
1303 }
1304 #[inline(always)]
1305 fn min_u16x8(self, a: u16x8<Self>, b: u16x8<Self>) -> u16x8<Self> {
1306 unsafe { vminq_u16(a.into(), b.into()).simd_into(self) }
1307 }
1308 #[inline(always)]
1309 fn max_u16x8(self, a: u16x8<Self>, b: u16x8<Self>) -> u16x8<Self> {
1310 unsafe { vmaxq_u16(a.into(), b.into()).simd_into(self) }
1311 }
1312 #[inline(always)]
1313 fn combine_u16x8(self, a: u16x8<Self>, b: u16x8<Self>) -> u16x16<Self> {
1314 u16x16 {
1315 val: crate::support::Aligned256(uint16x8x2_t(a.val.0, b.val.0)),
1316 simd: self,
1317 }
1318 }
1319 #[inline(always)]
1320 fn reinterpret_u8_u16x8(self, a: u16x8<Self>) -> u8x16<Self> {
1321 unsafe { vreinterpretq_u8_u16(a.into()).simd_into(self) }
1322 }
1323 #[inline(always)]
1324 fn reinterpret_u32_u16x8(self, a: u16x8<Self>) -> u32x4<Self> {
1325 unsafe { vreinterpretq_u32_u16(a.into()).simd_into(self) }
1326 }
1327 #[inline(always)]
1328 fn splat_mask16x8(self, val: i16) -> mask16x8<Self> {
1329 unsafe { vdupq_n_s16(val).simd_into(self) }
1330 }
1331 #[inline(always)]
1332 fn load_array_mask16x8(self, val: [i16; 8usize]) -> mask16x8<Self> {
1333 mask16x8 {
1334 val: unsafe { core::mem::transmute_copy(&val) },
1335 simd: self,
1336 }
1337 }
1338 #[inline(always)]
1339 fn load_array_ref_mask16x8(self, val: &[i16; 8usize]) -> mask16x8<Self> {
1340 mask16x8 {
1341 val: unsafe { core::mem::transmute_copy(val) },
1342 simd: self,
1343 }
1344 }
1345 #[inline(always)]
1346 fn as_array_mask16x8(self, a: mask16x8<Self>) -> [i16; 8usize] {
1347 unsafe { core::mem::transmute::<int16x8_t, [i16; 8usize]>(a.val.0) }
1348 }
1349 #[inline(always)]
1350 fn as_array_ref_mask16x8(self, a: &mask16x8<Self>) -> &[i16; 8usize] {
1351 unsafe { core::mem::transmute::<&int16x8_t, &[i16; 8usize]>(&a.val.0) }
1352 }
1353 #[inline(always)]
1354 fn as_array_mut_mask16x8(self, a: &mut mask16x8<Self>) -> &mut [i16; 8usize] {
1355 unsafe { core::mem::transmute::<&mut int16x8_t, &mut [i16; 8usize]>(&mut a.val.0) }
1356 }
1357 #[inline(always)]
1358 fn store_array_mask16x8(self, a: mask16x8<Self>, dest: &mut [i16; 8usize]) -> () {
1359 unsafe {
1360 core::ptr::copy_nonoverlapping(
1361 (&raw const a.val.0) as *const i16,
1362 dest.as_mut_ptr(),
1363 8usize,
1364 );
1365 }
1366 }
1367 #[inline(always)]
1368 fn cvt_from_bytes_mask16x8(self, a: u8x16<Self>) -> mask16x8<Self> {
1369 unsafe {
1370 mask16x8 {
1371 val: core::mem::transmute(a.val),
1372 simd: self,
1373 }
1374 }
1375 }
1376 #[inline(always)]
1377 fn cvt_to_bytes_mask16x8(self, a: mask16x8<Self>) -> u8x16<Self> {
1378 unsafe {
1379 u8x16 {
1380 val: core::mem::transmute(a.val),
1381 simd: self,
1382 }
1383 }
1384 }
1385 #[inline(always)]
1386 fn slide_mask16x8<const SHIFT: usize>(
1387 self,
1388 a: mask16x8<Self>,
1389 b: mask16x8<Self>,
1390 ) -> mask16x8<Self> {
1391 if SHIFT >= 8usize {
1392 return b;
1393 }
1394 let result = unsafe {
1395 dyn_vext_128(
1396 self.cvt_to_bytes_mask16x8(a).val.0,
1397 self.cvt_to_bytes_mask16x8(b).val.0,
1398 SHIFT * 2usize,
1399 )
1400 };
1401 self.cvt_from_bytes_mask16x8(u8x16 {
1402 val: crate::support::Aligned128(result),
1403 simd: self,
1404 })
1405 }
1406 #[inline(always)]
1407 fn slide_within_blocks_mask16x8<const SHIFT: usize>(
1408 self,
1409 a: mask16x8<Self>,
1410 b: mask16x8<Self>,
1411 ) -> mask16x8<Self> {
1412 self.slide_mask16x8::<SHIFT>(a, b)
1413 }
1414 #[inline(always)]
1415 fn and_mask16x8(self, a: mask16x8<Self>, b: mask16x8<Self>) -> mask16x8<Self> {
1416 unsafe { vandq_s16(a.into(), b.into()).simd_into(self) }
1417 }
1418 #[inline(always)]
1419 fn or_mask16x8(self, a: mask16x8<Self>, b: mask16x8<Self>) -> mask16x8<Self> {
1420 unsafe { vorrq_s16(a.into(), b.into()).simd_into(self) }
1421 }
1422 #[inline(always)]
1423 fn xor_mask16x8(self, a: mask16x8<Self>, b: mask16x8<Self>) -> mask16x8<Self> {
1424 unsafe { veorq_s16(a.into(), b.into()).simd_into(self) }
1425 }
1426 #[inline(always)]
1427 fn not_mask16x8(self, a: mask16x8<Self>) -> mask16x8<Self> {
1428 unsafe { vmvnq_s16(a.into()).simd_into(self) }
1429 }
1430 #[inline(always)]
1431 fn select_mask16x8(
1432 self,
1433 a: mask16x8<Self>,
1434 b: mask16x8<Self>,
1435 c: mask16x8<Self>,
1436 ) -> mask16x8<Self> {
1437 unsafe { vbslq_s16(vreinterpretq_u16_s16(a.into()), b.into(), c.into()).simd_into(self) }
1438 }
1439 #[inline(always)]
1440 fn simd_eq_mask16x8(self, a: mask16x8<Self>, b: mask16x8<Self>) -> mask16x8<Self> {
1441 unsafe { vreinterpretq_s16_u16(vceqq_s16(a.into(), b.into())).simd_into(self) }
1442 }
1443 #[inline(always)]
1444 fn any_true_mask16x8(self, a: mask16x8<Self>) -> bool {
1445 unsafe { vmaxvq_u32(vreinterpretq_u32_s16(a.into())) != 0 }
1446 }
1447 #[inline(always)]
1448 fn all_true_mask16x8(self, a: mask16x8<Self>) -> bool {
1449 unsafe { vminvq_u32(vreinterpretq_u32_s16(a.into())) == 0xffffffff }
1450 }
1451 #[inline(always)]
1452 fn any_false_mask16x8(self, a: mask16x8<Self>) -> bool {
1453 unsafe { vminvq_u32(vreinterpretq_u32_s16(a.into())) != 0xffffffff }
1454 }
1455 #[inline(always)]
1456 fn all_false_mask16x8(self, a: mask16x8<Self>) -> bool {
1457 unsafe { vmaxvq_u32(vreinterpretq_u32_s16(a.into())) == 0 }
1458 }
1459 #[inline(always)]
1460 fn combine_mask16x8(self, a: mask16x8<Self>, b: mask16x8<Self>) -> mask16x16<Self> {
1461 mask16x16 {
1462 val: crate::support::Aligned256(int16x8x2_t(a.val.0, b.val.0)),
1463 simd: self,
1464 }
1465 }
1466 #[inline(always)]
1467 fn splat_i32x4(self, val: i32) -> i32x4<Self> {
1468 unsafe { vdupq_n_s32(val).simd_into(self) }
1469 }
1470 #[inline(always)]
1471 fn load_array_i32x4(self, val: [i32; 4usize]) -> i32x4<Self> {
1472 i32x4 {
1473 val: unsafe { core::mem::transmute_copy(&val) },
1474 simd: self,
1475 }
1476 }
1477 #[inline(always)]
1478 fn load_array_ref_i32x4(self, val: &[i32; 4usize]) -> i32x4<Self> {
1479 i32x4 {
1480 val: unsafe { core::mem::transmute_copy(val) },
1481 simd: self,
1482 }
1483 }
1484 #[inline(always)]
1485 fn as_array_i32x4(self, a: i32x4<Self>) -> [i32; 4usize] {
1486 unsafe { core::mem::transmute::<int32x4_t, [i32; 4usize]>(a.val.0) }
1487 }
1488 #[inline(always)]
1489 fn as_array_ref_i32x4(self, a: &i32x4<Self>) -> &[i32; 4usize] {
1490 unsafe { core::mem::transmute::<&int32x4_t, &[i32; 4usize]>(&a.val.0) }
1491 }
1492 #[inline(always)]
1493 fn as_array_mut_i32x4(self, a: &mut i32x4<Self>) -> &mut [i32; 4usize] {
1494 unsafe { core::mem::transmute::<&mut int32x4_t, &mut [i32; 4usize]>(&mut a.val.0) }
1495 }
1496 #[inline(always)]
1497 fn store_array_i32x4(self, a: i32x4<Self>, dest: &mut [i32; 4usize]) -> () {
1498 unsafe {
1499 core::ptr::copy_nonoverlapping(
1500 (&raw const a.val.0) as *const i32,
1501 dest.as_mut_ptr(),
1502 4usize,
1503 );
1504 }
1505 }
1506 #[inline(always)]
1507 fn cvt_from_bytes_i32x4(self, a: u8x16<Self>) -> i32x4<Self> {
1508 unsafe {
1509 i32x4 {
1510 val: core::mem::transmute(a.val),
1511 simd: self,
1512 }
1513 }
1514 }
1515 #[inline(always)]
1516 fn cvt_to_bytes_i32x4(self, a: i32x4<Self>) -> u8x16<Self> {
1517 unsafe {
1518 u8x16 {
1519 val: core::mem::transmute(a.val),
1520 simd: self,
1521 }
1522 }
1523 }
1524 #[inline(always)]
1525 fn slide_i32x4<const SHIFT: usize>(self, a: i32x4<Self>, b: i32x4<Self>) -> i32x4<Self> {
1526 if SHIFT >= 4usize {
1527 return b;
1528 }
1529 let result = unsafe {
1530 dyn_vext_128(
1531 self.cvt_to_bytes_i32x4(a).val.0,
1532 self.cvt_to_bytes_i32x4(b).val.0,
1533 SHIFT * 4usize,
1534 )
1535 };
1536 self.cvt_from_bytes_i32x4(u8x16 {
1537 val: crate::support::Aligned128(result),
1538 simd: self,
1539 })
1540 }
1541 #[inline(always)]
1542 fn slide_within_blocks_i32x4<const SHIFT: usize>(
1543 self,
1544 a: i32x4<Self>,
1545 b: i32x4<Self>,
1546 ) -> i32x4<Self> {
1547 self.slide_i32x4::<SHIFT>(a, b)
1548 }
1549 #[inline(always)]
1550 fn add_i32x4(self, a: i32x4<Self>, b: i32x4<Self>) -> i32x4<Self> {
1551 unsafe { vaddq_s32(a.into(), b.into()).simd_into(self) }
1552 }
1553 #[inline(always)]
1554 fn sub_i32x4(self, a: i32x4<Self>, b: i32x4<Self>) -> i32x4<Self> {
1555 unsafe { vsubq_s32(a.into(), b.into()).simd_into(self) }
1556 }
1557 #[inline(always)]
1558 fn mul_i32x4(self, a: i32x4<Self>, b: i32x4<Self>) -> i32x4<Self> {
1559 unsafe { vmulq_s32(a.into(), b.into()).simd_into(self) }
1560 }
1561 #[inline(always)]
1562 fn and_i32x4(self, a: i32x4<Self>, b: i32x4<Self>) -> i32x4<Self> {
1563 unsafe { vandq_s32(a.into(), b.into()).simd_into(self) }
1564 }
1565 #[inline(always)]
1566 fn or_i32x4(self, a: i32x4<Self>, b: i32x4<Self>) -> i32x4<Self> {
1567 unsafe { vorrq_s32(a.into(), b.into()).simd_into(self) }
1568 }
1569 #[inline(always)]
1570 fn xor_i32x4(self, a: i32x4<Self>, b: i32x4<Self>) -> i32x4<Self> {
1571 unsafe { veorq_s32(a.into(), b.into()).simd_into(self) }
1572 }
1573 #[inline(always)]
1574 fn not_i32x4(self, a: i32x4<Self>) -> i32x4<Self> {
1575 unsafe { vmvnq_s32(a.into()).simd_into(self) }
1576 }
1577 #[inline(always)]
1578 fn shl_i32x4(self, a: i32x4<Self>, shift: u32) -> i32x4<Self> {
1579 unsafe { vshlq_s32(a.into(), vdupq_n_s32(shift.cast_signed())).simd_into(self) }
1580 }
1581 #[inline(always)]
1582 fn shlv_i32x4(self, a: i32x4<Self>, b: i32x4<Self>) -> i32x4<Self> {
1583 unsafe { vshlq_s32(a.into(), b.into()).simd_into(self) }
1584 }
1585 #[inline(always)]
1586 fn shr_i32x4(self, a: i32x4<Self>, shift: u32) -> i32x4<Self> {
1587 unsafe { vshlq_s32(a.into(), vdupq_n_s32(-shift.cast_signed())).simd_into(self) }
1588 }
1589 #[inline(always)]
1590 fn shrv_i32x4(self, a: i32x4<Self>, b: i32x4<Self>) -> i32x4<Self> {
1591 unsafe { vshlq_s32(a.into(), vnegq_s32(b.into())).simd_into(self) }
1592 }
1593 #[inline(always)]
1594 fn simd_eq_i32x4(self, a: i32x4<Self>, b: i32x4<Self>) -> mask32x4<Self> {
1595 unsafe { vreinterpretq_s32_u32(vceqq_s32(a.into(), b.into())).simd_into(self) }
1596 }
1597 #[inline(always)]
1598 fn simd_lt_i32x4(self, a: i32x4<Self>, b: i32x4<Self>) -> mask32x4<Self> {
1599 unsafe { vreinterpretq_s32_u32(vcltq_s32(a.into(), b.into())).simd_into(self) }
1600 }
1601 #[inline(always)]
1602 fn simd_le_i32x4(self, a: i32x4<Self>, b: i32x4<Self>) -> mask32x4<Self> {
1603 unsafe { vreinterpretq_s32_u32(vcleq_s32(a.into(), b.into())).simd_into(self) }
1604 }
1605 #[inline(always)]
1606 fn simd_ge_i32x4(self, a: i32x4<Self>, b: i32x4<Self>) -> mask32x4<Self> {
1607 unsafe { vreinterpretq_s32_u32(vcgeq_s32(a.into(), b.into())).simd_into(self) }
1608 }
1609 #[inline(always)]
1610 fn simd_gt_i32x4(self, a: i32x4<Self>, b: i32x4<Self>) -> mask32x4<Self> {
1611 unsafe { vreinterpretq_s32_u32(vcgtq_s32(a.into(), b.into())).simd_into(self) }
1612 }
1613 #[inline(always)]
1614 fn zip_low_i32x4(self, a: i32x4<Self>, b: i32x4<Self>) -> i32x4<Self> {
1615 let x = a.into();
1616 let y = b.into();
1617 unsafe { vzip1q_s32(x, y).simd_into(self) }
1618 }
1619 #[inline(always)]
1620 fn zip_high_i32x4(self, a: i32x4<Self>, b: i32x4<Self>) -> i32x4<Self> {
1621 let x = a.into();
1622 let y = b.into();
1623 unsafe { vzip2q_s32(x, y).simd_into(self) }
1624 }
1625 #[inline(always)]
1626 fn unzip_low_i32x4(self, a: i32x4<Self>, b: i32x4<Self>) -> i32x4<Self> {
1627 let x = a.into();
1628 let y = b.into();
1629 unsafe { vuzp1q_s32(x, y).simd_into(self) }
1630 }
1631 #[inline(always)]
1632 fn unzip_high_i32x4(self, a: i32x4<Self>, b: i32x4<Self>) -> i32x4<Self> {
1633 let x = a.into();
1634 let y = b.into();
1635 unsafe { vuzp2q_s32(x, y).simd_into(self) }
1636 }
1637 #[inline(always)]
1638 fn interleave_i32x4(self, a: i32x4<Self>, b: i32x4<Self>) -> (i32x4<Self>, i32x4<Self>) {
1639 (self.zip_low_i32x4(a, b), self.zip_high_i32x4(a, b))
1640 }
1641 #[inline(always)]
1642 fn deinterleave_i32x4(self, a: i32x4<Self>, b: i32x4<Self>) -> (i32x4<Self>, i32x4<Self>) {
1643 (self.unzip_low_i32x4(a, b), self.unzip_high_i32x4(a, b))
1644 }
1645 #[inline(always)]
1646 fn select_i32x4(self, a: mask32x4<Self>, b: i32x4<Self>, c: i32x4<Self>) -> i32x4<Self> {
1647 unsafe { vbslq_s32(vreinterpretq_u32_s32(a.into()), b.into(), c.into()).simd_into(self) }
1648 }
1649 #[inline(always)]
1650 fn min_i32x4(self, a: i32x4<Self>, b: i32x4<Self>) -> i32x4<Self> {
1651 unsafe { vminq_s32(a.into(), b.into()).simd_into(self) }
1652 }
1653 #[inline(always)]
1654 fn max_i32x4(self, a: i32x4<Self>, b: i32x4<Self>) -> i32x4<Self> {
1655 unsafe { vmaxq_s32(a.into(), b.into()).simd_into(self) }
1656 }
1657 #[inline(always)]
1658 fn combine_i32x4(self, a: i32x4<Self>, b: i32x4<Self>) -> i32x8<Self> {
1659 i32x8 {
1660 val: crate::support::Aligned256(int32x4x2_t(a.val.0, b.val.0)),
1661 simd: self,
1662 }
1663 }
1664 #[inline(always)]
1665 fn neg_i32x4(self, a: i32x4<Self>) -> i32x4<Self> {
1666 unsafe { vnegq_s32(a.into()).simd_into(self) }
1667 }
1668 #[inline(always)]
1669 fn reinterpret_u8_i32x4(self, a: i32x4<Self>) -> u8x16<Self> {
1670 unsafe { vreinterpretq_u8_s32(a.into()).simd_into(self) }
1671 }
1672 #[inline(always)]
1673 fn reinterpret_u32_i32x4(self, a: i32x4<Self>) -> u32x4<Self> {
1674 unsafe { vreinterpretq_u32_s32(a.into()).simd_into(self) }
1675 }
1676 #[inline(always)]
1677 fn cvt_f32_i32x4(self, a: i32x4<Self>) -> f32x4<Self> {
1678 unsafe { vcvtq_f32_s32(a.into()).simd_into(self) }
1679 }
1680 #[inline(always)]
1681 fn splat_u32x4(self, val: u32) -> u32x4<Self> {
1682 unsafe { vdupq_n_u32(val).simd_into(self) }
1683 }
1684 #[inline(always)]
1685 fn load_array_u32x4(self, val: [u32; 4usize]) -> u32x4<Self> {
1686 u32x4 {
1687 val: unsafe { core::mem::transmute_copy(&val) },
1688 simd: self,
1689 }
1690 }
1691 #[inline(always)]
1692 fn load_array_ref_u32x4(self, val: &[u32; 4usize]) -> u32x4<Self> {
1693 u32x4 {
1694 val: unsafe { core::mem::transmute_copy(val) },
1695 simd: self,
1696 }
1697 }
1698 #[inline(always)]
1699 fn as_array_u32x4(self, a: u32x4<Self>) -> [u32; 4usize] {
1700 unsafe { core::mem::transmute::<uint32x4_t, [u32; 4usize]>(a.val.0) }
1701 }
1702 #[inline(always)]
1703 fn as_array_ref_u32x4(self, a: &u32x4<Self>) -> &[u32; 4usize] {
1704 unsafe { core::mem::transmute::<&uint32x4_t, &[u32; 4usize]>(&a.val.0) }
1705 }
1706 #[inline(always)]
1707 fn as_array_mut_u32x4(self, a: &mut u32x4<Self>) -> &mut [u32; 4usize] {
1708 unsafe { core::mem::transmute::<&mut uint32x4_t, &mut [u32; 4usize]>(&mut a.val.0) }
1709 }
1710 #[inline(always)]
1711 fn store_array_u32x4(self, a: u32x4<Self>, dest: &mut [u32; 4usize]) -> () {
1712 unsafe {
1713 core::ptr::copy_nonoverlapping(
1714 (&raw const a.val.0) as *const u32,
1715 dest.as_mut_ptr(),
1716 4usize,
1717 );
1718 }
1719 }
1720 #[inline(always)]
1721 fn cvt_from_bytes_u32x4(self, a: u8x16<Self>) -> u32x4<Self> {
1722 unsafe {
1723 u32x4 {
1724 val: core::mem::transmute(a.val),
1725 simd: self,
1726 }
1727 }
1728 }
1729 #[inline(always)]
1730 fn cvt_to_bytes_u32x4(self, a: u32x4<Self>) -> u8x16<Self> {
1731 unsafe {
1732 u8x16 {
1733 val: core::mem::transmute(a.val),
1734 simd: self,
1735 }
1736 }
1737 }
1738 #[inline(always)]
1739 fn slide_u32x4<const SHIFT: usize>(self, a: u32x4<Self>, b: u32x4<Self>) -> u32x4<Self> {
1740 if SHIFT >= 4usize {
1741 return b;
1742 }
1743 let result = unsafe {
1744 dyn_vext_128(
1745 self.cvt_to_bytes_u32x4(a).val.0,
1746 self.cvt_to_bytes_u32x4(b).val.0,
1747 SHIFT * 4usize,
1748 )
1749 };
1750 self.cvt_from_bytes_u32x4(u8x16 {
1751 val: crate::support::Aligned128(result),
1752 simd: self,
1753 })
1754 }
1755 #[inline(always)]
1756 fn slide_within_blocks_u32x4<const SHIFT: usize>(
1757 self,
1758 a: u32x4<Self>,
1759 b: u32x4<Self>,
1760 ) -> u32x4<Self> {
1761 self.slide_u32x4::<SHIFT>(a, b)
1762 }
1763 #[inline(always)]
1764 fn add_u32x4(self, a: u32x4<Self>, b: u32x4<Self>) -> u32x4<Self> {
1765 unsafe { vaddq_u32(a.into(), b.into()).simd_into(self) }
1766 }
1767 #[inline(always)]
1768 fn sub_u32x4(self, a: u32x4<Self>, b: u32x4<Self>) -> u32x4<Self> {
1769 unsafe { vsubq_u32(a.into(), b.into()).simd_into(self) }
1770 }
1771 #[inline(always)]
1772 fn mul_u32x4(self, a: u32x4<Self>, b: u32x4<Self>) -> u32x4<Self> {
1773 unsafe { vmulq_u32(a.into(), b.into()).simd_into(self) }
1774 }
1775 #[inline(always)]
1776 fn and_u32x4(self, a: u32x4<Self>, b: u32x4<Self>) -> u32x4<Self> {
1777 unsafe { vandq_u32(a.into(), b.into()).simd_into(self) }
1778 }
1779 #[inline(always)]
1780 fn or_u32x4(self, a: u32x4<Self>, b: u32x4<Self>) -> u32x4<Self> {
1781 unsafe { vorrq_u32(a.into(), b.into()).simd_into(self) }
1782 }
1783 #[inline(always)]
1784 fn xor_u32x4(self, a: u32x4<Self>, b: u32x4<Self>) -> u32x4<Self> {
1785 unsafe { veorq_u32(a.into(), b.into()).simd_into(self) }
1786 }
1787 #[inline(always)]
1788 fn not_u32x4(self, a: u32x4<Self>) -> u32x4<Self> {
1789 unsafe { vmvnq_u32(a.into()).simd_into(self) }
1790 }
1791 #[inline(always)]
1792 fn shl_u32x4(self, a: u32x4<Self>, shift: u32) -> u32x4<Self> {
1793 unsafe { vshlq_u32(a.into(), vdupq_n_s32(shift.cast_signed())).simd_into(self) }
1794 }
1795 #[inline(always)]
1796 fn shlv_u32x4(self, a: u32x4<Self>, b: u32x4<Self>) -> u32x4<Self> {
1797 unsafe { vshlq_u32(a.into(), vreinterpretq_s32_u32(b.into())).simd_into(self) }
1798 }
1799 #[inline(always)]
1800 fn shr_u32x4(self, a: u32x4<Self>, shift: u32) -> u32x4<Self> {
1801 unsafe { vshlq_u32(a.into(), vdupq_n_s32(-shift.cast_signed())).simd_into(self) }
1802 }
1803 #[inline(always)]
1804 fn shrv_u32x4(self, a: u32x4<Self>, b: u32x4<Self>) -> u32x4<Self> {
1805 unsafe { vshlq_u32(a.into(), vnegq_s32(vreinterpretq_s32_u32(b.into()))).simd_into(self) }
1806 }
1807 #[inline(always)]
1808 fn simd_eq_u32x4(self, a: u32x4<Self>, b: u32x4<Self>) -> mask32x4<Self> {
1809 unsafe { vreinterpretq_s32_u32(vceqq_u32(a.into(), b.into())).simd_into(self) }
1810 }
1811 #[inline(always)]
1812 fn simd_lt_u32x4(self, a: u32x4<Self>, b: u32x4<Self>) -> mask32x4<Self> {
1813 unsafe { vreinterpretq_s32_u32(vcltq_u32(a.into(), b.into())).simd_into(self) }
1814 }
1815 #[inline(always)]
1816 fn simd_le_u32x4(self, a: u32x4<Self>, b: u32x4<Self>) -> mask32x4<Self> {
1817 unsafe { vreinterpretq_s32_u32(vcleq_u32(a.into(), b.into())).simd_into(self) }
1818 }
1819 #[inline(always)]
1820 fn simd_ge_u32x4(self, a: u32x4<Self>, b: u32x4<Self>) -> mask32x4<Self> {
1821 unsafe { vreinterpretq_s32_u32(vcgeq_u32(a.into(), b.into())).simd_into(self) }
1822 }
1823 #[inline(always)]
1824 fn simd_gt_u32x4(self, a: u32x4<Self>, b: u32x4<Self>) -> mask32x4<Self> {
1825 unsafe { vreinterpretq_s32_u32(vcgtq_u32(a.into(), b.into())).simd_into(self) }
1826 }
1827 #[inline(always)]
1828 fn zip_low_u32x4(self, a: u32x4<Self>, b: u32x4<Self>) -> u32x4<Self> {
1829 let x = a.into();
1830 let y = b.into();
1831 unsafe { vzip1q_u32(x, y).simd_into(self) }
1832 }
1833 #[inline(always)]
1834 fn zip_high_u32x4(self, a: u32x4<Self>, b: u32x4<Self>) -> u32x4<Self> {
1835 let x = a.into();
1836 let y = b.into();
1837 unsafe { vzip2q_u32(x, y).simd_into(self) }
1838 }
1839 #[inline(always)]
1840 fn unzip_low_u32x4(self, a: u32x4<Self>, b: u32x4<Self>) -> u32x4<Self> {
1841 let x = a.into();
1842 let y = b.into();
1843 unsafe { vuzp1q_u32(x, y).simd_into(self) }
1844 }
1845 #[inline(always)]
1846 fn unzip_high_u32x4(self, a: u32x4<Self>, b: u32x4<Self>) -> u32x4<Self> {
1847 let x = a.into();
1848 let y = b.into();
1849 unsafe { vuzp2q_u32(x, y).simd_into(self) }
1850 }
1851 #[inline(always)]
1852 fn interleave_u32x4(self, a: u32x4<Self>, b: u32x4<Self>) -> (u32x4<Self>, u32x4<Self>) {
1853 (self.zip_low_u32x4(a, b), self.zip_high_u32x4(a, b))
1854 }
1855 #[inline(always)]
1856 fn deinterleave_u32x4(self, a: u32x4<Self>, b: u32x4<Self>) -> (u32x4<Self>, u32x4<Self>) {
1857 (self.unzip_low_u32x4(a, b), self.unzip_high_u32x4(a, b))
1858 }
1859 #[inline(always)]
1860 fn select_u32x4(self, a: mask32x4<Self>, b: u32x4<Self>, c: u32x4<Self>) -> u32x4<Self> {
1861 unsafe { vbslq_u32(vreinterpretq_u32_s32(a.into()), b.into(), c.into()).simd_into(self) }
1862 }
1863 #[inline(always)]
1864 fn min_u32x4(self, a: u32x4<Self>, b: u32x4<Self>) -> u32x4<Self> {
1865 unsafe { vminq_u32(a.into(), b.into()).simd_into(self) }
1866 }
1867 #[inline(always)]
1868 fn max_u32x4(self, a: u32x4<Self>, b: u32x4<Self>) -> u32x4<Self> {
1869 unsafe { vmaxq_u32(a.into(), b.into()).simd_into(self) }
1870 }
1871 #[inline(always)]
1872 fn combine_u32x4(self, a: u32x4<Self>, b: u32x4<Self>) -> u32x8<Self> {
1873 u32x8 {
1874 val: crate::support::Aligned256(uint32x4x2_t(a.val.0, b.val.0)),
1875 simd: self,
1876 }
1877 }
1878 #[inline(always)]
1879 fn reinterpret_u8_u32x4(self, a: u32x4<Self>) -> u8x16<Self> {
1880 unsafe { vreinterpretq_u8_u32(a.into()).simd_into(self) }
1881 }
1882 #[inline(always)]
1883 fn cvt_f32_u32x4(self, a: u32x4<Self>) -> f32x4<Self> {
1884 unsafe { vcvtq_f32_u32(a.into()).simd_into(self) }
1885 }
1886 #[inline(always)]
1887 fn splat_mask32x4(self, val: i32) -> mask32x4<Self> {
1888 unsafe { vdupq_n_s32(val).simd_into(self) }
1889 }
1890 #[inline(always)]
1891 fn load_array_mask32x4(self, val: [i32; 4usize]) -> mask32x4<Self> {
1892 mask32x4 {
1893 val: unsafe { core::mem::transmute_copy(&val) },
1894 simd: self,
1895 }
1896 }
1897 #[inline(always)]
1898 fn load_array_ref_mask32x4(self, val: &[i32; 4usize]) -> mask32x4<Self> {
1899 mask32x4 {
1900 val: unsafe { core::mem::transmute_copy(val) },
1901 simd: self,
1902 }
1903 }
1904 #[inline(always)]
1905 fn as_array_mask32x4(self, a: mask32x4<Self>) -> [i32; 4usize] {
1906 unsafe { core::mem::transmute::<int32x4_t, [i32; 4usize]>(a.val.0) }
1907 }
1908 #[inline(always)]
1909 fn as_array_ref_mask32x4(self, a: &mask32x4<Self>) -> &[i32; 4usize] {
1910 unsafe { core::mem::transmute::<&int32x4_t, &[i32; 4usize]>(&a.val.0) }
1911 }
1912 #[inline(always)]
1913 fn as_array_mut_mask32x4(self, a: &mut mask32x4<Self>) -> &mut [i32; 4usize] {
1914 unsafe { core::mem::transmute::<&mut int32x4_t, &mut [i32; 4usize]>(&mut a.val.0) }
1915 }
1916 #[inline(always)]
1917 fn store_array_mask32x4(self, a: mask32x4<Self>, dest: &mut [i32; 4usize]) -> () {
1918 unsafe {
1919 core::ptr::copy_nonoverlapping(
1920 (&raw const a.val.0) as *const i32,
1921 dest.as_mut_ptr(),
1922 4usize,
1923 );
1924 }
1925 }
1926 #[inline(always)]
1927 fn cvt_from_bytes_mask32x4(self, a: u8x16<Self>) -> mask32x4<Self> {
1928 unsafe {
1929 mask32x4 {
1930 val: core::mem::transmute(a.val),
1931 simd: self,
1932 }
1933 }
1934 }
1935 #[inline(always)]
1936 fn cvt_to_bytes_mask32x4(self, a: mask32x4<Self>) -> u8x16<Self> {
1937 unsafe {
1938 u8x16 {
1939 val: core::mem::transmute(a.val),
1940 simd: self,
1941 }
1942 }
1943 }
1944 #[inline(always)]
1945 fn slide_mask32x4<const SHIFT: usize>(
1946 self,
1947 a: mask32x4<Self>,
1948 b: mask32x4<Self>,
1949 ) -> mask32x4<Self> {
1950 if SHIFT >= 4usize {
1951 return b;
1952 }
1953 let result = unsafe {
1954 dyn_vext_128(
1955 self.cvt_to_bytes_mask32x4(a).val.0,
1956 self.cvt_to_bytes_mask32x4(b).val.0,
1957 SHIFT * 4usize,
1958 )
1959 };
1960 self.cvt_from_bytes_mask32x4(u8x16 {
1961 val: crate::support::Aligned128(result),
1962 simd: self,
1963 })
1964 }
1965 #[inline(always)]
1966 fn slide_within_blocks_mask32x4<const SHIFT: usize>(
1967 self,
1968 a: mask32x4<Self>,
1969 b: mask32x4<Self>,
1970 ) -> mask32x4<Self> {
1971 self.slide_mask32x4::<SHIFT>(a, b)
1972 }
1973 #[inline(always)]
1974 fn and_mask32x4(self, a: mask32x4<Self>, b: mask32x4<Self>) -> mask32x4<Self> {
1975 unsafe { vandq_s32(a.into(), b.into()).simd_into(self) }
1976 }
1977 #[inline(always)]
1978 fn or_mask32x4(self, a: mask32x4<Self>, b: mask32x4<Self>) -> mask32x4<Self> {
1979 unsafe { vorrq_s32(a.into(), b.into()).simd_into(self) }
1980 }
1981 #[inline(always)]
1982 fn xor_mask32x4(self, a: mask32x4<Self>, b: mask32x4<Self>) -> mask32x4<Self> {
1983 unsafe { veorq_s32(a.into(), b.into()).simd_into(self) }
1984 }
1985 #[inline(always)]
1986 fn not_mask32x4(self, a: mask32x4<Self>) -> mask32x4<Self> {
1987 unsafe { vmvnq_s32(a.into()).simd_into(self) }
1988 }
1989 #[inline(always)]
1990 fn select_mask32x4(
1991 self,
1992 a: mask32x4<Self>,
1993 b: mask32x4<Self>,
1994 c: mask32x4<Self>,
1995 ) -> mask32x4<Self> {
1996 unsafe { vbslq_s32(vreinterpretq_u32_s32(a.into()), b.into(), c.into()).simd_into(self) }
1997 }
1998 #[inline(always)]
1999 fn simd_eq_mask32x4(self, a: mask32x4<Self>, b: mask32x4<Self>) -> mask32x4<Self> {
2000 unsafe { vreinterpretq_s32_u32(vceqq_s32(a.into(), b.into())).simd_into(self) }
2001 }
2002 #[inline(always)]
2003 fn any_true_mask32x4(self, a: mask32x4<Self>) -> bool {
2004 unsafe { vmaxvq_u32(vreinterpretq_u32_s32(a.into())) != 0 }
2005 }
2006 #[inline(always)]
2007 fn all_true_mask32x4(self, a: mask32x4<Self>) -> bool {
2008 unsafe { vminvq_u32(vreinterpretq_u32_s32(a.into())) == 0xffffffff }
2009 }
2010 #[inline(always)]
2011 fn any_false_mask32x4(self, a: mask32x4<Self>) -> bool {
2012 unsafe { vminvq_u32(vreinterpretq_u32_s32(a.into())) != 0xffffffff }
2013 }
2014 #[inline(always)]
2015 fn all_false_mask32x4(self, a: mask32x4<Self>) -> bool {
2016 unsafe { vmaxvq_u32(vreinterpretq_u32_s32(a.into())) == 0 }
2017 }
2018 #[inline(always)]
2019 fn combine_mask32x4(self, a: mask32x4<Self>, b: mask32x4<Self>) -> mask32x8<Self> {
2020 mask32x8 {
2021 val: crate::support::Aligned256(int32x4x2_t(a.val.0, b.val.0)),
2022 simd: self,
2023 }
2024 }
2025 #[inline(always)]
2026 fn splat_f64x2(self, val: f64) -> f64x2<Self> {
2027 unsafe { vdupq_n_f64(val).simd_into(self) }
2028 }
2029 #[inline(always)]
2030 fn load_array_f64x2(self, val: [f64; 2usize]) -> f64x2<Self> {
2031 f64x2 {
2032 val: unsafe { core::mem::transmute_copy(&val) },
2033 simd: self,
2034 }
2035 }
2036 #[inline(always)]
2037 fn load_array_ref_f64x2(self, val: &[f64; 2usize]) -> f64x2<Self> {
2038 f64x2 {
2039 val: unsafe { core::mem::transmute_copy(val) },
2040 simd: self,
2041 }
2042 }
2043 #[inline(always)]
2044 fn as_array_f64x2(self, a: f64x2<Self>) -> [f64; 2usize] {
2045 unsafe { core::mem::transmute::<float64x2_t, [f64; 2usize]>(a.val.0) }
2046 }
2047 #[inline(always)]
2048 fn as_array_ref_f64x2(self, a: &f64x2<Self>) -> &[f64; 2usize] {
2049 unsafe { core::mem::transmute::<&float64x2_t, &[f64; 2usize]>(&a.val.0) }
2050 }
2051 #[inline(always)]
2052 fn as_array_mut_f64x2(self, a: &mut f64x2<Self>) -> &mut [f64; 2usize] {
2053 unsafe { core::mem::transmute::<&mut float64x2_t, &mut [f64; 2usize]>(&mut a.val.0) }
2054 }
2055 #[inline(always)]
2056 fn store_array_f64x2(self, a: f64x2<Self>, dest: &mut [f64; 2usize]) -> () {
2057 unsafe {
2058 core::ptr::copy_nonoverlapping(
2059 (&raw const a.val.0) as *const f64,
2060 dest.as_mut_ptr(),
2061 2usize,
2062 );
2063 }
2064 }
2065 #[inline(always)]
2066 fn cvt_from_bytes_f64x2(self, a: u8x16<Self>) -> f64x2<Self> {
2067 unsafe {
2068 f64x2 {
2069 val: core::mem::transmute(a.val),
2070 simd: self,
2071 }
2072 }
2073 }
2074 #[inline(always)]
2075 fn cvt_to_bytes_f64x2(self, a: f64x2<Self>) -> u8x16<Self> {
2076 unsafe {
2077 u8x16 {
2078 val: core::mem::transmute(a.val),
2079 simd: self,
2080 }
2081 }
2082 }
2083 #[inline(always)]
2084 fn slide_f64x2<const SHIFT: usize>(self, a: f64x2<Self>, b: f64x2<Self>) -> f64x2<Self> {
2085 if SHIFT >= 2usize {
2086 return b;
2087 }
2088 let result = unsafe {
2089 dyn_vext_128(
2090 self.cvt_to_bytes_f64x2(a).val.0,
2091 self.cvt_to_bytes_f64x2(b).val.0,
2092 SHIFT * 8usize,
2093 )
2094 };
2095 self.cvt_from_bytes_f64x2(u8x16 {
2096 val: crate::support::Aligned128(result),
2097 simd: self,
2098 })
2099 }
2100 #[inline(always)]
2101 fn slide_within_blocks_f64x2<const SHIFT: usize>(
2102 self,
2103 a: f64x2<Self>,
2104 b: f64x2<Self>,
2105 ) -> f64x2<Self> {
2106 self.slide_f64x2::<SHIFT>(a, b)
2107 }
2108 #[inline(always)]
2109 fn abs_f64x2(self, a: f64x2<Self>) -> f64x2<Self> {
2110 unsafe { vabsq_f64(a.into()).simd_into(self) }
2111 }
2112 #[inline(always)]
2113 fn neg_f64x2(self, a: f64x2<Self>) -> f64x2<Self> {
2114 unsafe { vnegq_f64(a.into()).simd_into(self) }
2115 }
2116 #[inline(always)]
2117 fn sqrt_f64x2(self, a: f64x2<Self>) -> f64x2<Self> {
2118 unsafe { vsqrtq_f64(a.into()).simd_into(self) }
2119 }
2120 #[inline(always)]
2121 fn add_f64x2(self, a: f64x2<Self>, b: f64x2<Self>) -> f64x2<Self> {
2122 unsafe { vaddq_f64(a.into(), b.into()).simd_into(self) }
2123 }
2124 #[inline(always)]
2125 fn sub_f64x2(self, a: f64x2<Self>, b: f64x2<Self>) -> f64x2<Self> {
2126 unsafe { vsubq_f64(a.into(), b.into()).simd_into(self) }
2127 }
2128 #[inline(always)]
2129 fn mul_f64x2(self, a: f64x2<Self>, b: f64x2<Self>) -> f64x2<Self> {
2130 unsafe { vmulq_f64(a.into(), b.into()).simd_into(self) }
2131 }
2132 #[inline(always)]
2133 fn div_f64x2(self, a: f64x2<Self>, b: f64x2<Self>) -> f64x2<Self> {
2134 unsafe { vdivq_f64(a.into(), b.into()).simd_into(self) }
2135 }
2136 #[inline(always)]
2137 fn copysign_f64x2(self, a: f64x2<Self>, b: f64x2<Self>) -> f64x2<Self> {
2138 unsafe {
2139 let sign_mask = vdupq_n_u64(1 << 63);
2140 vbslq_f64(sign_mask, b.into(), a.into()).simd_into(self)
2141 }
2142 }
2143 #[inline(always)]
2144 fn simd_eq_f64x2(self, a: f64x2<Self>, b: f64x2<Self>) -> mask64x2<Self> {
2145 unsafe { vreinterpretq_s64_u64(vceqq_f64(a.into(), b.into())).simd_into(self) }
2146 }
2147 #[inline(always)]
2148 fn simd_lt_f64x2(self, a: f64x2<Self>, b: f64x2<Self>) -> mask64x2<Self> {
2149 unsafe { vreinterpretq_s64_u64(vcltq_f64(a.into(), b.into())).simd_into(self) }
2150 }
2151 #[inline(always)]
2152 fn simd_le_f64x2(self, a: f64x2<Self>, b: f64x2<Self>) -> mask64x2<Self> {
2153 unsafe { vreinterpretq_s64_u64(vcleq_f64(a.into(), b.into())).simd_into(self) }
2154 }
2155 #[inline(always)]
2156 fn simd_ge_f64x2(self, a: f64x2<Self>, b: f64x2<Self>) -> mask64x2<Self> {
2157 unsafe { vreinterpretq_s64_u64(vcgeq_f64(a.into(), b.into())).simd_into(self) }
2158 }
2159 #[inline(always)]
2160 fn simd_gt_f64x2(self, a: f64x2<Self>, b: f64x2<Self>) -> mask64x2<Self> {
2161 unsafe { vreinterpretq_s64_u64(vcgtq_f64(a.into(), b.into())).simd_into(self) }
2162 }
2163 #[inline(always)]
2164 fn zip_low_f64x2(self, a: f64x2<Self>, b: f64x2<Self>) -> f64x2<Self> {
2165 let x = a.into();
2166 let y = b.into();
2167 unsafe { vzip1q_f64(x, y).simd_into(self) }
2168 }
2169 #[inline(always)]
2170 fn zip_high_f64x2(self, a: f64x2<Self>, b: f64x2<Self>) -> f64x2<Self> {
2171 let x = a.into();
2172 let y = b.into();
2173 unsafe { vzip2q_f64(x, y).simd_into(self) }
2174 }
2175 #[inline(always)]
2176 fn unzip_low_f64x2(self, a: f64x2<Self>, b: f64x2<Self>) -> f64x2<Self> {
2177 let x = a.into();
2178 let y = b.into();
2179 unsafe { vuzp1q_f64(x, y).simd_into(self) }
2180 }
2181 #[inline(always)]
2182 fn unzip_high_f64x2(self, a: f64x2<Self>, b: f64x2<Self>) -> f64x2<Self> {
2183 let x = a.into();
2184 let y = b.into();
2185 unsafe { vuzp2q_f64(x, y).simd_into(self) }
2186 }
2187 #[inline(always)]
2188 fn interleave_f64x2(self, a: f64x2<Self>, b: f64x2<Self>) -> (f64x2<Self>, f64x2<Self>) {
2189 (self.zip_low_f64x2(a, b), self.zip_high_f64x2(a, b))
2190 }
2191 #[inline(always)]
2192 fn deinterleave_f64x2(self, a: f64x2<Self>, b: f64x2<Self>) -> (f64x2<Self>, f64x2<Self>) {
2193 (self.unzip_low_f64x2(a, b), self.unzip_high_f64x2(a, b))
2194 }
2195 #[inline(always)]
2196 fn max_f64x2(self, a: f64x2<Self>, b: f64x2<Self>) -> f64x2<Self> {
2197 unsafe { vmaxq_f64(a.into(), b.into()).simd_into(self) }
2198 }
2199 #[inline(always)]
2200 fn min_f64x2(self, a: f64x2<Self>, b: f64x2<Self>) -> f64x2<Self> {
2201 unsafe { vminq_f64(a.into(), b.into()).simd_into(self) }
2202 }
2203 #[inline(always)]
2204 fn max_precise_f64x2(self, a: f64x2<Self>, b: f64x2<Self>) -> f64x2<Self> {
2205 unsafe { vmaxnmq_f64(a.into(), b.into()).simd_into(self) }
2206 }
2207 #[inline(always)]
2208 fn min_precise_f64x2(self, a: f64x2<Self>, b: f64x2<Self>) -> f64x2<Self> {
2209 unsafe { vminnmq_f64(a.into(), b.into()).simd_into(self) }
2210 }
2211 #[inline(always)]
2212 fn mul_add_f64x2(self, a: f64x2<Self>, b: f64x2<Self>, c: f64x2<Self>) -> f64x2<Self> {
2213 unsafe { vfmaq_f64(c.into(), b.into(), a.into()).simd_into(self) }
2214 }
2215 #[inline(always)]
2216 fn mul_sub_f64x2(self, a: f64x2<Self>, b: f64x2<Self>, c: f64x2<Self>) -> f64x2<Self> {
2217 unsafe { vnegq_f64(vfmsq_f64(c.into(), b.into(), a.into())).simd_into(self) }
2218 }
2219 #[inline(always)]
2220 fn floor_f64x2(self, a: f64x2<Self>) -> f64x2<Self> {
2221 unsafe { vrndmq_f64(a.into()).simd_into(self) }
2222 }
2223 #[inline(always)]
2224 fn ceil_f64x2(self, a: f64x2<Self>) -> f64x2<Self> {
2225 unsafe { vrndpq_f64(a.into()).simd_into(self) }
2226 }
2227 #[inline(always)]
2228 fn round_ties_even_f64x2(self, a: f64x2<Self>) -> f64x2<Self> {
2229 unsafe { vrndnq_f64(a.into()).simd_into(self) }
2230 }
2231 #[inline(always)]
2232 fn fract_f64x2(self, a: f64x2<Self>) -> f64x2<Self> {
2233 unsafe {
2234 let c1 = vcvtq_s64_f64(a.into());
2235 let c2 = vcvtq_f64_s64(c1);
2236 vsubq_f64(a.into(), c2).simd_into(self)
2237 }
2238 }
2239 #[inline(always)]
2240 fn trunc_f64x2(self, a: f64x2<Self>) -> f64x2<Self> {
2241 unsafe { vrndq_f64(a.into()).simd_into(self) }
2242 }
2243 #[inline(always)]
2244 fn select_f64x2(self, a: mask64x2<Self>, b: f64x2<Self>, c: f64x2<Self>) -> f64x2<Self> {
2245 unsafe { vbslq_f64(vreinterpretq_u64_s64(a.into()), b.into(), c.into()).simd_into(self) }
2246 }
2247 #[inline(always)]
2248 fn combine_f64x2(self, a: f64x2<Self>, b: f64x2<Self>) -> f64x4<Self> {
2249 f64x4 {
2250 val: crate::support::Aligned256(float64x2x2_t(a.val.0, b.val.0)),
2251 simd: self,
2252 }
2253 }
2254 #[inline(always)]
2255 fn reinterpret_f32_f64x2(self, a: f64x2<Self>) -> f32x4<Self> {
2256 unsafe { vreinterpretq_f32_f64(a.into()).simd_into(self) }
2257 }
2258 #[inline(always)]
2259 fn splat_mask64x2(self, val: i64) -> mask64x2<Self> {
2260 unsafe { vdupq_n_s64(val).simd_into(self) }
2261 }
2262 #[inline(always)]
2263 fn load_array_mask64x2(self, val: [i64; 2usize]) -> mask64x2<Self> {
2264 mask64x2 {
2265 val: unsafe { core::mem::transmute_copy(&val) },
2266 simd: self,
2267 }
2268 }
2269 #[inline(always)]
2270 fn load_array_ref_mask64x2(self, val: &[i64; 2usize]) -> mask64x2<Self> {
2271 mask64x2 {
2272 val: unsafe { core::mem::transmute_copy(val) },
2273 simd: self,
2274 }
2275 }
2276 #[inline(always)]
2277 fn as_array_mask64x2(self, a: mask64x2<Self>) -> [i64; 2usize] {
2278 unsafe { core::mem::transmute::<int64x2_t, [i64; 2usize]>(a.val.0) }
2279 }
2280 #[inline(always)]
2281 fn as_array_ref_mask64x2(self, a: &mask64x2<Self>) -> &[i64; 2usize] {
2282 unsafe { core::mem::transmute::<&int64x2_t, &[i64; 2usize]>(&a.val.0) }
2283 }
2284 #[inline(always)]
2285 fn as_array_mut_mask64x2(self, a: &mut mask64x2<Self>) -> &mut [i64; 2usize] {
2286 unsafe { core::mem::transmute::<&mut int64x2_t, &mut [i64; 2usize]>(&mut a.val.0) }
2287 }
2288 #[inline(always)]
2289 fn store_array_mask64x2(self, a: mask64x2<Self>, dest: &mut [i64; 2usize]) -> () {
2290 unsafe {
2291 core::ptr::copy_nonoverlapping(
2292 (&raw const a.val.0) as *const i64,
2293 dest.as_mut_ptr(),
2294 2usize,
2295 );
2296 }
2297 }
2298 #[inline(always)]
2299 fn cvt_from_bytes_mask64x2(self, a: u8x16<Self>) -> mask64x2<Self> {
2300 unsafe {
2301 mask64x2 {
2302 val: core::mem::transmute(a.val),
2303 simd: self,
2304 }
2305 }
2306 }
2307 #[inline(always)]
2308 fn cvt_to_bytes_mask64x2(self, a: mask64x2<Self>) -> u8x16<Self> {
2309 unsafe {
2310 u8x16 {
2311 val: core::mem::transmute(a.val),
2312 simd: self,
2313 }
2314 }
2315 }
2316 #[inline(always)]
2317 fn slide_mask64x2<const SHIFT: usize>(
2318 self,
2319 a: mask64x2<Self>,
2320 b: mask64x2<Self>,
2321 ) -> mask64x2<Self> {
2322 if SHIFT >= 2usize {
2323 return b;
2324 }
2325 let result = unsafe {
2326 dyn_vext_128(
2327 self.cvt_to_bytes_mask64x2(a).val.0,
2328 self.cvt_to_bytes_mask64x2(b).val.0,
2329 SHIFT * 8usize,
2330 )
2331 };
2332 self.cvt_from_bytes_mask64x2(u8x16 {
2333 val: crate::support::Aligned128(result),
2334 simd: self,
2335 })
2336 }
2337 #[inline(always)]
2338 fn slide_within_blocks_mask64x2<const SHIFT: usize>(
2339 self,
2340 a: mask64x2<Self>,
2341 b: mask64x2<Self>,
2342 ) -> mask64x2<Self> {
2343 self.slide_mask64x2::<SHIFT>(a, b)
2344 }
2345 #[inline(always)]
2346 fn and_mask64x2(self, a: mask64x2<Self>, b: mask64x2<Self>) -> mask64x2<Self> {
2347 unsafe { vandq_s64(a.into(), b.into()).simd_into(self) }
2348 }
2349 #[inline(always)]
2350 fn or_mask64x2(self, a: mask64x2<Self>, b: mask64x2<Self>) -> mask64x2<Self> {
2351 unsafe { vorrq_s64(a.into(), b.into()).simd_into(self) }
2352 }
2353 #[inline(always)]
2354 fn xor_mask64x2(self, a: mask64x2<Self>, b: mask64x2<Self>) -> mask64x2<Self> {
2355 unsafe { veorq_s64(a.into(), b.into()).simd_into(self) }
2356 }
2357 #[inline(always)]
2358 fn not_mask64x2(self, a: mask64x2<Self>) -> mask64x2<Self> {
2359 unsafe { vreinterpretq_s64_s32(vmvnq_s32(vreinterpretq_s32_s64(a.into()))).simd_into(self) }
2360 }
2361 #[inline(always)]
2362 fn select_mask64x2(
2363 self,
2364 a: mask64x2<Self>,
2365 b: mask64x2<Self>,
2366 c: mask64x2<Self>,
2367 ) -> mask64x2<Self> {
2368 unsafe { vbslq_s64(vreinterpretq_u64_s64(a.into()), b.into(), c.into()).simd_into(self) }
2369 }
2370 #[inline(always)]
2371 fn simd_eq_mask64x2(self, a: mask64x2<Self>, b: mask64x2<Self>) -> mask64x2<Self> {
2372 unsafe { vreinterpretq_s64_u64(vceqq_s64(a.into(), b.into())).simd_into(self) }
2373 }
2374 #[inline(always)]
2375 fn any_true_mask64x2(self, a: mask64x2<Self>) -> bool {
2376 unsafe { vmaxvq_u32(vreinterpretq_u32_s64(a.into())) != 0 }
2377 }
2378 #[inline(always)]
2379 fn all_true_mask64x2(self, a: mask64x2<Self>) -> bool {
2380 unsafe { vminvq_u32(vreinterpretq_u32_s64(a.into())) == 0xffffffff }
2381 }
2382 #[inline(always)]
2383 fn any_false_mask64x2(self, a: mask64x2<Self>) -> bool {
2384 unsafe { vminvq_u32(vreinterpretq_u32_s64(a.into())) != 0xffffffff }
2385 }
2386 #[inline(always)]
2387 fn all_false_mask64x2(self, a: mask64x2<Self>) -> bool {
2388 unsafe { vmaxvq_u32(vreinterpretq_u32_s64(a.into())) == 0 }
2389 }
2390 #[inline(always)]
2391 fn combine_mask64x2(self, a: mask64x2<Self>, b: mask64x2<Self>) -> mask64x4<Self> {
2392 mask64x4 {
2393 val: crate::support::Aligned256(int64x2x2_t(a.val.0, b.val.0)),
2394 simd: self,
2395 }
2396 }
2397 #[inline(always)]
2398 fn splat_f32x8(self, val: f32) -> f32x8<Self> {
2399 let half = self.splat_f32x4(val);
2400 self.combine_f32x4(half, half)
2401 }
2402 #[inline(always)]
2403 fn load_array_f32x8(self, val: [f32; 8usize]) -> f32x8<Self> {
2404 f32x8 {
2405 val: unsafe { core::mem::transmute_copy(&val) },
2406 simd: self,
2407 }
2408 }
2409 #[inline(always)]
2410 fn load_array_ref_f32x8(self, val: &[f32; 8usize]) -> f32x8<Self> {
2411 f32x8 {
2412 val: unsafe { core::mem::transmute_copy(val) },
2413 simd: self,
2414 }
2415 }
2416 #[inline(always)]
2417 fn as_array_f32x8(self, a: f32x8<Self>) -> [f32; 8usize] {
2418 unsafe { core::mem::transmute::<float32x4x2_t, [f32; 8usize]>(a.val.0) }
2419 }
2420 #[inline(always)]
2421 fn as_array_ref_f32x8(self, a: &f32x8<Self>) -> &[f32; 8usize] {
2422 unsafe { core::mem::transmute::<&float32x4x2_t, &[f32; 8usize]>(&a.val.0) }
2423 }
2424 #[inline(always)]
2425 fn as_array_mut_f32x8(self, a: &mut f32x8<Self>) -> &mut [f32; 8usize] {
2426 unsafe { core::mem::transmute::<&mut float32x4x2_t, &mut [f32; 8usize]>(&mut a.val.0) }
2427 }
2428 #[inline(always)]
2429 fn store_array_f32x8(self, a: f32x8<Self>, dest: &mut [f32; 8usize]) -> () {
2430 unsafe {
2431 core::ptr::copy_nonoverlapping(
2432 (&raw const a.val.0) as *const f32,
2433 dest.as_mut_ptr(),
2434 8usize,
2435 );
2436 }
2437 }
2438 #[inline(always)]
2439 fn cvt_from_bytes_f32x8(self, a: u8x32<Self>) -> f32x8<Self> {
2440 unsafe {
2441 f32x8 {
2442 val: core::mem::transmute(a.val),
2443 simd: self,
2444 }
2445 }
2446 }
2447 #[inline(always)]
2448 fn cvt_to_bytes_f32x8(self, a: f32x8<Self>) -> u8x32<Self> {
2449 unsafe {
2450 u8x32 {
2451 val: core::mem::transmute(a.val),
2452 simd: self,
2453 }
2454 }
2455 }
2456 #[inline(always)]
2457 fn slide_f32x8<const SHIFT: usize>(self, a: f32x8<Self>, b: f32x8<Self>) -> f32x8<Self> {
2458 if SHIFT >= 8usize {
2459 return b;
2460 }
2461 let result = unsafe {
2462 let a_bytes = self.cvt_to_bytes_f32x8(a).val.0;
2463 let b_bytes = self.cvt_to_bytes_f32x8(b).val.0;
2464 let a_blocks = [a_bytes.0, a_bytes.1];
2465 let b_blocks = [b_bytes.0, b_bytes.1];
2466 let shift_bytes = SHIFT * 4usize;
2467 uint8x16x2_t(
2468 {
2469 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
2470 &a_blocks,
2471 &b_blocks,
2472 0,
2473 shift_bytes,
2474 );
2475 dyn_vext_128(lo, hi, shift_bytes % 16)
2476 },
2477 {
2478 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
2479 &a_blocks,
2480 &b_blocks,
2481 1,
2482 shift_bytes,
2483 );
2484 dyn_vext_128(lo, hi, shift_bytes % 16)
2485 },
2486 )
2487 };
2488 self.cvt_from_bytes_f32x8(u8x32 {
2489 val: crate::support::Aligned256(result),
2490 simd: self,
2491 })
2492 }
2493 #[inline(always)]
2494 fn slide_within_blocks_f32x8<const SHIFT: usize>(
2495 self,
2496 a: f32x8<Self>,
2497 b: f32x8<Self>,
2498 ) -> f32x8<Self> {
2499 let (a0, a1) = self.split_f32x8(a);
2500 let (b0, b1) = self.split_f32x8(b);
2501 self.combine_f32x4(
2502 self.slide_within_blocks_f32x4::<SHIFT>(a0, b0),
2503 self.slide_within_blocks_f32x4::<SHIFT>(a1, b1),
2504 )
2505 }
2506 #[inline(always)]
2507 fn abs_f32x8(self, a: f32x8<Self>) -> f32x8<Self> {
2508 let (a0, a1) = self.split_f32x8(a);
2509 self.combine_f32x4(self.abs_f32x4(a0), self.abs_f32x4(a1))
2510 }
2511 #[inline(always)]
2512 fn neg_f32x8(self, a: f32x8<Self>) -> f32x8<Self> {
2513 let (a0, a1) = self.split_f32x8(a);
2514 self.combine_f32x4(self.neg_f32x4(a0), self.neg_f32x4(a1))
2515 }
2516 #[inline(always)]
2517 fn sqrt_f32x8(self, a: f32x8<Self>) -> f32x8<Self> {
2518 let (a0, a1) = self.split_f32x8(a);
2519 self.combine_f32x4(self.sqrt_f32x4(a0), self.sqrt_f32x4(a1))
2520 }
2521 #[inline(always)]
2522 fn add_f32x8(self, a: f32x8<Self>, b: f32x8<Self>) -> f32x8<Self> {
2523 let (a0, a1) = self.split_f32x8(a);
2524 let (b0, b1) = self.split_f32x8(b);
2525 self.combine_f32x4(self.add_f32x4(a0, b0), self.add_f32x4(a1, b1))
2526 }
2527 #[inline(always)]
2528 fn sub_f32x8(self, a: f32x8<Self>, b: f32x8<Self>) -> f32x8<Self> {
2529 let (a0, a1) = self.split_f32x8(a);
2530 let (b0, b1) = self.split_f32x8(b);
2531 self.combine_f32x4(self.sub_f32x4(a0, b0), self.sub_f32x4(a1, b1))
2532 }
2533 #[inline(always)]
2534 fn mul_f32x8(self, a: f32x8<Self>, b: f32x8<Self>) -> f32x8<Self> {
2535 let (a0, a1) = self.split_f32x8(a);
2536 let (b0, b1) = self.split_f32x8(b);
2537 self.combine_f32x4(self.mul_f32x4(a0, b0), self.mul_f32x4(a1, b1))
2538 }
2539 #[inline(always)]
2540 fn div_f32x8(self, a: f32x8<Self>, b: f32x8<Self>) -> f32x8<Self> {
2541 let (a0, a1) = self.split_f32x8(a);
2542 let (b0, b1) = self.split_f32x8(b);
2543 self.combine_f32x4(self.div_f32x4(a0, b0), self.div_f32x4(a1, b1))
2544 }
2545 #[inline(always)]
2546 fn copysign_f32x8(self, a: f32x8<Self>, b: f32x8<Self>) -> f32x8<Self> {
2547 let (a0, a1) = self.split_f32x8(a);
2548 let (b0, b1) = self.split_f32x8(b);
2549 self.combine_f32x4(self.copysign_f32x4(a0, b0), self.copysign_f32x4(a1, b1))
2550 }
2551 #[inline(always)]
2552 fn simd_eq_f32x8(self, a: f32x8<Self>, b: f32x8<Self>) -> mask32x8<Self> {
2553 let (a0, a1) = self.split_f32x8(a);
2554 let (b0, b1) = self.split_f32x8(b);
2555 self.combine_mask32x4(self.simd_eq_f32x4(a0, b0), self.simd_eq_f32x4(a1, b1))
2556 }
2557 #[inline(always)]
2558 fn simd_lt_f32x8(self, a: f32x8<Self>, b: f32x8<Self>) -> mask32x8<Self> {
2559 let (a0, a1) = self.split_f32x8(a);
2560 let (b0, b1) = self.split_f32x8(b);
2561 self.combine_mask32x4(self.simd_lt_f32x4(a0, b0), self.simd_lt_f32x4(a1, b1))
2562 }
2563 #[inline(always)]
2564 fn simd_le_f32x8(self, a: f32x8<Self>, b: f32x8<Self>) -> mask32x8<Self> {
2565 let (a0, a1) = self.split_f32x8(a);
2566 let (b0, b1) = self.split_f32x8(b);
2567 self.combine_mask32x4(self.simd_le_f32x4(a0, b0), self.simd_le_f32x4(a1, b1))
2568 }
2569 #[inline(always)]
2570 fn simd_ge_f32x8(self, a: f32x8<Self>, b: f32x8<Self>) -> mask32x8<Self> {
2571 let (a0, a1) = self.split_f32x8(a);
2572 let (b0, b1) = self.split_f32x8(b);
2573 self.combine_mask32x4(self.simd_ge_f32x4(a0, b0), self.simd_ge_f32x4(a1, b1))
2574 }
2575 #[inline(always)]
2576 fn simd_gt_f32x8(self, a: f32x8<Self>, b: f32x8<Self>) -> mask32x8<Self> {
2577 let (a0, a1) = self.split_f32x8(a);
2578 let (b0, b1) = self.split_f32x8(b);
2579 self.combine_mask32x4(self.simd_gt_f32x4(a0, b0), self.simd_gt_f32x4(a1, b1))
2580 }
2581 #[inline(always)]
2582 fn zip_low_f32x8(self, a: f32x8<Self>, b: f32x8<Self>) -> f32x8<Self> {
2583 let (a0, _) = self.split_f32x8(a);
2584 let (b0, _) = self.split_f32x8(b);
2585 self.combine_f32x4(self.zip_low_f32x4(a0, b0), self.zip_high_f32x4(a0, b0))
2586 }
2587 #[inline(always)]
2588 fn zip_high_f32x8(self, a: f32x8<Self>, b: f32x8<Self>) -> f32x8<Self> {
2589 let (_, a1) = self.split_f32x8(a);
2590 let (_, b1) = self.split_f32x8(b);
2591 self.combine_f32x4(self.zip_low_f32x4(a1, b1), self.zip_high_f32x4(a1, b1))
2592 }
2593 #[inline(always)]
2594 fn unzip_low_f32x8(self, a: f32x8<Self>, b: f32x8<Self>) -> f32x8<Self> {
2595 let (a0, a1) = self.split_f32x8(a);
2596 let (b0, b1) = self.split_f32x8(b);
2597 self.combine_f32x4(self.unzip_low_f32x4(a0, a1), self.unzip_low_f32x4(b0, b1))
2598 }
2599 #[inline(always)]
2600 fn unzip_high_f32x8(self, a: f32x8<Self>, b: f32x8<Self>) -> f32x8<Self> {
2601 let (a0, a1) = self.split_f32x8(a);
2602 let (b0, b1) = self.split_f32x8(b);
2603 self.combine_f32x4(self.unzip_high_f32x4(a0, a1), self.unzip_high_f32x4(b0, b1))
2604 }
2605 #[inline(always)]
2606 fn interleave_f32x8(self, a: f32x8<Self>, b: f32x8<Self>) -> (f32x8<Self>, f32x8<Self>) {
2607 let (a0, a1) = self.split_f32x8(a);
2608 let (b0, b1) = self.split_f32x8(b);
2609 let lo_lo = self.zip_low_f32x4(a0, b0);
2610 let lo_hi = self.zip_high_f32x4(a0, b0);
2611 let hi_lo = self.zip_low_f32x4(a1, b1);
2612 let hi_hi = self.zip_high_f32x4(a1, b1);
2613 (
2614 self.combine_f32x4(lo_lo, lo_hi),
2615 self.combine_f32x4(hi_lo, hi_hi),
2616 )
2617 }
2618 #[inline(always)]
2619 fn deinterleave_f32x8(self, a: f32x8<Self>, b: f32x8<Self>) -> (f32x8<Self>, f32x8<Self>) {
2620 let (a0, a1) = self.split_f32x8(a);
2621 let (b0, b1) = self.split_f32x8(b);
2622 let lo_even = self.unzip_low_f32x4(a0, a1);
2623 let lo_odd = self.unzip_high_f32x4(a0, a1);
2624 let hi_even = self.unzip_low_f32x4(b0, b1);
2625 let hi_odd = self.unzip_high_f32x4(b0, b1);
2626 (
2627 self.combine_f32x4(lo_even, hi_even),
2628 self.combine_f32x4(lo_odd, hi_odd),
2629 )
2630 }
2631 #[inline(always)]
2632 fn max_f32x8(self, a: f32x8<Self>, b: f32x8<Self>) -> f32x8<Self> {
2633 let (a0, a1) = self.split_f32x8(a);
2634 let (b0, b1) = self.split_f32x8(b);
2635 self.combine_f32x4(self.max_f32x4(a0, b0), self.max_f32x4(a1, b1))
2636 }
2637 #[inline(always)]
2638 fn min_f32x8(self, a: f32x8<Self>, b: f32x8<Self>) -> f32x8<Self> {
2639 let (a0, a1) = self.split_f32x8(a);
2640 let (b0, b1) = self.split_f32x8(b);
2641 self.combine_f32x4(self.min_f32x4(a0, b0), self.min_f32x4(a1, b1))
2642 }
2643 #[inline(always)]
2644 fn max_precise_f32x8(self, a: f32x8<Self>, b: f32x8<Self>) -> f32x8<Self> {
2645 let (a0, a1) = self.split_f32x8(a);
2646 let (b0, b1) = self.split_f32x8(b);
2647 self.combine_f32x4(
2648 self.max_precise_f32x4(a0, b0),
2649 self.max_precise_f32x4(a1, b1),
2650 )
2651 }
2652 #[inline(always)]
2653 fn min_precise_f32x8(self, a: f32x8<Self>, b: f32x8<Self>) -> f32x8<Self> {
2654 let (a0, a1) = self.split_f32x8(a);
2655 let (b0, b1) = self.split_f32x8(b);
2656 self.combine_f32x4(
2657 self.min_precise_f32x4(a0, b0),
2658 self.min_precise_f32x4(a1, b1),
2659 )
2660 }
2661 #[inline(always)]
2662 fn mul_add_f32x8(self, a: f32x8<Self>, b: f32x8<Self>, c: f32x8<Self>) -> f32x8<Self> {
2663 let (a0, a1) = self.split_f32x8(a);
2664 let (b0, b1) = self.split_f32x8(b);
2665 let (c0, c1) = self.split_f32x8(c);
2666 self.combine_f32x4(
2667 self.mul_add_f32x4(a0, b0, c0),
2668 self.mul_add_f32x4(a1, b1, c1),
2669 )
2670 }
2671 #[inline(always)]
2672 fn mul_sub_f32x8(self, a: f32x8<Self>, b: f32x8<Self>, c: f32x8<Self>) -> f32x8<Self> {
2673 let (a0, a1) = self.split_f32x8(a);
2674 let (b0, b1) = self.split_f32x8(b);
2675 let (c0, c1) = self.split_f32x8(c);
2676 self.combine_f32x4(
2677 self.mul_sub_f32x4(a0, b0, c0),
2678 self.mul_sub_f32x4(a1, b1, c1),
2679 )
2680 }
2681 #[inline(always)]
2682 fn floor_f32x8(self, a: f32x8<Self>) -> f32x8<Self> {
2683 let (a0, a1) = self.split_f32x8(a);
2684 self.combine_f32x4(self.floor_f32x4(a0), self.floor_f32x4(a1))
2685 }
2686 #[inline(always)]
2687 fn ceil_f32x8(self, a: f32x8<Self>) -> f32x8<Self> {
2688 let (a0, a1) = self.split_f32x8(a);
2689 self.combine_f32x4(self.ceil_f32x4(a0), self.ceil_f32x4(a1))
2690 }
2691 #[inline(always)]
2692 fn round_ties_even_f32x8(self, a: f32x8<Self>) -> f32x8<Self> {
2693 let (a0, a1) = self.split_f32x8(a);
2694 self.combine_f32x4(
2695 self.round_ties_even_f32x4(a0),
2696 self.round_ties_even_f32x4(a1),
2697 )
2698 }
2699 #[inline(always)]
2700 fn fract_f32x8(self, a: f32x8<Self>) -> f32x8<Self> {
2701 let (a0, a1) = self.split_f32x8(a);
2702 self.combine_f32x4(self.fract_f32x4(a0), self.fract_f32x4(a1))
2703 }
2704 #[inline(always)]
2705 fn trunc_f32x8(self, a: f32x8<Self>) -> f32x8<Self> {
2706 let (a0, a1) = self.split_f32x8(a);
2707 self.combine_f32x4(self.trunc_f32x4(a0), self.trunc_f32x4(a1))
2708 }
2709 #[inline(always)]
2710 fn select_f32x8(self, a: mask32x8<Self>, b: f32x8<Self>, c: f32x8<Self>) -> f32x8<Self> {
2711 let (a0, a1) = self.split_mask32x8(a);
2712 let (b0, b1) = self.split_f32x8(b);
2713 let (c0, c1) = self.split_f32x8(c);
2714 self.combine_f32x4(self.select_f32x4(a0, b0, c0), self.select_f32x4(a1, b1, c1))
2715 }
2716 #[inline(always)]
2717 fn combine_f32x8(self, a: f32x8<Self>, b: f32x8<Self>) -> f32x16<Self> {
2718 f32x16 {
2719 val: crate::support::Aligned512(float32x4x4_t(
2720 a.val.0.0, a.val.0.1, b.val.0.0, b.val.0.1,
2721 )),
2722 simd: self,
2723 }
2724 }
2725 #[inline(always)]
2726 fn split_f32x8(self, a: f32x8<Self>) -> (f32x4<Self>, f32x4<Self>) {
2727 (
2728 f32x4 {
2729 val: crate::support::Aligned128(a.val.0.0),
2730 simd: self,
2731 },
2732 f32x4 {
2733 val: crate::support::Aligned128(a.val.0.1),
2734 simd: self,
2735 },
2736 )
2737 }
2738 #[inline(always)]
2739 fn reinterpret_f64_f32x8(self, a: f32x8<Self>) -> f64x4<Self> {
2740 let (a0, a1) = self.split_f32x8(a);
2741 self.combine_f64x2(
2742 self.reinterpret_f64_f32x4(a0),
2743 self.reinterpret_f64_f32x4(a1),
2744 )
2745 }
2746 #[inline(always)]
2747 fn reinterpret_i32_f32x8(self, a: f32x8<Self>) -> i32x8<Self> {
2748 let (a0, a1) = self.split_f32x8(a);
2749 self.combine_i32x4(
2750 self.reinterpret_i32_f32x4(a0),
2751 self.reinterpret_i32_f32x4(a1),
2752 )
2753 }
2754 #[inline(always)]
2755 fn reinterpret_u8_f32x8(self, a: f32x8<Self>) -> u8x32<Self> {
2756 let (a0, a1) = self.split_f32x8(a);
2757 self.combine_u8x16(self.reinterpret_u8_f32x4(a0), self.reinterpret_u8_f32x4(a1))
2758 }
2759 #[inline(always)]
2760 fn reinterpret_u32_f32x8(self, a: f32x8<Self>) -> u32x8<Self> {
2761 let (a0, a1) = self.split_f32x8(a);
2762 self.combine_u32x4(
2763 self.reinterpret_u32_f32x4(a0),
2764 self.reinterpret_u32_f32x4(a1),
2765 )
2766 }
2767 #[inline(always)]
2768 fn cvt_u32_f32x8(self, a: f32x8<Self>) -> u32x8<Self> {
2769 let (a0, a1) = self.split_f32x8(a);
2770 self.combine_u32x4(self.cvt_u32_f32x4(a0), self.cvt_u32_f32x4(a1))
2771 }
2772 #[inline(always)]
2773 fn cvt_u32_precise_f32x8(self, a: f32x8<Self>) -> u32x8<Self> {
2774 let (a0, a1) = self.split_f32x8(a);
2775 self.combine_u32x4(
2776 self.cvt_u32_precise_f32x4(a0),
2777 self.cvt_u32_precise_f32x4(a1),
2778 )
2779 }
2780 #[inline(always)]
2781 fn cvt_i32_f32x8(self, a: f32x8<Self>) -> i32x8<Self> {
2782 let (a0, a1) = self.split_f32x8(a);
2783 self.combine_i32x4(self.cvt_i32_f32x4(a0), self.cvt_i32_f32x4(a1))
2784 }
2785 #[inline(always)]
2786 fn cvt_i32_precise_f32x8(self, a: f32x8<Self>) -> i32x8<Self> {
2787 let (a0, a1) = self.split_f32x8(a);
2788 self.combine_i32x4(
2789 self.cvt_i32_precise_f32x4(a0),
2790 self.cvt_i32_precise_f32x4(a1),
2791 )
2792 }
2793 #[inline(always)]
2794 fn splat_i8x32(self, val: i8) -> i8x32<Self> {
2795 let half = self.splat_i8x16(val);
2796 self.combine_i8x16(half, half)
2797 }
2798 #[inline(always)]
2799 fn load_array_i8x32(self, val: [i8; 32usize]) -> i8x32<Self> {
2800 i8x32 {
2801 val: unsafe { core::mem::transmute_copy(&val) },
2802 simd: self,
2803 }
2804 }
2805 #[inline(always)]
2806 fn load_array_ref_i8x32(self, val: &[i8; 32usize]) -> i8x32<Self> {
2807 i8x32 {
2808 val: unsafe { core::mem::transmute_copy(val) },
2809 simd: self,
2810 }
2811 }
2812 #[inline(always)]
2813 fn as_array_i8x32(self, a: i8x32<Self>) -> [i8; 32usize] {
2814 unsafe { core::mem::transmute::<int8x16x2_t, [i8; 32usize]>(a.val.0) }
2815 }
2816 #[inline(always)]
2817 fn as_array_ref_i8x32(self, a: &i8x32<Self>) -> &[i8; 32usize] {
2818 unsafe { core::mem::transmute::<&int8x16x2_t, &[i8; 32usize]>(&a.val.0) }
2819 }
2820 #[inline(always)]
2821 fn as_array_mut_i8x32(self, a: &mut i8x32<Self>) -> &mut [i8; 32usize] {
2822 unsafe { core::mem::transmute::<&mut int8x16x2_t, &mut [i8; 32usize]>(&mut a.val.0) }
2823 }
2824 #[inline(always)]
2825 fn store_array_i8x32(self, a: i8x32<Self>, dest: &mut [i8; 32usize]) -> () {
2826 unsafe {
2827 core::ptr::copy_nonoverlapping(
2828 (&raw const a.val.0) as *const i8,
2829 dest.as_mut_ptr(),
2830 32usize,
2831 );
2832 }
2833 }
2834 #[inline(always)]
2835 fn cvt_from_bytes_i8x32(self, a: u8x32<Self>) -> i8x32<Self> {
2836 unsafe {
2837 i8x32 {
2838 val: core::mem::transmute(a.val),
2839 simd: self,
2840 }
2841 }
2842 }
2843 #[inline(always)]
2844 fn cvt_to_bytes_i8x32(self, a: i8x32<Self>) -> u8x32<Self> {
2845 unsafe {
2846 u8x32 {
2847 val: core::mem::transmute(a.val),
2848 simd: self,
2849 }
2850 }
2851 }
2852 #[inline(always)]
2853 fn slide_i8x32<const SHIFT: usize>(self, a: i8x32<Self>, b: i8x32<Self>) -> i8x32<Self> {
2854 if SHIFT >= 32usize {
2855 return b;
2856 }
2857 let result = unsafe {
2858 let a_bytes = self.cvt_to_bytes_i8x32(a).val.0;
2859 let b_bytes = self.cvt_to_bytes_i8x32(b).val.0;
2860 let a_blocks = [a_bytes.0, a_bytes.1];
2861 let b_blocks = [b_bytes.0, b_bytes.1];
2862 let shift_bytes = SHIFT;
2863 uint8x16x2_t(
2864 {
2865 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
2866 &a_blocks,
2867 &b_blocks,
2868 0,
2869 shift_bytes,
2870 );
2871 dyn_vext_128(lo, hi, shift_bytes % 16)
2872 },
2873 {
2874 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
2875 &a_blocks,
2876 &b_blocks,
2877 1,
2878 shift_bytes,
2879 );
2880 dyn_vext_128(lo, hi, shift_bytes % 16)
2881 },
2882 )
2883 };
2884 self.cvt_from_bytes_i8x32(u8x32 {
2885 val: crate::support::Aligned256(result),
2886 simd: self,
2887 })
2888 }
2889 #[inline(always)]
2890 fn slide_within_blocks_i8x32<const SHIFT: usize>(
2891 self,
2892 a: i8x32<Self>,
2893 b: i8x32<Self>,
2894 ) -> i8x32<Self> {
2895 let (a0, a1) = self.split_i8x32(a);
2896 let (b0, b1) = self.split_i8x32(b);
2897 self.combine_i8x16(
2898 self.slide_within_blocks_i8x16::<SHIFT>(a0, b0),
2899 self.slide_within_blocks_i8x16::<SHIFT>(a1, b1),
2900 )
2901 }
2902 #[inline(always)]
2903 fn add_i8x32(self, a: i8x32<Self>, b: i8x32<Self>) -> i8x32<Self> {
2904 let (a0, a1) = self.split_i8x32(a);
2905 let (b0, b1) = self.split_i8x32(b);
2906 self.combine_i8x16(self.add_i8x16(a0, b0), self.add_i8x16(a1, b1))
2907 }
2908 #[inline(always)]
2909 fn sub_i8x32(self, a: i8x32<Self>, b: i8x32<Self>) -> i8x32<Self> {
2910 let (a0, a1) = self.split_i8x32(a);
2911 let (b0, b1) = self.split_i8x32(b);
2912 self.combine_i8x16(self.sub_i8x16(a0, b0), self.sub_i8x16(a1, b1))
2913 }
2914 #[inline(always)]
2915 fn mul_i8x32(self, a: i8x32<Self>, b: i8x32<Self>) -> i8x32<Self> {
2916 let (a0, a1) = self.split_i8x32(a);
2917 let (b0, b1) = self.split_i8x32(b);
2918 self.combine_i8x16(self.mul_i8x16(a0, b0), self.mul_i8x16(a1, b1))
2919 }
2920 #[inline(always)]
2921 fn and_i8x32(self, a: i8x32<Self>, b: i8x32<Self>) -> i8x32<Self> {
2922 let (a0, a1) = self.split_i8x32(a);
2923 let (b0, b1) = self.split_i8x32(b);
2924 self.combine_i8x16(self.and_i8x16(a0, b0), self.and_i8x16(a1, b1))
2925 }
2926 #[inline(always)]
2927 fn or_i8x32(self, a: i8x32<Self>, b: i8x32<Self>) -> i8x32<Self> {
2928 let (a0, a1) = self.split_i8x32(a);
2929 let (b0, b1) = self.split_i8x32(b);
2930 self.combine_i8x16(self.or_i8x16(a0, b0), self.or_i8x16(a1, b1))
2931 }
2932 #[inline(always)]
2933 fn xor_i8x32(self, a: i8x32<Self>, b: i8x32<Self>) -> i8x32<Self> {
2934 let (a0, a1) = self.split_i8x32(a);
2935 let (b0, b1) = self.split_i8x32(b);
2936 self.combine_i8x16(self.xor_i8x16(a0, b0), self.xor_i8x16(a1, b1))
2937 }
2938 #[inline(always)]
2939 fn not_i8x32(self, a: i8x32<Self>) -> i8x32<Self> {
2940 let (a0, a1) = self.split_i8x32(a);
2941 self.combine_i8x16(self.not_i8x16(a0), self.not_i8x16(a1))
2942 }
2943 #[inline(always)]
2944 fn shl_i8x32(self, a: i8x32<Self>, shift: u32) -> i8x32<Self> {
2945 let (a0, a1) = self.split_i8x32(a);
2946 self.combine_i8x16(self.shl_i8x16(a0, shift), self.shl_i8x16(a1, shift))
2947 }
2948 #[inline(always)]
2949 fn shlv_i8x32(self, a: i8x32<Self>, b: i8x32<Self>) -> i8x32<Self> {
2950 let (a0, a1) = self.split_i8x32(a);
2951 let (b0, b1) = self.split_i8x32(b);
2952 self.combine_i8x16(self.shlv_i8x16(a0, b0), self.shlv_i8x16(a1, b1))
2953 }
2954 #[inline(always)]
2955 fn shr_i8x32(self, a: i8x32<Self>, shift: u32) -> i8x32<Self> {
2956 let (a0, a1) = self.split_i8x32(a);
2957 self.combine_i8x16(self.shr_i8x16(a0, shift), self.shr_i8x16(a1, shift))
2958 }
2959 #[inline(always)]
2960 fn shrv_i8x32(self, a: i8x32<Self>, b: i8x32<Self>) -> i8x32<Self> {
2961 let (a0, a1) = self.split_i8x32(a);
2962 let (b0, b1) = self.split_i8x32(b);
2963 self.combine_i8x16(self.shrv_i8x16(a0, b0), self.shrv_i8x16(a1, b1))
2964 }
2965 #[inline(always)]
2966 fn simd_eq_i8x32(self, a: i8x32<Self>, b: i8x32<Self>) -> mask8x32<Self> {
2967 let (a0, a1) = self.split_i8x32(a);
2968 let (b0, b1) = self.split_i8x32(b);
2969 self.combine_mask8x16(self.simd_eq_i8x16(a0, b0), self.simd_eq_i8x16(a1, b1))
2970 }
2971 #[inline(always)]
2972 fn simd_lt_i8x32(self, a: i8x32<Self>, b: i8x32<Self>) -> mask8x32<Self> {
2973 let (a0, a1) = self.split_i8x32(a);
2974 let (b0, b1) = self.split_i8x32(b);
2975 self.combine_mask8x16(self.simd_lt_i8x16(a0, b0), self.simd_lt_i8x16(a1, b1))
2976 }
2977 #[inline(always)]
2978 fn simd_le_i8x32(self, a: i8x32<Self>, b: i8x32<Self>) -> mask8x32<Self> {
2979 let (a0, a1) = self.split_i8x32(a);
2980 let (b0, b1) = self.split_i8x32(b);
2981 self.combine_mask8x16(self.simd_le_i8x16(a0, b0), self.simd_le_i8x16(a1, b1))
2982 }
2983 #[inline(always)]
2984 fn simd_ge_i8x32(self, a: i8x32<Self>, b: i8x32<Self>) -> mask8x32<Self> {
2985 let (a0, a1) = self.split_i8x32(a);
2986 let (b0, b1) = self.split_i8x32(b);
2987 self.combine_mask8x16(self.simd_ge_i8x16(a0, b0), self.simd_ge_i8x16(a1, b1))
2988 }
2989 #[inline(always)]
2990 fn simd_gt_i8x32(self, a: i8x32<Self>, b: i8x32<Self>) -> mask8x32<Self> {
2991 let (a0, a1) = self.split_i8x32(a);
2992 let (b0, b1) = self.split_i8x32(b);
2993 self.combine_mask8x16(self.simd_gt_i8x16(a0, b0), self.simd_gt_i8x16(a1, b1))
2994 }
2995 #[inline(always)]
2996 fn zip_low_i8x32(self, a: i8x32<Self>, b: i8x32<Self>) -> i8x32<Self> {
2997 let (a0, _) = self.split_i8x32(a);
2998 let (b0, _) = self.split_i8x32(b);
2999 self.combine_i8x16(self.zip_low_i8x16(a0, b0), self.zip_high_i8x16(a0, b0))
3000 }
3001 #[inline(always)]
3002 fn zip_high_i8x32(self, a: i8x32<Self>, b: i8x32<Self>) -> i8x32<Self> {
3003 let (_, a1) = self.split_i8x32(a);
3004 let (_, b1) = self.split_i8x32(b);
3005 self.combine_i8x16(self.zip_low_i8x16(a1, b1), self.zip_high_i8x16(a1, b1))
3006 }
3007 #[inline(always)]
3008 fn unzip_low_i8x32(self, a: i8x32<Self>, b: i8x32<Self>) -> i8x32<Self> {
3009 let (a0, a1) = self.split_i8x32(a);
3010 let (b0, b1) = self.split_i8x32(b);
3011 self.combine_i8x16(self.unzip_low_i8x16(a0, a1), self.unzip_low_i8x16(b0, b1))
3012 }
3013 #[inline(always)]
3014 fn unzip_high_i8x32(self, a: i8x32<Self>, b: i8x32<Self>) -> i8x32<Self> {
3015 let (a0, a1) = self.split_i8x32(a);
3016 let (b0, b1) = self.split_i8x32(b);
3017 self.combine_i8x16(self.unzip_high_i8x16(a0, a1), self.unzip_high_i8x16(b0, b1))
3018 }
3019 #[inline(always)]
3020 fn interleave_i8x32(self, a: i8x32<Self>, b: i8x32<Self>) -> (i8x32<Self>, i8x32<Self>) {
3021 let (a0, a1) = self.split_i8x32(a);
3022 let (b0, b1) = self.split_i8x32(b);
3023 let lo_lo = self.zip_low_i8x16(a0, b0);
3024 let lo_hi = self.zip_high_i8x16(a0, b0);
3025 let hi_lo = self.zip_low_i8x16(a1, b1);
3026 let hi_hi = self.zip_high_i8x16(a1, b1);
3027 (
3028 self.combine_i8x16(lo_lo, lo_hi),
3029 self.combine_i8x16(hi_lo, hi_hi),
3030 )
3031 }
3032 #[inline(always)]
3033 fn deinterleave_i8x32(self, a: i8x32<Self>, b: i8x32<Self>) -> (i8x32<Self>, i8x32<Self>) {
3034 let (a0, a1) = self.split_i8x32(a);
3035 let (b0, b1) = self.split_i8x32(b);
3036 let lo_even = self.unzip_low_i8x16(a0, a1);
3037 let lo_odd = self.unzip_high_i8x16(a0, a1);
3038 let hi_even = self.unzip_low_i8x16(b0, b1);
3039 let hi_odd = self.unzip_high_i8x16(b0, b1);
3040 (
3041 self.combine_i8x16(lo_even, hi_even),
3042 self.combine_i8x16(lo_odd, hi_odd),
3043 )
3044 }
3045 #[inline(always)]
3046 fn select_i8x32(self, a: mask8x32<Self>, b: i8x32<Self>, c: i8x32<Self>) -> i8x32<Self> {
3047 let (a0, a1) = self.split_mask8x32(a);
3048 let (b0, b1) = self.split_i8x32(b);
3049 let (c0, c1) = self.split_i8x32(c);
3050 self.combine_i8x16(self.select_i8x16(a0, b0, c0), self.select_i8x16(a1, b1, c1))
3051 }
3052 #[inline(always)]
3053 fn min_i8x32(self, a: i8x32<Self>, b: i8x32<Self>) -> i8x32<Self> {
3054 let (a0, a1) = self.split_i8x32(a);
3055 let (b0, b1) = self.split_i8x32(b);
3056 self.combine_i8x16(self.min_i8x16(a0, b0), self.min_i8x16(a1, b1))
3057 }
3058 #[inline(always)]
3059 fn max_i8x32(self, a: i8x32<Self>, b: i8x32<Self>) -> i8x32<Self> {
3060 let (a0, a1) = self.split_i8x32(a);
3061 let (b0, b1) = self.split_i8x32(b);
3062 self.combine_i8x16(self.max_i8x16(a0, b0), self.max_i8x16(a1, b1))
3063 }
3064 #[inline(always)]
3065 fn combine_i8x32(self, a: i8x32<Self>, b: i8x32<Self>) -> i8x64<Self> {
3066 i8x64 {
3067 val: crate::support::Aligned512(int8x16x4_t(
3068 a.val.0.0, a.val.0.1, b.val.0.0, b.val.0.1,
3069 )),
3070 simd: self,
3071 }
3072 }
3073 #[inline(always)]
3074 fn split_i8x32(self, a: i8x32<Self>) -> (i8x16<Self>, i8x16<Self>) {
3075 (
3076 i8x16 {
3077 val: crate::support::Aligned128(a.val.0.0),
3078 simd: self,
3079 },
3080 i8x16 {
3081 val: crate::support::Aligned128(a.val.0.1),
3082 simd: self,
3083 },
3084 )
3085 }
3086 #[inline(always)]
3087 fn neg_i8x32(self, a: i8x32<Self>) -> i8x32<Self> {
3088 let (a0, a1) = self.split_i8x32(a);
3089 self.combine_i8x16(self.neg_i8x16(a0), self.neg_i8x16(a1))
3090 }
3091 #[inline(always)]
3092 fn reinterpret_u8_i8x32(self, a: i8x32<Self>) -> u8x32<Self> {
3093 let (a0, a1) = self.split_i8x32(a);
3094 self.combine_u8x16(self.reinterpret_u8_i8x16(a0), self.reinterpret_u8_i8x16(a1))
3095 }
3096 #[inline(always)]
3097 fn reinterpret_u32_i8x32(self, a: i8x32<Self>) -> u32x8<Self> {
3098 let (a0, a1) = self.split_i8x32(a);
3099 self.combine_u32x4(
3100 self.reinterpret_u32_i8x16(a0),
3101 self.reinterpret_u32_i8x16(a1),
3102 )
3103 }
3104 #[inline(always)]
3105 fn splat_u8x32(self, val: u8) -> u8x32<Self> {
3106 let half = self.splat_u8x16(val);
3107 self.combine_u8x16(half, half)
3108 }
3109 #[inline(always)]
3110 fn load_array_u8x32(self, val: [u8; 32usize]) -> u8x32<Self> {
3111 u8x32 {
3112 val: unsafe { core::mem::transmute_copy(&val) },
3113 simd: self,
3114 }
3115 }
3116 #[inline(always)]
3117 fn load_array_ref_u8x32(self, val: &[u8; 32usize]) -> u8x32<Self> {
3118 u8x32 {
3119 val: unsafe { core::mem::transmute_copy(val) },
3120 simd: self,
3121 }
3122 }
3123 #[inline(always)]
3124 fn as_array_u8x32(self, a: u8x32<Self>) -> [u8; 32usize] {
3125 unsafe { core::mem::transmute::<uint8x16x2_t, [u8; 32usize]>(a.val.0) }
3126 }
3127 #[inline(always)]
3128 fn as_array_ref_u8x32(self, a: &u8x32<Self>) -> &[u8; 32usize] {
3129 unsafe { core::mem::transmute::<&uint8x16x2_t, &[u8; 32usize]>(&a.val.0) }
3130 }
3131 #[inline(always)]
3132 fn as_array_mut_u8x32(self, a: &mut u8x32<Self>) -> &mut [u8; 32usize] {
3133 unsafe { core::mem::transmute::<&mut uint8x16x2_t, &mut [u8; 32usize]>(&mut a.val.0) }
3134 }
3135 #[inline(always)]
3136 fn store_array_u8x32(self, a: u8x32<Self>, dest: &mut [u8; 32usize]) -> () {
3137 unsafe {
3138 core::ptr::copy_nonoverlapping(
3139 (&raw const a.val.0) as *const u8,
3140 dest.as_mut_ptr(),
3141 32usize,
3142 );
3143 }
3144 }
3145 #[inline(always)]
3146 fn cvt_from_bytes_u8x32(self, a: u8x32<Self>) -> u8x32<Self> {
3147 unsafe {
3148 u8x32 {
3149 val: core::mem::transmute(a.val),
3150 simd: self,
3151 }
3152 }
3153 }
3154 #[inline(always)]
3155 fn cvt_to_bytes_u8x32(self, a: u8x32<Self>) -> u8x32<Self> {
3156 unsafe {
3157 u8x32 {
3158 val: core::mem::transmute(a.val),
3159 simd: self,
3160 }
3161 }
3162 }
3163 #[inline(always)]
3164 fn slide_u8x32<const SHIFT: usize>(self, a: u8x32<Self>, b: u8x32<Self>) -> u8x32<Self> {
3165 if SHIFT >= 32usize {
3166 return b;
3167 }
3168 let result = unsafe {
3169 let a_bytes = self.cvt_to_bytes_u8x32(a).val.0;
3170 let b_bytes = self.cvt_to_bytes_u8x32(b).val.0;
3171 let a_blocks = [a_bytes.0, a_bytes.1];
3172 let b_blocks = [b_bytes.0, b_bytes.1];
3173 let shift_bytes = SHIFT;
3174 uint8x16x2_t(
3175 {
3176 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
3177 &a_blocks,
3178 &b_blocks,
3179 0,
3180 shift_bytes,
3181 );
3182 dyn_vext_128(lo, hi, shift_bytes % 16)
3183 },
3184 {
3185 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
3186 &a_blocks,
3187 &b_blocks,
3188 1,
3189 shift_bytes,
3190 );
3191 dyn_vext_128(lo, hi, shift_bytes % 16)
3192 },
3193 )
3194 };
3195 self.cvt_from_bytes_u8x32(u8x32 {
3196 val: crate::support::Aligned256(result),
3197 simd: self,
3198 })
3199 }
3200 #[inline(always)]
3201 fn slide_within_blocks_u8x32<const SHIFT: usize>(
3202 self,
3203 a: u8x32<Self>,
3204 b: u8x32<Self>,
3205 ) -> u8x32<Self> {
3206 let (a0, a1) = self.split_u8x32(a);
3207 let (b0, b1) = self.split_u8x32(b);
3208 self.combine_u8x16(
3209 self.slide_within_blocks_u8x16::<SHIFT>(a0, b0),
3210 self.slide_within_blocks_u8x16::<SHIFT>(a1, b1),
3211 )
3212 }
3213 #[inline(always)]
3214 fn add_u8x32(self, a: u8x32<Self>, b: u8x32<Self>) -> u8x32<Self> {
3215 let (a0, a1) = self.split_u8x32(a);
3216 let (b0, b1) = self.split_u8x32(b);
3217 self.combine_u8x16(self.add_u8x16(a0, b0), self.add_u8x16(a1, b1))
3218 }
3219 #[inline(always)]
3220 fn sub_u8x32(self, a: u8x32<Self>, b: u8x32<Self>) -> u8x32<Self> {
3221 let (a0, a1) = self.split_u8x32(a);
3222 let (b0, b1) = self.split_u8x32(b);
3223 self.combine_u8x16(self.sub_u8x16(a0, b0), self.sub_u8x16(a1, b1))
3224 }
3225 #[inline(always)]
3226 fn mul_u8x32(self, a: u8x32<Self>, b: u8x32<Self>) -> u8x32<Self> {
3227 let (a0, a1) = self.split_u8x32(a);
3228 let (b0, b1) = self.split_u8x32(b);
3229 self.combine_u8x16(self.mul_u8x16(a0, b0), self.mul_u8x16(a1, b1))
3230 }
3231 #[inline(always)]
3232 fn and_u8x32(self, a: u8x32<Self>, b: u8x32<Self>) -> u8x32<Self> {
3233 let (a0, a1) = self.split_u8x32(a);
3234 let (b0, b1) = self.split_u8x32(b);
3235 self.combine_u8x16(self.and_u8x16(a0, b0), self.and_u8x16(a1, b1))
3236 }
3237 #[inline(always)]
3238 fn or_u8x32(self, a: u8x32<Self>, b: u8x32<Self>) -> u8x32<Self> {
3239 let (a0, a1) = self.split_u8x32(a);
3240 let (b0, b1) = self.split_u8x32(b);
3241 self.combine_u8x16(self.or_u8x16(a0, b0), self.or_u8x16(a1, b1))
3242 }
3243 #[inline(always)]
3244 fn xor_u8x32(self, a: u8x32<Self>, b: u8x32<Self>) -> u8x32<Self> {
3245 let (a0, a1) = self.split_u8x32(a);
3246 let (b0, b1) = self.split_u8x32(b);
3247 self.combine_u8x16(self.xor_u8x16(a0, b0), self.xor_u8x16(a1, b1))
3248 }
3249 #[inline(always)]
3250 fn not_u8x32(self, a: u8x32<Self>) -> u8x32<Self> {
3251 let (a0, a1) = self.split_u8x32(a);
3252 self.combine_u8x16(self.not_u8x16(a0), self.not_u8x16(a1))
3253 }
3254 #[inline(always)]
3255 fn shl_u8x32(self, a: u8x32<Self>, shift: u32) -> u8x32<Self> {
3256 let (a0, a1) = self.split_u8x32(a);
3257 self.combine_u8x16(self.shl_u8x16(a0, shift), self.shl_u8x16(a1, shift))
3258 }
3259 #[inline(always)]
3260 fn shlv_u8x32(self, a: u8x32<Self>, b: u8x32<Self>) -> u8x32<Self> {
3261 let (a0, a1) = self.split_u8x32(a);
3262 let (b0, b1) = self.split_u8x32(b);
3263 self.combine_u8x16(self.shlv_u8x16(a0, b0), self.shlv_u8x16(a1, b1))
3264 }
3265 #[inline(always)]
3266 fn shr_u8x32(self, a: u8x32<Self>, shift: u32) -> u8x32<Self> {
3267 let (a0, a1) = self.split_u8x32(a);
3268 self.combine_u8x16(self.shr_u8x16(a0, shift), self.shr_u8x16(a1, shift))
3269 }
3270 #[inline(always)]
3271 fn shrv_u8x32(self, a: u8x32<Self>, b: u8x32<Self>) -> u8x32<Self> {
3272 let (a0, a1) = self.split_u8x32(a);
3273 let (b0, b1) = self.split_u8x32(b);
3274 self.combine_u8x16(self.shrv_u8x16(a0, b0), self.shrv_u8x16(a1, b1))
3275 }
3276 #[inline(always)]
3277 fn simd_eq_u8x32(self, a: u8x32<Self>, b: u8x32<Self>) -> mask8x32<Self> {
3278 let (a0, a1) = self.split_u8x32(a);
3279 let (b0, b1) = self.split_u8x32(b);
3280 self.combine_mask8x16(self.simd_eq_u8x16(a0, b0), self.simd_eq_u8x16(a1, b1))
3281 }
3282 #[inline(always)]
3283 fn simd_lt_u8x32(self, a: u8x32<Self>, b: u8x32<Self>) -> mask8x32<Self> {
3284 let (a0, a1) = self.split_u8x32(a);
3285 let (b0, b1) = self.split_u8x32(b);
3286 self.combine_mask8x16(self.simd_lt_u8x16(a0, b0), self.simd_lt_u8x16(a1, b1))
3287 }
3288 #[inline(always)]
3289 fn simd_le_u8x32(self, a: u8x32<Self>, b: u8x32<Self>) -> mask8x32<Self> {
3290 let (a0, a1) = self.split_u8x32(a);
3291 let (b0, b1) = self.split_u8x32(b);
3292 self.combine_mask8x16(self.simd_le_u8x16(a0, b0), self.simd_le_u8x16(a1, b1))
3293 }
3294 #[inline(always)]
3295 fn simd_ge_u8x32(self, a: u8x32<Self>, b: u8x32<Self>) -> mask8x32<Self> {
3296 let (a0, a1) = self.split_u8x32(a);
3297 let (b0, b1) = self.split_u8x32(b);
3298 self.combine_mask8x16(self.simd_ge_u8x16(a0, b0), self.simd_ge_u8x16(a1, b1))
3299 }
3300 #[inline(always)]
3301 fn simd_gt_u8x32(self, a: u8x32<Self>, b: u8x32<Self>) -> mask8x32<Self> {
3302 let (a0, a1) = self.split_u8x32(a);
3303 let (b0, b1) = self.split_u8x32(b);
3304 self.combine_mask8x16(self.simd_gt_u8x16(a0, b0), self.simd_gt_u8x16(a1, b1))
3305 }
3306 #[inline(always)]
3307 fn zip_low_u8x32(self, a: u8x32<Self>, b: u8x32<Self>) -> u8x32<Self> {
3308 let (a0, _) = self.split_u8x32(a);
3309 let (b0, _) = self.split_u8x32(b);
3310 self.combine_u8x16(self.zip_low_u8x16(a0, b0), self.zip_high_u8x16(a0, b0))
3311 }
3312 #[inline(always)]
3313 fn zip_high_u8x32(self, a: u8x32<Self>, b: u8x32<Self>) -> u8x32<Self> {
3314 let (_, a1) = self.split_u8x32(a);
3315 let (_, b1) = self.split_u8x32(b);
3316 self.combine_u8x16(self.zip_low_u8x16(a1, b1), self.zip_high_u8x16(a1, b1))
3317 }
3318 #[inline(always)]
3319 fn unzip_low_u8x32(self, a: u8x32<Self>, b: u8x32<Self>) -> u8x32<Self> {
3320 let (a0, a1) = self.split_u8x32(a);
3321 let (b0, b1) = self.split_u8x32(b);
3322 self.combine_u8x16(self.unzip_low_u8x16(a0, a1), self.unzip_low_u8x16(b0, b1))
3323 }
3324 #[inline(always)]
3325 fn unzip_high_u8x32(self, a: u8x32<Self>, b: u8x32<Self>) -> u8x32<Self> {
3326 let (a0, a1) = self.split_u8x32(a);
3327 let (b0, b1) = self.split_u8x32(b);
3328 self.combine_u8x16(self.unzip_high_u8x16(a0, a1), self.unzip_high_u8x16(b0, b1))
3329 }
3330 #[inline(always)]
3331 fn interleave_u8x32(self, a: u8x32<Self>, b: u8x32<Self>) -> (u8x32<Self>, u8x32<Self>) {
3332 let (a0, a1) = self.split_u8x32(a);
3333 let (b0, b1) = self.split_u8x32(b);
3334 let lo_lo = self.zip_low_u8x16(a0, b0);
3335 let lo_hi = self.zip_high_u8x16(a0, b0);
3336 let hi_lo = self.zip_low_u8x16(a1, b1);
3337 let hi_hi = self.zip_high_u8x16(a1, b1);
3338 (
3339 self.combine_u8x16(lo_lo, lo_hi),
3340 self.combine_u8x16(hi_lo, hi_hi),
3341 )
3342 }
3343 #[inline(always)]
3344 fn deinterleave_u8x32(self, a: u8x32<Self>, b: u8x32<Self>) -> (u8x32<Self>, u8x32<Self>) {
3345 let (a0, a1) = self.split_u8x32(a);
3346 let (b0, b1) = self.split_u8x32(b);
3347 let lo_even = self.unzip_low_u8x16(a0, a1);
3348 let lo_odd = self.unzip_high_u8x16(a0, a1);
3349 let hi_even = self.unzip_low_u8x16(b0, b1);
3350 let hi_odd = self.unzip_high_u8x16(b0, b1);
3351 (
3352 self.combine_u8x16(lo_even, hi_even),
3353 self.combine_u8x16(lo_odd, hi_odd),
3354 )
3355 }
3356 #[inline(always)]
3357 fn select_u8x32(self, a: mask8x32<Self>, b: u8x32<Self>, c: u8x32<Self>) -> u8x32<Self> {
3358 let (a0, a1) = self.split_mask8x32(a);
3359 let (b0, b1) = self.split_u8x32(b);
3360 let (c0, c1) = self.split_u8x32(c);
3361 self.combine_u8x16(self.select_u8x16(a0, b0, c0), self.select_u8x16(a1, b1, c1))
3362 }
3363 #[inline(always)]
3364 fn min_u8x32(self, a: u8x32<Self>, b: u8x32<Self>) -> u8x32<Self> {
3365 let (a0, a1) = self.split_u8x32(a);
3366 let (b0, b1) = self.split_u8x32(b);
3367 self.combine_u8x16(self.min_u8x16(a0, b0), self.min_u8x16(a1, b1))
3368 }
3369 #[inline(always)]
3370 fn max_u8x32(self, a: u8x32<Self>, b: u8x32<Self>) -> u8x32<Self> {
3371 let (a0, a1) = self.split_u8x32(a);
3372 let (b0, b1) = self.split_u8x32(b);
3373 self.combine_u8x16(self.max_u8x16(a0, b0), self.max_u8x16(a1, b1))
3374 }
3375 #[inline(always)]
3376 fn combine_u8x32(self, a: u8x32<Self>, b: u8x32<Self>) -> u8x64<Self> {
3377 u8x64 {
3378 val: crate::support::Aligned512(uint8x16x4_t(
3379 a.val.0.0, a.val.0.1, b.val.0.0, b.val.0.1,
3380 )),
3381 simd: self,
3382 }
3383 }
3384 #[inline(always)]
3385 fn split_u8x32(self, a: u8x32<Self>) -> (u8x16<Self>, u8x16<Self>) {
3386 (
3387 u8x16 {
3388 val: crate::support::Aligned128(a.val.0.0),
3389 simd: self,
3390 },
3391 u8x16 {
3392 val: crate::support::Aligned128(a.val.0.1),
3393 simd: self,
3394 },
3395 )
3396 }
3397 #[inline(always)]
3398 fn widen_u8x32(self, a: u8x32<Self>) -> u16x32<Self> {
3399 let (a0, a1) = self.split_u8x32(a);
3400 self.combine_u16x16(self.widen_u8x16(a0), self.widen_u8x16(a1))
3401 }
3402 #[inline(always)]
3403 fn reinterpret_u32_u8x32(self, a: u8x32<Self>) -> u32x8<Self> {
3404 let (a0, a1) = self.split_u8x32(a);
3405 self.combine_u32x4(
3406 self.reinterpret_u32_u8x16(a0),
3407 self.reinterpret_u32_u8x16(a1),
3408 )
3409 }
3410 #[inline(always)]
3411 fn splat_mask8x32(self, val: i8) -> mask8x32<Self> {
3412 let half = self.splat_mask8x16(val);
3413 self.combine_mask8x16(half, half)
3414 }
3415 #[inline(always)]
3416 fn load_array_mask8x32(self, val: [i8; 32usize]) -> mask8x32<Self> {
3417 mask8x32 {
3418 val: unsafe { core::mem::transmute_copy(&val) },
3419 simd: self,
3420 }
3421 }
3422 #[inline(always)]
3423 fn load_array_ref_mask8x32(self, val: &[i8; 32usize]) -> mask8x32<Self> {
3424 mask8x32 {
3425 val: unsafe { core::mem::transmute_copy(val) },
3426 simd: self,
3427 }
3428 }
3429 #[inline(always)]
3430 fn as_array_mask8x32(self, a: mask8x32<Self>) -> [i8; 32usize] {
3431 unsafe { core::mem::transmute::<int8x16x2_t, [i8; 32usize]>(a.val.0) }
3432 }
3433 #[inline(always)]
3434 fn as_array_ref_mask8x32(self, a: &mask8x32<Self>) -> &[i8; 32usize] {
3435 unsafe { core::mem::transmute::<&int8x16x2_t, &[i8; 32usize]>(&a.val.0) }
3436 }
3437 #[inline(always)]
3438 fn as_array_mut_mask8x32(self, a: &mut mask8x32<Self>) -> &mut [i8; 32usize] {
3439 unsafe { core::mem::transmute::<&mut int8x16x2_t, &mut [i8; 32usize]>(&mut a.val.0) }
3440 }
3441 #[inline(always)]
3442 fn store_array_mask8x32(self, a: mask8x32<Self>, dest: &mut [i8; 32usize]) -> () {
3443 unsafe {
3444 core::ptr::copy_nonoverlapping(
3445 (&raw const a.val.0) as *const i8,
3446 dest.as_mut_ptr(),
3447 32usize,
3448 );
3449 }
3450 }
3451 #[inline(always)]
3452 fn cvt_from_bytes_mask8x32(self, a: u8x32<Self>) -> mask8x32<Self> {
3453 unsafe {
3454 mask8x32 {
3455 val: core::mem::transmute(a.val),
3456 simd: self,
3457 }
3458 }
3459 }
3460 #[inline(always)]
3461 fn cvt_to_bytes_mask8x32(self, a: mask8x32<Self>) -> u8x32<Self> {
3462 unsafe {
3463 u8x32 {
3464 val: core::mem::transmute(a.val),
3465 simd: self,
3466 }
3467 }
3468 }
3469 #[inline(always)]
3470 fn slide_mask8x32<const SHIFT: usize>(
3471 self,
3472 a: mask8x32<Self>,
3473 b: mask8x32<Self>,
3474 ) -> mask8x32<Self> {
3475 if SHIFT >= 32usize {
3476 return b;
3477 }
3478 let result = unsafe {
3479 let a_bytes = self.cvt_to_bytes_mask8x32(a).val.0;
3480 let b_bytes = self.cvt_to_bytes_mask8x32(b).val.0;
3481 let a_blocks = [a_bytes.0, a_bytes.1];
3482 let b_blocks = [b_bytes.0, b_bytes.1];
3483 let shift_bytes = SHIFT;
3484 uint8x16x2_t(
3485 {
3486 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
3487 &a_blocks,
3488 &b_blocks,
3489 0,
3490 shift_bytes,
3491 );
3492 dyn_vext_128(lo, hi, shift_bytes % 16)
3493 },
3494 {
3495 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
3496 &a_blocks,
3497 &b_blocks,
3498 1,
3499 shift_bytes,
3500 );
3501 dyn_vext_128(lo, hi, shift_bytes % 16)
3502 },
3503 )
3504 };
3505 self.cvt_from_bytes_mask8x32(u8x32 {
3506 val: crate::support::Aligned256(result),
3507 simd: self,
3508 })
3509 }
3510 #[inline(always)]
3511 fn slide_within_blocks_mask8x32<const SHIFT: usize>(
3512 self,
3513 a: mask8x32<Self>,
3514 b: mask8x32<Self>,
3515 ) -> mask8x32<Self> {
3516 let (a0, a1) = self.split_mask8x32(a);
3517 let (b0, b1) = self.split_mask8x32(b);
3518 self.combine_mask8x16(
3519 self.slide_within_blocks_mask8x16::<SHIFT>(a0, b0),
3520 self.slide_within_blocks_mask8x16::<SHIFT>(a1, b1),
3521 )
3522 }
3523 #[inline(always)]
3524 fn and_mask8x32(self, a: mask8x32<Self>, b: mask8x32<Self>) -> mask8x32<Self> {
3525 let (a0, a1) = self.split_mask8x32(a);
3526 let (b0, b1) = self.split_mask8x32(b);
3527 self.combine_mask8x16(self.and_mask8x16(a0, b0), self.and_mask8x16(a1, b1))
3528 }
3529 #[inline(always)]
3530 fn or_mask8x32(self, a: mask8x32<Self>, b: mask8x32<Self>) -> mask8x32<Self> {
3531 let (a0, a1) = self.split_mask8x32(a);
3532 let (b0, b1) = self.split_mask8x32(b);
3533 self.combine_mask8x16(self.or_mask8x16(a0, b0), self.or_mask8x16(a1, b1))
3534 }
3535 #[inline(always)]
3536 fn xor_mask8x32(self, a: mask8x32<Self>, b: mask8x32<Self>) -> mask8x32<Self> {
3537 let (a0, a1) = self.split_mask8x32(a);
3538 let (b0, b1) = self.split_mask8x32(b);
3539 self.combine_mask8x16(self.xor_mask8x16(a0, b0), self.xor_mask8x16(a1, b1))
3540 }
3541 #[inline(always)]
3542 fn not_mask8x32(self, a: mask8x32<Self>) -> mask8x32<Self> {
3543 let (a0, a1) = self.split_mask8x32(a);
3544 self.combine_mask8x16(self.not_mask8x16(a0), self.not_mask8x16(a1))
3545 }
3546 #[inline(always)]
3547 fn select_mask8x32(
3548 self,
3549 a: mask8x32<Self>,
3550 b: mask8x32<Self>,
3551 c: mask8x32<Self>,
3552 ) -> mask8x32<Self> {
3553 let (a0, a1) = self.split_mask8x32(a);
3554 let (b0, b1) = self.split_mask8x32(b);
3555 let (c0, c1) = self.split_mask8x32(c);
3556 self.combine_mask8x16(
3557 self.select_mask8x16(a0, b0, c0),
3558 self.select_mask8x16(a1, b1, c1),
3559 )
3560 }
3561 #[inline(always)]
3562 fn simd_eq_mask8x32(self, a: mask8x32<Self>, b: mask8x32<Self>) -> mask8x32<Self> {
3563 let (a0, a1) = self.split_mask8x32(a);
3564 let (b0, b1) = self.split_mask8x32(b);
3565 self.combine_mask8x16(self.simd_eq_mask8x16(a0, b0), self.simd_eq_mask8x16(a1, b1))
3566 }
3567 #[inline(always)]
3568 fn any_true_mask8x32(self, a: mask8x32<Self>) -> bool {
3569 let (a0, a1) = self.split_mask8x32(a);
3570 self.any_true_mask8x16(a0) || self.any_true_mask8x16(a1)
3571 }
3572 #[inline(always)]
3573 fn all_true_mask8x32(self, a: mask8x32<Self>) -> bool {
3574 let (a0, a1) = self.split_mask8x32(a);
3575 self.all_true_mask8x16(a0) && self.all_true_mask8x16(a1)
3576 }
3577 #[inline(always)]
3578 fn any_false_mask8x32(self, a: mask8x32<Self>) -> bool {
3579 let (a0, a1) = self.split_mask8x32(a);
3580 self.any_false_mask8x16(a0) || self.any_false_mask8x16(a1)
3581 }
3582 #[inline(always)]
3583 fn all_false_mask8x32(self, a: mask8x32<Self>) -> bool {
3584 let (a0, a1) = self.split_mask8x32(a);
3585 self.all_false_mask8x16(a0) && self.all_false_mask8x16(a1)
3586 }
3587 #[inline(always)]
3588 fn combine_mask8x32(self, a: mask8x32<Self>, b: mask8x32<Self>) -> mask8x64<Self> {
3589 mask8x64 {
3590 val: crate::support::Aligned512(int8x16x4_t(
3591 a.val.0.0, a.val.0.1, b.val.0.0, b.val.0.1,
3592 )),
3593 simd: self,
3594 }
3595 }
3596 #[inline(always)]
3597 fn split_mask8x32(self, a: mask8x32<Self>) -> (mask8x16<Self>, mask8x16<Self>) {
3598 (
3599 mask8x16 {
3600 val: crate::support::Aligned128(a.val.0.0),
3601 simd: self,
3602 },
3603 mask8x16 {
3604 val: crate::support::Aligned128(a.val.0.1),
3605 simd: self,
3606 },
3607 )
3608 }
3609 #[inline(always)]
3610 fn splat_i16x16(self, val: i16) -> i16x16<Self> {
3611 let half = self.splat_i16x8(val);
3612 self.combine_i16x8(half, half)
3613 }
3614 #[inline(always)]
3615 fn load_array_i16x16(self, val: [i16; 16usize]) -> i16x16<Self> {
3616 i16x16 {
3617 val: unsafe { core::mem::transmute_copy(&val) },
3618 simd: self,
3619 }
3620 }
3621 #[inline(always)]
3622 fn load_array_ref_i16x16(self, val: &[i16; 16usize]) -> i16x16<Self> {
3623 i16x16 {
3624 val: unsafe { core::mem::transmute_copy(val) },
3625 simd: self,
3626 }
3627 }
3628 #[inline(always)]
3629 fn as_array_i16x16(self, a: i16x16<Self>) -> [i16; 16usize] {
3630 unsafe { core::mem::transmute::<int16x8x2_t, [i16; 16usize]>(a.val.0) }
3631 }
3632 #[inline(always)]
3633 fn as_array_ref_i16x16(self, a: &i16x16<Self>) -> &[i16; 16usize] {
3634 unsafe { core::mem::transmute::<&int16x8x2_t, &[i16; 16usize]>(&a.val.0) }
3635 }
3636 #[inline(always)]
3637 fn as_array_mut_i16x16(self, a: &mut i16x16<Self>) -> &mut [i16; 16usize] {
3638 unsafe { core::mem::transmute::<&mut int16x8x2_t, &mut [i16; 16usize]>(&mut a.val.0) }
3639 }
3640 #[inline(always)]
3641 fn store_array_i16x16(self, a: i16x16<Self>, dest: &mut [i16; 16usize]) -> () {
3642 unsafe {
3643 core::ptr::copy_nonoverlapping(
3644 (&raw const a.val.0) as *const i16,
3645 dest.as_mut_ptr(),
3646 16usize,
3647 );
3648 }
3649 }
3650 #[inline(always)]
3651 fn cvt_from_bytes_i16x16(self, a: u8x32<Self>) -> i16x16<Self> {
3652 unsafe {
3653 i16x16 {
3654 val: core::mem::transmute(a.val),
3655 simd: self,
3656 }
3657 }
3658 }
3659 #[inline(always)]
3660 fn cvt_to_bytes_i16x16(self, a: i16x16<Self>) -> u8x32<Self> {
3661 unsafe {
3662 u8x32 {
3663 val: core::mem::transmute(a.val),
3664 simd: self,
3665 }
3666 }
3667 }
3668 #[inline(always)]
3669 fn slide_i16x16<const SHIFT: usize>(self, a: i16x16<Self>, b: i16x16<Self>) -> i16x16<Self> {
3670 if SHIFT >= 16usize {
3671 return b;
3672 }
3673 let result = unsafe {
3674 let a_bytes = self.cvt_to_bytes_i16x16(a).val.0;
3675 let b_bytes = self.cvt_to_bytes_i16x16(b).val.0;
3676 let a_blocks = [a_bytes.0, a_bytes.1];
3677 let b_blocks = [b_bytes.0, b_bytes.1];
3678 let shift_bytes = SHIFT * 2usize;
3679 uint8x16x2_t(
3680 {
3681 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
3682 &a_blocks,
3683 &b_blocks,
3684 0,
3685 shift_bytes,
3686 );
3687 dyn_vext_128(lo, hi, shift_bytes % 16)
3688 },
3689 {
3690 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
3691 &a_blocks,
3692 &b_blocks,
3693 1,
3694 shift_bytes,
3695 );
3696 dyn_vext_128(lo, hi, shift_bytes % 16)
3697 },
3698 )
3699 };
3700 self.cvt_from_bytes_i16x16(u8x32 {
3701 val: crate::support::Aligned256(result),
3702 simd: self,
3703 })
3704 }
3705 #[inline(always)]
3706 fn slide_within_blocks_i16x16<const SHIFT: usize>(
3707 self,
3708 a: i16x16<Self>,
3709 b: i16x16<Self>,
3710 ) -> i16x16<Self> {
3711 let (a0, a1) = self.split_i16x16(a);
3712 let (b0, b1) = self.split_i16x16(b);
3713 self.combine_i16x8(
3714 self.slide_within_blocks_i16x8::<SHIFT>(a0, b0),
3715 self.slide_within_blocks_i16x8::<SHIFT>(a1, b1),
3716 )
3717 }
3718 #[inline(always)]
3719 fn add_i16x16(self, a: i16x16<Self>, b: i16x16<Self>) -> i16x16<Self> {
3720 let (a0, a1) = self.split_i16x16(a);
3721 let (b0, b1) = self.split_i16x16(b);
3722 self.combine_i16x8(self.add_i16x8(a0, b0), self.add_i16x8(a1, b1))
3723 }
3724 #[inline(always)]
3725 fn sub_i16x16(self, a: i16x16<Self>, b: i16x16<Self>) -> i16x16<Self> {
3726 let (a0, a1) = self.split_i16x16(a);
3727 let (b0, b1) = self.split_i16x16(b);
3728 self.combine_i16x8(self.sub_i16x8(a0, b0), self.sub_i16x8(a1, b1))
3729 }
3730 #[inline(always)]
3731 fn mul_i16x16(self, a: i16x16<Self>, b: i16x16<Self>) -> i16x16<Self> {
3732 let (a0, a1) = self.split_i16x16(a);
3733 let (b0, b1) = self.split_i16x16(b);
3734 self.combine_i16x8(self.mul_i16x8(a0, b0), self.mul_i16x8(a1, b1))
3735 }
3736 #[inline(always)]
3737 fn and_i16x16(self, a: i16x16<Self>, b: i16x16<Self>) -> i16x16<Self> {
3738 let (a0, a1) = self.split_i16x16(a);
3739 let (b0, b1) = self.split_i16x16(b);
3740 self.combine_i16x8(self.and_i16x8(a0, b0), self.and_i16x8(a1, b1))
3741 }
3742 #[inline(always)]
3743 fn or_i16x16(self, a: i16x16<Self>, b: i16x16<Self>) -> i16x16<Self> {
3744 let (a0, a1) = self.split_i16x16(a);
3745 let (b0, b1) = self.split_i16x16(b);
3746 self.combine_i16x8(self.or_i16x8(a0, b0), self.or_i16x8(a1, b1))
3747 }
3748 #[inline(always)]
3749 fn xor_i16x16(self, a: i16x16<Self>, b: i16x16<Self>) -> i16x16<Self> {
3750 let (a0, a1) = self.split_i16x16(a);
3751 let (b0, b1) = self.split_i16x16(b);
3752 self.combine_i16x8(self.xor_i16x8(a0, b0), self.xor_i16x8(a1, b1))
3753 }
3754 #[inline(always)]
3755 fn not_i16x16(self, a: i16x16<Self>) -> i16x16<Self> {
3756 let (a0, a1) = self.split_i16x16(a);
3757 self.combine_i16x8(self.not_i16x8(a0), self.not_i16x8(a1))
3758 }
3759 #[inline(always)]
3760 fn shl_i16x16(self, a: i16x16<Self>, shift: u32) -> i16x16<Self> {
3761 let (a0, a1) = self.split_i16x16(a);
3762 self.combine_i16x8(self.shl_i16x8(a0, shift), self.shl_i16x8(a1, shift))
3763 }
3764 #[inline(always)]
3765 fn shlv_i16x16(self, a: i16x16<Self>, b: i16x16<Self>) -> i16x16<Self> {
3766 let (a0, a1) = self.split_i16x16(a);
3767 let (b0, b1) = self.split_i16x16(b);
3768 self.combine_i16x8(self.shlv_i16x8(a0, b0), self.shlv_i16x8(a1, b1))
3769 }
3770 #[inline(always)]
3771 fn shr_i16x16(self, a: i16x16<Self>, shift: u32) -> i16x16<Self> {
3772 let (a0, a1) = self.split_i16x16(a);
3773 self.combine_i16x8(self.shr_i16x8(a0, shift), self.shr_i16x8(a1, shift))
3774 }
3775 #[inline(always)]
3776 fn shrv_i16x16(self, a: i16x16<Self>, b: i16x16<Self>) -> i16x16<Self> {
3777 let (a0, a1) = self.split_i16x16(a);
3778 let (b0, b1) = self.split_i16x16(b);
3779 self.combine_i16x8(self.shrv_i16x8(a0, b0), self.shrv_i16x8(a1, b1))
3780 }
3781 #[inline(always)]
3782 fn simd_eq_i16x16(self, a: i16x16<Self>, b: i16x16<Self>) -> mask16x16<Self> {
3783 let (a0, a1) = self.split_i16x16(a);
3784 let (b0, b1) = self.split_i16x16(b);
3785 self.combine_mask16x8(self.simd_eq_i16x8(a0, b0), self.simd_eq_i16x8(a1, b1))
3786 }
3787 #[inline(always)]
3788 fn simd_lt_i16x16(self, a: i16x16<Self>, b: i16x16<Self>) -> mask16x16<Self> {
3789 let (a0, a1) = self.split_i16x16(a);
3790 let (b0, b1) = self.split_i16x16(b);
3791 self.combine_mask16x8(self.simd_lt_i16x8(a0, b0), self.simd_lt_i16x8(a1, b1))
3792 }
3793 #[inline(always)]
3794 fn simd_le_i16x16(self, a: i16x16<Self>, b: i16x16<Self>) -> mask16x16<Self> {
3795 let (a0, a1) = self.split_i16x16(a);
3796 let (b0, b1) = self.split_i16x16(b);
3797 self.combine_mask16x8(self.simd_le_i16x8(a0, b0), self.simd_le_i16x8(a1, b1))
3798 }
3799 #[inline(always)]
3800 fn simd_ge_i16x16(self, a: i16x16<Self>, b: i16x16<Self>) -> mask16x16<Self> {
3801 let (a0, a1) = self.split_i16x16(a);
3802 let (b0, b1) = self.split_i16x16(b);
3803 self.combine_mask16x8(self.simd_ge_i16x8(a0, b0), self.simd_ge_i16x8(a1, b1))
3804 }
3805 #[inline(always)]
3806 fn simd_gt_i16x16(self, a: i16x16<Self>, b: i16x16<Self>) -> mask16x16<Self> {
3807 let (a0, a1) = self.split_i16x16(a);
3808 let (b0, b1) = self.split_i16x16(b);
3809 self.combine_mask16x8(self.simd_gt_i16x8(a0, b0), self.simd_gt_i16x8(a1, b1))
3810 }
3811 #[inline(always)]
3812 fn zip_low_i16x16(self, a: i16x16<Self>, b: i16x16<Self>) -> i16x16<Self> {
3813 let (a0, _) = self.split_i16x16(a);
3814 let (b0, _) = self.split_i16x16(b);
3815 self.combine_i16x8(self.zip_low_i16x8(a0, b0), self.zip_high_i16x8(a0, b0))
3816 }
3817 #[inline(always)]
3818 fn zip_high_i16x16(self, a: i16x16<Self>, b: i16x16<Self>) -> i16x16<Self> {
3819 let (_, a1) = self.split_i16x16(a);
3820 let (_, b1) = self.split_i16x16(b);
3821 self.combine_i16x8(self.zip_low_i16x8(a1, b1), self.zip_high_i16x8(a1, b1))
3822 }
3823 #[inline(always)]
3824 fn unzip_low_i16x16(self, a: i16x16<Self>, b: i16x16<Self>) -> i16x16<Self> {
3825 let (a0, a1) = self.split_i16x16(a);
3826 let (b0, b1) = self.split_i16x16(b);
3827 self.combine_i16x8(self.unzip_low_i16x8(a0, a1), self.unzip_low_i16x8(b0, b1))
3828 }
3829 #[inline(always)]
3830 fn unzip_high_i16x16(self, a: i16x16<Self>, b: i16x16<Self>) -> i16x16<Self> {
3831 let (a0, a1) = self.split_i16x16(a);
3832 let (b0, b1) = self.split_i16x16(b);
3833 self.combine_i16x8(self.unzip_high_i16x8(a0, a1), self.unzip_high_i16x8(b0, b1))
3834 }
3835 #[inline(always)]
3836 fn interleave_i16x16(self, a: i16x16<Self>, b: i16x16<Self>) -> (i16x16<Self>, i16x16<Self>) {
3837 let (a0, a1) = self.split_i16x16(a);
3838 let (b0, b1) = self.split_i16x16(b);
3839 let lo_lo = self.zip_low_i16x8(a0, b0);
3840 let lo_hi = self.zip_high_i16x8(a0, b0);
3841 let hi_lo = self.zip_low_i16x8(a1, b1);
3842 let hi_hi = self.zip_high_i16x8(a1, b1);
3843 (
3844 self.combine_i16x8(lo_lo, lo_hi),
3845 self.combine_i16x8(hi_lo, hi_hi),
3846 )
3847 }
3848 #[inline(always)]
3849 fn deinterleave_i16x16(self, a: i16x16<Self>, b: i16x16<Self>) -> (i16x16<Self>, i16x16<Self>) {
3850 let (a0, a1) = self.split_i16x16(a);
3851 let (b0, b1) = self.split_i16x16(b);
3852 let lo_even = self.unzip_low_i16x8(a0, a1);
3853 let lo_odd = self.unzip_high_i16x8(a0, a1);
3854 let hi_even = self.unzip_low_i16x8(b0, b1);
3855 let hi_odd = self.unzip_high_i16x8(b0, b1);
3856 (
3857 self.combine_i16x8(lo_even, hi_even),
3858 self.combine_i16x8(lo_odd, hi_odd),
3859 )
3860 }
3861 #[inline(always)]
3862 fn select_i16x16(self, a: mask16x16<Self>, b: i16x16<Self>, c: i16x16<Self>) -> i16x16<Self> {
3863 let (a0, a1) = self.split_mask16x16(a);
3864 let (b0, b1) = self.split_i16x16(b);
3865 let (c0, c1) = self.split_i16x16(c);
3866 self.combine_i16x8(self.select_i16x8(a0, b0, c0), self.select_i16x8(a1, b1, c1))
3867 }
3868 #[inline(always)]
3869 fn min_i16x16(self, a: i16x16<Self>, b: i16x16<Self>) -> i16x16<Self> {
3870 let (a0, a1) = self.split_i16x16(a);
3871 let (b0, b1) = self.split_i16x16(b);
3872 self.combine_i16x8(self.min_i16x8(a0, b0), self.min_i16x8(a1, b1))
3873 }
3874 #[inline(always)]
3875 fn max_i16x16(self, a: i16x16<Self>, b: i16x16<Self>) -> i16x16<Self> {
3876 let (a0, a1) = self.split_i16x16(a);
3877 let (b0, b1) = self.split_i16x16(b);
3878 self.combine_i16x8(self.max_i16x8(a0, b0), self.max_i16x8(a1, b1))
3879 }
3880 #[inline(always)]
3881 fn combine_i16x16(self, a: i16x16<Self>, b: i16x16<Self>) -> i16x32<Self> {
3882 i16x32 {
3883 val: crate::support::Aligned512(int16x8x4_t(
3884 a.val.0.0, a.val.0.1, b.val.0.0, b.val.0.1,
3885 )),
3886 simd: self,
3887 }
3888 }
3889 #[inline(always)]
3890 fn split_i16x16(self, a: i16x16<Self>) -> (i16x8<Self>, i16x8<Self>) {
3891 (
3892 i16x8 {
3893 val: crate::support::Aligned128(a.val.0.0),
3894 simd: self,
3895 },
3896 i16x8 {
3897 val: crate::support::Aligned128(a.val.0.1),
3898 simd: self,
3899 },
3900 )
3901 }
3902 #[inline(always)]
3903 fn neg_i16x16(self, a: i16x16<Self>) -> i16x16<Self> {
3904 let (a0, a1) = self.split_i16x16(a);
3905 self.combine_i16x8(self.neg_i16x8(a0), self.neg_i16x8(a1))
3906 }
3907 #[inline(always)]
3908 fn reinterpret_u8_i16x16(self, a: i16x16<Self>) -> u8x32<Self> {
3909 let (a0, a1) = self.split_i16x16(a);
3910 self.combine_u8x16(self.reinterpret_u8_i16x8(a0), self.reinterpret_u8_i16x8(a1))
3911 }
3912 #[inline(always)]
3913 fn reinterpret_u32_i16x16(self, a: i16x16<Self>) -> u32x8<Self> {
3914 let (a0, a1) = self.split_i16x16(a);
3915 self.combine_u32x4(
3916 self.reinterpret_u32_i16x8(a0),
3917 self.reinterpret_u32_i16x8(a1),
3918 )
3919 }
3920 #[inline(always)]
3921 fn splat_u16x16(self, val: u16) -> u16x16<Self> {
3922 let half = self.splat_u16x8(val);
3923 self.combine_u16x8(half, half)
3924 }
3925 #[inline(always)]
3926 fn load_array_u16x16(self, val: [u16; 16usize]) -> u16x16<Self> {
3927 u16x16 {
3928 val: unsafe { core::mem::transmute_copy(&val) },
3929 simd: self,
3930 }
3931 }
3932 #[inline(always)]
3933 fn load_array_ref_u16x16(self, val: &[u16; 16usize]) -> u16x16<Self> {
3934 u16x16 {
3935 val: unsafe { core::mem::transmute_copy(val) },
3936 simd: self,
3937 }
3938 }
3939 #[inline(always)]
3940 fn as_array_u16x16(self, a: u16x16<Self>) -> [u16; 16usize] {
3941 unsafe { core::mem::transmute::<uint16x8x2_t, [u16; 16usize]>(a.val.0) }
3942 }
3943 #[inline(always)]
3944 fn as_array_ref_u16x16(self, a: &u16x16<Self>) -> &[u16; 16usize] {
3945 unsafe { core::mem::transmute::<&uint16x8x2_t, &[u16; 16usize]>(&a.val.0) }
3946 }
3947 #[inline(always)]
3948 fn as_array_mut_u16x16(self, a: &mut u16x16<Self>) -> &mut [u16; 16usize] {
3949 unsafe { core::mem::transmute::<&mut uint16x8x2_t, &mut [u16; 16usize]>(&mut a.val.0) }
3950 }
3951 #[inline(always)]
3952 fn store_array_u16x16(self, a: u16x16<Self>, dest: &mut [u16; 16usize]) -> () {
3953 unsafe {
3954 core::ptr::copy_nonoverlapping(
3955 (&raw const a.val.0) as *const u16,
3956 dest.as_mut_ptr(),
3957 16usize,
3958 );
3959 }
3960 }
3961 #[inline(always)]
3962 fn cvt_from_bytes_u16x16(self, a: u8x32<Self>) -> u16x16<Self> {
3963 unsafe {
3964 u16x16 {
3965 val: core::mem::transmute(a.val),
3966 simd: self,
3967 }
3968 }
3969 }
3970 #[inline(always)]
3971 fn cvt_to_bytes_u16x16(self, a: u16x16<Self>) -> u8x32<Self> {
3972 unsafe {
3973 u8x32 {
3974 val: core::mem::transmute(a.val),
3975 simd: self,
3976 }
3977 }
3978 }
3979 #[inline(always)]
3980 fn slide_u16x16<const SHIFT: usize>(self, a: u16x16<Self>, b: u16x16<Self>) -> u16x16<Self> {
3981 if SHIFT >= 16usize {
3982 return b;
3983 }
3984 let result = unsafe {
3985 let a_bytes = self.cvt_to_bytes_u16x16(a).val.0;
3986 let b_bytes = self.cvt_to_bytes_u16x16(b).val.0;
3987 let a_blocks = [a_bytes.0, a_bytes.1];
3988 let b_blocks = [b_bytes.0, b_bytes.1];
3989 let shift_bytes = SHIFT * 2usize;
3990 uint8x16x2_t(
3991 {
3992 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
3993 &a_blocks,
3994 &b_blocks,
3995 0,
3996 shift_bytes,
3997 );
3998 dyn_vext_128(lo, hi, shift_bytes % 16)
3999 },
4000 {
4001 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
4002 &a_blocks,
4003 &b_blocks,
4004 1,
4005 shift_bytes,
4006 );
4007 dyn_vext_128(lo, hi, shift_bytes % 16)
4008 },
4009 )
4010 };
4011 self.cvt_from_bytes_u16x16(u8x32 {
4012 val: crate::support::Aligned256(result),
4013 simd: self,
4014 })
4015 }
4016 #[inline(always)]
4017 fn slide_within_blocks_u16x16<const SHIFT: usize>(
4018 self,
4019 a: u16x16<Self>,
4020 b: u16x16<Self>,
4021 ) -> u16x16<Self> {
4022 let (a0, a1) = self.split_u16x16(a);
4023 let (b0, b1) = self.split_u16x16(b);
4024 self.combine_u16x8(
4025 self.slide_within_blocks_u16x8::<SHIFT>(a0, b0),
4026 self.slide_within_blocks_u16x8::<SHIFT>(a1, b1),
4027 )
4028 }
4029 #[inline(always)]
4030 fn add_u16x16(self, a: u16x16<Self>, b: u16x16<Self>) -> u16x16<Self> {
4031 let (a0, a1) = self.split_u16x16(a);
4032 let (b0, b1) = self.split_u16x16(b);
4033 self.combine_u16x8(self.add_u16x8(a0, b0), self.add_u16x8(a1, b1))
4034 }
4035 #[inline(always)]
4036 fn sub_u16x16(self, a: u16x16<Self>, b: u16x16<Self>) -> u16x16<Self> {
4037 let (a0, a1) = self.split_u16x16(a);
4038 let (b0, b1) = self.split_u16x16(b);
4039 self.combine_u16x8(self.sub_u16x8(a0, b0), self.sub_u16x8(a1, b1))
4040 }
4041 #[inline(always)]
4042 fn mul_u16x16(self, a: u16x16<Self>, b: u16x16<Self>) -> u16x16<Self> {
4043 let (a0, a1) = self.split_u16x16(a);
4044 let (b0, b1) = self.split_u16x16(b);
4045 self.combine_u16x8(self.mul_u16x8(a0, b0), self.mul_u16x8(a1, b1))
4046 }
4047 #[inline(always)]
4048 fn and_u16x16(self, a: u16x16<Self>, b: u16x16<Self>) -> u16x16<Self> {
4049 let (a0, a1) = self.split_u16x16(a);
4050 let (b0, b1) = self.split_u16x16(b);
4051 self.combine_u16x8(self.and_u16x8(a0, b0), self.and_u16x8(a1, b1))
4052 }
4053 #[inline(always)]
4054 fn or_u16x16(self, a: u16x16<Self>, b: u16x16<Self>) -> u16x16<Self> {
4055 let (a0, a1) = self.split_u16x16(a);
4056 let (b0, b1) = self.split_u16x16(b);
4057 self.combine_u16x8(self.or_u16x8(a0, b0), self.or_u16x8(a1, b1))
4058 }
4059 #[inline(always)]
4060 fn xor_u16x16(self, a: u16x16<Self>, b: u16x16<Self>) -> u16x16<Self> {
4061 let (a0, a1) = self.split_u16x16(a);
4062 let (b0, b1) = self.split_u16x16(b);
4063 self.combine_u16x8(self.xor_u16x8(a0, b0), self.xor_u16x8(a1, b1))
4064 }
4065 #[inline(always)]
4066 fn not_u16x16(self, a: u16x16<Self>) -> u16x16<Self> {
4067 let (a0, a1) = self.split_u16x16(a);
4068 self.combine_u16x8(self.not_u16x8(a0), self.not_u16x8(a1))
4069 }
4070 #[inline(always)]
4071 fn shl_u16x16(self, a: u16x16<Self>, shift: u32) -> u16x16<Self> {
4072 let (a0, a1) = self.split_u16x16(a);
4073 self.combine_u16x8(self.shl_u16x8(a0, shift), self.shl_u16x8(a1, shift))
4074 }
4075 #[inline(always)]
4076 fn shlv_u16x16(self, a: u16x16<Self>, b: u16x16<Self>) -> u16x16<Self> {
4077 let (a0, a1) = self.split_u16x16(a);
4078 let (b0, b1) = self.split_u16x16(b);
4079 self.combine_u16x8(self.shlv_u16x8(a0, b0), self.shlv_u16x8(a1, b1))
4080 }
4081 #[inline(always)]
4082 fn shr_u16x16(self, a: u16x16<Self>, shift: u32) -> u16x16<Self> {
4083 let (a0, a1) = self.split_u16x16(a);
4084 self.combine_u16x8(self.shr_u16x8(a0, shift), self.shr_u16x8(a1, shift))
4085 }
4086 #[inline(always)]
4087 fn shrv_u16x16(self, a: u16x16<Self>, b: u16x16<Self>) -> u16x16<Self> {
4088 let (a0, a1) = self.split_u16x16(a);
4089 let (b0, b1) = self.split_u16x16(b);
4090 self.combine_u16x8(self.shrv_u16x8(a0, b0), self.shrv_u16x8(a1, b1))
4091 }
4092 #[inline(always)]
4093 fn simd_eq_u16x16(self, a: u16x16<Self>, b: u16x16<Self>) -> mask16x16<Self> {
4094 let (a0, a1) = self.split_u16x16(a);
4095 let (b0, b1) = self.split_u16x16(b);
4096 self.combine_mask16x8(self.simd_eq_u16x8(a0, b0), self.simd_eq_u16x8(a1, b1))
4097 }
4098 #[inline(always)]
4099 fn simd_lt_u16x16(self, a: u16x16<Self>, b: u16x16<Self>) -> mask16x16<Self> {
4100 let (a0, a1) = self.split_u16x16(a);
4101 let (b0, b1) = self.split_u16x16(b);
4102 self.combine_mask16x8(self.simd_lt_u16x8(a0, b0), self.simd_lt_u16x8(a1, b1))
4103 }
4104 #[inline(always)]
4105 fn simd_le_u16x16(self, a: u16x16<Self>, b: u16x16<Self>) -> mask16x16<Self> {
4106 let (a0, a1) = self.split_u16x16(a);
4107 let (b0, b1) = self.split_u16x16(b);
4108 self.combine_mask16x8(self.simd_le_u16x8(a0, b0), self.simd_le_u16x8(a1, b1))
4109 }
4110 #[inline(always)]
4111 fn simd_ge_u16x16(self, a: u16x16<Self>, b: u16x16<Self>) -> mask16x16<Self> {
4112 let (a0, a1) = self.split_u16x16(a);
4113 let (b0, b1) = self.split_u16x16(b);
4114 self.combine_mask16x8(self.simd_ge_u16x8(a0, b0), self.simd_ge_u16x8(a1, b1))
4115 }
4116 #[inline(always)]
4117 fn simd_gt_u16x16(self, a: u16x16<Self>, b: u16x16<Self>) -> mask16x16<Self> {
4118 let (a0, a1) = self.split_u16x16(a);
4119 let (b0, b1) = self.split_u16x16(b);
4120 self.combine_mask16x8(self.simd_gt_u16x8(a0, b0), self.simd_gt_u16x8(a1, b1))
4121 }
4122 #[inline(always)]
4123 fn zip_low_u16x16(self, a: u16x16<Self>, b: u16x16<Self>) -> u16x16<Self> {
4124 let (a0, _) = self.split_u16x16(a);
4125 let (b0, _) = self.split_u16x16(b);
4126 self.combine_u16x8(self.zip_low_u16x8(a0, b0), self.zip_high_u16x8(a0, b0))
4127 }
4128 #[inline(always)]
4129 fn zip_high_u16x16(self, a: u16x16<Self>, b: u16x16<Self>) -> u16x16<Self> {
4130 let (_, a1) = self.split_u16x16(a);
4131 let (_, b1) = self.split_u16x16(b);
4132 self.combine_u16x8(self.zip_low_u16x8(a1, b1), self.zip_high_u16x8(a1, b1))
4133 }
4134 #[inline(always)]
4135 fn unzip_low_u16x16(self, a: u16x16<Self>, b: u16x16<Self>) -> u16x16<Self> {
4136 let (a0, a1) = self.split_u16x16(a);
4137 let (b0, b1) = self.split_u16x16(b);
4138 self.combine_u16x8(self.unzip_low_u16x8(a0, a1), self.unzip_low_u16x8(b0, b1))
4139 }
4140 #[inline(always)]
4141 fn unzip_high_u16x16(self, a: u16x16<Self>, b: u16x16<Self>) -> u16x16<Self> {
4142 let (a0, a1) = self.split_u16x16(a);
4143 let (b0, b1) = self.split_u16x16(b);
4144 self.combine_u16x8(self.unzip_high_u16x8(a0, a1), self.unzip_high_u16x8(b0, b1))
4145 }
4146 #[inline(always)]
4147 fn interleave_u16x16(self, a: u16x16<Self>, b: u16x16<Self>) -> (u16x16<Self>, u16x16<Self>) {
4148 let (a0, a1) = self.split_u16x16(a);
4149 let (b0, b1) = self.split_u16x16(b);
4150 let lo_lo = self.zip_low_u16x8(a0, b0);
4151 let lo_hi = self.zip_high_u16x8(a0, b0);
4152 let hi_lo = self.zip_low_u16x8(a1, b1);
4153 let hi_hi = self.zip_high_u16x8(a1, b1);
4154 (
4155 self.combine_u16x8(lo_lo, lo_hi),
4156 self.combine_u16x8(hi_lo, hi_hi),
4157 )
4158 }
4159 #[inline(always)]
4160 fn deinterleave_u16x16(self, a: u16x16<Self>, b: u16x16<Self>) -> (u16x16<Self>, u16x16<Self>) {
4161 let (a0, a1) = self.split_u16x16(a);
4162 let (b0, b1) = self.split_u16x16(b);
4163 let lo_even = self.unzip_low_u16x8(a0, a1);
4164 let lo_odd = self.unzip_high_u16x8(a0, a1);
4165 let hi_even = self.unzip_low_u16x8(b0, b1);
4166 let hi_odd = self.unzip_high_u16x8(b0, b1);
4167 (
4168 self.combine_u16x8(lo_even, hi_even),
4169 self.combine_u16x8(lo_odd, hi_odd),
4170 )
4171 }
4172 #[inline(always)]
4173 fn select_u16x16(self, a: mask16x16<Self>, b: u16x16<Self>, c: u16x16<Self>) -> u16x16<Self> {
4174 let (a0, a1) = self.split_mask16x16(a);
4175 let (b0, b1) = self.split_u16x16(b);
4176 let (c0, c1) = self.split_u16x16(c);
4177 self.combine_u16x8(self.select_u16x8(a0, b0, c0), self.select_u16x8(a1, b1, c1))
4178 }
4179 #[inline(always)]
4180 fn min_u16x16(self, a: u16x16<Self>, b: u16x16<Self>) -> u16x16<Self> {
4181 let (a0, a1) = self.split_u16x16(a);
4182 let (b0, b1) = self.split_u16x16(b);
4183 self.combine_u16x8(self.min_u16x8(a0, b0), self.min_u16x8(a1, b1))
4184 }
4185 #[inline(always)]
4186 fn max_u16x16(self, a: u16x16<Self>, b: u16x16<Self>) -> u16x16<Self> {
4187 let (a0, a1) = self.split_u16x16(a);
4188 let (b0, b1) = self.split_u16x16(b);
4189 self.combine_u16x8(self.max_u16x8(a0, b0), self.max_u16x8(a1, b1))
4190 }
4191 #[inline(always)]
4192 fn combine_u16x16(self, a: u16x16<Self>, b: u16x16<Self>) -> u16x32<Self> {
4193 u16x32 {
4194 val: crate::support::Aligned512(uint16x8x4_t(
4195 a.val.0.0, a.val.0.1, b.val.0.0, b.val.0.1,
4196 )),
4197 simd: self,
4198 }
4199 }
4200 #[inline(always)]
4201 fn split_u16x16(self, a: u16x16<Self>) -> (u16x8<Self>, u16x8<Self>) {
4202 (
4203 u16x8 {
4204 val: crate::support::Aligned128(a.val.0.0),
4205 simd: self,
4206 },
4207 u16x8 {
4208 val: crate::support::Aligned128(a.val.0.1),
4209 simd: self,
4210 },
4211 )
4212 }
4213 #[inline(always)]
4214 fn narrow_u16x16(self, a: u16x16<Self>) -> u8x16<Self> {
4215 unsafe {
4216 let converted: uint16x8x2_t = a.into();
4217 let low = vmovn_u16(converted.0);
4218 let high = vmovn_u16(converted.1);
4219 vcombine_u8(low, high).simd_into(self)
4220 }
4221 }
4222 #[inline(always)]
4223 fn reinterpret_u8_u16x16(self, a: u16x16<Self>) -> u8x32<Self> {
4224 let (a0, a1) = self.split_u16x16(a);
4225 self.combine_u8x16(self.reinterpret_u8_u16x8(a0), self.reinterpret_u8_u16x8(a1))
4226 }
4227 #[inline(always)]
4228 fn reinterpret_u32_u16x16(self, a: u16x16<Self>) -> u32x8<Self> {
4229 let (a0, a1) = self.split_u16x16(a);
4230 self.combine_u32x4(
4231 self.reinterpret_u32_u16x8(a0),
4232 self.reinterpret_u32_u16x8(a1),
4233 )
4234 }
4235 #[inline(always)]
4236 fn splat_mask16x16(self, val: i16) -> mask16x16<Self> {
4237 let half = self.splat_mask16x8(val);
4238 self.combine_mask16x8(half, half)
4239 }
4240 #[inline(always)]
4241 fn load_array_mask16x16(self, val: [i16; 16usize]) -> mask16x16<Self> {
4242 mask16x16 {
4243 val: unsafe { core::mem::transmute_copy(&val) },
4244 simd: self,
4245 }
4246 }
4247 #[inline(always)]
4248 fn load_array_ref_mask16x16(self, val: &[i16; 16usize]) -> mask16x16<Self> {
4249 mask16x16 {
4250 val: unsafe { core::mem::transmute_copy(val) },
4251 simd: self,
4252 }
4253 }
4254 #[inline(always)]
4255 fn as_array_mask16x16(self, a: mask16x16<Self>) -> [i16; 16usize] {
4256 unsafe { core::mem::transmute::<int16x8x2_t, [i16; 16usize]>(a.val.0) }
4257 }
4258 #[inline(always)]
4259 fn as_array_ref_mask16x16(self, a: &mask16x16<Self>) -> &[i16; 16usize] {
4260 unsafe { core::mem::transmute::<&int16x8x2_t, &[i16; 16usize]>(&a.val.0) }
4261 }
4262 #[inline(always)]
4263 fn as_array_mut_mask16x16(self, a: &mut mask16x16<Self>) -> &mut [i16; 16usize] {
4264 unsafe { core::mem::transmute::<&mut int16x8x2_t, &mut [i16; 16usize]>(&mut a.val.0) }
4265 }
4266 #[inline(always)]
4267 fn store_array_mask16x16(self, a: mask16x16<Self>, dest: &mut [i16; 16usize]) -> () {
4268 unsafe {
4269 core::ptr::copy_nonoverlapping(
4270 (&raw const a.val.0) as *const i16,
4271 dest.as_mut_ptr(),
4272 16usize,
4273 );
4274 }
4275 }
4276 #[inline(always)]
4277 fn cvt_from_bytes_mask16x16(self, a: u8x32<Self>) -> mask16x16<Self> {
4278 unsafe {
4279 mask16x16 {
4280 val: core::mem::transmute(a.val),
4281 simd: self,
4282 }
4283 }
4284 }
4285 #[inline(always)]
4286 fn cvt_to_bytes_mask16x16(self, a: mask16x16<Self>) -> u8x32<Self> {
4287 unsafe {
4288 u8x32 {
4289 val: core::mem::transmute(a.val),
4290 simd: self,
4291 }
4292 }
4293 }
4294 #[inline(always)]
4295 fn slide_mask16x16<const SHIFT: usize>(
4296 self,
4297 a: mask16x16<Self>,
4298 b: mask16x16<Self>,
4299 ) -> mask16x16<Self> {
4300 if SHIFT >= 16usize {
4301 return b;
4302 }
4303 let result = unsafe {
4304 let a_bytes = self.cvt_to_bytes_mask16x16(a).val.0;
4305 let b_bytes = self.cvt_to_bytes_mask16x16(b).val.0;
4306 let a_blocks = [a_bytes.0, a_bytes.1];
4307 let b_blocks = [b_bytes.0, b_bytes.1];
4308 let shift_bytes = SHIFT * 2usize;
4309 uint8x16x2_t(
4310 {
4311 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
4312 &a_blocks,
4313 &b_blocks,
4314 0,
4315 shift_bytes,
4316 );
4317 dyn_vext_128(lo, hi, shift_bytes % 16)
4318 },
4319 {
4320 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
4321 &a_blocks,
4322 &b_blocks,
4323 1,
4324 shift_bytes,
4325 );
4326 dyn_vext_128(lo, hi, shift_bytes % 16)
4327 },
4328 )
4329 };
4330 self.cvt_from_bytes_mask16x16(u8x32 {
4331 val: crate::support::Aligned256(result),
4332 simd: self,
4333 })
4334 }
4335 #[inline(always)]
4336 fn slide_within_blocks_mask16x16<const SHIFT: usize>(
4337 self,
4338 a: mask16x16<Self>,
4339 b: mask16x16<Self>,
4340 ) -> mask16x16<Self> {
4341 let (a0, a1) = self.split_mask16x16(a);
4342 let (b0, b1) = self.split_mask16x16(b);
4343 self.combine_mask16x8(
4344 self.slide_within_blocks_mask16x8::<SHIFT>(a0, b0),
4345 self.slide_within_blocks_mask16x8::<SHIFT>(a1, b1),
4346 )
4347 }
4348 #[inline(always)]
4349 fn and_mask16x16(self, a: mask16x16<Self>, b: mask16x16<Self>) -> mask16x16<Self> {
4350 let (a0, a1) = self.split_mask16x16(a);
4351 let (b0, b1) = self.split_mask16x16(b);
4352 self.combine_mask16x8(self.and_mask16x8(a0, b0), self.and_mask16x8(a1, b1))
4353 }
4354 #[inline(always)]
4355 fn or_mask16x16(self, a: mask16x16<Self>, b: mask16x16<Self>) -> mask16x16<Self> {
4356 let (a0, a1) = self.split_mask16x16(a);
4357 let (b0, b1) = self.split_mask16x16(b);
4358 self.combine_mask16x8(self.or_mask16x8(a0, b0), self.or_mask16x8(a1, b1))
4359 }
4360 #[inline(always)]
4361 fn xor_mask16x16(self, a: mask16x16<Self>, b: mask16x16<Self>) -> mask16x16<Self> {
4362 let (a0, a1) = self.split_mask16x16(a);
4363 let (b0, b1) = self.split_mask16x16(b);
4364 self.combine_mask16x8(self.xor_mask16x8(a0, b0), self.xor_mask16x8(a1, b1))
4365 }
4366 #[inline(always)]
4367 fn not_mask16x16(self, a: mask16x16<Self>) -> mask16x16<Self> {
4368 let (a0, a1) = self.split_mask16x16(a);
4369 self.combine_mask16x8(self.not_mask16x8(a0), self.not_mask16x8(a1))
4370 }
4371 #[inline(always)]
4372 fn select_mask16x16(
4373 self,
4374 a: mask16x16<Self>,
4375 b: mask16x16<Self>,
4376 c: mask16x16<Self>,
4377 ) -> mask16x16<Self> {
4378 let (a0, a1) = self.split_mask16x16(a);
4379 let (b0, b1) = self.split_mask16x16(b);
4380 let (c0, c1) = self.split_mask16x16(c);
4381 self.combine_mask16x8(
4382 self.select_mask16x8(a0, b0, c0),
4383 self.select_mask16x8(a1, b1, c1),
4384 )
4385 }
4386 #[inline(always)]
4387 fn simd_eq_mask16x16(self, a: mask16x16<Self>, b: mask16x16<Self>) -> mask16x16<Self> {
4388 let (a0, a1) = self.split_mask16x16(a);
4389 let (b0, b1) = self.split_mask16x16(b);
4390 self.combine_mask16x8(self.simd_eq_mask16x8(a0, b0), self.simd_eq_mask16x8(a1, b1))
4391 }
4392 #[inline(always)]
4393 fn any_true_mask16x16(self, a: mask16x16<Self>) -> bool {
4394 let (a0, a1) = self.split_mask16x16(a);
4395 self.any_true_mask16x8(a0) || self.any_true_mask16x8(a1)
4396 }
4397 #[inline(always)]
4398 fn all_true_mask16x16(self, a: mask16x16<Self>) -> bool {
4399 let (a0, a1) = self.split_mask16x16(a);
4400 self.all_true_mask16x8(a0) && self.all_true_mask16x8(a1)
4401 }
4402 #[inline(always)]
4403 fn any_false_mask16x16(self, a: mask16x16<Self>) -> bool {
4404 let (a0, a1) = self.split_mask16x16(a);
4405 self.any_false_mask16x8(a0) || self.any_false_mask16x8(a1)
4406 }
4407 #[inline(always)]
4408 fn all_false_mask16x16(self, a: mask16x16<Self>) -> bool {
4409 let (a0, a1) = self.split_mask16x16(a);
4410 self.all_false_mask16x8(a0) && self.all_false_mask16x8(a1)
4411 }
4412 #[inline(always)]
4413 fn combine_mask16x16(self, a: mask16x16<Self>, b: mask16x16<Self>) -> mask16x32<Self> {
4414 mask16x32 {
4415 val: crate::support::Aligned512(int16x8x4_t(
4416 a.val.0.0, a.val.0.1, b.val.0.0, b.val.0.1,
4417 )),
4418 simd: self,
4419 }
4420 }
4421 #[inline(always)]
4422 fn split_mask16x16(self, a: mask16x16<Self>) -> (mask16x8<Self>, mask16x8<Self>) {
4423 (
4424 mask16x8 {
4425 val: crate::support::Aligned128(a.val.0.0),
4426 simd: self,
4427 },
4428 mask16x8 {
4429 val: crate::support::Aligned128(a.val.0.1),
4430 simd: self,
4431 },
4432 )
4433 }
4434 #[inline(always)]
4435 fn splat_i32x8(self, val: i32) -> i32x8<Self> {
4436 let half = self.splat_i32x4(val);
4437 self.combine_i32x4(half, half)
4438 }
4439 #[inline(always)]
4440 fn load_array_i32x8(self, val: [i32; 8usize]) -> i32x8<Self> {
4441 i32x8 {
4442 val: unsafe { core::mem::transmute_copy(&val) },
4443 simd: self,
4444 }
4445 }
4446 #[inline(always)]
4447 fn load_array_ref_i32x8(self, val: &[i32; 8usize]) -> i32x8<Self> {
4448 i32x8 {
4449 val: unsafe { core::mem::transmute_copy(val) },
4450 simd: self,
4451 }
4452 }
4453 #[inline(always)]
4454 fn as_array_i32x8(self, a: i32x8<Self>) -> [i32; 8usize] {
4455 unsafe { core::mem::transmute::<int32x4x2_t, [i32; 8usize]>(a.val.0) }
4456 }
4457 #[inline(always)]
4458 fn as_array_ref_i32x8(self, a: &i32x8<Self>) -> &[i32; 8usize] {
4459 unsafe { core::mem::transmute::<&int32x4x2_t, &[i32; 8usize]>(&a.val.0) }
4460 }
4461 #[inline(always)]
4462 fn as_array_mut_i32x8(self, a: &mut i32x8<Self>) -> &mut [i32; 8usize] {
4463 unsafe { core::mem::transmute::<&mut int32x4x2_t, &mut [i32; 8usize]>(&mut a.val.0) }
4464 }
4465 #[inline(always)]
4466 fn store_array_i32x8(self, a: i32x8<Self>, dest: &mut [i32; 8usize]) -> () {
4467 unsafe {
4468 core::ptr::copy_nonoverlapping(
4469 (&raw const a.val.0) as *const i32,
4470 dest.as_mut_ptr(),
4471 8usize,
4472 );
4473 }
4474 }
4475 #[inline(always)]
4476 fn cvt_from_bytes_i32x8(self, a: u8x32<Self>) -> i32x8<Self> {
4477 unsafe {
4478 i32x8 {
4479 val: core::mem::transmute(a.val),
4480 simd: self,
4481 }
4482 }
4483 }
4484 #[inline(always)]
4485 fn cvt_to_bytes_i32x8(self, a: i32x8<Self>) -> u8x32<Self> {
4486 unsafe {
4487 u8x32 {
4488 val: core::mem::transmute(a.val),
4489 simd: self,
4490 }
4491 }
4492 }
4493 #[inline(always)]
4494 fn slide_i32x8<const SHIFT: usize>(self, a: i32x8<Self>, b: i32x8<Self>) -> i32x8<Self> {
4495 if SHIFT >= 8usize {
4496 return b;
4497 }
4498 let result = unsafe {
4499 let a_bytes = self.cvt_to_bytes_i32x8(a).val.0;
4500 let b_bytes = self.cvt_to_bytes_i32x8(b).val.0;
4501 let a_blocks = [a_bytes.0, a_bytes.1];
4502 let b_blocks = [b_bytes.0, b_bytes.1];
4503 let shift_bytes = SHIFT * 4usize;
4504 uint8x16x2_t(
4505 {
4506 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
4507 &a_blocks,
4508 &b_blocks,
4509 0,
4510 shift_bytes,
4511 );
4512 dyn_vext_128(lo, hi, shift_bytes % 16)
4513 },
4514 {
4515 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
4516 &a_blocks,
4517 &b_blocks,
4518 1,
4519 shift_bytes,
4520 );
4521 dyn_vext_128(lo, hi, shift_bytes % 16)
4522 },
4523 )
4524 };
4525 self.cvt_from_bytes_i32x8(u8x32 {
4526 val: crate::support::Aligned256(result),
4527 simd: self,
4528 })
4529 }
4530 #[inline(always)]
4531 fn slide_within_blocks_i32x8<const SHIFT: usize>(
4532 self,
4533 a: i32x8<Self>,
4534 b: i32x8<Self>,
4535 ) -> i32x8<Self> {
4536 let (a0, a1) = self.split_i32x8(a);
4537 let (b0, b1) = self.split_i32x8(b);
4538 self.combine_i32x4(
4539 self.slide_within_blocks_i32x4::<SHIFT>(a0, b0),
4540 self.slide_within_blocks_i32x4::<SHIFT>(a1, b1),
4541 )
4542 }
4543 #[inline(always)]
4544 fn add_i32x8(self, a: i32x8<Self>, b: i32x8<Self>) -> i32x8<Self> {
4545 let (a0, a1) = self.split_i32x8(a);
4546 let (b0, b1) = self.split_i32x8(b);
4547 self.combine_i32x4(self.add_i32x4(a0, b0), self.add_i32x4(a1, b1))
4548 }
4549 #[inline(always)]
4550 fn sub_i32x8(self, a: i32x8<Self>, b: i32x8<Self>) -> i32x8<Self> {
4551 let (a0, a1) = self.split_i32x8(a);
4552 let (b0, b1) = self.split_i32x8(b);
4553 self.combine_i32x4(self.sub_i32x4(a0, b0), self.sub_i32x4(a1, b1))
4554 }
4555 #[inline(always)]
4556 fn mul_i32x8(self, a: i32x8<Self>, b: i32x8<Self>) -> i32x8<Self> {
4557 let (a0, a1) = self.split_i32x8(a);
4558 let (b0, b1) = self.split_i32x8(b);
4559 self.combine_i32x4(self.mul_i32x4(a0, b0), self.mul_i32x4(a1, b1))
4560 }
4561 #[inline(always)]
4562 fn and_i32x8(self, a: i32x8<Self>, b: i32x8<Self>) -> i32x8<Self> {
4563 let (a0, a1) = self.split_i32x8(a);
4564 let (b0, b1) = self.split_i32x8(b);
4565 self.combine_i32x4(self.and_i32x4(a0, b0), self.and_i32x4(a1, b1))
4566 }
4567 #[inline(always)]
4568 fn or_i32x8(self, a: i32x8<Self>, b: i32x8<Self>) -> i32x8<Self> {
4569 let (a0, a1) = self.split_i32x8(a);
4570 let (b0, b1) = self.split_i32x8(b);
4571 self.combine_i32x4(self.or_i32x4(a0, b0), self.or_i32x4(a1, b1))
4572 }
4573 #[inline(always)]
4574 fn xor_i32x8(self, a: i32x8<Self>, b: i32x8<Self>) -> i32x8<Self> {
4575 let (a0, a1) = self.split_i32x8(a);
4576 let (b0, b1) = self.split_i32x8(b);
4577 self.combine_i32x4(self.xor_i32x4(a0, b0), self.xor_i32x4(a1, b1))
4578 }
4579 #[inline(always)]
4580 fn not_i32x8(self, a: i32x8<Self>) -> i32x8<Self> {
4581 let (a0, a1) = self.split_i32x8(a);
4582 self.combine_i32x4(self.not_i32x4(a0), self.not_i32x4(a1))
4583 }
4584 #[inline(always)]
4585 fn shl_i32x8(self, a: i32x8<Self>, shift: u32) -> i32x8<Self> {
4586 let (a0, a1) = self.split_i32x8(a);
4587 self.combine_i32x4(self.shl_i32x4(a0, shift), self.shl_i32x4(a1, shift))
4588 }
4589 #[inline(always)]
4590 fn shlv_i32x8(self, a: i32x8<Self>, b: i32x8<Self>) -> i32x8<Self> {
4591 let (a0, a1) = self.split_i32x8(a);
4592 let (b0, b1) = self.split_i32x8(b);
4593 self.combine_i32x4(self.shlv_i32x4(a0, b0), self.shlv_i32x4(a1, b1))
4594 }
4595 #[inline(always)]
4596 fn shr_i32x8(self, a: i32x8<Self>, shift: u32) -> i32x8<Self> {
4597 let (a0, a1) = self.split_i32x8(a);
4598 self.combine_i32x4(self.shr_i32x4(a0, shift), self.shr_i32x4(a1, shift))
4599 }
4600 #[inline(always)]
4601 fn shrv_i32x8(self, a: i32x8<Self>, b: i32x8<Self>) -> i32x8<Self> {
4602 let (a0, a1) = self.split_i32x8(a);
4603 let (b0, b1) = self.split_i32x8(b);
4604 self.combine_i32x4(self.shrv_i32x4(a0, b0), self.shrv_i32x4(a1, b1))
4605 }
4606 #[inline(always)]
4607 fn simd_eq_i32x8(self, a: i32x8<Self>, b: i32x8<Self>) -> mask32x8<Self> {
4608 let (a0, a1) = self.split_i32x8(a);
4609 let (b0, b1) = self.split_i32x8(b);
4610 self.combine_mask32x4(self.simd_eq_i32x4(a0, b0), self.simd_eq_i32x4(a1, b1))
4611 }
4612 #[inline(always)]
4613 fn simd_lt_i32x8(self, a: i32x8<Self>, b: i32x8<Self>) -> mask32x8<Self> {
4614 let (a0, a1) = self.split_i32x8(a);
4615 let (b0, b1) = self.split_i32x8(b);
4616 self.combine_mask32x4(self.simd_lt_i32x4(a0, b0), self.simd_lt_i32x4(a1, b1))
4617 }
4618 #[inline(always)]
4619 fn simd_le_i32x8(self, a: i32x8<Self>, b: i32x8<Self>) -> mask32x8<Self> {
4620 let (a0, a1) = self.split_i32x8(a);
4621 let (b0, b1) = self.split_i32x8(b);
4622 self.combine_mask32x4(self.simd_le_i32x4(a0, b0), self.simd_le_i32x4(a1, b1))
4623 }
4624 #[inline(always)]
4625 fn simd_ge_i32x8(self, a: i32x8<Self>, b: i32x8<Self>) -> mask32x8<Self> {
4626 let (a0, a1) = self.split_i32x8(a);
4627 let (b0, b1) = self.split_i32x8(b);
4628 self.combine_mask32x4(self.simd_ge_i32x4(a0, b0), self.simd_ge_i32x4(a1, b1))
4629 }
4630 #[inline(always)]
4631 fn simd_gt_i32x8(self, a: i32x8<Self>, b: i32x8<Self>) -> mask32x8<Self> {
4632 let (a0, a1) = self.split_i32x8(a);
4633 let (b0, b1) = self.split_i32x8(b);
4634 self.combine_mask32x4(self.simd_gt_i32x4(a0, b0), self.simd_gt_i32x4(a1, b1))
4635 }
4636 #[inline(always)]
4637 fn zip_low_i32x8(self, a: i32x8<Self>, b: i32x8<Self>) -> i32x8<Self> {
4638 let (a0, _) = self.split_i32x8(a);
4639 let (b0, _) = self.split_i32x8(b);
4640 self.combine_i32x4(self.zip_low_i32x4(a0, b0), self.zip_high_i32x4(a0, b0))
4641 }
4642 #[inline(always)]
4643 fn zip_high_i32x8(self, a: i32x8<Self>, b: i32x8<Self>) -> i32x8<Self> {
4644 let (_, a1) = self.split_i32x8(a);
4645 let (_, b1) = self.split_i32x8(b);
4646 self.combine_i32x4(self.zip_low_i32x4(a1, b1), self.zip_high_i32x4(a1, b1))
4647 }
4648 #[inline(always)]
4649 fn unzip_low_i32x8(self, a: i32x8<Self>, b: i32x8<Self>) -> i32x8<Self> {
4650 let (a0, a1) = self.split_i32x8(a);
4651 let (b0, b1) = self.split_i32x8(b);
4652 self.combine_i32x4(self.unzip_low_i32x4(a0, a1), self.unzip_low_i32x4(b0, b1))
4653 }
4654 #[inline(always)]
4655 fn unzip_high_i32x8(self, a: i32x8<Self>, b: i32x8<Self>) -> i32x8<Self> {
4656 let (a0, a1) = self.split_i32x8(a);
4657 let (b0, b1) = self.split_i32x8(b);
4658 self.combine_i32x4(self.unzip_high_i32x4(a0, a1), self.unzip_high_i32x4(b0, b1))
4659 }
4660 #[inline(always)]
4661 fn interleave_i32x8(self, a: i32x8<Self>, b: i32x8<Self>) -> (i32x8<Self>, i32x8<Self>) {
4662 let (a0, a1) = self.split_i32x8(a);
4663 let (b0, b1) = self.split_i32x8(b);
4664 let lo_lo = self.zip_low_i32x4(a0, b0);
4665 let lo_hi = self.zip_high_i32x4(a0, b0);
4666 let hi_lo = self.zip_low_i32x4(a1, b1);
4667 let hi_hi = self.zip_high_i32x4(a1, b1);
4668 (
4669 self.combine_i32x4(lo_lo, lo_hi),
4670 self.combine_i32x4(hi_lo, hi_hi),
4671 )
4672 }
4673 #[inline(always)]
4674 fn deinterleave_i32x8(self, a: i32x8<Self>, b: i32x8<Self>) -> (i32x8<Self>, i32x8<Self>) {
4675 let (a0, a1) = self.split_i32x8(a);
4676 let (b0, b1) = self.split_i32x8(b);
4677 let lo_even = self.unzip_low_i32x4(a0, a1);
4678 let lo_odd = self.unzip_high_i32x4(a0, a1);
4679 let hi_even = self.unzip_low_i32x4(b0, b1);
4680 let hi_odd = self.unzip_high_i32x4(b0, b1);
4681 (
4682 self.combine_i32x4(lo_even, hi_even),
4683 self.combine_i32x4(lo_odd, hi_odd),
4684 )
4685 }
4686 #[inline(always)]
4687 fn select_i32x8(self, a: mask32x8<Self>, b: i32x8<Self>, c: i32x8<Self>) -> i32x8<Self> {
4688 let (a0, a1) = self.split_mask32x8(a);
4689 let (b0, b1) = self.split_i32x8(b);
4690 let (c0, c1) = self.split_i32x8(c);
4691 self.combine_i32x4(self.select_i32x4(a0, b0, c0), self.select_i32x4(a1, b1, c1))
4692 }
4693 #[inline(always)]
4694 fn min_i32x8(self, a: i32x8<Self>, b: i32x8<Self>) -> i32x8<Self> {
4695 let (a0, a1) = self.split_i32x8(a);
4696 let (b0, b1) = self.split_i32x8(b);
4697 self.combine_i32x4(self.min_i32x4(a0, b0), self.min_i32x4(a1, b1))
4698 }
4699 #[inline(always)]
4700 fn max_i32x8(self, a: i32x8<Self>, b: i32x8<Self>) -> i32x8<Self> {
4701 let (a0, a1) = self.split_i32x8(a);
4702 let (b0, b1) = self.split_i32x8(b);
4703 self.combine_i32x4(self.max_i32x4(a0, b0), self.max_i32x4(a1, b1))
4704 }
4705 #[inline(always)]
4706 fn combine_i32x8(self, a: i32x8<Self>, b: i32x8<Self>) -> i32x16<Self> {
4707 i32x16 {
4708 val: crate::support::Aligned512(int32x4x4_t(
4709 a.val.0.0, a.val.0.1, b.val.0.0, b.val.0.1,
4710 )),
4711 simd: self,
4712 }
4713 }
4714 #[inline(always)]
4715 fn split_i32x8(self, a: i32x8<Self>) -> (i32x4<Self>, i32x4<Self>) {
4716 (
4717 i32x4 {
4718 val: crate::support::Aligned128(a.val.0.0),
4719 simd: self,
4720 },
4721 i32x4 {
4722 val: crate::support::Aligned128(a.val.0.1),
4723 simd: self,
4724 },
4725 )
4726 }
4727 #[inline(always)]
4728 fn neg_i32x8(self, a: i32x8<Self>) -> i32x8<Self> {
4729 let (a0, a1) = self.split_i32x8(a);
4730 self.combine_i32x4(self.neg_i32x4(a0), self.neg_i32x4(a1))
4731 }
4732 #[inline(always)]
4733 fn reinterpret_u8_i32x8(self, a: i32x8<Self>) -> u8x32<Self> {
4734 let (a0, a1) = self.split_i32x8(a);
4735 self.combine_u8x16(self.reinterpret_u8_i32x4(a0), self.reinterpret_u8_i32x4(a1))
4736 }
4737 #[inline(always)]
4738 fn reinterpret_u32_i32x8(self, a: i32x8<Self>) -> u32x8<Self> {
4739 let (a0, a1) = self.split_i32x8(a);
4740 self.combine_u32x4(
4741 self.reinterpret_u32_i32x4(a0),
4742 self.reinterpret_u32_i32x4(a1),
4743 )
4744 }
4745 #[inline(always)]
4746 fn cvt_f32_i32x8(self, a: i32x8<Self>) -> f32x8<Self> {
4747 let (a0, a1) = self.split_i32x8(a);
4748 self.combine_f32x4(self.cvt_f32_i32x4(a0), self.cvt_f32_i32x4(a1))
4749 }
4750 #[inline(always)]
4751 fn splat_u32x8(self, val: u32) -> u32x8<Self> {
4752 let half = self.splat_u32x4(val);
4753 self.combine_u32x4(half, half)
4754 }
4755 #[inline(always)]
4756 fn load_array_u32x8(self, val: [u32; 8usize]) -> u32x8<Self> {
4757 u32x8 {
4758 val: unsafe { core::mem::transmute_copy(&val) },
4759 simd: self,
4760 }
4761 }
4762 #[inline(always)]
4763 fn load_array_ref_u32x8(self, val: &[u32; 8usize]) -> u32x8<Self> {
4764 u32x8 {
4765 val: unsafe { core::mem::transmute_copy(val) },
4766 simd: self,
4767 }
4768 }
4769 #[inline(always)]
4770 fn as_array_u32x8(self, a: u32x8<Self>) -> [u32; 8usize] {
4771 unsafe { core::mem::transmute::<uint32x4x2_t, [u32; 8usize]>(a.val.0) }
4772 }
4773 #[inline(always)]
4774 fn as_array_ref_u32x8(self, a: &u32x8<Self>) -> &[u32; 8usize] {
4775 unsafe { core::mem::transmute::<&uint32x4x2_t, &[u32; 8usize]>(&a.val.0) }
4776 }
4777 #[inline(always)]
4778 fn as_array_mut_u32x8(self, a: &mut u32x8<Self>) -> &mut [u32; 8usize] {
4779 unsafe { core::mem::transmute::<&mut uint32x4x2_t, &mut [u32; 8usize]>(&mut a.val.0) }
4780 }
4781 #[inline(always)]
4782 fn store_array_u32x8(self, a: u32x8<Self>, dest: &mut [u32; 8usize]) -> () {
4783 unsafe {
4784 core::ptr::copy_nonoverlapping(
4785 (&raw const a.val.0) as *const u32,
4786 dest.as_mut_ptr(),
4787 8usize,
4788 );
4789 }
4790 }
4791 #[inline(always)]
4792 fn cvt_from_bytes_u32x8(self, a: u8x32<Self>) -> u32x8<Self> {
4793 unsafe {
4794 u32x8 {
4795 val: core::mem::transmute(a.val),
4796 simd: self,
4797 }
4798 }
4799 }
4800 #[inline(always)]
4801 fn cvt_to_bytes_u32x8(self, a: u32x8<Self>) -> u8x32<Self> {
4802 unsafe {
4803 u8x32 {
4804 val: core::mem::transmute(a.val),
4805 simd: self,
4806 }
4807 }
4808 }
4809 #[inline(always)]
4810 fn slide_u32x8<const SHIFT: usize>(self, a: u32x8<Self>, b: u32x8<Self>) -> u32x8<Self> {
4811 if SHIFT >= 8usize {
4812 return b;
4813 }
4814 let result = unsafe {
4815 let a_bytes = self.cvt_to_bytes_u32x8(a).val.0;
4816 let b_bytes = self.cvt_to_bytes_u32x8(b).val.0;
4817 let a_blocks = [a_bytes.0, a_bytes.1];
4818 let b_blocks = [b_bytes.0, b_bytes.1];
4819 let shift_bytes = SHIFT * 4usize;
4820 uint8x16x2_t(
4821 {
4822 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
4823 &a_blocks,
4824 &b_blocks,
4825 0,
4826 shift_bytes,
4827 );
4828 dyn_vext_128(lo, hi, shift_bytes % 16)
4829 },
4830 {
4831 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
4832 &a_blocks,
4833 &b_blocks,
4834 1,
4835 shift_bytes,
4836 );
4837 dyn_vext_128(lo, hi, shift_bytes % 16)
4838 },
4839 )
4840 };
4841 self.cvt_from_bytes_u32x8(u8x32 {
4842 val: crate::support::Aligned256(result),
4843 simd: self,
4844 })
4845 }
4846 #[inline(always)]
4847 fn slide_within_blocks_u32x8<const SHIFT: usize>(
4848 self,
4849 a: u32x8<Self>,
4850 b: u32x8<Self>,
4851 ) -> u32x8<Self> {
4852 let (a0, a1) = self.split_u32x8(a);
4853 let (b0, b1) = self.split_u32x8(b);
4854 self.combine_u32x4(
4855 self.slide_within_blocks_u32x4::<SHIFT>(a0, b0),
4856 self.slide_within_blocks_u32x4::<SHIFT>(a1, b1),
4857 )
4858 }
4859 #[inline(always)]
4860 fn add_u32x8(self, a: u32x8<Self>, b: u32x8<Self>) -> u32x8<Self> {
4861 let (a0, a1) = self.split_u32x8(a);
4862 let (b0, b1) = self.split_u32x8(b);
4863 self.combine_u32x4(self.add_u32x4(a0, b0), self.add_u32x4(a1, b1))
4864 }
4865 #[inline(always)]
4866 fn sub_u32x8(self, a: u32x8<Self>, b: u32x8<Self>) -> u32x8<Self> {
4867 let (a0, a1) = self.split_u32x8(a);
4868 let (b0, b1) = self.split_u32x8(b);
4869 self.combine_u32x4(self.sub_u32x4(a0, b0), self.sub_u32x4(a1, b1))
4870 }
4871 #[inline(always)]
4872 fn mul_u32x8(self, a: u32x8<Self>, b: u32x8<Self>) -> u32x8<Self> {
4873 let (a0, a1) = self.split_u32x8(a);
4874 let (b0, b1) = self.split_u32x8(b);
4875 self.combine_u32x4(self.mul_u32x4(a0, b0), self.mul_u32x4(a1, b1))
4876 }
4877 #[inline(always)]
4878 fn and_u32x8(self, a: u32x8<Self>, b: u32x8<Self>) -> u32x8<Self> {
4879 let (a0, a1) = self.split_u32x8(a);
4880 let (b0, b1) = self.split_u32x8(b);
4881 self.combine_u32x4(self.and_u32x4(a0, b0), self.and_u32x4(a1, b1))
4882 }
4883 #[inline(always)]
4884 fn or_u32x8(self, a: u32x8<Self>, b: u32x8<Self>) -> u32x8<Self> {
4885 let (a0, a1) = self.split_u32x8(a);
4886 let (b0, b1) = self.split_u32x8(b);
4887 self.combine_u32x4(self.or_u32x4(a0, b0), self.or_u32x4(a1, b1))
4888 }
4889 #[inline(always)]
4890 fn xor_u32x8(self, a: u32x8<Self>, b: u32x8<Self>) -> u32x8<Self> {
4891 let (a0, a1) = self.split_u32x8(a);
4892 let (b0, b1) = self.split_u32x8(b);
4893 self.combine_u32x4(self.xor_u32x4(a0, b0), self.xor_u32x4(a1, b1))
4894 }
4895 #[inline(always)]
4896 fn not_u32x8(self, a: u32x8<Self>) -> u32x8<Self> {
4897 let (a0, a1) = self.split_u32x8(a);
4898 self.combine_u32x4(self.not_u32x4(a0), self.not_u32x4(a1))
4899 }
4900 #[inline(always)]
4901 fn shl_u32x8(self, a: u32x8<Self>, shift: u32) -> u32x8<Self> {
4902 let (a0, a1) = self.split_u32x8(a);
4903 self.combine_u32x4(self.shl_u32x4(a0, shift), self.shl_u32x4(a1, shift))
4904 }
4905 #[inline(always)]
4906 fn shlv_u32x8(self, a: u32x8<Self>, b: u32x8<Self>) -> u32x8<Self> {
4907 let (a0, a1) = self.split_u32x8(a);
4908 let (b0, b1) = self.split_u32x8(b);
4909 self.combine_u32x4(self.shlv_u32x4(a0, b0), self.shlv_u32x4(a1, b1))
4910 }
4911 #[inline(always)]
4912 fn shr_u32x8(self, a: u32x8<Self>, shift: u32) -> u32x8<Self> {
4913 let (a0, a1) = self.split_u32x8(a);
4914 self.combine_u32x4(self.shr_u32x4(a0, shift), self.shr_u32x4(a1, shift))
4915 }
4916 #[inline(always)]
4917 fn shrv_u32x8(self, a: u32x8<Self>, b: u32x8<Self>) -> u32x8<Self> {
4918 let (a0, a1) = self.split_u32x8(a);
4919 let (b0, b1) = self.split_u32x8(b);
4920 self.combine_u32x4(self.shrv_u32x4(a0, b0), self.shrv_u32x4(a1, b1))
4921 }
4922 #[inline(always)]
4923 fn simd_eq_u32x8(self, a: u32x8<Self>, b: u32x8<Self>) -> mask32x8<Self> {
4924 let (a0, a1) = self.split_u32x8(a);
4925 let (b0, b1) = self.split_u32x8(b);
4926 self.combine_mask32x4(self.simd_eq_u32x4(a0, b0), self.simd_eq_u32x4(a1, b1))
4927 }
4928 #[inline(always)]
4929 fn simd_lt_u32x8(self, a: u32x8<Self>, b: u32x8<Self>) -> mask32x8<Self> {
4930 let (a0, a1) = self.split_u32x8(a);
4931 let (b0, b1) = self.split_u32x8(b);
4932 self.combine_mask32x4(self.simd_lt_u32x4(a0, b0), self.simd_lt_u32x4(a1, b1))
4933 }
4934 #[inline(always)]
4935 fn simd_le_u32x8(self, a: u32x8<Self>, b: u32x8<Self>) -> mask32x8<Self> {
4936 let (a0, a1) = self.split_u32x8(a);
4937 let (b0, b1) = self.split_u32x8(b);
4938 self.combine_mask32x4(self.simd_le_u32x4(a0, b0), self.simd_le_u32x4(a1, b1))
4939 }
4940 #[inline(always)]
4941 fn simd_ge_u32x8(self, a: u32x8<Self>, b: u32x8<Self>) -> mask32x8<Self> {
4942 let (a0, a1) = self.split_u32x8(a);
4943 let (b0, b1) = self.split_u32x8(b);
4944 self.combine_mask32x4(self.simd_ge_u32x4(a0, b0), self.simd_ge_u32x4(a1, b1))
4945 }
4946 #[inline(always)]
4947 fn simd_gt_u32x8(self, a: u32x8<Self>, b: u32x8<Self>) -> mask32x8<Self> {
4948 let (a0, a1) = self.split_u32x8(a);
4949 let (b0, b1) = self.split_u32x8(b);
4950 self.combine_mask32x4(self.simd_gt_u32x4(a0, b0), self.simd_gt_u32x4(a1, b1))
4951 }
4952 #[inline(always)]
4953 fn zip_low_u32x8(self, a: u32x8<Self>, b: u32x8<Self>) -> u32x8<Self> {
4954 let (a0, _) = self.split_u32x8(a);
4955 let (b0, _) = self.split_u32x8(b);
4956 self.combine_u32x4(self.zip_low_u32x4(a0, b0), self.zip_high_u32x4(a0, b0))
4957 }
4958 #[inline(always)]
4959 fn zip_high_u32x8(self, a: u32x8<Self>, b: u32x8<Self>) -> u32x8<Self> {
4960 let (_, a1) = self.split_u32x8(a);
4961 let (_, b1) = self.split_u32x8(b);
4962 self.combine_u32x4(self.zip_low_u32x4(a1, b1), self.zip_high_u32x4(a1, b1))
4963 }
4964 #[inline(always)]
4965 fn unzip_low_u32x8(self, a: u32x8<Self>, b: u32x8<Self>) -> u32x8<Self> {
4966 let (a0, a1) = self.split_u32x8(a);
4967 let (b0, b1) = self.split_u32x8(b);
4968 self.combine_u32x4(self.unzip_low_u32x4(a0, a1), self.unzip_low_u32x4(b0, b1))
4969 }
4970 #[inline(always)]
4971 fn unzip_high_u32x8(self, a: u32x8<Self>, b: u32x8<Self>) -> u32x8<Self> {
4972 let (a0, a1) = self.split_u32x8(a);
4973 let (b0, b1) = self.split_u32x8(b);
4974 self.combine_u32x4(self.unzip_high_u32x4(a0, a1), self.unzip_high_u32x4(b0, b1))
4975 }
4976 #[inline(always)]
4977 fn interleave_u32x8(self, a: u32x8<Self>, b: u32x8<Self>) -> (u32x8<Self>, u32x8<Self>) {
4978 let (a0, a1) = self.split_u32x8(a);
4979 let (b0, b1) = self.split_u32x8(b);
4980 let lo_lo = self.zip_low_u32x4(a0, b0);
4981 let lo_hi = self.zip_high_u32x4(a0, b0);
4982 let hi_lo = self.zip_low_u32x4(a1, b1);
4983 let hi_hi = self.zip_high_u32x4(a1, b1);
4984 (
4985 self.combine_u32x4(lo_lo, lo_hi),
4986 self.combine_u32x4(hi_lo, hi_hi),
4987 )
4988 }
4989 #[inline(always)]
4990 fn deinterleave_u32x8(self, a: u32x8<Self>, b: u32x8<Self>) -> (u32x8<Self>, u32x8<Self>) {
4991 let (a0, a1) = self.split_u32x8(a);
4992 let (b0, b1) = self.split_u32x8(b);
4993 let lo_even = self.unzip_low_u32x4(a0, a1);
4994 let lo_odd = self.unzip_high_u32x4(a0, a1);
4995 let hi_even = self.unzip_low_u32x4(b0, b1);
4996 let hi_odd = self.unzip_high_u32x4(b0, b1);
4997 (
4998 self.combine_u32x4(lo_even, hi_even),
4999 self.combine_u32x4(lo_odd, hi_odd),
5000 )
5001 }
5002 #[inline(always)]
5003 fn select_u32x8(self, a: mask32x8<Self>, b: u32x8<Self>, c: u32x8<Self>) -> u32x8<Self> {
5004 let (a0, a1) = self.split_mask32x8(a);
5005 let (b0, b1) = self.split_u32x8(b);
5006 let (c0, c1) = self.split_u32x8(c);
5007 self.combine_u32x4(self.select_u32x4(a0, b0, c0), self.select_u32x4(a1, b1, c1))
5008 }
5009 #[inline(always)]
5010 fn min_u32x8(self, a: u32x8<Self>, b: u32x8<Self>) -> u32x8<Self> {
5011 let (a0, a1) = self.split_u32x8(a);
5012 let (b0, b1) = self.split_u32x8(b);
5013 self.combine_u32x4(self.min_u32x4(a0, b0), self.min_u32x4(a1, b1))
5014 }
5015 #[inline(always)]
5016 fn max_u32x8(self, a: u32x8<Self>, b: u32x8<Self>) -> u32x8<Self> {
5017 let (a0, a1) = self.split_u32x8(a);
5018 let (b0, b1) = self.split_u32x8(b);
5019 self.combine_u32x4(self.max_u32x4(a0, b0), self.max_u32x4(a1, b1))
5020 }
5021 #[inline(always)]
5022 fn combine_u32x8(self, a: u32x8<Self>, b: u32x8<Self>) -> u32x16<Self> {
5023 u32x16 {
5024 val: crate::support::Aligned512(uint32x4x4_t(
5025 a.val.0.0, a.val.0.1, b.val.0.0, b.val.0.1,
5026 )),
5027 simd: self,
5028 }
5029 }
5030 #[inline(always)]
5031 fn split_u32x8(self, a: u32x8<Self>) -> (u32x4<Self>, u32x4<Self>) {
5032 (
5033 u32x4 {
5034 val: crate::support::Aligned128(a.val.0.0),
5035 simd: self,
5036 },
5037 u32x4 {
5038 val: crate::support::Aligned128(a.val.0.1),
5039 simd: self,
5040 },
5041 )
5042 }
5043 #[inline(always)]
5044 fn reinterpret_u8_u32x8(self, a: u32x8<Self>) -> u8x32<Self> {
5045 let (a0, a1) = self.split_u32x8(a);
5046 self.combine_u8x16(self.reinterpret_u8_u32x4(a0), self.reinterpret_u8_u32x4(a1))
5047 }
5048 #[inline(always)]
5049 fn cvt_f32_u32x8(self, a: u32x8<Self>) -> f32x8<Self> {
5050 let (a0, a1) = self.split_u32x8(a);
5051 self.combine_f32x4(self.cvt_f32_u32x4(a0), self.cvt_f32_u32x4(a1))
5052 }
5053 #[inline(always)]
5054 fn splat_mask32x8(self, val: i32) -> mask32x8<Self> {
5055 let half = self.splat_mask32x4(val);
5056 self.combine_mask32x4(half, half)
5057 }
5058 #[inline(always)]
5059 fn load_array_mask32x8(self, val: [i32; 8usize]) -> mask32x8<Self> {
5060 mask32x8 {
5061 val: unsafe { core::mem::transmute_copy(&val) },
5062 simd: self,
5063 }
5064 }
5065 #[inline(always)]
5066 fn load_array_ref_mask32x8(self, val: &[i32; 8usize]) -> mask32x8<Self> {
5067 mask32x8 {
5068 val: unsafe { core::mem::transmute_copy(val) },
5069 simd: self,
5070 }
5071 }
5072 #[inline(always)]
5073 fn as_array_mask32x8(self, a: mask32x8<Self>) -> [i32; 8usize] {
5074 unsafe { core::mem::transmute::<int32x4x2_t, [i32; 8usize]>(a.val.0) }
5075 }
5076 #[inline(always)]
5077 fn as_array_ref_mask32x8(self, a: &mask32x8<Self>) -> &[i32; 8usize] {
5078 unsafe { core::mem::transmute::<&int32x4x2_t, &[i32; 8usize]>(&a.val.0) }
5079 }
5080 #[inline(always)]
5081 fn as_array_mut_mask32x8(self, a: &mut mask32x8<Self>) -> &mut [i32; 8usize] {
5082 unsafe { core::mem::transmute::<&mut int32x4x2_t, &mut [i32; 8usize]>(&mut a.val.0) }
5083 }
5084 #[inline(always)]
5085 fn store_array_mask32x8(self, a: mask32x8<Self>, dest: &mut [i32; 8usize]) -> () {
5086 unsafe {
5087 core::ptr::copy_nonoverlapping(
5088 (&raw const a.val.0) as *const i32,
5089 dest.as_mut_ptr(),
5090 8usize,
5091 );
5092 }
5093 }
5094 #[inline(always)]
5095 fn cvt_from_bytes_mask32x8(self, a: u8x32<Self>) -> mask32x8<Self> {
5096 unsafe {
5097 mask32x8 {
5098 val: core::mem::transmute(a.val),
5099 simd: self,
5100 }
5101 }
5102 }
5103 #[inline(always)]
5104 fn cvt_to_bytes_mask32x8(self, a: mask32x8<Self>) -> u8x32<Self> {
5105 unsafe {
5106 u8x32 {
5107 val: core::mem::transmute(a.val),
5108 simd: self,
5109 }
5110 }
5111 }
5112 #[inline(always)]
5113 fn slide_mask32x8<const SHIFT: usize>(
5114 self,
5115 a: mask32x8<Self>,
5116 b: mask32x8<Self>,
5117 ) -> mask32x8<Self> {
5118 if SHIFT >= 8usize {
5119 return b;
5120 }
5121 let result = unsafe {
5122 let a_bytes = self.cvt_to_bytes_mask32x8(a).val.0;
5123 let b_bytes = self.cvt_to_bytes_mask32x8(b).val.0;
5124 let a_blocks = [a_bytes.0, a_bytes.1];
5125 let b_blocks = [b_bytes.0, b_bytes.1];
5126 let shift_bytes = SHIFT * 4usize;
5127 uint8x16x2_t(
5128 {
5129 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
5130 &a_blocks,
5131 &b_blocks,
5132 0,
5133 shift_bytes,
5134 );
5135 dyn_vext_128(lo, hi, shift_bytes % 16)
5136 },
5137 {
5138 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
5139 &a_blocks,
5140 &b_blocks,
5141 1,
5142 shift_bytes,
5143 );
5144 dyn_vext_128(lo, hi, shift_bytes % 16)
5145 },
5146 )
5147 };
5148 self.cvt_from_bytes_mask32x8(u8x32 {
5149 val: crate::support::Aligned256(result),
5150 simd: self,
5151 })
5152 }
5153 #[inline(always)]
5154 fn slide_within_blocks_mask32x8<const SHIFT: usize>(
5155 self,
5156 a: mask32x8<Self>,
5157 b: mask32x8<Self>,
5158 ) -> mask32x8<Self> {
5159 let (a0, a1) = self.split_mask32x8(a);
5160 let (b0, b1) = self.split_mask32x8(b);
5161 self.combine_mask32x4(
5162 self.slide_within_blocks_mask32x4::<SHIFT>(a0, b0),
5163 self.slide_within_blocks_mask32x4::<SHIFT>(a1, b1),
5164 )
5165 }
5166 #[inline(always)]
5167 fn and_mask32x8(self, a: mask32x8<Self>, b: mask32x8<Self>) -> mask32x8<Self> {
5168 let (a0, a1) = self.split_mask32x8(a);
5169 let (b0, b1) = self.split_mask32x8(b);
5170 self.combine_mask32x4(self.and_mask32x4(a0, b0), self.and_mask32x4(a1, b1))
5171 }
5172 #[inline(always)]
5173 fn or_mask32x8(self, a: mask32x8<Self>, b: mask32x8<Self>) -> mask32x8<Self> {
5174 let (a0, a1) = self.split_mask32x8(a);
5175 let (b0, b1) = self.split_mask32x8(b);
5176 self.combine_mask32x4(self.or_mask32x4(a0, b0), self.or_mask32x4(a1, b1))
5177 }
5178 #[inline(always)]
5179 fn xor_mask32x8(self, a: mask32x8<Self>, b: mask32x8<Self>) -> mask32x8<Self> {
5180 let (a0, a1) = self.split_mask32x8(a);
5181 let (b0, b1) = self.split_mask32x8(b);
5182 self.combine_mask32x4(self.xor_mask32x4(a0, b0), self.xor_mask32x4(a1, b1))
5183 }
5184 #[inline(always)]
5185 fn not_mask32x8(self, a: mask32x8<Self>) -> mask32x8<Self> {
5186 let (a0, a1) = self.split_mask32x8(a);
5187 self.combine_mask32x4(self.not_mask32x4(a0), self.not_mask32x4(a1))
5188 }
5189 #[inline(always)]
5190 fn select_mask32x8(
5191 self,
5192 a: mask32x8<Self>,
5193 b: mask32x8<Self>,
5194 c: mask32x8<Self>,
5195 ) -> mask32x8<Self> {
5196 let (a0, a1) = self.split_mask32x8(a);
5197 let (b0, b1) = self.split_mask32x8(b);
5198 let (c0, c1) = self.split_mask32x8(c);
5199 self.combine_mask32x4(
5200 self.select_mask32x4(a0, b0, c0),
5201 self.select_mask32x4(a1, b1, c1),
5202 )
5203 }
5204 #[inline(always)]
5205 fn simd_eq_mask32x8(self, a: mask32x8<Self>, b: mask32x8<Self>) -> mask32x8<Self> {
5206 let (a0, a1) = self.split_mask32x8(a);
5207 let (b0, b1) = self.split_mask32x8(b);
5208 self.combine_mask32x4(self.simd_eq_mask32x4(a0, b0), self.simd_eq_mask32x4(a1, b1))
5209 }
5210 #[inline(always)]
5211 fn any_true_mask32x8(self, a: mask32x8<Self>) -> bool {
5212 let (a0, a1) = self.split_mask32x8(a);
5213 self.any_true_mask32x4(a0) || self.any_true_mask32x4(a1)
5214 }
5215 #[inline(always)]
5216 fn all_true_mask32x8(self, a: mask32x8<Self>) -> bool {
5217 let (a0, a1) = self.split_mask32x8(a);
5218 self.all_true_mask32x4(a0) && self.all_true_mask32x4(a1)
5219 }
5220 #[inline(always)]
5221 fn any_false_mask32x8(self, a: mask32x8<Self>) -> bool {
5222 let (a0, a1) = self.split_mask32x8(a);
5223 self.any_false_mask32x4(a0) || self.any_false_mask32x4(a1)
5224 }
5225 #[inline(always)]
5226 fn all_false_mask32x8(self, a: mask32x8<Self>) -> bool {
5227 let (a0, a1) = self.split_mask32x8(a);
5228 self.all_false_mask32x4(a0) && self.all_false_mask32x4(a1)
5229 }
5230 #[inline(always)]
5231 fn combine_mask32x8(self, a: mask32x8<Self>, b: mask32x8<Self>) -> mask32x16<Self> {
5232 mask32x16 {
5233 val: crate::support::Aligned512(int32x4x4_t(
5234 a.val.0.0, a.val.0.1, b.val.0.0, b.val.0.1,
5235 )),
5236 simd: self,
5237 }
5238 }
5239 #[inline(always)]
5240 fn split_mask32x8(self, a: mask32x8<Self>) -> (mask32x4<Self>, mask32x4<Self>) {
5241 (
5242 mask32x4 {
5243 val: crate::support::Aligned128(a.val.0.0),
5244 simd: self,
5245 },
5246 mask32x4 {
5247 val: crate::support::Aligned128(a.val.0.1),
5248 simd: self,
5249 },
5250 )
5251 }
5252 #[inline(always)]
5253 fn splat_f64x4(self, val: f64) -> f64x4<Self> {
5254 let half = self.splat_f64x2(val);
5255 self.combine_f64x2(half, half)
5256 }
5257 #[inline(always)]
5258 fn load_array_f64x4(self, val: [f64; 4usize]) -> f64x4<Self> {
5259 f64x4 {
5260 val: unsafe { core::mem::transmute_copy(&val) },
5261 simd: self,
5262 }
5263 }
5264 #[inline(always)]
5265 fn load_array_ref_f64x4(self, val: &[f64; 4usize]) -> f64x4<Self> {
5266 f64x4 {
5267 val: unsafe { core::mem::transmute_copy(val) },
5268 simd: self,
5269 }
5270 }
5271 #[inline(always)]
5272 fn as_array_f64x4(self, a: f64x4<Self>) -> [f64; 4usize] {
5273 unsafe { core::mem::transmute::<float64x2x2_t, [f64; 4usize]>(a.val.0) }
5274 }
5275 #[inline(always)]
5276 fn as_array_ref_f64x4(self, a: &f64x4<Self>) -> &[f64; 4usize] {
5277 unsafe { core::mem::transmute::<&float64x2x2_t, &[f64; 4usize]>(&a.val.0) }
5278 }
5279 #[inline(always)]
5280 fn as_array_mut_f64x4(self, a: &mut f64x4<Self>) -> &mut [f64; 4usize] {
5281 unsafe { core::mem::transmute::<&mut float64x2x2_t, &mut [f64; 4usize]>(&mut a.val.0) }
5282 }
5283 #[inline(always)]
5284 fn store_array_f64x4(self, a: f64x4<Self>, dest: &mut [f64; 4usize]) -> () {
5285 unsafe {
5286 core::ptr::copy_nonoverlapping(
5287 (&raw const a.val.0) as *const f64,
5288 dest.as_mut_ptr(),
5289 4usize,
5290 );
5291 }
5292 }
5293 #[inline(always)]
5294 fn cvt_from_bytes_f64x4(self, a: u8x32<Self>) -> f64x4<Self> {
5295 unsafe {
5296 f64x4 {
5297 val: core::mem::transmute(a.val),
5298 simd: self,
5299 }
5300 }
5301 }
5302 #[inline(always)]
5303 fn cvt_to_bytes_f64x4(self, a: f64x4<Self>) -> u8x32<Self> {
5304 unsafe {
5305 u8x32 {
5306 val: core::mem::transmute(a.val),
5307 simd: self,
5308 }
5309 }
5310 }
5311 #[inline(always)]
5312 fn slide_f64x4<const SHIFT: usize>(self, a: f64x4<Self>, b: f64x4<Self>) -> f64x4<Self> {
5313 if SHIFT >= 4usize {
5314 return b;
5315 }
5316 let result = unsafe {
5317 let a_bytes = self.cvt_to_bytes_f64x4(a).val.0;
5318 let b_bytes = self.cvt_to_bytes_f64x4(b).val.0;
5319 let a_blocks = [a_bytes.0, a_bytes.1];
5320 let b_blocks = [b_bytes.0, b_bytes.1];
5321 let shift_bytes = SHIFT * 8usize;
5322 uint8x16x2_t(
5323 {
5324 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
5325 &a_blocks,
5326 &b_blocks,
5327 0,
5328 shift_bytes,
5329 );
5330 dyn_vext_128(lo, hi, shift_bytes % 16)
5331 },
5332 {
5333 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
5334 &a_blocks,
5335 &b_blocks,
5336 1,
5337 shift_bytes,
5338 );
5339 dyn_vext_128(lo, hi, shift_bytes % 16)
5340 },
5341 )
5342 };
5343 self.cvt_from_bytes_f64x4(u8x32 {
5344 val: crate::support::Aligned256(result),
5345 simd: self,
5346 })
5347 }
5348 #[inline(always)]
5349 fn slide_within_blocks_f64x4<const SHIFT: usize>(
5350 self,
5351 a: f64x4<Self>,
5352 b: f64x4<Self>,
5353 ) -> f64x4<Self> {
5354 let (a0, a1) = self.split_f64x4(a);
5355 let (b0, b1) = self.split_f64x4(b);
5356 self.combine_f64x2(
5357 self.slide_within_blocks_f64x2::<SHIFT>(a0, b0),
5358 self.slide_within_blocks_f64x2::<SHIFT>(a1, b1),
5359 )
5360 }
5361 #[inline(always)]
5362 fn abs_f64x4(self, a: f64x4<Self>) -> f64x4<Self> {
5363 let (a0, a1) = self.split_f64x4(a);
5364 self.combine_f64x2(self.abs_f64x2(a0), self.abs_f64x2(a1))
5365 }
5366 #[inline(always)]
5367 fn neg_f64x4(self, a: f64x4<Self>) -> f64x4<Self> {
5368 let (a0, a1) = self.split_f64x4(a);
5369 self.combine_f64x2(self.neg_f64x2(a0), self.neg_f64x2(a1))
5370 }
5371 #[inline(always)]
5372 fn sqrt_f64x4(self, a: f64x4<Self>) -> f64x4<Self> {
5373 let (a0, a1) = self.split_f64x4(a);
5374 self.combine_f64x2(self.sqrt_f64x2(a0), self.sqrt_f64x2(a1))
5375 }
5376 #[inline(always)]
5377 fn add_f64x4(self, a: f64x4<Self>, b: f64x4<Self>) -> f64x4<Self> {
5378 let (a0, a1) = self.split_f64x4(a);
5379 let (b0, b1) = self.split_f64x4(b);
5380 self.combine_f64x2(self.add_f64x2(a0, b0), self.add_f64x2(a1, b1))
5381 }
5382 #[inline(always)]
5383 fn sub_f64x4(self, a: f64x4<Self>, b: f64x4<Self>) -> f64x4<Self> {
5384 let (a0, a1) = self.split_f64x4(a);
5385 let (b0, b1) = self.split_f64x4(b);
5386 self.combine_f64x2(self.sub_f64x2(a0, b0), self.sub_f64x2(a1, b1))
5387 }
5388 #[inline(always)]
5389 fn mul_f64x4(self, a: f64x4<Self>, b: f64x4<Self>) -> f64x4<Self> {
5390 let (a0, a1) = self.split_f64x4(a);
5391 let (b0, b1) = self.split_f64x4(b);
5392 self.combine_f64x2(self.mul_f64x2(a0, b0), self.mul_f64x2(a1, b1))
5393 }
5394 #[inline(always)]
5395 fn div_f64x4(self, a: f64x4<Self>, b: f64x4<Self>) -> f64x4<Self> {
5396 let (a0, a1) = self.split_f64x4(a);
5397 let (b0, b1) = self.split_f64x4(b);
5398 self.combine_f64x2(self.div_f64x2(a0, b0), self.div_f64x2(a1, b1))
5399 }
5400 #[inline(always)]
5401 fn copysign_f64x4(self, a: f64x4<Self>, b: f64x4<Self>) -> f64x4<Self> {
5402 let (a0, a1) = self.split_f64x4(a);
5403 let (b0, b1) = self.split_f64x4(b);
5404 self.combine_f64x2(self.copysign_f64x2(a0, b0), self.copysign_f64x2(a1, b1))
5405 }
5406 #[inline(always)]
5407 fn simd_eq_f64x4(self, a: f64x4<Self>, b: f64x4<Self>) -> mask64x4<Self> {
5408 let (a0, a1) = self.split_f64x4(a);
5409 let (b0, b1) = self.split_f64x4(b);
5410 self.combine_mask64x2(self.simd_eq_f64x2(a0, b0), self.simd_eq_f64x2(a1, b1))
5411 }
5412 #[inline(always)]
5413 fn simd_lt_f64x4(self, a: f64x4<Self>, b: f64x4<Self>) -> mask64x4<Self> {
5414 let (a0, a1) = self.split_f64x4(a);
5415 let (b0, b1) = self.split_f64x4(b);
5416 self.combine_mask64x2(self.simd_lt_f64x2(a0, b0), self.simd_lt_f64x2(a1, b1))
5417 }
5418 #[inline(always)]
5419 fn simd_le_f64x4(self, a: f64x4<Self>, b: f64x4<Self>) -> mask64x4<Self> {
5420 let (a0, a1) = self.split_f64x4(a);
5421 let (b0, b1) = self.split_f64x4(b);
5422 self.combine_mask64x2(self.simd_le_f64x2(a0, b0), self.simd_le_f64x2(a1, b1))
5423 }
5424 #[inline(always)]
5425 fn simd_ge_f64x4(self, a: f64x4<Self>, b: f64x4<Self>) -> mask64x4<Self> {
5426 let (a0, a1) = self.split_f64x4(a);
5427 let (b0, b1) = self.split_f64x4(b);
5428 self.combine_mask64x2(self.simd_ge_f64x2(a0, b0), self.simd_ge_f64x2(a1, b1))
5429 }
5430 #[inline(always)]
5431 fn simd_gt_f64x4(self, a: f64x4<Self>, b: f64x4<Self>) -> mask64x4<Self> {
5432 let (a0, a1) = self.split_f64x4(a);
5433 let (b0, b1) = self.split_f64x4(b);
5434 self.combine_mask64x2(self.simd_gt_f64x2(a0, b0), self.simd_gt_f64x2(a1, b1))
5435 }
5436 #[inline(always)]
5437 fn zip_low_f64x4(self, a: f64x4<Self>, b: f64x4<Self>) -> f64x4<Self> {
5438 let (a0, _) = self.split_f64x4(a);
5439 let (b0, _) = self.split_f64x4(b);
5440 self.combine_f64x2(self.zip_low_f64x2(a0, b0), self.zip_high_f64x2(a0, b0))
5441 }
5442 #[inline(always)]
5443 fn zip_high_f64x4(self, a: f64x4<Self>, b: f64x4<Self>) -> f64x4<Self> {
5444 let (_, a1) = self.split_f64x4(a);
5445 let (_, b1) = self.split_f64x4(b);
5446 self.combine_f64x2(self.zip_low_f64x2(a1, b1), self.zip_high_f64x2(a1, b1))
5447 }
5448 #[inline(always)]
5449 fn unzip_low_f64x4(self, a: f64x4<Self>, b: f64x4<Self>) -> f64x4<Self> {
5450 let (a0, a1) = self.split_f64x4(a);
5451 let (b0, b1) = self.split_f64x4(b);
5452 self.combine_f64x2(self.unzip_low_f64x2(a0, a1), self.unzip_low_f64x2(b0, b1))
5453 }
5454 #[inline(always)]
5455 fn unzip_high_f64x4(self, a: f64x4<Self>, b: f64x4<Self>) -> f64x4<Self> {
5456 let (a0, a1) = self.split_f64x4(a);
5457 let (b0, b1) = self.split_f64x4(b);
5458 self.combine_f64x2(self.unzip_high_f64x2(a0, a1), self.unzip_high_f64x2(b0, b1))
5459 }
5460 #[inline(always)]
5461 fn interleave_f64x4(self, a: f64x4<Self>, b: f64x4<Self>) -> (f64x4<Self>, f64x4<Self>) {
5462 let (a0, a1) = self.split_f64x4(a);
5463 let (b0, b1) = self.split_f64x4(b);
5464 let lo_lo = self.zip_low_f64x2(a0, b0);
5465 let lo_hi = self.zip_high_f64x2(a0, b0);
5466 let hi_lo = self.zip_low_f64x2(a1, b1);
5467 let hi_hi = self.zip_high_f64x2(a1, b1);
5468 (
5469 self.combine_f64x2(lo_lo, lo_hi),
5470 self.combine_f64x2(hi_lo, hi_hi),
5471 )
5472 }
5473 #[inline(always)]
5474 fn deinterleave_f64x4(self, a: f64x4<Self>, b: f64x4<Self>) -> (f64x4<Self>, f64x4<Self>) {
5475 let (a0, a1) = self.split_f64x4(a);
5476 let (b0, b1) = self.split_f64x4(b);
5477 let lo_even = self.unzip_low_f64x2(a0, a1);
5478 let lo_odd = self.unzip_high_f64x2(a0, a1);
5479 let hi_even = self.unzip_low_f64x2(b0, b1);
5480 let hi_odd = self.unzip_high_f64x2(b0, b1);
5481 (
5482 self.combine_f64x2(lo_even, hi_even),
5483 self.combine_f64x2(lo_odd, hi_odd),
5484 )
5485 }
5486 #[inline(always)]
5487 fn max_f64x4(self, a: f64x4<Self>, b: f64x4<Self>) -> f64x4<Self> {
5488 let (a0, a1) = self.split_f64x4(a);
5489 let (b0, b1) = self.split_f64x4(b);
5490 self.combine_f64x2(self.max_f64x2(a0, b0), self.max_f64x2(a1, b1))
5491 }
5492 #[inline(always)]
5493 fn min_f64x4(self, a: f64x4<Self>, b: f64x4<Self>) -> f64x4<Self> {
5494 let (a0, a1) = self.split_f64x4(a);
5495 let (b0, b1) = self.split_f64x4(b);
5496 self.combine_f64x2(self.min_f64x2(a0, b0), self.min_f64x2(a1, b1))
5497 }
5498 #[inline(always)]
5499 fn max_precise_f64x4(self, a: f64x4<Self>, b: f64x4<Self>) -> f64x4<Self> {
5500 let (a0, a1) = self.split_f64x4(a);
5501 let (b0, b1) = self.split_f64x4(b);
5502 self.combine_f64x2(
5503 self.max_precise_f64x2(a0, b0),
5504 self.max_precise_f64x2(a1, b1),
5505 )
5506 }
5507 #[inline(always)]
5508 fn min_precise_f64x4(self, a: f64x4<Self>, b: f64x4<Self>) -> f64x4<Self> {
5509 let (a0, a1) = self.split_f64x4(a);
5510 let (b0, b1) = self.split_f64x4(b);
5511 self.combine_f64x2(
5512 self.min_precise_f64x2(a0, b0),
5513 self.min_precise_f64x2(a1, b1),
5514 )
5515 }
5516 #[inline(always)]
5517 fn mul_add_f64x4(self, a: f64x4<Self>, b: f64x4<Self>, c: f64x4<Self>) -> f64x4<Self> {
5518 let (a0, a1) = self.split_f64x4(a);
5519 let (b0, b1) = self.split_f64x4(b);
5520 let (c0, c1) = self.split_f64x4(c);
5521 self.combine_f64x2(
5522 self.mul_add_f64x2(a0, b0, c0),
5523 self.mul_add_f64x2(a1, b1, c1),
5524 )
5525 }
5526 #[inline(always)]
5527 fn mul_sub_f64x4(self, a: f64x4<Self>, b: f64x4<Self>, c: f64x4<Self>) -> f64x4<Self> {
5528 let (a0, a1) = self.split_f64x4(a);
5529 let (b0, b1) = self.split_f64x4(b);
5530 let (c0, c1) = self.split_f64x4(c);
5531 self.combine_f64x2(
5532 self.mul_sub_f64x2(a0, b0, c0),
5533 self.mul_sub_f64x2(a1, b1, c1),
5534 )
5535 }
5536 #[inline(always)]
5537 fn floor_f64x4(self, a: f64x4<Self>) -> f64x4<Self> {
5538 let (a0, a1) = self.split_f64x4(a);
5539 self.combine_f64x2(self.floor_f64x2(a0), self.floor_f64x2(a1))
5540 }
5541 #[inline(always)]
5542 fn ceil_f64x4(self, a: f64x4<Self>) -> f64x4<Self> {
5543 let (a0, a1) = self.split_f64x4(a);
5544 self.combine_f64x2(self.ceil_f64x2(a0), self.ceil_f64x2(a1))
5545 }
5546 #[inline(always)]
5547 fn round_ties_even_f64x4(self, a: f64x4<Self>) -> f64x4<Self> {
5548 let (a0, a1) = self.split_f64x4(a);
5549 self.combine_f64x2(
5550 self.round_ties_even_f64x2(a0),
5551 self.round_ties_even_f64x2(a1),
5552 )
5553 }
5554 #[inline(always)]
5555 fn fract_f64x4(self, a: f64x4<Self>) -> f64x4<Self> {
5556 let (a0, a1) = self.split_f64x4(a);
5557 self.combine_f64x2(self.fract_f64x2(a0), self.fract_f64x2(a1))
5558 }
5559 #[inline(always)]
5560 fn trunc_f64x4(self, a: f64x4<Self>) -> f64x4<Self> {
5561 let (a0, a1) = self.split_f64x4(a);
5562 self.combine_f64x2(self.trunc_f64x2(a0), self.trunc_f64x2(a1))
5563 }
5564 #[inline(always)]
5565 fn select_f64x4(self, a: mask64x4<Self>, b: f64x4<Self>, c: f64x4<Self>) -> f64x4<Self> {
5566 let (a0, a1) = self.split_mask64x4(a);
5567 let (b0, b1) = self.split_f64x4(b);
5568 let (c0, c1) = self.split_f64x4(c);
5569 self.combine_f64x2(self.select_f64x2(a0, b0, c0), self.select_f64x2(a1, b1, c1))
5570 }
5571 #[inline(always)]
5572 fn combine_f64x4(self, a: f64x4<Self>, b: f64x4<Self>) -> f64x8<Self> {
5573 f64x8 {
5574 val: crate::support::Aligned512(float64x2x4_t(
5575 a.val.0.0, a.val.0.1, b.val.0.0, b.val.0.1,
5576 )),
5577 simd: self,
5578 }
5579 }
5580 #[inline(always)]
5581 fn split_f64x4(self, a: f64x4<Self>) -> (f64x2<Self>, f64x2<Self>) {
5582 (
5583 f64x2 {
5584 val: crate::support::Aligned128(a.val.0.0),
5585 simd: self,
5586 },
5587 f64x2 {
5588 val: crate::support::Aligned128(a.val.0.1),
5589 simd: self,
5590 },
5591 )
5592 }
5593 #[inline(always)]
5594 fn reinterpret_f32_f64x4(self, a: f64x4<Self>) -> f32x8<Self> {
5595 let (a0, a1) = self.split_f64x4(a);
5596 self.combine_f32x4(
5597 self.reinterpret_f32_f64x2(a0),
5598 self.reinterpret_f32_f64x2(a1),
5599 )
5600 }
5601 #[inline(always)]
5602 fn splat_mask64x4(self, val: i64) -> mask64x4<Self> {
5603 let half = self.splat_mask64x2(val);
5604 self.combine_mask64x2(half, half)
5605 }
5606 #[inline(always)]
5607 fn load_array_mask64x4(self, val: [i64; 4usize]) -> mask64x4<Self> {
5608 mask64x4 {
5609 val: unsafe { core::mem::transmute_copy(&val) },
5610 simd: self,
5611 }
5612 }
5613 #[inline(always)]
5614 fn load_array_ref_mask64x4(self, val: &[i64; 4usize]) -> mask64x4<Self> {
5615 mask64x4 {
5616 val: unsafe { core::mem::transmute_copy(val) },
5617 simd: self,
5618 }
5619 }
5620 #[inline(always)]
5621 fn as_array_mask64x4(self, a: mask64x4<Self>) -> [i64; 4usize] {
5622 unsafe { core::mem::transmute::<int64x2x2_t, [i64; 4usize]>(a.val.0) }
5623 }
5624 #[inline(always)]
5625 fn as_array_ref_mask64x4(self, a: &mask64x4<Self>) -> &[i64; 4usize] {
5626 unsafe { core::mem::transmute::<&int64x2x2_t, &[i64; 4usize]>(&a.val.0) }
5627 }
5628 #[inline(always)]
5629 fn as_array_mut_mask64x4(self, a: &mut mask64x4<Self>) -> &mut [i64; 4usize] {
5630 unsafe { core::mem::transmute::<&mut int64x2x2_t, &mut [i64; 4usize]>(&mut a.val.0) }
5631 }
5632 #[inline(always)]
5633 fn store_array_mask64x4(self, a: mask64x4<Self>, dest: &mut [i64; 4usize]) -> () {
5634 unsafe {
5635 core::ptr::copy_nonoverlapping(
5636 (&raw const a.val.0) as *const i64,
5637 dest.as_mut_ptr(),
5638 4usize,
5639 );
5640 }
5641 }
5642 #[inline(always)]
5643 fn cvt_from_bytes_mask64x4(self, a: u8x32<Self>) -> mask64x4<Self> {
5644 unsafe {
5645 mask64x4 {
5646 val: core::mem::transmute(a.val),
5647 simd: self,
5648 }
5649 }
5650 }
5651 #[inline(always)]
5652 fn cvt_to_bytes_mask64x4(self, a: mask64x4<Self>) -> u8x32<Self> {
5653 unsafe {
5654 u8x32 {
5655 val: core::mem::transmute(a.val),
5656 simd: self,
5657 }
5658 }
5659 }
5660 #[inline(always)]
5661 fn slide_mask64x4<const SHIFT: usize>(
5662 self,
5663 a: mask64x4<Self>,
5664 b: mask64x4<Self>,
5665 ) -> mask64x4<Self> {
5666 if SHIFT >= 4usize {
5667 return b;
5668 }
5669 let result = unsafe {
5670 let a_bytes = self.cvt_to_bytes_mask64x4(a).val.0;
5671 let b_bytes = self.cvt_to_bytes_mask64x4(b).val.0;
5672 let a_blocks = [a_bytes.0, a_bytes.1];
5673 let b_blocks = [b_bytes.0, b_bytes.1];
5674 let shift_bytes = SHIFT * 8usize;
5675 uint8x16x2_t(
5676 {
5677 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
5678 &a_blocks,
5679 &b_blocks,
5680 0,
5681 shift_bytes,
5682 );
5683 dyn_vext_128(lo, hi, shift_bytes % 16)
5684 },
5685 {
5686 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
5687 &a_blocks,
5688 &b_blocks,
5689 1,
5690 shift_bytes,
5691 );
5692 dyn_vext_128(lo, hi, shift_bytes % 16)
5693 },
5694 )
5695 };
5696 self.cvt_from_bytes_mask64x4(u8x32 {
5697 val: crate::support::Aligned256(result),
5698 simd: self,
5699 })
5700 }
5701 #[inline(always)]
5702 fn slide_within_blocks_mask64x4<const SHIFT: usize>(
5703 self,
5704 a: mask64x4<Self>,
5705 b: mask64x4<Self>,
5706 ) -> mask64x4<Self> {
5707 let (a0, a1) = self.split_mask64x4(a);
5708 let (b0, b1) = self.split_mask64x4(b);
5709 self.combine_mask64x2(
5710 self.slide_within_blocks_mask64x2::<SHIFT>(a0, b0),
5711 self.slide_within_blocks_mask64x2::<SHIFT>(a1, b1),
5712 )
5713 }
5714 #[inline(always)]
5715 fn and_mask64x4(self, a: mask64x4<Self>, b: mask64x4<Self>) -> mask64x4<Self> {
5716 let (a0, a1) = self.split_mask64x4(a);
5717 let (b0, b1) = self.split_mask64x4(b);
5718 self.combine_mask64x2(self.and_mask64x2(a0, b0), self.and_mask64x2(a1, b1))
5719 }
5720 #[inline(always)]
5721 fn or_mask64x4(self, a: mask64x4<Self>, b: mask64x4<Self>) -> mask64x4<Self> {
5722 let (a0, a1) = self.split_mask64x4(a);
5723 let (b0, b1) = self.split_mask64x4(b);
5724 self.combine_mask64x2(self.or_mask64x2(a0, b0), self.or_mask64x2(a1, b1))
5725 }
5726 #[inline(always)]
5727 fn xor_mask64x4(self, a: mask64x4<Self>, b: mask64x4<Self>) -> mask64x4<Self> {
5728 let (a0, a1) = self.split_mask64x4(a);
5729 let (b0, b1) = self.split_mask64x4(b);
5730 self.combine_mask64x2(self.xor_mask64x2(a0, b0), self.xor_mask64x2(a1, b1))
5731 }
5732 #[inline(always)]
5733 fn not_mask64x4(self, a: mask64x4<Self>) -> mask64x4<Self> {
5734 let (a0, a1) = self.split_mask64x4(a);
5735 self.combine_mask64x2(self.not_mask64x2(a0), self.not_mask64x2(a1))
5736 }
5737 #[inline(always)]
5738 fn select_mask64x4(
5739 self,
5740 a: mask64x4<Self>,
5741 b: mask64x4<Self>,
5742 c: mask64x4<Self>,
5743 ) -> mask64x4<Self> {
5744 let (a0, a1) = self.split_mask64x4(a);
5745 let (b0, b1) = self.split_mask64x4(b);
5746 let (c0, c1) = self.split_mask64x4(c);
5747 self.combine_mask64x2(
5748 self.select_mask64x2(a0, b0, c0),
5749 self.select_mask64x2(a1, b1, c1),
5750 )
5751 }
5752 #[inline(always)]
5753 fn simd_eq_mask64x4(self, a: mask64x4<Self>, b: mask64x4<Self>) -> mask64x4<Self> {
5754 let (a0, a1) = self.split_mask64x4(a);
5755 let (b0, b1) = self.split_mask64x4(b);
5756 self.combine_mask64x2(self.simd_eq_mask64x2(a0, b0), self.simd_eq_mask64x2(a1, b1))
5757 }
5758 #[inline(always)]
5759 fn any_true_mask64x4(self, a: mask64x4<Self>) -> bool {
5760 let (a0, a1) = self.split_mask64x4(a);
5761 self.any_true_mask64x2(a0) || self.any_true_mask64x2(a1)
5762 }
5763 #[inline(always)]
5764 fn all_true_mask64x4(self, a: mask64x4<Self>) -> bool {
5765 let (a0, a1) = self.split_mask64x4(a);
5766 self.all_true_mask64x2(a0) && self.all_true_mask64x2(a1)
5767 }
5768 #[inline(always)]
5769 fn any_false_mask64x4(self, a: mask64x4<Self>) -> bool {
5770 let (a0, a1) = self.split_mask64x4(a);
5771 self.any_false_mask64x2(a0) || self.any_false_mask64x2(a1)
5772 }
5773 #[inline(always)]
5774 fn all_false_mask64x4(self, a: mask64x4<Self>) -> bool {
5775 let (a0, a1) = self.split_mask64x4(a);
5776 self.all_false_mask64x2(a0) && self.all_false_mask64x2(a1)
5777 }
5778 #[inline(always)]
5779 fn combine_mask64x4(self, a: mask64x4<Self>, b: mask64x4<Self>) -> mask64x8<Self> {
5780 mask64x8 {
5781 val: crate::support::Aligned512(int64x2x4_t(
5782 a.val.0.0, a.val.0.1, b.val.0.0, b.val.0.1,
5783 )),
5784 simd: self,
5785 }
5786 }
5787 #[inline(always)]
5788 fn split_mask64x4(self, a: mask64x4<Self>) -> (mask64x2<Self>, mask64x2<Self>) {
5789 (
5790 mask64x2 {
5791 val: crate::support::Aligned128(a.val.0.0),
5792 simd: self,
5793 },
5794 mask64x2 {
5795 val: crate::support::Aligned128(a.val.0.1),
5796 simd: self,
5797 },
5798 )
5799 }
5800 #[inline(always)]
5801 fn splat_f32x16(self, val: f32) -> f32x16<Self> {
5802 let half = self.splat_f32x8(val);
5803 self.combine_f32x8(half, half)
5804 }
5805 #[inline(always)]
5806 fn load_array_f32x16(self, val: [f32; 16usize]) -> f32x16<Self> {
5807 f32x16 {
5808 val: unsafe { core::mem::transmute_copy(&val) },
5809 simd: self,
5810 }
5811 }
5812 #[inline(always)]
5813 fn load_array_ref_f32x16(self, val: &[f32; 16usize]) -> f32x16<Self> {
5814 f32x16 {
5815 val: unsafe { core::mem::transmute_copy(val) },
5816 simd: self,
5817 }
5818 }
5819 #[inline(always)]
5820 fn as_array_f32x16(self, a: f32x16<Self>) -> [f32; 16usize] {
5821 unsafe { core::mem::transmute::<float32x4x4_t, [f32; 16usize]>(a.val.0) }
5822 }
5823 #[inline(always)]
5824 fn as_array_ref_f32x16(self, a: &f32x16<Self>) -> &[f32; 16usize] {
5825 unsafe { core::mem::transmute::<&float32x4x4_t, &[f32; 16usize]>(&a.val.0) }
5826 }
5827 #[inline(always)]
5828 fn as_array_mut_f32x16(self, a: &mut f32x16<Self>) -> &mut [f32; 16usize] {
5829 unsafe { core::mem::transmute::<&mut float32x4x4_t, &mut [f32; 16usize]>(&mut a.val.0) }
5830 }
5831 #[inline(always)]
5832 fn store_array_f32x16(self, a: f32x16<Self>, dest: &mut [f32; 16usize]) -> () {
5833 unsafe {
5834 core::ptr::copy_nonoverlapping(
5835 (&raw const a.val.0) as *const f32,
5836 dest.as_mut_ptr(),
5837 16usize,
5838 );
5839 }
5840 }
5841 #[inline(always)]
5842 fn cvt_from_bytes_f32x16(self, a: u8x64<Self>) -> f32x16<Self> {
5843 unsafe {
5844 f32x16 {
5845 val: core::mem::transmute(a.val),
5846 simd: self,
5847 }
5848 }
5849 }
5850 #[inline(always)]
5851 fn cvt_to_bytes_f32x16(self, a: f32x16<Self>) -> u8x64<Self> {
5852 unsafe {
5853 u8x64 {
5854 val: core::mem::transmute(a.val),
5855 simd: self,
5856 }
5857 }
5858 }
5859 #[inline(always)]
5860 fn slide_f32x16<const SHIFT: usize>(self, a: f32x16<Self>, b: f32x16<Self>) -> f32x16<Self> {
5861 if SHIFT >= 16usize {
5862 return b;
5863 }
5864 let result = unsafe {
5865 let a_bytes = self.cvt_to_bytes_f32x16(a).val.0;
5866 let b_bytes = self.cvt_to_bytes_f32x16(b).val.0;
5867 let a_blocks = [a_bytes.0, a_bytes.1, a_bytes.2, a_bytes.3];
5868 let b_blocks = [b_bytes.0, b_bytes.1, b_bytes.2, b_bytes.3];
5869 let shift_bytes = SHIFT * 4usize;
5870 uint8x16x4_t(
5871 {
5872 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
5873 &a_blocks,
5874 &b_blocks,
5875 0,
5876 shift_bytes,
5877 );
5878 dyn_vext_128(lo, hi, shift_bytes % 16)
5879 },
5880 {
5881 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
5882 &a_blocks,
5883 &b_blocks,
5884 1,
5885 shift_bytes,
5886 );
5887 dyn_vext_128(lo, hi, shift_bytes % 16)
5888 },
5889 {
5890 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
5891 &a_blocks,
5892 &b_blocks,
5893 2,
5894 shift_bytes,
5895 );
5896 dyn_vext_128(lo, hi, shift_bytes % 16)
5897 },
5898 {
5899 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
5900 &a_blocks,
5901 &b_blocks,
5902 3,
5903 shift_bytes,
5904 );
5905 dyn_vext_128(lo, hi, shift_bytes % 16)
5906 },
5907 )
5908 };
5909 self.cvt_from_bytes_f32x16(u8x64 {
5910 val: crate::support::Aligned512(result),
5911 simd: self,
5912 })
5913 }
5914 #[inline(always)]
5915 fn slide_within_blocks_f32x16<const SHIFT: usize>(
5916 self,
5917 a: f32x16<Self>,
5918 b: f32x16<Self>,
5919 ) -> f32x16<Self> {
5920 let (a0, a1) = self.split_f32x16(a);
5921 let (b0, b1) = self.split_f32x16(b);
5922 self.combine_f32x8(
5923 self.slide_within_blocks_f32x8::<SHIFT>(a0, b0),
5924 self.slide_within_blocks_f32x8::<SHIFT>(a1, b1),
5925 )
5926 }
5927 #[inline(always)]
5928 fn abs_f32x16(self, a: f32x16<Self>) -> f32x16<Self> {
5929 let (a0, a1) = self.split_f32x16(a);
5930 self.combine_f32x8(self.abs_f32x8(a0), self.abs_f32x8(a1))
5931 }
5932 #[inline(always)]
5933 fn neg_f32x16(self, a: f32x16<Self>) -> f32x16<Self> {
5934 let (a0, a1) = self.split_f32x16(a);
5935 self.combine_f32x8(self.neg_f32x8(a0), self.neg_f32x8(a1))
5936 }
5937 #[inline(always)]
5938 fn sqrt_f32x16(self, a: f32x16<Self>) -> f32x16<Self> {
5939 let (a0, a1) = self.split_f32x16(a);
5940 self.combine_f32x8(self.sqrt_f32x8(a0), self.sqrt_f32x8(a1))
5941 }
5942 #[inline(always)]
5943 fn add_f32x16(self, a: f32x16<Self>, b: f32x16<Self>) -> f32x16<Self> {
5944 let (a0, a1) = self.split_f32x16(a);
5945 let (b0, b1) = self.split_f32x16(b);
5946 self.combine_f32x8(self.add_f32x8(a0, b0), self.add_f32x8(a1, b1))
5947 }
5948 #[inline(always)]
5949 fn sub_f32x16(self, a: f32x16<Self>, b: f32x16<Self>) -> f32x16<Self> {
5950 let (a0, a1) = self.split_f32x16(a);
5951 let (b0, b1) = self.split_f32x16(b);
5952 self.combine_f32x8(self.sub_f32x8(a0, b0), self.sub_f32x8(a1, b1))
5953 }
5954 #[inline(always)]
5955 fn mul_f32x16(self, a: f32x16<Self>, b: f32x16<Self>) -> f32x16<Self> {
5956 let (a0, a1) = self.split_f32x16(a);
5957 let (b0, b1) = self.split_f32x16(b);
5958 self.combine_f32x8(self.mul_f32x8(a0, b0), self.mul_f32x8(a1, b1))
5959 }
5960 #[inline(always)]
5961 fn div_f32x16(self, a: f32x16<Self>, b: f32x16<Self>) -> f32x16<Self> {
5962 let (a0, a1) = self.split_f32x16(a);
5963 let (b0, b1) = self.split_f32x16(b);
5964 self.combine_f32x8(self.div_f32x8(a0, b0), self.div_f32x8(a1, b1))
5965 }
5966 #[inline(always)]
5967 fn copysign_f32x16(self, a: f32x16<Self>, b: f32x16<Self>) -> f32x16<Self> {
5968 let (a0, a1) = self.split_f32x16(a);
5969 let (b0, b1) = self.split_f32x16(b);
5970 self.combine_f32x8(self.copysign_f32x8(a0, b0), self.copysign_f32x8(a1, b1))
5971 }
5972 #[inline(always)]
5973 fn simd_eq_f32x16(self, a: f32x16<Self>, b: f32x16<Self>) -> mask32x16<Self> {
5974 let (a0, a1) = self.split_f32x16(a);
5975 let (b0, b1) = self.split_f32x16(b);
5976 self.combine_mask32x8(self.simd_eq_f32x8(a0, b0), self.simd_eq_f32x8(a1, b1))
5977 }
5978 #[inline(always)]
5979 fn simd_lt_f32x16(self, a: f32x16<Self>, b: f32x16<Self>) -> mask32x16<Self> {
5980 let (a0, a1) = self.split_f32x16(a);
5981 let (b0, b1) = self.split_f32x16(b);
5982 self.combine_mask32x8(self.simd_lt_f32x8(a0, b0), self.simd_lt_f32x8(a1, b1))
5983 }
5984 #[inline(always)]
5985 fn simd_le_f32x16(self, a: f32x16<Self>, b: f32x16<Self>) -> mask32x16<Self> {
5986 let (a0, a1) = self.split_f32x16(a);
5987 let (b0, b1) = self.split_f32x16(b);
5988 self.combine_mask32x8(self.simd_le_f32x8(a0, b0), self.simd_le_f32x8(a1, b1))
5989 }
5990 #[inline(always)]
5991 fn simd_ge_f32x16(self, a: f32x16<Self>, b: f32x16<Self>) -> mask32x16<Self> {
5992 let (a0, a1) = self.split_f32x16(a);
5993 let (b0, b1) = self.split_f32x16(b);
5994 self.combine_mask32x8(self.simd_ge_f32x8(a0, b0), self.simd_ge_f32x8(a1, b1))
5995 }
5996 #[inline(always)]
5997 fn simd_gt_f32x16(self, a: f32x16<Self>, b: f32x16<Self>) -> mask32x16<Self> {
5998 let (a0, a1) = self.split_f32x16(a);
5999 let (b0, b1) = self.split_f32x16(b);
6000 self.combine_mask32x8(self.simd_gt_f32x8(a0, b0), self.simd_gt_f32x8(a1, b1))
6001 }
6002 #[inline(always)]
6003 fn zip_low_f32x16(self, a: f32x16<Self>, b: f32x16<Self>) -> f32x16<Self> {
6004 let (a0, _) = self.split_f32x16(a);
6005 let (b0, _) = self.split_f32x16(b);
6006 self.combine_f32x8(self.zip_low_f32x8(a0, b0), self.zip_high_f32x8(a0, b0))
6007 }
6008 #[inline(always)]
6009 fn zip_high_f32x16(self, a: f32x16<Self>, b: f32x16<Self>) -> f32x16<Self> {
6010 let (_, a1) = self.split_f32x16(a);
6011 let (_, b1) = self.split_f32x16(b);
6012 self.combine_f32x8(self.zip_low_f32x8(a1, b1), self.zip_high_f32x8(a1, b1))
6013 }
6014 #[inline(always)]
6015 fn unzip_low_f32x16(self, a: f32x16<Self>, b: f32x16<Self>) -> f32x16<Self> {
6016 let (a0, a1) = self.split_f32x16(a);
6017 let (b0, b1) = self.split_f32x16(b);
6018 self.combine_f32x8(self.unzip_low_f32x8(a0, a1), self.unzip_low_f32x8(b0, b1))
6019 }
6020 #[inline(always)]
6021 fn unzip_high_f32x16(self, a: f32x16<Self>, b: f32x16<Self>) -> f32x16<Self> {
6022 let (a0, a1) = self.split_f32x16(a);
6023 let (b0, b1) = self.split_f32x16(b);
6024 self.combine_f32x8(self.unzip_high_f32x8(a0, a1), self.unzip_high_f32x8(b0, b1))
6025 }
6026 #[inline(always)]
6027 fn interleave_f32x16(self, a: f32x16<Self>, b: f32x16<Self>) -> (f32x16<Self>, f32x16<Self>) {
6028 let (a0, a1) = self.split_f32x16(a);
6029 let (b0, b1) = self.split_f32x16(b);
6030 let lo_lo = self.zip_low_f32x8(a0, b0);
6031 let lo_hi = self.zip_high_f32x8(a0, b0);
6032 let hi_lo = self.zip_low_f32x8(a1, b1);
6033 let hi_hi = self.zip_high_f32x8(a1, b1);
6034 (
6035 self.combine_f32x8(lo_lo, lo_hi),
6036 self.combine_f32x8(hi_lo, hi_hi),
6037 )
6038 }
6039 #[inline(always)]
6040 fn deinterleave_f32x16(self, a: f32x16<Self>, b: f32x16<Self>) -> (f32x16<Self>, f32x16<Self>) {
6041 let (a0, a1) = self.split_f32x16(a);
6042 let (b0, b1) = self.split_f32x16(b);
6043 let lo_even = self.unzip_low_f32x8(a0, a1);
6044 let lo_odd = self.unzip_high_f32x8(a0, a1);
6045 let hi_even = self.unzip_low_f32x8(b0, b1);
6046 let hi_odd = self.unzip_high_f32x8(b0, b1);
6047 (
6048 self.combine_f32x8(lo_even, hi_even),
6049 self.combine_f32x8(lo_odd, hi_odd),
6050 )
6051 }
6052 #[inline(always)]
6053 fn max_f32x16(self, a: f32x16<Self>, b: f32x16<Self>) -> f32x16<Self> {
6054 let (a0, a1) = self.split_f32x16(a);
6055 let (b0, b1) = self.split_f32x16(b);
6056 self.combine_f32x8(self.max_f32x8(a0, b0), self.max_f32x8(a1, b1))
6057 }
6058 #[inline(always)]
6059 fn min_f32x16(self, a: f32x16<Self>, b: f32x16<Self>) -> f32x16<Self> {
6060 let (a0, a1) = self.split_f32x16(a);
6061 let (b0, b1) = self.split_f32x16(b);
6062 self.combine_f32x8(self.min_f32x8(a0, b0), self.min_f32x8(a1, b1))
6063 }
6064 #[inline(always)]
6065 fn max_precise_f32x16(self, a: f32x16<Self>, b: f32x16<Self>) -> f32x16<Self> {
6066 let (a0, a1) = self.split_f32x16(a);
6067 let (b0, b1) = self.split_f32x16(b);
6068 self.combine_f32x8(
6069 self.max_precise_f32x8(a0, b0),
6070 self.max_precise_f32x8(a1, b1),
6071 )
6072 }
6073 #[inline(always)]
6074 fn min_precise_f32x16(self, a: f32x16<Self>, b: f32x16<Self>) -> f32x16<Self> {
6075 let (a0, a1) = self.split_f32x16(a);
6076 let (b0, b1) = self.split_f32x16(b);
6077 self.combine_f32x8(
6078 self.min_precise_f32x8(a0, b0),
6079 self.min_precise_f32x8(a1, b1),
6080 )
6081 }
6082 #[inline(always)]
6083 fn mul_add_f32x16(self, a: f32x16<Self>, b: f32x16<Self>, c: f32x16<Self>) -> f32x16<Self> {
6084 let (a0, a1) = self.split_f32x16(a);
6085 let (b0, b1) = self.split_f32x16(b);
6086 let (c0, c1) = self.split_f32x16(c);
6087 self.combine_f32x8(
6088 self.mul_add_f32x8(a0, b0, c0),
6089 self.mul_add_f32x8(a1, b1, c1),
6090 )
6091 }
6092 #[inline(always)]
6093 fn mul_sub_f32x16(self, a: f32x16<Self>, b: f32x16<Self>, c: f32x16<Self>) -> f32x16<Self> {
6094 let (a0, a1) = self.split_f32x16(a);
6095 let (b0, b1) = self.split_f32x16(b);
6096 let (c0, c1) = self.split_f32x16(c);
6097 self.combine_f32x8(
6098 self.mul_sub_f32x8(a0, b0, c0),
6099 self.mul_sub_f32x8(a1, b1, c1),
6100 )
6101 }
6102 #[inline(always)]
6103 fn floor_f32x16(self, a: f32x16<Self>) -> f32x16<Self> {
6104 let (a0, a1) = self.split_f32x16(a);
6105 self.combine_f32x8(self.floor_f32x8(a0), self.floor_f32x8(a1))
6106 }
6107 #[inline(always)]
6108 fn ceil_f32x16(self, a: f32x16<Self>) -> f32x16<Self> {
6109 let (a0, a1) = self.split_f32x16(a);
6110 self.combine_f32x8(self.ceil_f32x8(a0), self.ceil_f32x8(a1))
6111 }
6112 #[inline(always)]
6113 fn round_ties_even_f32x16(self, a: f32x16<Self>) -> f32x16<Self> {
6114 let (a0, a1) = self.split_f32x16(a);
6115 self.combine_f32x8(
6116 self.round_ties_even_f32x8(a0),
6117 self.round_ties_even_f32x8(a1),
6118 )
6119 }
6120 #[inline(always)]
6121 fn fract_f32x16(self, a: f32x16<Self>) -> f32x16<Self> {
6122 let (a0, a1) = self.split_f32x16(a);
6123 self.combine_f32x8(self.fract_f32x8(a0), self.fract_f32x8(a1))
6124 }
6125 #[inline(always)]
6126 fn trunc_f32x16(self, a: f32x16<Self>) -> f32x16<Self> {
6127 let (a0, a1) = self.split_f32x16(a);
6128 self.combine_f32x8(self.trunc_f32x8(a0), self.trunc_f32x8(a1))
6129 }
6130 #[inline(always)]
6131 fn select_f32x16(self, a: mask32x16<Self>, b: f32x16<Self>, c: f32x16<Self>) -> f32x16<Self> {
6132 let (a0, a1) = self.split_mask32x16(a);
6133 let (b0, b1) = self.split_f32x16(b);
6134 let (c0, c1) = self.split_f32x16(c);
6135 self.combine_f32x8(self.select_f32x8(a0, b0, c0), self.select_f32x8(a1, b1, c1))
6136 }
6137 #[inline(always)]
6138 fn split_f32x16(self, a: f32x16<Self>) -> (f32x8<Self>, f32x8<Self>) {
6139 (
6140 f32x8 {
6141 val: crate::support::Aligned256(float32x4x2_t(a.val.0.0, a.val.0.1)),
6142 simd: self,
6143 },
6144 f32x8 {
6145 val: crate::support::Aligned256(float32x4x2_t(a.val.0.2, a.val.0.3)),
6146 simd: self,
6147 },
6148 )
6149 }
6150 #[inline(always)]
6151 fn reinterpret_f64_f32x16(self, a: f32x16<Self>) -> f64x8<Self> {
6152 let (a0, a1) = self.split_f32x16(a);
6153 self.combine_f64x4(
6154 self.reinterpret_f64_f32x8(a0),
6155 self.reinterpret_f64_f32x8(a1),
6156 )
6157 }
6158 #[inline(always)]
6159 fn reinterpret_i32_f32x16(self, a: f32x16<Self>) -> i32x16<Self> {
6160 let (a0, a1) = self.split_f32x16(a);
6161 self.combine_i32x8(
6162 self.reinterpret_i32_f32x8(a0),
6163 self.reinterpret_i32_f32x8(a1),
6164 )
6165 }
6166 #[inline(always)]
6167 fn load_interleaved_128_f32x16(self, src: &[f32; 16usize]) -> f32x16<Self> {
6168 unsafe { vld4q_f32(src.as_ptr()).simd_into(self) }
6169 }
6170 #[inline(always)]
6171 fn store_interleaved_128_f32x16(self, a: f32x16<Self>, dest: &mut [f32; 16usize]) -> () {
6172 unsafe { vst4q_f32(dest.as_mut_ptr(), a.into()) }
6173 }
6174 #[inline(always)]
6175 fn reinterpret_u8_f32x16(self, a: f32x16<Self>) -> u8x64<Self> {
6176 let (a0, a1) = self.split_f32x16(a);
6177 self.combine_u8x32(self.reinterpret_u8_f32x8(a0), self.reinterpret_u8_f32x8(a1))
6178 }
6179 #[inline(always)]
6180 fn reinterpret_u32_f32x16(self, a: f32x16<Self>) -> u32x16<Self> {
6181 let (a0, a1) = self.split_f32x16(a);
6182 self.combine_u32x8(
6183 self.reinterpret_u32_f32x8(a0),
6184 self.reinterpret_u32_f32x8(a1),
6185 )
6186 }
6187 #[inline(always)]
6188 fn cvt_u32_f32x16(self, a: f32x16<Self>) -> u32x16<Self> {
6189 let (a0, a1) = self.split_f32x16(a);
6190 self.combine_u32x8(self.cvt_u32_f32x8(a0), self.cvt_u32_f32x8(a1))
6191 }
6192 #[inline(always)]
6193 fn cvt_u32_precise_f32x16(self, a: f32x16<Self>) -> u32x16<Self> {
6194 let (a0, a1) = self.split_f32x16(a);
6195 self.combine_u32x8(
6196 self.cvt_u32_precise_f32x8(a0),
6197 self.cvt_u32_precise_f32x8(a1),
6198 )
6199 }
6200 #[inline(always)]
6201 fn cvt_i32_f32x16(self, a: f32x16<Self>) -> i32x16<Self> {
6202 let (a0, a1) = self.split_f32x16(a);
6203 self.combine_i32x8(self.cvt_i32_f32x8(a0), self.cvt_i32_f32x8(a1))
6204 }
6205 #[inline(always)]
6206 fn cvt_i32_precise_f32x16(self, a: f32x16<Self>) -> i32x16<Self> {
6207 let (a0, a1) = self.split_f32x16(a);
6208 self.combine_i32x8(
6209 self.cvt_i32_precise_f32x8(a0),
6210 self.cvt_i32_precise_f32x8(a1),
6211 )
6212 }
6213 #[inline(always)]
6214 fn splat_i8x64(self, val: i8) -> i8x64<Self> {
6215 let half = self.splat_i8x32(val);
6216 self.combine_i8x32(half, half)
6217 }
6218 #[inline(always)]
6219 fn load_array_i8x64(self, val: [i8; 64usize]) -> i8x64<Self> {
6220 i8x64 {
6221 val: unsafe { core::mem::transmute_copy(&val) },
6222 simd: self,
6223 }
6224 }
6225 #[inline(always)]
6226 fn load_array_ref_i8x64(self, val: &[i8; 64usize]) -> i8x64<Self> {
6227 i8x64 {
6228 val: unsafe { core::mem::transmute_copy(val) },
6229 simd: self,
6230 }
6231 }
6232 #[inline(always)]
6233 fn as_array_i8x64(self, a: i8x64<Self>) -> [i8; 64usize] {
6234 unsafe { core::mem::transmute::<int8x16x4_t, [i8; 64usize]>(a.val.0) }
6235 }
6236 #[inline(always)]
6237 fn as_array_ref_i8x64(self, a: &i8x64<Self>) -> &[i8; 64usize] {
6238 unsafe { core::mem::transmute::<&int8x16x4_t, &[i8; 64usize]>(&a.val.0) }
6239 }
6240 #[inline(always)]
6241 fn as_array_mut_i8x64(self, a: &mut i8x64<Self>) -> &mut [i8; 64usize] {
6242 unsafe { core::mem::transmute::<&mut int8x16x4_t, &mut [i8; 64usize]>(&mut a.val.0) }
6243 }
6244 #[inline(always)]
6245 fn store_array_i8x64(self, a: i8x64<Self>, dest: &mut [i8; 64usize]) -> () {
6246 unsafe {
6247 core::ptr::copy_nonoverlapping(
6248 (&raw const a.val.0) as *const i8,
6249 dest.as_mut_ptr(),
6250 64usize,
6251 );
6252 }
6253 }
6254 #[inline(always)]
6255 fn cvt_from_bytes_i8x64(self, a: u8x64<Self>) -> i8x64<Self> {
6256 unsafe {
6257 i8x64 {
6258 val: core::mem::transmute(a.val),
6259 simd: self,
6260 }
6261 }
6262 }
6263 #[inline(always)]
6264 fn cvt_to_bytes_i8x64(self, a: i8x64<Self>) -> u8x64<Self> {
6265 unsafe {
6266 u8x64 {
6267 val: core::mem::transmute(a.val),
6268 simd: self,
6269 }
6270 }
6271 }
6272 #[inline(always)]
6273 fn slide_i8x64<const SHIFT: usize>(self, a: i8x64<Self>, b: i8x64<Self>) -> i8x64<Self> {
6274 if SHIFT >= 64usize {
6275 return b;
6276 }
6277 let result = unsafe {
6278 let a_bytes = self.cvt_to_bytes_i8x64(a).val.0;
6279 let b_bytes = self.cvt_to_bytes_i8x64(b).val.0;
6280 let a_blocks = [a_bytes.0, a_bytes.1, a_bytes.2, a_bytes.3];
6281 let b_blocks = [b_bytes.0, b_bytes.1, b_bytes.2, b_bytes.3];
6282 let shift_bytes = SHIFT;
6283 uint8x16x4_t(
6284 {
6285 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
6286 &a_blocks,
6287 &b_blocks,
6288 0,
6289 shift_bytes,
6290 );
6291 dyn_vext_128(lo, hi, shift_bytes % 16)
6292 },
6293 {
6294 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
6295 &a_blocks,
6296 &b_blocks,
6297 1,
6298 shift_bytes,
6299 );
6300 dyn_vext_128(lo, hi, shift_bytes % 16)
6301 },
6302 {
6303 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
6304 &a_blocks,
6305 &b_blocks,
6306 2,
6307 shift_bytes,
6308 );
6309 dyn_vext_128(lo, hi, shift_bytes % 16)
6310 },
6311 {
6312 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
6313 &a_blocks,
6314 &b_blocks,
6315 3,
6316 shift_bytes,
6317 );
6318 dyn_vext_128(lo, hi, shift_bytes % 16)
6319 },
6320 )
6321 };
6322 self.cvt_from_bytes_i8x64(u8x64 {
6323 val: crate::support::Aligned512(result),
6324 simd: self,
6325 })
6326 }
6327 #[inline(always)]
6328 fn slide_within_blocks_i8x64<const SHIFT: usize>(
6329 self,
6330 a: i8x64<Self>,
6331 b: i8x64<Self>,
6332 ) -> i8x64<Self> {
6333 let (a0, a1) = self.split_i8x64(a);
6334 let (b0, b1) = self.split_i8x64(b);
6335 self.combine_i8x32(
6336 self.slide_within_blocks_i8x32::<SHIFT>(a0, b0),
6337 self.slide_within_blocks_i8x32::<SHIFT>(a1, b1),
6338 )
6339 }
6340 #[inline(always)]
6341 fn add_i8x64(self, a: i8x64<Self>, b: i8x64<Self>) -> i8x64<Self> {
6342 let (a0, a1) = self.split_i8x64(a);
6343 let (b0, b1) = self.split_i8x64(b);
6344 self.combine_i8x32(self.add_i8x32(a0, b0), self.add_i8x32(a1, b1))
6345 }
6346 #[inline(always)]
6347 fn sub_i8x64(self, a: i8x64<Self>, b: i8x64<Self>) -> i8x64<Self> {
6348 let (a0, a1) = self.split_i8x64(a);
6349 let (b0, b1) = self.split_i8x64(b);
6350 self.combine_i8x32(self.sub_i8x32(a0, b0), self.sub_i8x32(a1, b1))
6351 }
6352 #[inline(always)]
6353 fn mul_i8x64(self, a: i8x64<Self>, b: i8x64<Self>) -> i8x64<Self> {
6354 let (a0, a1) = self.split_i8x64(a);
6355 let (b0, b1) = self.split_i8x64(b);
6356 self.combine_i8x32(self.mul_i8x32(a0, b0), self.mul_i8x32(a1, b1))
6357 }
6358 #[inline(always)]
6359 fn and_i8x64(self, a: i8x64<Self>, b: i8x64<Self>) -> i8x64<Self> {
6360 let (a0, a1) = self.split_i8x64(a);
6361 let (b0, b1) = self.split_i8x64(b);
6362 self.combine_i8x32(self.and_i8x32(a0, b0), self.and_i8x32(a1, b1))
6363 }
6364 #[inline(always)]
6365 fn or_i8x64(self, a: i8x64<Self>, b: i8x64<Self>) -> i8x64<Self> {
6366 let (a0, a1) = self.split_i8x64(a);
6367 let (b0, b1) = self.split_i8x64(b);
6368 self.combine_i8x32(self.or_i8x32(a0, b0), self.or_i8x32(a1, b1))
6369 }
6370 #[inline(always)]
6371 fn xor_i8x64(self, a: i8x64<Self>, b: i8x64<Self>) -> i8x64<Self> {
6372 let (a0, a1) = self.split_i8x64(a);
6373 let (b0, b1) = self.split_i8x64(b);
6374 self.combine_i8x32(self.xor_i8x32(a0, b0), self.xor_i8x32(a1, b1))
6375 }
6376 #[inline(always)]
6377 fn not_i8x64(self, a: i8x64<Self>) -> i8x64<Self> {
6378 let (a0, a1) = self.split_i8x64(a);
6379 self.combine_i8x32(self.not_i8x32(a0), self.not_i8x32(a1))
6380 }
6381 #[inline(always)]
6382 fn shl_i8x64(self, a: i8x64<Self>, shift: u32) -> i8x64<Self> {
6383 let (a0, a1) = self.split_i8x64(a);
6384 self.combine_i8x32(self.shl_i8x32(a0, shift), self.shl_i8x32(a1, shift))
6385 }
6386 #[inline(always)]
6387 fn shlv_i8x64(self, a: i8x64<Self>, b: i8x64<Self>) -> i8x64<Self> {
6388 let (a0, a1) = self.split_i8x64(a);
6389 let (b0, b1) = self.split_i8x64(b);
6390 self.combine_i8x32(self.shlv_i8x32(a0, b0), self.shlv_i8x32(a1, b1))
6391 }
6392 #[inline(always)]
6393 fn shr_i8x64(self, a: i8x64<Self>, shift: u32) -> i8x64<Self> {
6394 let (a0, a1) = self.split_i8x64(a);
6395 self.combine_i8x32(self.shr_i8x32(a0, shift), self.shr_i8x32(a1, shift))
6396 }
6397 #[inline(always)]
6398 fn shrv_i8x64(self, a: i8x64<Self>, b: i8x64<Self>) -> i8x64<Self> {
6399 let (a0, a1) = self.split_i8x64(a);
6400 let (b0, b1) = self.split_i8x64(b);
6401 self.combine_i8x32(self.shrv_i8x32(a0, b0), self.shrv_i8x32(a1, b1))
6402 }
6403 #[inline(always)]
6404 fn simd_eq_i8x64(self, a: i8x64<Self>, b: i8x64<Self>) -> mask8x64<Self> {
6405 let (a0, a1) = self.split_i8x64(a);
6406 let (b0, b1) = self.split_i8x64(b);
6407 self.combine_mask8x32(self.simd_eq_i8x32(a0, b0), self.simd_eq_i8x32(a1, b1))
6408 }
6409 #[inline(always)]
6410 fn simd_lt_i8x64(self, a: i8x64<Self>, b: i8x64<Self>) -> mask8x64<Self> {
6411 let (a0, a1) = self.split_i8x64(a);
6412 let (b0, b1) = self.split_i8x64(b);
6413 self.combine_mask8x32(self.simd_lt_i8x32(a0, b0), self.simd_lt_i8x32(a1, b1))
6414 }
6415 #[inline(always)]
6416 fn simd_le_i8x64(self, a: i8x64<Self>, b: i8x64<Self>) -> mask8x64<Self> {
6417 let (a0, a1) = self.split_i8x64(a);
6418 let (b0, b1) = self.split_i8x64(b);
6419 self.combine_mask8x32(self.simd_le_i8x32(a0, b0), self.simd_le_i8x32(a1, b1))
6420 }
6421 #[inline(always)]
6422 fn simd_ge_i8x64(self, a: i8x64<Self>, b: i8x64<Self>) -> mask8x64<Self> {
6423 let (a0, a1) = self.split_i8x64(a);
6424 let (b0, b1) = self.split_i8x64(b);
6425 self.combine_mask8x32(self.simd_ge_i8x32(a0, b0), self.simd_ge_i8x32(a1, b1))
6426 }
6427 #[inline(always)]
6428 fn simd_gt_i8x64(self, a: i8x64<Self>, b: i8x64<Self>) -> mask8x64<Self> {
6429 let (a0, a1) = self.split_i8x64(a);
6430 let (b0, b1) = self.split_i8x64(b);
6431 self.combine_mask8x32(self.simd_gt_i8x32(a0, b0), self.simd_gt_i8x32(a1, b1))
6432 }
6433 #[inline(always)]
6434 fn zip_low_i8x64(self, a: i8x64<Self>, b: i8x64<Self>) -> i8x64<Self> {
6435 let (a0, _) = self.split_i8x64(a);
6436 let (b0, _) = self.split_i8x64(b);
6437 self.combine_i8x32(self.zip_low_i8x32(a0, b0), self.zip_high_i8x32(a0, b0))
6438 }
6439 #[inline(always)]
6440 fn zip_high_i8x64(self, a: i8x64<Self>, b: i8x64<Self>) -> i8x64<Self> {
6441 let (_, a1) = self.split_i8x64(a);
6442 let (_, b1) = self.split_i8x64(b);
6443 self.combine_i8x32(self.zip_low_i8x32(a1, b1), self.zip_high_i8x32(a1, b1))
6444 }
6445 #[inline(always)]
6446 fn unzip_low_i8x64(self, a: i8x64<Self>, b: i8x64<Self>) -> i8x64<Self> {
6447 let (a0, a1) = self.split_i8x64(a);
6448 let (b0, b1) = self.split_i8x64(b);
6449 self.combine_i8x32(self.unzip_low_i8x32(a0, a1), self.unzip_low_i8x32(b0, b1))
6450 }
6451 #[inline(always)]
6452 fn unzip_high_i8x64(self, a: i8x64<Self>, b: i8x64<Self>) -> i8x64<Self> {
6453 let (a0, a1) = self.split_i8x64(a);
6454 let (b0, b1) = self.split_i8x64(b);
6455 self.combine_i8x32(self.unzip_high_i8x32(a0, a1), self.unzip_high_i8x32(b0, b1))
6456 }
6457 #[inline(always)]
6458 fn interleave_i8x64(self, a: i8x64<Self>, b: i8x64<Self>) -> (i8x64<Self>, i8x64<Self>) {
6459 let (a0, a1) = self.split_i8x64(a);
6460 let (b0, b1) = self.split_i8x64(b);
6461 let lo_lo = self.zip_low_i8x32(a0, b0);
6462 let lo_hi = self.zip_high_i8x32(a0, b0);
6463 let hi_lo = self.zip_low_i8x32(a1, b1);
6464 let hi_hi = self.zip_high_i8x32(a1, b1);
6465 (
6466 self.combine_i8x32(lo_lo, lo_hi),
6467 self.combine_i8x32(hi_lo, hi_hi),
6468 )
6469 }
6470 #[inline(always)]
6471 fn deinterleave_i8x64(self, a: i8x64<Self>, b: i8x64<Self>) -> (i8x64<Self>, i8x64<Self>) {
6472 let (a0, a1) = self.split_i8x64(a);
6473 let (b0, b1) = self.split_i8x64(b);
6474 let lo_even = self.unzip_low_i8x32(a0, a1);
6475 let lo_odd = self.unzip_high_i8x32(a0, a1);
6476 let hi_even = self.unzip_low_i8x32(b0, b1);
6477 let hi_odd = self.unzip_high_i8x32(b0, b1);
6478 (
6479 self.combine_i8x32(lo_even, hi_even),
6480 self.combine_i8x32(lo_odd, hi_odd),
6481 )
6482 }
6483 #[inline(always)]
6484 fn select_i8x64(self, a: mask8x64<Self>, b: i8x64<Self>, c: i8x64<Self>) -> i8x64<Self> {
6485 let (a0, a1) = self.split_mask8x64(a);
6486 let (b0, b1) = self.split_i8x64(b);
6487 let (c0, c1) = self.split_i8x64(c);
6488 self.combine_i8x32(self.select_i8x32(a0, b0, c0), self.select_i8x32(a1, b1, c1))
6489 }
6490 #[inline(always)]
6491 fn min_i8x64(self, a: i8x64<Self>, b: i8x64<Self>) -> i8x64<Self> {
6492 let (a0, a1) = self.split_i8x64(a);
6493 let (b0, b1) = self.split_i8x64(b);
6494 self.combine_i8x32(self.min_i8x32(a0, b0), self.min_i8x32(a1, b1))
6495 }
6496 #[inline(always)]
6497 fn max_i8x64(self, a: i8x64<Self>, b: i8x64<Self>) -> i8x64<Self> {
6498 let (a0, a1) = self.split_i8x64(a);
6499 let (b0, b1) = self.split_i8x64(b);
6500 self.combine_i8x32(self.max_i8x32(a0, b0), self.max_i8x32(a1, b1))
6501 }
6502 #[inline(always)]
6503 fn split_i8x64(self, a: i8x64<Self>) -> (i8x32<Self>, i8x32<Self>) {
6504 (
6505 i8x32 {
6506 val: crate::support::Aligned256(int8x16x2_t(a.val.0.0, a.val.0.1)),
6507 simd: self,
6508 },
6509 i8x32 {
6510 val: crate::support::Aligned256(int8x16x2_t(a.val.0.2, a.val.0.3)),
6511 simd: self,
6512 },
6513 )
6514 }
6515 #[inline(always)]
6516 fn neg_i8x64(self, a: i8x64<Self>) -> i8x64<Self> {
6517 let (a0, a1) = self.split_i8x64(a);
6518 self.combine_i8x32(self.neg_i8x32(a0), self.neg_i8x32(a1))
6519 }
6520 #[inline(always)]
6521 fn reinterpret_u8_i8x64(self, a: i8x64<Self>) -> u8x64<Self> {
6522 let (a0, a1) = self.split_i8x64(a);
6523 self.combine_u8x32(self.reinterpret_u8_i8x32(a0), self.reinterpret_u8_i8x32(a1))
6524 }
6525 #[inline(always)]
6526 fn reinterpret_u32_i8x64(self, a: i8x64<Self>) -> u32x16<Self> {
6527 let (a0, a1) = self.split_i8x64(a);
6528 self.combine_u32x8(
6529 self.reinterpret_u32_i8x32(a0),
6530 self.reinterpret_u32_i8x32(a1),
6531 )
6532 }
6533 #[inline(always)]
6534 fn splat_u8x64(self, val: u8) -> u8x64<Self> {
6535 let half = self.splat_u8x32(val);
6536 self.combine_u8x32(half, half)
6537 }
6538 #[inline(always)]
6539 fn load_array_u8x64(self, val: [u8; 64usize]) -> u8x64<Self> {
6540 u8x64 {
6541 val: unsafe { core::mem::transmute_copy(&val) },
6542 simd: self,
6543 }
6544 }
6545 #[inline(always)]
6546 fn load_array_ref_u8x64(self, val: &[u8; 64usize]) -> u8x64<Self> {
6547 u8x64 {
6548 val: unsafe { core::mem::transmute_copy(val) },
6549 simd: self,
6550 }
6551 }
6552 #[inline(always)]
6553 fn as_array_u8x64(self, a: u8x64<Self>) -> [u8; 64usize] {
6554 unsafe { core::mem::transmute::<uint8x16x4_t, [u8; 64usize]>(a.val.0) }
6555 }
6556 #[inline(always)]
6557 fn as_array_ref_u8x64(self, a: &u8x64<Self>) -> &[u8; 64usize] {
6558 unsafe { core::mem::transmute::<&uint8x16x4_t, &[u8; 64usize]>(&a.val.0) }
6559 }
6560 #[inline(always)]
6561 fn as_array_mut_u8x64(self, a: &mut u8x64<Self>) -> &mut [u8; 64usize] {
6562 unsafe { core::mem::transmute::<&mut uint8x16x4_t, &mut [u8; 64usize]>(&mut a.val.0) }
6563 }
6564 #[inline(always)]
6565 fn store_array_u8x64(self, a: u8x64<Self>, dest: &mut [u8; 64usize]) -> () {
6566 unsafe {
6567 core::ptr::copy_nonoverlapping(
6568 (&raw const a.val.0) as *const u8,
6569 dest.as_mut_ptr(),
6570 64usize,
6571 );
6572 }
6573 }
6574 #[inline(always)]
6575 fn cvt_from_bytes_u8x64(self, a: u8x64<Self>) -> u8x64<Self> {
6576 unsafe {
6577 u8x64 {
6578 val: core::mem::transmute(a.val),
6579 simd: self,
6580 }
6581 }
6582 }
6583 #[inline(always)]
6584 fn cvt_to_bytes_u8x64(self, a: u8x64<Self>) -> u8x64<Self> {
6585 unsafe {
6586 u8x64 {
6587 val: core::mem::transmute(a.val),
6588 simd: self,
6589 }
6590 }
6591 }
6592 #[inline(always)]
6593 fn slide_u8x64<const SHIFT: usize>(self, a: u8x64<Self>, b: u8x64<Self>) -> u8x64<Self> {
6594 if SHIFT >= 64usize {
6595 return b;
6596 }
6597 let result = unsafe {
6598 let a_bytes = self.cvt_to_bytes_u8x64(a).val.0;
6599 let b_bytes = self.cvt_to_bytes_u8x64(b).val.0;
6600 let a_blocks = [a_bytes.0, a_bytes.1, a_bytes.2, a_bytes.3];
6601 let b_blocks = [b_bytes.0, b_bytes.1, b_bytes.2, b_bytes.3];
6602 let shift_bytes = SHIFT;
6603 uint8x16x4_t(
6604 {
6605 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
6606 &a_blocks,
6607 &b_blocks,
6608 0,
6609 shift_bytes,
6610 );
6611 dyn_vext_128(lo, hi, shift_bytes % 16)
6612 },
6613 {
6614 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
6615 &a_blocks,
6616 &b_blocks,
6617 1,
6618 shift_bytes,
6619 );
6620 dyn_vext_128(lo, hi, shift_bytes % 16)
6621 },
6622 {
6623 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
6624 &a_blocks,
6625 &b_blocks,
6626 2,
6627 shift_bytes,
6628 );
6629 dyn_vext_128(lo, hi, shift_bytes % 16)
6630 },
6631 {
6632 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
6633 &a_blocks,
6634 &b_blocks,
6635 3,
6636 shift_bytes,
6637 );
6638 dyn_vext_128(lo, hi, shift_bytes % 16)
6639 },
6640 )
6641 };
6642 self.cvt_from_bytes_u8x64(u8x64 {
6643 val: crate::support::Aligned512(result),
6644 simd: self,
6645 })
6646 }
6647 #[inline(always)]
6648 fn slide_within_blocks_u8x64<const SHIFT: usize>(
6649 self,
6650 a: u8x64<Self>,
6651 b: u8x64<Self>,
6652 ) -> u8x64<Self> {
6653 let (a0, a1) = self.split_u8x64(a);
6654 let (b0, b1) = self.split_u8x64(b);
6655 self.combine_u8x32(
6656 self.slide_within_blocks_u8x32::<SHIFT>(a0, b0),
6657 self.slide_within_blocks_u8x32::<SHIFT>(a1, b1),
6658 )
6659 }
6660 #[inline(always)]
6661 fn add_u8x64(self, a: u8x64<Self>, b: u8x64<Self>) -> u8x64<Self> {
6662 let (a0, a1) = self.split_u8x64(a);
6663 let (b0, b1) = self.split_u8x64(b);
6664 self.combine_u8x32(self.add_u8x32(a0, b0), self.add_u8x32(a1, b1))
6665 }
6666 #[inline(always)]
6667 fn sub_u8x64(self, a: u8x64<Self>, b: u8x64<Self>) -> u8x64<Self> {
6668 let (a0, a1) = self.split_u8x64(a);
6669 let (b0, b1) = self.split_u8x64(b);
6670 self.combine_u8x32(self.sub_u8x32(a0, b0), self.sub_u8x32(a1, b1))
6671 }
6672 #[inline(always)]
6673 fn mul_u8x64(self, a: u8x64<Self>, b: u8x64<Self>) -> u8x64<Self> {
6674 let (a0, a1) = self.split_u8x64(a);
6675 let (b0, b1) = self.split_u8x64(b);
6676 self.combine_u8x32(self.mul_u8x32(a0, b0), self.mul_u8x32(a1, b1))
6677 }
6678 #[inline(always)]
6679 fn and_u8x64(self, a: u8x64<Self>, b: u8x64<Self>) -> u8x64<Self> {
6680 let (a0, a1) = self.split_u8x64(a);
6681 let (b0, b1) = self.split_u8x64(b);
6682 self.combine_u8x32(self.and_u8x32(a0, b0), self.and_u8x32(a1, b1))
6683 }
6684 #[inline(always)]
6685 fn or_u8x64(self, a: u8x64<Self>, b: u8x64<Self>) -> u8x64<Self> {
6686 let (a0, a1) = self.split_u8x64(a);
6687 let (b0, b1) = self.split_u8x64(b);
6688 self.combine_u8x32(self.or_u8x32(a0, b0), self.or_u8x32(a1, b1))
6689 }
6690 #[inline(always)]
6691 fn xor_u8x64(self, a: u8x64<Self>, b: u8x64<Self>) -> u8x64<Self> {
6692 let (a0, a1) = self.split_u8x64(a);
6693 let (b0, b1) = self.split_u8x64(b);
6694 self.combine_u8x32(self.xor_u8x32(a0, b0), self.xor_u8x32(a1, b1))
6695 }
6696 #[inline(always)]
6697 fn not_u8x64(self, a: u8x64<Self>) -> u8x64<Self> {
6698 let (a0, a1) = self.split_u8x64(a);
6699 self.combine_u8x32(self.not_u8x32(a0), self.not_u8x32(a1))
6700 }
6701 #[inline(always)]
6702 fn shl_u8x64(self, a: u8x64<Self>, shift: u32) -> u8x64<Self> {
6703 let (a0, a1) = self.split_u8x64(a);
6704 self.combine_u8x32(self.shl_u8x32(a0, shift), self.shl_u8x32(a1, shift))
6705 }
6706 #[inline(always)]
6707 fn shlv_u8x64(self, a: u8x64<Self>, b: u8x64<Self>) -> u8x64<Self> {
6708 let (a0, a1) = self.split_u8x64(a);
6709 let (b0, b1) = self.split_u8x64(b);
6710 self.combine_u8x32(self.shlv_u8x32(a0, b0), self.shlv_u8x32(a1, b1))
6711 }
6712 #[inline(always)]
6713 fn shr_u8x64(self, a: u8x64<Self>, shift: u32) -> u8x64<Self> {
6714 let (a0, a1) = self.split_u8x64(a);
6715 self.combine_u8x32(self.shr_u8x32(a0, shift), self.shr_u8x32(a1, shift))
6716 }
6717 #[inline(always)]
6718 fn shrv_u8x64(self, a: u8x64<Self>, b: u8x64<Self>) -> u8x64<Self> {
6719 let (a0, a1) = self.split_u8x64(a);
6720 let (b0, b1) = self.split_u8x64(b);
6721 self.combine_u8x32(self.shrv_u8x32(a0, b0), self.shrv_u8x32(a1, b1))
6722 }
6723 #[inline(always)]
6724 fn simd_eq_u8x64(self, a: u8x64<Self>, b: u8x64<Self>) -> mask8x64<Self> {
6725 let (a0, a1) = self.split_u8x64(a);
6726 let (b0, b1) = self.split_u8x64(b);
6727 self.combine_mask8x32(self.simd_eq_u8x32(a0, b0), self.simd_eq_u8x32(a1, b1))
6728 }
6729 #[inline(always)]
6730 fn simd_lt_u8x64(self, a: u8x64<Self>, b: u8x64<Self>) -> mask8x64<Self> {
6731 let (a0, a1) = self.split_u8x64(a);
6732 let (b0, b1) = self.split_u8x64(b);
6733 self.combine_mask8x32(self.simd_lt_u8x32(a0, b0), self.simd_lt_u8x32(a1, b1))
6734 }
6735 #[inline(always)]
6736 fn simd_le_u8x64(self, a: u8x64<Self>, b: u8x64<Self>) -> mask8x64<Self> {
6737 let (a0, a1) = self.split_u8x64(a);
6738 let (b0, b1) = self.split_u8x64(b);
6739 self.combine_mask8x32(self.simd_le_u8x32(a0, b0), self.simd_le_u8x32(a1, b1))
6740 }
6741 #[inline(always)]
6742 fn simd_ge_u8x64(self, a: u8x64<Self>, b: u8x64<Self>) -> mask8x64<Self> {
6743 let (a0, a1) = self.split_u8x64(a);
6744 let (b0, b1) = self.split_u8x64(b);
6745 self.combine_mask8x32(self.simd_ge_u8x32(a0, b0), self.simd_ge_u8x32(a1, b1))
6746 }
6747 #[inline(always)]
6748 fn simd_gt_u8x64(self, a: u8x64<Self>, b: u8x64<Self>) -> mask8x64<Self> {
6749 let (a0, a1) = self.split_u8x64(a);
6750 let (b0, b1) = self.split_u8x64(b);
6751 self.combine_mask8x32(self.simd_gt_u8x32(a0, b0), self.simd_gt_u8x32(a1, b1))
6752 }
6753 #[inline(always)]
6754 fn zip_low_u8x64(self, a: u8x64<Self>, b: u8x64<Self>) -> u8x64<Self> {
6755 let (a0, _) = self.split_u8x64(a);
6756 let (b0, _) = self.split_u8x64(b);
6757 self.combine_u8x32(self.zip_low_u8x32(a0, b0), self.zip_high_u8x32(a0, b0))
6758 }
6759 #[inline(always)]
6760 fn zip_high_u8x64(self, a: u8x64<Self>, b: u8x64<Self>) -> u8x64<Self> {
6761 let (_, a1) = self.split_u8x64(a);
6762 let (_, b1) = self.split_u8x64(b);
6763 self.combine_u8x32(self.zip_low_u8x32(a1, b1), self.zip_high_u8x32(a1, b1))
6764 }
6765 #[inline(always)]
6766 fn unzip_low_u8x64(self, a: u8x64<Self>, b: u8x64<Self>) -> u8x64<Self> {
6767 let (a0, a1) = self.split_u8x64(a);
6768 let (b0, b1) = self.split_u8x64(b);
6769 self.combine_u8x32(self.unzip_low_u8x32(a0, a1), self.unzip_low_u8x32(b0, b1))
6770 }
6771 #[inline(always)]
6772 fn unzip_high_u8x64(self, a: u8x64<Self>, b: u8x64<Self>) -> u8x64<Self> {
6773 let (a0, a1) = self.split_u8x64(a);
6774 let (b0, b1) = self.split_u8x64(b);
6775 self.combine_u8x32(self.unzip_high_u8x32(a0, a1), self.unzip_high_u8x32(b0, b1))
6776 }
6777 #[inline(always)]
6778 fn interleave_u8x64(self, a: u8x64<Self>, b: u8x64<Self>) -> (u8x64<Self>, u8x64<Self>) {
6779 let (a0, a1) = self.split_u8x64(a);
6780 let (b0, b1) = self.split_u8x64(b);
6781 let lo_lo = self.zip_low_u8x32(a0, b0);
6782 let lo_hi = self.zip_high_u8x32(a0, b0);
6783 let hi_lo = self.zip_low_u8x32(a1, b1);
6784 let hi_hi = self.zip_high_u8x32(a1, b1);
6785 (
6786 self.combine_u8x32(lo_lo, lo_hi),
6787 self.combine_u8x32(hi_lo, hi_hi),
6788 )
6789 }
6790 #[inline(always)]
6791 fn deinterleave_u8x64(self, a: u8x64<Self>, b: u8x64<Self>) -> (u8x64<Self>, u8x64<Self>) {
6792 let (a0, a1) = self.split_u8x64(a);
6793 let (b0, b1) = self.split_u8x64(b);
6794 let lo_even = self.unzip_low_u8x32(a0, a1);
6795 let lo_odd = self.unzip_high_u8x32(a0, a1);
6796 let hi_even = self.unzip_low_u8x32(b0, b1);
6797 let hi_odd = self.unzip_high_u8x32(b0, b1);
6798 (
6799 self.combine_u8x32(lo_even, hi_even),
6800 self.combine_u8x32(lo_odd, hi_odd),
6801 )
6802 }
6803 #[inline(always)]
6804 fn select_u8x64(self, a: mask8x64<Self>, b: u8x64<Self>, c: u8x64<Self>) -> u8x64<Self> {
6805 let (a0, a1) = self.split_mask8x64(a);
6806 let (b0, b1) = self.split_u8x64(b);
6807 let (c0, c1) = self.split_u8x64(c);
6808 self.combine_u8x32(self.select_u8x32(a0, b0, c0), self.select_u8x32(a1, b1, c1))
6809 }
6810 #[inline(always)]
6811 fn min_u8x64(self, a: u8x64<Self>, b: u8x64<Self>) -> u8x64<Self> {
6812 let (a0, a1) = self.split_u8x64(a);
6813 let (b0, b1) = self.split_u8x64(b);
6814 self.combine_u8x32(self.min_u8x32(a0, b0), self.min_u8x32(a1, b1))
6815 }
6816 #[inline(always)]
6817 fn max_u8x64(self, a: u8x64<Self>, b: u8x64<Self>) -> u8x64<Self> {
6818 let (a0, a1) = self.split_u8x64(a);
6819 let (b0, b1) = self.split_u8x64(b);
6820 self.combine_u8x32(self.max_u8x32(a0, b0), self.max_u8x32(a1, b1))
6821 }
6822 #[inline(always)]
6823 fn split_u8x64(self, a: u8x64<Self>) -> (u8x32<Self>, u8x32<Self>) {
6824 (
6825 u8x32 {
6826 val: crate::support::Aligned256(uint8x16x2_t(a.val.0.0, a.val.0.1)),
6827 simd: self,
6828 },
6829 u8x32 {
6830 val: crate::support::Aligned256(uint8x16x2_t(a.val.0.2, a.val.0.3)),
6831 simd: self,
6832 },
6833 )
6834 }
6835 #[inline(always)]
6836 fn load_interleaved_128_u8x64(self, src: &[u8; 64usize]) -> u8x64<Self> {
6837 unsafe { vld4q_u8(src.as_ptr()).simd_into(self) }
6838 }
6839 #[inline(always)]
6840 fn store_interleaved_128_u8x64(self, a: u8x64<Self>, dest: &mut [u8; 64usize]) -> () {
6841 unsafe { vst4q_u8(dest.as_mut_ptr(), a.into()) }
6842 }
6843 #[inline(always)]
6844 fn reinterpret_u32_u8x64(self, a: u8x64<Self>) -> u32x16<Self> {
6845 let (a0, a1) = self.split_u8x64(a);
6846 self.combine_u32x8(
6847 self.reinterpret_u32_u8x32(a0),
6848 self.reinterpret_u32_u8x32(a1),
6849 )
6850 }
6851 #[inline(always)]
6852 fn splat_mask8x64(self, val: i8) -> mask8x64<Self> {
6853 let half = self.splat_mask8x32(val);
6854 self.combine_mask8x32(half, half)
6855 }
6856 #[inline(always)]
6857 fn load_array_mask8x64(self, val: [i8; 64usize]) -> mask8x64<Self> {
6858 mask8x64 {
6859 val: unsafe { core::mem::transmute_copy(&val) },
6860 simd: self,
6861 }
6862 }
6863 #[inline(always)]
6864 fn load_array_ref_mask8x64(self, val: &[i8; 64usize]) -> mask8x64<Self> {
6865 mask8x64 {
6866 val: unsafe { core::mem::transmute_copy(val) },
6867 simd: self,
6868 }
6869 }
6870 #[inline(always)]
6871 fn as_array_mask8x64(self, a: mask8x64<Self>) -> [i8; 64usize] {
6872 unsafe { core::mem::transmute::<int8x16x4_t, [i8; 64usize]>(a.val.0) }
6873 }
6874 #[inline(always)]
6875 fn as_array_ref_mask8x64(self, a: &mask8x64<Self>) -> &[i8; 64usize] {
6876 unsafe { core::mem::transmute::<&int8x16x4_t, &[i8; 64usize]>(&a.val.0) }
6877 }
6878 #[inline(always)]
6879 fn as_array_mut_mask8x64(self, a: &mut mask8x64<Self>) -> &mut [i8; 64usize] {
6880 unsafe { core::mem::transmute::<&mut int8x16x4_t, &mut [i8; 64usize]>(&mut a.val.0) }
6881 }
6882 #[inline(always)]
6883 fn store_array_mask8x64(self, a: mask8x64<Self>, dest: &mut [i8; 64usize]) -> () {
6884 unsafe {
6885 core::ptr::copy_nonoverlapping(
6886 (&raw const a.val.0) as *const i8,
6887 dest.as_mut_ptr(),
6888 64usize,
6889 );
6890 }
6891 }
6892 #[inline(always)]
6893 fn cvt_from_bytes_mask8x64(self, a: u8x64<Self>) -> mask8x64<Self> {
6894 unsafe {
6895 mask8x64 {
6896 val: core::mem::transmute(a.val),
6897 simd: self,
6898 }
6899 }
6900 }
6901 #[inline(always)]
6902 fn cvt_to_bytes_mask8x64(self, a: mask8x64<Self>) -> u8x64<Self> {
6903 unsafe {
6904 u8x64 {
6905 val: core::mem::transmute(a.val),
6906 simd: self,
6907 }
6908 }
6909 }
6910 #[inline(always)]
6911 fn slide_mask8x64<const SHIFT: usize>(
6912 self,
6913 a: mask8x64<Self>,
6914 b: mask8x64<Self>,
6915 ) -> mask8x64<Self> {
6916 if SHIFT >= 64usize {
6917 return b;
6918 }
6919 let result = unsafe {
6920 let a_bytes = self.cvt_to_bytes_mask8x64(a).val.0;
6921 let b_bytes = self.cvt_to_bytes_mask8x64(b).val.0;
6922 let a_blocks = [a_bytes.0, a_bytes.1, a_bytes.2, a_bytes.3];
6923 let b_blocks = [b_bytes.0, b_bytes.1, b_bytes.2, b_bytes.3];
6924 let shift_bytes = SHIFT;
6925 uint8x16x4_t(
6926 {
6927 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
6928 &a_blocks,
6929 &b_blocks,
6930 0,
6931 shift_bytes,
6932 );
6933 dyn_vext_128(lo, hi, shift_bytes % 16)
6934 },
6935 {
6936 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
6937 &a_blocks,
6938 &b_blocks,
6939 1,
6940 shift_bytes,
6941 );
6942 dyn_vext_128(lo, hi, shift_bytes % 16)
6943 },
6944 {
6945 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
6946 &a_blocks,
6947 &b_blocks,
6948 2,
6949 shift_bytes,
6950 );
6951 dyn_vext_128(lo, hi, shift_bytes % 16)
6952 },
6953 {
6954 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
6955 &a_blocks,
6956 &b_blocks,
6957 3,
6958 shift_bytes,
6959 );
6960 dyn_vext_128(lo, hi, shift_bytes % 16)
6961 },
6962 )
6963 };
6964 self.cvt_from_bytes_mask8x64(u8x64 {
6965 val: crate::support::Aligned512(result),
6966 simd: self,
6967 })
6968 }
6969 #[inline(always)]
6970 fn slide_within_blocks_mask8x64<const SHIFT: usize>(
6971 self,
6972 a: mask8x64<Self>,
6973 b: mask8x64<Self>,
6974 ) -> mask8x64<Self> {
6975 let (a0, a1) = self.split_mask8x64(a);
6976 let (b0, b1) = self.split_mask8x64(b);
6977 self.combine_mask8x32(
6978 self.slide_within_blocks_mask8x32::<SHIFT>(a0, b0),
6979 self.slide_within_blocks_mask8x32::<SHIFT>(a1, b1),
6980 )
6981 }
6982 #[inline(always)]
6983 fn and_mask8x64(self, a: mask8x64<Self>, b: mask8x64<Self>) -> mask8x64<Self> {
6984 let (a0, a1) = self.split_mask8x64(a);
6985 let (b0, b1) = self.split_mask8x64(b);
6986 self.combine_mask8x32(self.and_mask8x32(a0, b0), self.and_mask8x32(a1, b1))
6987 }
6988 #[inline(always)]
6989 fn or_mask8x64(self, a: mask8x64<Self>, b: mask8x64<Self>) -> mask8x64<Self> {
6990 let (a0, a1) = self.split_mask8x64(a);
6991 let (b0, b1) = self.split_mask8x64(b);
6992 self.combine_mask8x32(self.or_mask8x32(a0, b0), self.or_mask8x32(a1, b1))
6993 }
6994 #[inline(always)]
6995 fn xor_mask8x64(self, a: mask8x64<Self>, b: mask8x64<Self>) -> mask8x64<Self> {
6996 let (a0, a1) = self.split_mask8x64(a);
6997 let (b0, b1) = self.split_mask8x64(b);
6998 self.combine_mask8x32(self.xor_mask8x32(a0, b0), self.xor_mask8x32(a1, b1))
6999 }
7000 #[inline(always)]
7001 fn not_mask8x64(self, a: mask8x64<Self>) -> mask8x64<Self> {
7002 let (a0, a1) = self.split_mask8x64(a);
7003 self.combine_mask8x32(self.not_mask8x32(a0), self.not_mask8x32(a1))
7004 }
7005 #[inline(always)]
7006 fn select_mask8x64(
7007 self,
7008 a: mask8x64<Self>,
7009 b: mask8x64<Self>,
7010 c: mask8x64<Self>,
7011 ) -> mask8x64<Self> {
7012 let (a0, a1) = self.split_mask8x64(a);
7013 let (b0, b1) = self.split_mask8x64(b);
7014 let (c0, c1) = self.split_mask8x64(c);
7015 self.combine_mask8x32(
7016 self.select_mask8x32(a0, b0, c0),
7017 self.select_mask8x32(a1, b1, c1),
7018 )
7019 }
7020 #[inline(always)]
7021 fn simd_eq_mask8x64(self, a: mask8x64<Self>, b: mask8x64<Self>) -> mask8x64<Self> {
7022 let (a0, a1) = self.split_mask8x64(a);
7023 let (b0, b1) = self.split_mask8x64(b);
7024 self.combine_mask8x32(self.simd_eq_mask8x32(a0, b0), self.simd_eq_mask8x32(a1, b1))
7025 }
7026 #[inline(always)]
7027 fn any_true_mask8x64(self, a: mask8x64<Self>) -> bool {
7028 let (a0, a1) = self.split_mask8x64(a);
7029 self.any_true_mask8x32(a0) || self.any_true_mask8x32(a1)
7030 }
7031 #[inline(always)]
7032 fn all_true_mask8x64(self, a: mask8x64<Self>) -> bool {
7033 let (a0, a1) = self.split_mask8x64(a);
7034 self.all_true_mask8x32(a0) && self.all_true_mask8x32(a1)
7035 }
7036 #[inline(always)]
7037 fn any_false_mask8x64(self, a: mask8x64<Self>) -> bool {
7038 let (a0, a1) = self.split_mask8x64(a);
7039 self.any_false_mask8x32(a0) || self.any_false_mask8x32(a1)
7040 }
7041 #[inline(always)]
7042 fn all_false_mask8x64(self, a: mask8x64<Self>) -> bool {
7043 let (a0, a1) = self.split_mask8x64(a);
7044 self.all_false_mask8x32(a0) && self.all_false_mask8x32(a1)
7045 }
7046 #[inline(always)]
7047 fn split_mask8x64(self, a: mask8x64<Self>) -> (mask8x32<Self>, mask8x32<Self>) {
7048 (
7049 mask8x32 {
7050 val: crate::support::Aligned256(int8x16x2_t(a.val.0.0, a.val.0.1)),
7051 simd: self,
7052 },
7053 mask8x32 {
7054 val: crate::support::Aligned256(int8x16x2_t(a.val.0.2, a.val.0.3)),
7055 simd: self,
7056 },
7057 )
7058 }
7059 #[inline(always)]
7060 fn splat_i16x32(self, val: i16) -> i16x32<Self> {
7061 let half = self.splat_i16x16(val);
7062 self.combine_i16x16(half, half)
7063 }
7064 #[inline(always)]
7065 fn load_array_i16x32(self, val: [i16; 32usize]) -> i16x32<Self> {
7066 i16x32 {
7067 val: unsafe { core::mem::transmute_copy(&val) },
7068 simd: self,
7069 }
7070 }
7071 #[inline(always)]
7072 fn load_array_ref_i16x32(self, val: &[i16; 32usize]) -> i16x32<Self> {
7073 i16x32 {
7074 val: unsafe { core::mem::transmute_copy(val) },
7075 simd: self,
7076 }
7077 }
7078 #[inline(always)]
7079 fn as_array_i16x32(self, a: i16x32<Self>) -> [i16; 32usize] {
7080 unsafe { core::mem::transmute::<int16x8x4_t, [i16; 32usize]>(a.val.0) }
7081 }
7082 #[inline(always)]
7083 fn as_array_ref_i16x32(self, a: &i16x32<Self>) -> &[i16; 32usize] {
7084 unsafe { core::mem::transmute::<&int16x8x4_t, &[i16; 32usize]>(&a.val.0) }
7085 }
7086 #[inline(always)]
7087 fn as_array_mut_i16x32(self, a: &mut i16x32<Self>) -> &mut [i16; 32usize] {
7088 unsafe { core::mem::transmute::<&mut int16x8x4_t, &mut [i16; 32usize]>(&mut a.val.0) }
7089 }
7090 #[inline(always)]
7091 fn store_array_i16x32(self, a: i16x32<Self>, dest: &mut [i16; 32usize]) -> () {
7092 unsafe {
7093 core::ptr::copy_nonoverlapping(
7094 (&raw const a.val.0) as *const i16,
7095 dest.as_mut_ptr(),
7096 32usize,
7097 );
7098 }
7099 }
7100 #[inline(always)]
7101 fn cvt_from_bytes_i16x32(self, a: u8x64<Self>) -> i16x32<Self> {
7102 unsafe {
7103 i16x32 {
7104 val: core::mem::transmute(a.val),
7105 simd: self,
7106 }
7107 }
7108 }
7109 #[inline(always)]
7110 fn cvt_to_bytes_i16x32(self, a: i16x32<Self>) -> u8x64<Self> {
7111 unsafe {
7112 u8x64 {
7113 val: core::mem::transmute(a.val),
7114 simd: self,
7115 }
7116 }
7117 }
7118 #[inline(always)]
7119 fn slide_i16x32<const SHIFT: usize>(self, a: i16x32<Self>, b: i16x32<Self>) -> i16x32<Self> {
7120 if SHIFT >= 32usize {
7121 return b;
7122 }
7123 let result = unsafe {
7124 let a_bytes = self.cvt_to_bytes_i16x32(a).val.0;
7125 let b_bytes = self.cvt_to_bytes_i16x32(b).val.0;
7126 let a_blocks = [a_bytes.0, a_bytes.1, a_bytes.2, a_bytes.3];
7127 let b_blocks = [b_bytes.0, b_bytes.1, b_bytes.2, b_bytes.3];
7128 let shift_bytes = SHIFT * 2usize;
7129 uint8x16x4_t(
7130 {
7131 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
7132 &a_blocks,
7133 &b_blocks,
7134 0,
7135 shift_bytes,
7136 );
7137 dyn_vext_128(lo, hi, shift_bytes % 16)
7138 },
7139 {
7140 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
7141 &a_blocks,
7142 &b_blocks,
7143 1,
7144 shift_bytes,
7145 );
7146 dyn_vext_128(lo, hi, shift_bytes % 16)
7147 },
7148 {
7149 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
7150 &a_blocks,
7151 &b_blocks,
7152 2,
7153 shift_bytes,
7154 );
7155 dyn_vext_128(lo, hi, shift_bytes % 16)
7156 },
7157 {
7158 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
7159 &a_blocks,
7160 &b_blocks,
7161 3,
7162 shift_bytes,
7163 );
7164 dyn_vext_128(lo, hi, shift_bytes % 16)
7165 },
7166 )
7167 };
7168 self.cvt_from_bytes_i16x32(u8x64 {
7169 val: crate::support::Aligned512(result),
7170 simd: self,
7171 })
7172 }
7173 #[inline(always)]
7174 fn slide_within_blocks_i16x32<const SHIFT: usize>(
7175 self,
7176 a: i16x32<Self>,
7177 b: i16x32<Self>,
7178 ) -> i16x32<Self> {
7179 let (a0, a1) = self.split_i16x32(a);
7180 let (b0, b1) = self.split_i16x32(b);
7181 self.combine_i16x16(
7182 self.slide_within_blocks_i16x16::<SHIFT>(a0, b0),
7183 self.slide_within_blocks_i16x16::<SHIFT>(a1, b1),
7184 )
7185 }
7186 #[inline(always)]
7187 fn add_i16x32(self, a: i16x32<Self>, b: i16x32<Self>) -> i16x32<Self> {
7188 let (a0, a1) = self.split_i16x32(a);
7189 let (b0, b1) = self.split_i16x32(b);
7190 self.combine_i16x16(self.add_i16x16(a0, b0), self.add_i16x16(a1, b1))
7191 }
7192 #[inline(always)]
7193 fn sub_i16x32(self, a: i16x32<Self>, b: i16x32<Self>) -> i16x32<Self> {
7194 let (a0, a1) = self.split_i16x32(a);
7195 let (b0, b1) = self.split_i16x32(b);
7196 self.combine_i16x16(self.sub_i16x16(a0, b0), self.sub_i16x16(a1, b1))
7197 }
7198 #[inline(always)]
7199 fn mul_i16x32(self, a: i16x32<Self>, b: i16x32<Self>) -> i16x32<Self> {
7200 let (a0, a1) = self.split_i16x32(a);
7201 let (b0, b1) = self.split_i16x32(b);
7202 self.combine_i16x16(self.mul_i16x16(a0, b0), self.mul_i16x16(a1, b1))
7203 }
7204 #[inline(always)]
7205 fn and_i16x32(self, a: i16x32<Self>, b: i16x32<Self>) -> i16x32<Self> {
7206 let (a0, a1) = self.split_i16x32(a);
7207 let (b0, b1) = self.split_i16x32(b);
7208 self.combine_i16x16(self.and_i16x16(a0, b0), self.and_i16x16(a1, b1))
7209 }
7210 #[inline(always)]
7211 fn or_i16x32(self, a: i16x32<Self>, b: i16x32<Self>) -> i16x32<Self> {
7212 let (a0, a1) = self.split_i16x32(a);
7213 let (b0, b1) = self.split_i16x32(b);
7214 self.combine_i16x16(self.or_i16x16(a0, b0), self.or_i16x16(a1, b1))
7215 }
7216 #[inline(always)]
7217 fn xor_i16x32(self, a: i16x32<Self>, b: i16x32<Self>) -> i16x32<Self> {
7218 let (a0, a1) = self.split_i16x32(a);
7219 let (b0, b1) = self.split_i16x32(b);
7220 self.combine_i16x16(self.xor_i16x16(a0, b0), self.xor_i16x16(a1, b1))
7221 }
7222 #[inline(always)]
7223 fn not_i16x32(self, a: i16x32<Self>) -> i16x32<Self> {
7224 let (a0, a1) = self.split_i16x32(a);
7225 self.combine_i16x16(self.not_i16x16(a0), self.not_i16x16(a1))
7226 }
7227 #[inline(always)]
7228 fn shl_i16x32(self, a: i16x32<Self>, shift: u32) -> i16x32<Self> {
7229 let (a0, a1) = self.split_i16x32(a);
7230 self.combine_i16x16(self.shl_i16x16(a0, shift), self.shl_i16x16(a1, shift))
7231 }
7232 #[inline(always)]
7233 fn shlv_i16x32(self, a: i16x32<Self>, b: i16x32<Self>) -> i16x32<Self> {
7234 let (a0, a1) = self.split_i16x32(a);
7235 let (b0, b1) = self.split_i16x32(b);
7236 self.combine_i16x16(self.shlv_i16x16(a0, b0), self.shlv_i16x16(a1, b1))
7237 }
7238 #[inline(always)]
7239 fn shr_i16x32(self, a: i16x32<Self>, shift: u32) -> i16x32<Self> {
7240 let (a0, a1) = self.split_i16x32(a);
7241 self.combine_i16x16(self.shr_i16x16(a0, shift), self.shr_i16x16(a1, shift))
7242 }
7243 #[inline(always)]
7244 fn shrv_i16x32(self, a: i16x32<Self>, b: i16x32<Self>) -> i16x32<Self> {
7245 let (a0, a1) = self.split_i16x32(a);
7246 let (b0, b1) = self.split_i16x32(b);
7247 self.combine_i16x16(self.shrv_i16x16(a0, b0), self.shrv_i16x16(a1, b1))
7248 }
7249 #[inline(always)]
7250 fn simd_eq_i16x32(self, a: i16x32<Self>, b: i16x32<Self>) -> mask16x32<Self> {
7251 let (a0, a1) = self.split_i16x32(a);
7252 let (b0, b1) = self.split_i16x32(b);
7253 self.combine_mask16x16(self.simd_eq_i16x16(a0, b0), self.simd_eq_i16x16(a1, b1))
7254 }
7255 #[inline(always)]
7256 fn simd_lt_i16x32(self, a: i16x32<Self>, b: i16x32<Self>) -> mask16x32<Self> {
7257 let (a0, a1) = self.split_i16x32(a);
7258 let (b0, b1) = self.split_i16x32(b);
7259 self.combine_mask16x16(self.simd_lt_i16x16(a0, b0), self.simd_lt_i16x16(a1, b1))
7260 }
7261 #[inline(always)]
7262 fn simd_le_i16x32(self, a: i16x32<Self>, b: i16x32<Self>) -> mask16x32<Self> {
7263 let (a0, a1) = self.split_i16x32(a);
7264 let (b0, b1) = self.split_i16x32(b);
7265 self.combine_mask16x16(self.simd_le_i16x16(a0, b0), self.simd_le_i16x16(a1, b1))
7266 }
7267 #[inline(always)]
7268 fn simd_ge_i16x32(self, a: i16x32<Self>, b: i16x32<Self>) -> mask16x32<Self> {
7269 let (a0, a1) = self.split_i16x32(a);
7270 let (b0, b1) = self.split_i16x32(b);
7271 self.combine_mask16x16(self.simd_ge_i16x16(a0, b0), self.simd_ge_i16x16(a1, b1))
7272 }
7273 #[inline(always)]
7274 fn simd_gt_i16x32(self, a: i16x32<Self>, b: i16x32<Self>) -> mask16x32<Self> {
7275 let (a0, a1) = self.split_i16x32(a);
7276 let (b0, b1) = self.split_i16x32(b);
7277 self.combine_mask16x16(self.simd_gt_i16x16(a0, b0), self.simd_gt_i16x16(a1, b1))
7278 }
7279 #[inline(always)]
7280 fn zip_low_i16x32(self, a: i16x32<Self>, b: i16x32<Self>) -> i16x32<Self> {
7281 let (a0, _) = self.split_i16x32(a);
7282 let (b0, _) = self.split_i16x32(b);
7283 self.combine_i16x16(self.zip_low_i16x16(a0, b0), self.zip_high_i16x16(a0, b0))
7284 }
7285 #[inline(always)]
7286 fn zip_high_i16x32(self, a: i16x32<Self>, b: i16x32<Self>) -> i16x32<Self> {
7287 let (_, a1) = self.split_i16x32(a);
7288 let (_, b1) = self.split_i16x32(b);
7289 self.combine_i16x16(self.zip_low_i16x16(a1, b1), self.zip_high_i16x16(a1, b1))
7290 }
7291 #[inline(always)]
7292 fn unzip_low_i16x32(self, a: i16x32<Self>, b: i16x32<Self>) -> i16x32<Self> {
7293 let (a0, a1) = self.split_i16x32(a);
7294 let (b0, b1) = self.split_i16x32(b);
7295 self.combine_i16x16(self.unzip_low_i16x16(a0, a1), self.unzip_low_i16x16(b0, b1))
7296 }
7297 #[inline(always)]
7298 fn unzip_high_i16x32(self, a: i16x32<Self>, b: i16x32<Self>) -> i16x32<Self> {
7299 let (a0, a1) = self.split_i16x32(a);
7300 let (b0, b1) = self.split_i16x32(b);
7301 self.combine_i16x16(
7302 self.unzip_high_i16x16(a0, a1),
7303 self.unzip_high_i16x16(b0, b1),
7304 )
7305 }
7306 #[inline(always)]
7307 fn interleave_i16x32(self, a: i16x32<Self>, b: i16x32<Self>) -> (i16x32<Self>, i16x32<Self>) {
7308 let (a0, a1) = self.split_i16x32(a);
7309 let (b0, b1) = self.split_i16x32(b);
7310 let lo_lo = self.zip_low_i16x16(a0, b0);
7311 let lo_hi = self.zip_high_i16x16(a0, b0);
7312 let hi_lo = self.zip_low_i16x16(a1, b1);
7313 let hi_hi = self.zip_high_i16x16(a1, b1);
7314 (
7315 self.combine_i16x16(lo_lo, lo_hi),
7316 self.combine_i16x16(hi_lo, hi_hi),
7317 )
7318 }
7319 #[inline(always)]
7320 fn deinterleave_i16x32(self, a: i16x32<Self>, b: i16x32<Self>) -> (i16x32<Self>, i16x32<Self>) {
7321 let (a0, a1) = self.split_i16x32(a);
7322 let (b0, b1) = self.split_i16x32(b);
7323 let lo_even = self.unzip_low_i16x16(a0, a1);
7324 let lo_odd = self.unzip_high_i16x16(a0, a1);
7325 let hi_even = self.unzip_low_i16x16(b0, b1);
7326 let hi_odd = self.unzip_high_i16x16(b0, b1);
7327 (
7328 self.combine_i16x16(lo_even, hi_even),
7329 self.combine_i16x16(lo_odd, hi_odd),
7330 )
7331 }
7332 #[inline(always)]
7333 fn select_i16x32(self, a: mask16x32<Self>, b: i16x32<Self>, c: i16x32<Self>) -> i16x32<Self> {
7334 let (a0, a1) = self.split_mask16x32(a);
7335 let (b0, b1) = self.split_i16x32(b);
7336 let (c0, c1) = self.split_i16x32(c);
7337 self.combine_i16x16(
7338 self.select_i16x16(a0, b0, c0),
7339 self.select_i16x16(a1, b1, c1),
7340 )
7341 }
7342 #[inline(always)]
7343 fn min_i16x32(self, a: i16x32<Self>, b: i16x32<Self>) -> i16x32<Self> {
7344 let (a0, a1) = self.split_i16x32(a);
7345 let (b0, b1) = self.split_i16x32(b);
7346 self.combine_i16x16(self.min_i16x16(a0, b0), self.min_i16x16(a1, b1))
7347 }
7348 #[inline(always)]
7349 fn max_i16x32(self, a: i16x32<Self>, b: i16x32<Self>) -> i16x32<Self> {
7350 let (a0, a1) = self.split_i16x32(a);
7351 let (b0, b1) = self.split_i16x32(b);
7352 self.combine_i16x16(self.max_i16x16(a0, b0), self.max_i16x16(a1, b1))
7353 }
7354 #[inline(always)]
7355 fn split_i16x32(self, a: i16x32<Self>) -> (i16x16<Self>, i16x16<Self>) {
7356 (
7357 i16x16 {
7358 val: crate::support::Aligned256(int16x8x2_t(a.val.0.0, a.val.0.1)),
7359 simd: self,
7360 },
7361 i16x16 {
7362 val: crate::support::Aligned256(int16x8x2_t(a.val.0.2, a.val.0.3)),
7363 simd: self,
7364 },
7365 )
7366 }
7367 #[inline(always)]
7368 fn neg_i16x32(self, a: i16x32<Self>) -> i16x32<Self> {
7369 let (a0, a1) = self.split_i16x32(a);
7370 self.combine_i16x16(self.neg_i16x16(a0), self.neg_i16x16(a1))
7371 }
7372 #[inline(always)]
7373 fn reinterpret_u8_i16x32(self, a: i16x32<Self>) -> u8x64<Self> {
7374 let (a0, a1) = self.split_i16x32(a);
7375 self.combine_u8x32(
7376 self.reinterpret_u8_i16x16(a0),
7377 self.reinterpret_u8_i16x16(a1),
7378 )
7379 }
7380 #[inline(always)]
7381 fn reinterpret_u32_i16x32(self, a: i16x32<Self>) -> u32x16<Self> {
7382 let (a0, a1) = self.split_i16x32(a);
7383 self.combine_u32x8(
7384 self.reinterpret_u32_i16x16(a0),
7385 self.reinterpret_u32_i16x16(a1),
7386 )
7387 }
7388 #[inline(always)]
7389 fn splat_u16x32(self, val: u16) -> u16x32<Self> {
7390 let half = self.splat_u16x16(val);
7391 self.combine_u16x16(half, half)
7392 }
7393 #[inline(always)]
7394 fn load_array_u16x32(self, val: [u16; 32usize]) -> u16x32<Self> {
7395 u16x32 {
7396 val: unsafe { core::mem::transmute_copy(&val) },
7397 simd: self,
7398 }
7399 }
7400 #[inline(always)]
7401 fn load_array_ref_u16x32(self, val: &[u16; 32usize]) -> u16x32<Self> {
7402 u16x32 {
7403 val: unsafe { core::mem::transmute_copy(val) },
7404 simd: self,
7405 }
7406 }
7407 #[inline(always)]
7408 fn as_array_u16x32(self, a: u16x32<Self>) -> [u16; 32usize] {
7409 unsafe { core::mem::transmute::<uint16x8x4_t, [u16; 32usize]>(a.val.0) }
7410 }
7411 #[inline(always)]
7412 fn as_array_ref_u16x32(self, a: &u16x32<Self>) -> &[u16; 32usize] {
7413 unsafe { core::mem::transmute::<&uint16x8x4_t, &[u16; 32usize]>(&a.val.0) }
7414 }
7415 #[inline(always)]
7416 fn as_array_mut_u16x32(self, a: &mut u16x32<Self>) -> &mut [u16; 32usize] {
7417 unsafe { core::mem::transmute::<&mut uint16x8x4_t, &mut [u16; 32usize]>(&mut a.val.0) }
7418 }
7419 #[inline(always)]
7420 fn store_array_u16x32(self, a: u16x32<Self>, dest: &mut [u16; 32usize]) -> () {
7421 unsafe {
7422 core::ptr::copy_nonoverlapping(
7423 (&raw const a.val.0) as *const u16,
7424 dest.as_mut_ptr(),
7425 32usize,
7426 );
7427 }
7428 }
7429 #[inline(always)]
7430 fn cvt_from_bytes_u16x32(self, a: u8x64<Self>) -> u16x32<Self> {
7431 unsafe {
7432 u16x32 {
7433 val: core::mem::transmute(a.val),
7434 simd: self,
7435 }
7436 }
7437 }
7438 #[inline(always)]
7439 fn cvt_to_bytes_u16x32(self, a: u16x32<Self>) -> u8x64<Self> {
7440 unsafe {
7441 u8x64 {
7442 val: core::mem::transmute(a.val),
7443 simd: self,
7444 }
7445 }
7446 }
7447 #[inline(always)]
7448 fn slide_u16x32<const SHIFT: usize>(self, a: u16x32<Self>, b: u16x32<Self>) -> u16x32<Self> {
7449 if SHIFT >= 32usize {
7450 return b;
7451 }
7452 let result = unsafe {
7453 let a_bytes = self.cvt_to_bytes_u16x32(a).val.0;
7454 let b_bytes = self.cvt_to_bytes_u16x32(b).val.0;
7455 let a_blocks = [a_bytes.0, a_bytes.1, a_bytes.2, a_bytes.3];
7456 let b_blocks = [b_bytes.0, b_bytes.1, b_bytes.2, b_bytes.3];
7457 let shift_bytes = SHIFT * 2usize;
7458 uint8x16x4_t(
7459 {
7460 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
7461 &a_blocks,
7462 &b_blocks,
7463 0,
7464 shift_bytes,
7465 );
7466 dyn_vext_128(lo, hi, shift_bytes % 16)
7467 },
7468 {
7469 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
7470 &a_blocks,
7471 &b_blocks,
7472 1,
7473 shift_bytes,
7474 );
7475 dyn_vext_128(lo, hi, shift_bytes % 16)
7476 },
7477 {
7478 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
7479 &a_blocks,
7480 &b_blocks,
7481 2,
7482 shift_bytes,
7483 );
7484 dyn_vext_128(lo, hi, shift_bytes % 16)
7485 },
7486 {
7487 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
7488 &a_blocks,
7489 &b_blocks,
7490 3,
7491 shift_bytes,
7492 );
7493 dyn_vext_128(lo, hi, shift_bytes % 16)
7494 },
7495 )
7496 };
7497 self.cvt_from_bytes_u16x32(u8x64 {
7498 val: crate::support::Aligned512(result),
7499 simd: self,
7500 })
7501 }
7502 #[inline(always)]
7503 fn slide_within_blocks_u16x32<const SHIFT: usize>(
7504 self,
7505 a: u16x32<Self>,
7506 b: u16x32<Self>,
7507 ) -> u16x32<Self> {
7508 let (a0, a1) = self.split_u16x32(a);
7509 let (b0, b1) = self.split_u16x32(b);
7510 self.combine_u16x16(
7511 self.slide_within_blocks_u16x16::<SHIFT>(a0, b0),
7512 self.slide_within_blocks_u16x16::<SHIFT>(a1, b1),
7513 )
7514 }
7515 #[inline(always)]
7516 fn add_u16x32(self, a: u16x32<Self>, b: u16x32<Self>) -> u16x32<Self> {
7517 let (a0, a1) = self.split_u16x32(a);
7518 let (b0, b1) = self.split_u16x32(b);
7519 self.combine_u16x16(self.add_u16x16(a0, b0), self.add_u16x16(a1, b1))
7520 }
7521 #[inline(always)]
7522 fn sub_u16x32(self, a: u16x32<Self>, b: u16x32<Self>) -> u16x32<Self> {
7523 let (a0, a1) = self.split_u16x32(a);
7524 let (b0, b1) = self.split_u16x32(b);
7525 self.combine_u16x16(self.sub_u16x16(a0, b0), self.sub_u16x16(a1, b1))
7526 }
7527 #[inline(always)]
7528 fn mul_u16x32(self, a: u16x32<Self>, b: u16x32<Self>) -> u16x32<Self> {
7529 let (a0, a1) = self.split_u16x32(a);
7530 let (b0, b1) = self.split_u16x32(b);
7531 self.combine_u16x16(self.mul_u16x16(a0, b0), self.mul_u16x16(a1, b1))
7532 }
7533 #[inline(always)]
7534 fn and_u16x32(self, a: u16x32<Self>, b: u16x32<Self>) -> u16x32<Self> {
7535 let (a0, a1) = self.split_u16x32(a);
7536 let (b0, b1) = self.split_u16x32(b);
7537 self.combine_u16x16(self.and_u16x16(a0, b0), self.and_u16x16(a1, b1))
7538 }
7539 #[inline(always)]
7540 fn or_u16x32(self, a: u16x32<Self>, b: u16x32<Self>) -> u16x32<Self> {
7541 let (a0, a1) = self.split_u16x32(a);
7542 let (b0, b1) = self.split_u16x32(b);
7543 self.combine_u16x16(self.or_u16x16(a0, b0), self.or_u16x16(a1, b1))
7544 }
7545 #[inline(always)]
7546 fn xor_u16x32(self, a: u16x32<Self>, b: u16x32<Self>) -> u16x32<Self> {
7547 let (a0, a1) = self.split_u16x32(a);
7548 let (b0, b1) = self.split_u16x32(b);
7549 self.combine_u16x16(self.xor_u16x16(a0, b0), self.xor_u16x16(a1, b1))
7550 }
7551 #[inline(always)]
7552 fn not_u16x32(self, a: u16x32<Self>) -> u16x32<Self> {
7553 let (a0, a1) = self.split_u16x32(a);
7554 self.combine_u16x16(self.not_u16x16(a0), self.not_u16x16(a1))
7555 }
7556 #[inline(always)]
7557 fn shl_u16x32(self, a: u16x32<Self>, shift: u32) -> u16x32<Self> {
7558 let (a0, a1) = self.split_u16x32(a);
7559 self.combine_u16x16(self.shl_u16x16(a0, shift), self.shl_u16x16(a1, shift))
7560 }
7561 #[inline(always)]
7562 fn shlv_u16x32(self, a: u16x32<Self>, b: u16x32<Self>) -> u16x32<Self> {
7563 let (a0, a1) = self.split_u16x32(a);
7564 let (b0, b1) = self.split_u16x32(b);
7565 self.combine_u16x16(self.shlv_u16x16(a0, b0), self.shlv_u16x16(a1, b1))
7566 }
7567 #[inline(always)]
7568 fn shr_u16x32(self, a: u16x32<Self>, shift: u32) -> u16x32<Self> {
7569 let (a0, a1) = self.split_u16x32(a);
7570 self.combine_u16x16(self.shr_u16x16(a0, shift), self.shr_u16x16(a1, shift))
7571 }
7572 #[inline(always)]
7573 fn shrv_u16x32(self, a: u16x32<Self>, b: u16x32<Self>) -> u16x32<Self> {
7574 let (a0, a1) = self.split_u16x32(a);
7575 let (b0, b1) = self.split_u16x32(b);
7576 self.combine_u16x16(self.shrv_u16x16(a0, b0), self.shrv_u16x16(a1, b1))
7577 }
7578 #[inline(always)]
7579 fn simd_eq_u16x32(self, a: u16x32<Self>, b: u16x32<Self>) -> mask16x32<Self> {
7580 let (a0, a1) = self.split_u16x32(a);
7581 let (b0, b1) = self.split_u16x32(b);
7582 self.combine_mask16x16(self.simd_eq_u16x16(a0, b0), self.simd_eq_u16x16(a1, b1))
7583 }
7584 #[inline(always)]
7585 fn simd_lt_u16x32(self, a: u16x32<Self>, b: u16x32<Self>) -> mask16x32<Self> {
7586 let (a0, a1) = self.split_u16x32(a);
7587 let (b0, b1) = self.split_u16x32(b);
7588 self.combine_mask16x16(self.simd_lt_u16x16(a0, b0), self.simd_lt_u16x16(a1, b1))
7589 }
7590 #[inline(always)]
7591 fn simd_le_u16x32(self, a: u16x32<Self>, b: u16x32<Self>) -> mask16x32<Self> {
7592 let (a0, a1) = self.split_u16x32(a);
7593 let (b0, b1) = self.split_u16x32(b);
7594 self.combine_mask16x16(self.simd_le_u16x16(a0, b0), self.simd_le_u16x16(a1, b1))
7595 }
7596 #[inline(always)]
7597 fn simd_ge_u16x32(self, a: u16x32<Self>, b: u16x32<Self>) -> mask16x32<Self> {
7598 let (a0, a1) = self.split_u16x32(a);
7599 let (b0, b1) = self.split_u16x32(b);
7600 self.combine_mask16x16(self.simd_ge_u16x16(a0, b0), self.simd_ge_u16x16(a1, b1))
7601 }
7602 #[inline(always)]
7603 fn simd_gt_u16x32(self, a: u16x32<Self>, b: u16x32<Self>) -> mask16x32<Self> {
7604 let (a0, a1) = self.split_u16x32(a);
7605 let (b0, b1) = self.split_u16x32(b);
7606 self.combine_mask16x16(self.simd_gt_u16x16(a0, b0), self.simd_gt_u16x16(a1, b1))
7607 }
7608 #[inline(always)]
7609 fn zip_low_u16x32(self, a: u16x32<Self>, b: u16x32<Self>) -> u16x32<Self> {
7610 let (a0, _) = self.split_u16x32(a);
7611 let (b0, _) = self.split_u16x32(b);
7612 self.combine_u16x16(self.zip_low_u16x16(a0, b0), self.zip_high_u16x16(a0, b0))
7613 }
7614 #[inline(always)]
7615 fn zip_high_u16x32(self, a: u16x32<Self>, b: u16x32<Self>) -> u16x32<Self> {
7616 let (_, a1) = self.split_u16x32(a);
7617 let (_, b1) = self.split_u16x32(b);
7618 self.combine_u16x16(self.zip_low_u16x16(a1, b1), self.zip_high_u16x16(a1, b1))
7619 }
7620 #[inline(always)]
7621 fn unzip_low_u16x32(self, a: u16x32<Self>, b: u16x32<Self>) -> u16x32<Self> {
7622 let (a0, a1) = self.split_u16x32(a);
7623 let (b0, b1) = self.split_u16x32(b);
7624 self.combine_u16x16(self.unzip_low_u16x16(a0, a1), self.unzip_low_u16x16(b0, b1))
7625 }
7626 #[inline(always)]
7627 fn unzip_high_u16x32(self, a: u16x32<Self>, b: u16x32<Self>) -> u16x32<Self> {
7628 let (a0, a1) = self.split_u16x32(a);
7629 let (b0, b1) = self.split_u16x32(b);
7630 self.combine_u16x16(
7631 self.unzip_high_u16x16(a0, a1),
7632 self.unzip_high_u16x16(b0, b1),
7633 )
7634 }
7635 #[inline(always)]
7636 fn interleave_u16x32(self, a: u16x32<Self>, b: u16x32<Self>) -> (u16x32<Self>, u16x32<Self>) {
7637 let (a0, a1) = self.split_u16x32(a);
7638 let (b0, b1) = self.split_u16x32(b);
7639 let lo_lo = self.zip_low_u16x16(a0, b0);
7640 let lo_hi = self.zip_high_u16x16(a0, b0);
7641 let hi_lo = self.zip_low_u16x16(a1, b1);
7642 let hi_hi = self.zip_high_u16x16(a1, b1);
7643 (
7644 self.combine_u16x16(lo_lo, lo_hi),
7645 self.combine_u16x16(hi_lo, hi_hi),
7646 )
7647 }
7648 #[inline(always)]
7649 fn deinterleave_u16x32(self, a: u16x32<Self>, b: u16x32<Self>) -> (u16x32<Self>, u16x32<Self>) {
7650 let (a0, a1) = self.split_u16x32(a);
7651 let (b0, b1) = self.split_u16x32(b);
7652 let lo_even = self.unzip_low_u16x16(a0, a1);
7653 let lo_odd = self.unzip_high_u16x16(a0, a1);
7654 let hi_even = self.unzip_low_u16x16(b0, b1);
7655 let hi_odd = self.unzip_high_u16x16(b0, b1);
7656 (
7657 self.combine_u16x16(lo_even, hi_even),
7658 self.combine_u16x16(lo_odd, hi_odd),
7659 )
7660 }
7661 #[inline(always)]
7662 fn select_u16x32(self, a: mask16x32<Self>, b: u16x32<Self>, c: u16x32<Self>) -> u16x32<Self> {
7663 let (a0, a1) = self.split_mask16x32(a);
7664 let (b0, b1) = self.split_u16x32(b);
7665 let (c0, c1) = self.split_u16x32(c);
7666 self.combine_u16x16(
7667 self.select_u16x16(a0, b0, c0),
7668 self.select_u16x16(a1, b1, c1),
7669 )
7670 }
7671 #[inline(always)]
7672 fn min_u16x32(self, a: u16x32<Self>, b: u16x32<Self>) -> u16x32<Self> {
7673 let (a0, a1) = self.split_u16x32(a);
7674 let (b0, b1) = self.split_u16x32(b);
7675 self.combine_u16x16(self.min_u16x16(a0, b0), self.min_u16x16(a1, b1))
7676 }
7677 #[inline(always)]
7678 fn max_u16x32(self, a: u16x32<Self>, b: u16x32<Self>) -> u16x32<Self> {
7679 let (a0, a1) = self.split_u16x32(a);
7680 let (b0, b1) = self.split_u16x32(b);
7681 self.combine_u16x16(self.max_u16x16(a0, b0), self.max_u16x16(a1, b1))
7682 }
7683 #[inline(always)]
7684 fn split_u16x32(self, a: u16x32<Self>) -> (u16x16<Self>, u16x16<Self>) {
7685 (
7686 u16x16 {
7687 val: crate::support::Aligned256(uint16x8x2_t(a.val.0.0, a.val.0.1)),
7688 simd: self,
7689 },
7690 u16x16 {
7691 val: crate::support::Aligned256(uint16x8x2_t(a.val.0.2, a.val.0.3)),
7692 simd: self,
7693 },
7694 )
7695 }
7696 #[inline(always)]
7697 fn load_interleaved_128_u16x32(self, src: &[u16; 32usize]) -> u16x32<Self> {
7698 unsafe { vld4q_u16(src.as_ptr()).simd_into(self) }
7699 }
7700 #[inline(always)]
7701 fn store_interleaved_128_u16x32(self, a: u16x32<Self>, dest: &mut [u16; 32usize]) -> () {
7702 unsafe { vst4q_u16(dest.as_mut_ptr(), a.into()) }
7703 }
7704 #[inline(always)]
7705 fn narrow_u16x32(self, a: u16x32<Self>) -> u8x32<Self> {
7706 let (a0, a1) = self.split_u16x32(a);
7707 self.combine_u8x16(self.narrow_u16x16(a0), self.narrow_u16x16(a1))
7708 }
7709 #[inline(always)]
7710 fn reinterpret_u8_u16x32(self, a: u16x32<Self>) -> u8x64<Self> {
7711 let (a0, a1) = self.split_u16x32(a);
7712 self.combine_u8x32(
7713 self.reinterpret_u8_u16x16(a0),
7714 self.reinterpret_u8_u16x16(a1),
7715 )
7716 }
7717 #[inline(always)]
7718 fn reinterpret_u32_u16x32(self, a: u16x32<Self>) -> u32x16<Self> {
7719 let (a0, a1) = self.split_u16x32(a);
7720 self.combine_u32x8(
7721 self.reinterpret_u32_u16x16(a0),
7722 self.reinterpret_u32_u16x16(a1),
7723 )
7724 }
7725 #[inline(always)]
7726 fn splat_mask16x32(self, val: i16) -> mask16x32<Self> {
7727 let half = self.splat_mask16x16(val);
7728 self.combine_mask16x16(half, half)
7729 }
7730 #[inline(always)]
7731 fn load_array_mask16x32(self, val: [i16; 32usize]) -> mask16x32<Self> {
7732 mask16x32 {
7733 val: unsafe { core::mem::transmute_copy(&val) },
7734 simd: self,
7735 }
7736 }
7737 #[inline(always)]
7738 fn load_array_ref_mask16x32(self, val: &[i16; 32usize]) -> mask16x32<Self> {
7739 mask16x32 {
7740 val: unsafe { core::mem::transmute_copy(val) },
7741 simd: self,
7742 }
7743 }
7744 #[inline(always)]
7745 fn as_array_mask16x32(self, a: mask16x32<Self>) -> [i16; 32usize] {
7746 unsafe { core::mem::transmute::<int16x8x4_t, [i16; 32usize]>(a.val.0) }
7747 }
7748 #[inline(always)]
7749 fn as_array_ref_mask16x32(self, a: &mask16x32<Self>) -> &[i16; 32usize] {
7750 unsafe { core::mem::transmute::<&int16x8x4_t, &[i16; 32usize]>(&a.val.0) }
7751 }
7752 #[inline(always)]
7753 fn as_array_mut_mask16x32(self, a: &mut mask16x32<Self>) -> &mut [i16; 32usize] {
7754 unsafe { core::mem::transmute::<&mut int16x8x4_t, &mut [i16; 32usize]>(&mut a.val.0) }
7755 }
7756 #[inline(always)]
7757 fn store_array_mask16x32(self, a: mask16x32<Self>, dest: &mut [i16; 32usize]) -> () {
7758 unsafe {
7759 core::ptr::copy_nonoverlapping(
7760 (&raw const a.val.0) as *const i16,
7761 dest.as_mut_ptr(),
7762 32usize,
7763 );
7764 }
7765 }
7766 #[inline(always)]
7767 fn cvt_from_bytes_mask16x32(self, a: u8x64<Self>) -> mask16x32<Self> {
7768 unsafe {
7769 mask16x32 {
7770 val: core::mem::transmute(a.val),
7771 simd: self,
7772 }
7773 }
7774 }
7775 #[inline(always)]
7776 fn cvt_to_bytes_mask16x32(self, a: mask16x32<Self>) -> u8x64<Self> {
7777 unsafe {
7778 u8x64 {
7779 val: core::mem::transmute(a.val),
7780 simd: self,
7781 }
7782 }
7783 }
7784 #[inline(always)]
7785 fn slide_mask16x32<const SHIFT: usize>(
7786 self,
7787 a: mask16x32<Self>,
7788 b: mask16x32<Self>,
7789 ) -> mask16x32<Self> {
7790 if SHIFT >= 32usize {
7791 return b;
7792 }
7793 let result = unsafe {
7794 let a_bytes = self.cvt_to_bytes_mask16x32(a).val.0;
7795 let b_bytes = self.cvt_to_bytes_mask16x32(b).val.0;
7796 let a_blocks = [a_bytes.0, a_bytes.1, a_bytes.2, a_bytes.3];
7797 let b_blocks = [b_bytes.0, b_bytes.1, b_bytes.2, b_bytes.3];
7798 let shift_bytes = SHIFT * 2usize;
7799 uint8x16x4_t(
7800 {
7801 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
7802 &a_blocks,
7803 &b_blocks,
7804 0,
7805 shift_bytes,
7806 );
7807 dyn_vext_128(lo, hi, shift_bytes % 16)
7808 },
7809 {
7810 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
7811 &a_blocks,
7812 &b_blocks,
7813 1,
7814 shift_bytes,
7815 );
7816 dyn_vext_128(lo, hi, shift_bytes % 16)
7817 },
7818 {
7819 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
7820 &a_blocks,
7821 &b_blocks,
7822 2,
7823 shift_bytes,
7824 );
7825 dyn_vext_128(lo, hi, shift_bytes % 16)
7826 },
7827 {
7828 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
7829 &a_blocks,
7830 &b_blocks,
7831 3,
7832 shift_bytes,
7833 );
7834 dyn_vext_128(lo, hi, shift_bytes % 16)
7835 },
7836 )
7837 };
7838 self.cvt_from_bytes_mask16x32(u8x64 {
7839 val: crate::support::Aligned512(result),
7840 simd: self,
7841 })
7842 }
7843 #[inline(always)]
7844 fn slide_within_blocks_mask16x32<const SHIFT: usize>(
7845 self,
7846 a: mask16x32<Self>,
7847 b: mask16x32<Self>,
7848 ) -> mask16x32<Self> {
7849 let (a0, a1) = self.split_mask16x32(a);
7850 let (b0, b1) = self.split_mask16x32(b);
7851 self.combine_mask16x16(
7852 self.slide_within_blocks_mask16x16::<SHIFT>(a0, b0),
7853 self.slide_within_blocks_mask16x16::<SHIFT>(a1, b1),
7854 )
7855 }
7856 #[inline(always)]
7857 fn and_mask16x32(self, a: mask16x32<Self>, b: mask16x32<Self>) -> mask16x32<Self> {
7858 let (a0, a1) = self.split_mask16x32(a);
7859 let (b0, b1) = self.split_mask16x32(b);
7860 self.combine_mask16x16(self.and_mask16x16(a0, b0), self.and_mask16x16(a1, b1))
7861 }
7862 #[inline(always)]
7863 fn or_mask16x32(self, a: mask16x32<Self>, b: mask16x32<Self>) -> mask16x32<Self> {
7864 let (a0, a1) = self.split_mask16x32(a);
7865 let (b0, b1) = self.split_mask16x32(b);
7866 self.combine_mask16x16(self.or_mask16x16(a0, b0), self.or_mask16x16(a1, b1))
7867 }
7868 #[inline(always)]
7869 fn xor_mask16x32(self, a: mask16x32<Self>, b: mask16x32<Self>) -> mask16x32<Self> {
7870 let (a0, a1) = self.split_mask16x32(a);
7871 let (b0, b1) = self.split_mask16x32(b);
7872 self.combine_mask16x16(self.xor_mask16x16(a0, b0), self.xor_mask16x16(a1, b1))
7873 }
7874 #[inline(always)]
7875 fn not_mask16x32(self, a: mask16x32<Self>) -> mask16x32<Self> {
7876 let (a0, a1) = self.split_mask16x32(a);
7877 self.combine_mask16x16(self.not_mask16x16(a0), self.not_mask16x16(a1))
7878 }
7879 #[inline(always)]
7880 fn select_mask16x32(
7881 self,
7882 a: mask16x32<Self>,
7883 b: mask16x32<Self>,
7884 c: mask16x32<Self>,
7885 ) -> mask16x32<Self> {
7886 let (a0, a1) = self.split_mask16x32(a);
7887 let (b0, b1) = self.split_mask16x32(b);
7888 let (c0, c1) = self.split_mask16x32(c);
7889 self.combine_mask16x16(
7890 self.select_mask16x16(a0, b0, c0),
7891 self.select_mask16x16(a1, b1, c1),
7892 )
7893 }
7894 #[inline(always)]
7895 fn simd_eq_mask16x32(self, a: mask16x32<Self>, b: mask16x32<Self>) -> mask16x32<Self> {
7896 let (a0, a1) = self.split_mask16x32(a);
7897 let (b0, b1) = self.split_mask16x32(b);
7898 self.combine_mask16x16(
7899 self.simd_eq_mask16x16(a0, b0),
7900 self.simd_eq_mask16x16(a1, b1),
7901 )
7902 }
7903 #[inline(always)]
7904 fn any_true_mask16x32(self, a: mask16x32<Self>) -> bool {
7905 let (a0, a1) = self.split_mask16x32(a);
7906 self.any_true_mask16x16(a0) || self.any_true_mask16x16(a1)
7907 }
7908 #[inline(always)]
7909 fn all_true_mask16x32(self, a: mask16x32<Self>) -> bool {
7910 let (a0, a1) = self.split_mask16x32(a);
7911 self.all_true_mask16x16(a0) && self.all_true_mask16x16(a1)
7912 }
7913 #[inline(always)]
7914 fn any_false_mask16x32(self, a: mask16x32<Self>) -> bool {
7915 let (a0, a1) = self.split_mask16x32(a);
7916 self.any_false_mask16x16(a0) || self.any_false_mask16x16(a1)
7917 }
7918 #[inline(always)]
7919 fn all_false_mask16x32(self, a: mask16x32<Self>) -> bool {
7920 let (a0, a1) = self.split_mask16x32(a);
7921 self.all_false_mask16x16(a0) && self.all_false_mask16x16(a1)
7922 }
7923 #[inline(always)]
7924 fn split_mask16x32(self, a: mask16x32<Self>) -> (mask16x16<Self>, mask16x16<Self>) {
7925 (
7926 mask16x16 {
7927 val: crate::support::Aligned256(int16x8x2_t(a.val.0.0, a.val.0.1)),
7928 simd: self,
7929 },
7930 mask16x16 {
7931 val: crate::support::Aligned256(int16x8x2_t(a.val.0.2, a.val.0.3)),
7932 simd: self,
7933 },
7934 )
7935 }
7936 #[inline(always)]
7937 fn splat_i32x16(self, val: i32) -> i32x16<Self> {
7938 let half = self.splat_i32x8(val);
7939 self.combine_i32x8(half, half)
7940 }
7941 #[inline(always)]
7942 fn load_array_i32x16(self, val: [i32; 16usize]) -> i32x16<Self> {
7943 i32x16 {
7944 val: unsafe { core::mem::transmute_copy(&val) },
7945 simd: self,
7946 }
7947 }
7948 #[inline(always)]
7949 fn load_array_ref_i32x16(self, val: &[i32; 16usize]) -> i32x16<Self> {
7950 i32x16 {
7951 val: unsafe { core::mem::transmute_copy(val) },
7952 simd: self,
7953 }
7954 }
7955 #[inline(always)]
7956 fn as_array_i32x16(self, a: i32x16<Self>) -> [i32; 16usize] {
7957 unsafe { core::mem::transmute::<int32x4x4_t, [i32; 16usize]>(a.val.0) }
7958 }
7959 #[inline(always)]
7960 fn as_array_ref_i32x16(self, a: &i32x16<Self>) -> &[i32; 16usize] {
7961 unsafe { core::mem::transmute::<&int32x4x4_t, &[i32; 16usize]>(&a.val.0) }
7962 }
7963 #[inline(always)]
7964 fn as_array_mut_i32x16(self, a: &mut i32x16<Self>) -> &mut [i32; 16usize] {
7965 unsafe { core::mem::transmute::<&mut int32x4x4_t, &mut [i32; 16usize]>(&mut a.val.0) }
7966 }
7967 #[inline(always)]
7968 fn store_array_i32x16(self, a: i32x16<Self>, dest: &mut [i32; 16usize]) -> () {
7969 unsafe {
7970 core::ptr::copy_nonoverlapping(
7971 (&raw const a.val.0) as *const i32,
7972 dest.as_mut_ptr(),
7973 16usize,
7974 );
7975 }
7976 }
7977 #[inline(always)]
7978 fn cvt_from_bytes_i32x16(self, a: u8x64<Self>) -> i32x16<Self> {
7979 unsafe {
7980 i32x16 {
7981 val: core::mem::transmute(a.val),
7982 simd: self,
7983 }
7984 }
7985 }
7986 #[inline(always)]
7987 fn cvt_to_bytes_i32x16(self, a: i32x16<Self>) -> u8x64<Self> {
7988 unsafe {
7989 u8x64 {
7990 val: core::mem::transmute(a.val),
7991 simd: self,
7992 }
7993 }
7994 }
7995 #[inline(always)]
7996 fn slide_i32x16<const SHIFT: usize>(self, a: i32x16<Self>, b: i32x16<Self>) -> i32x16<Self> {
7997 if SHIFT >= 16usize {
7998 return b;
7999 }
8000 let result = unsafe {
8001 let a_bytes = self.cvt_to_bytes_i32x16(a).val.0;
8002 let b_bytes = self.cvt_to_bytes_i32x16(b).val.0;
8003 let a_blocks = [a_bytes.0, a_bytes.1, a_bytes.2, a_bytes.3];
8004 let b_blocks = [b_bytes.0, b_bytes.1, b_bytes.2, b_bytes.3];
8005 let shift_bytes = SHIFT * 4usize;
8006 uint8x16x4_t(
8007 {
8008 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
8009 &a_blocks,
8010 &b_blocks,
8011 0,
8012 shift_bytes,
8013 );
8014 dyn_vext_128(lo, hi, shift_bytes % 16)
8015 },
8016 {
8017 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
8018 &a_blocks,
8019 &b_blocks,
8020 1,
8021 shift_bytes,
8022 );
8023 dyn_vext_128(lo, hi, shift_bytes % 16)
8024 },
8025 {
8026 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
8027 &a_blocks,
8028 &b_blocks,
8029 2,
8030 shift_bytes,
8031 );
8032 dyn_vext_128(lo, hi, shift_bytes % 16)
8033 },
8034 {
8035 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
8036 &a_blocks,
8037 &b_blocks,
8038 3,
8039 shift_bytes,
8040 );
8041 dyn_vext_128(lo, hi, shift_bytes % 16)
8042 },
8043 )
8044 };
8045 self.cvt_from_bytes_i32x16(u8x64 {
8046 val: crate::support::Aligned512(result),
8047 simd: self,
8048 })
8049 }
8050 #[inline(always)]
8051 fn slide_within_blocks_i32x16<const SHIFT: usize>(
8052 self,
8053 a: i32x16<Self>,
8054 b: i32x16<Self>,
8055 ) -> i32x16<Self> {
8056 let (a0, a1) = self.split_i32x16(a);
8057 let (b0, b1) = self.split_i32x16(b);
8058 self.combine_i32x8(
8059 self.slide_within_blocks_i32x8::<SHIFT>(a0, b0),
8060 self.slide_within_blocks_i32x8::<SHIFT>(a1, b1),
8061 )
8062 }
8063 #[inline(always)]
8064 fn add_i32x16(self, a: i32x16<Self>, b: i32x16<Self>) -> i32x16<Self> {
8065 let (a0, a1) = self.split_i32x16(a);
8066 let (b0, b1) = self.split_i32x16(b);
8067 self.combine_i32x8(self.add_i32x8(a0, b0), self.add_i32x8(a1, b1))
8068 }
8069 #[inline(always)]
8070 fn sub_i32x16(self, a: i32x16<Self>, b: i32x16<Self>) -> i32x16<Self> {
8071 let (a0, a1) = self.split_i32x16(a);
8072 let (b0, b1) = self.split_i32x16(b);
8073 self.combine_i32x8(self.sub_i32x8(a0, b0), self.sub_i32x8(a1, b1))
8074 }
8075 #[inline(always)]
8076 fn mul_i32x16(self, a: i32x16<Self>, b: i32x16<Self>) -> i32x16<Self> {
8077 let (a0, a1) = self.split_i32x16(a);
8078 let (b0, b1) = self.split_i32x16(b);
8079 self.combine_i32x8(self.mul_i32x8(a0, b0), self.mul_i32x8(a1, b1))
8080 }
8081 #[inline(always)]
8082 fn and_i32x16(self, a: i32x16<Self>, b: i32x16<Self>) -> i32x16<Self> {
8083 let (a0, a1) = self.split_i32x16(a);
8084 let (b0, b1) = self.split_i32x16(b);
8085 self.combine_i32x8(self.and_i32x8(a0, b0), self.and_i32x8(a1, b1))
8086 }
8087 #[inline(always)]
8088 fn or_i32x16(self, a: i32x16<Self>, b: i32x16<Self>) -> i32x16<Self> {
8089 let (a0, a1) = self.split_i32x16(a);
8090 let (b0, b1) = self.split_i32x16(b);
8091 self.combine_i32x8(self.or_i32x8(a0, b0), self.or_i32x8(a1, b1))
8092 }
8093 #[inline(always)]
8094 fn xor_i32x16(self, a: i32x16<Self>, b: i32x16<Self>) -> i32x16<Self> {
8095 let (a0, a1) = self.split_i32x16(a);
8096 let (b0, b1) = self.split_i32x16(b);
8097 self.combine_i32x8(self.xor_i32x8(a0, b0), self.xor_i32x8(a1, b1))
8098 }
8099 #[inline(always)]
8100 fn not_i32x16(self, a: i32x16<Self>) -> i32x16<Self> {
8101 let (a0, a1) = self.split_i32x16(a);
8102 self.combine_i32x8(self.not_i32x8(a0), self.not_i32x8(a1))
8103 }
8104 #[inline(always)]
8105 fn shl_i32x16(self, a: i32x16<Self>, shift: u32) -> i32x16<Self> {
8106 let (a0, a1) = self.split_i32x16(a);
8107 self.combine_i32x8(self.shl_i32x8(a0, shift), self.shl_i32x8(a1, shift))
8108 }
8109 #[inline(always)]
8110 fn shlv_i32x16(self, a: i32x16<Self>, b: i32x16<Self>) -> i32x16<Self> {
8111 let (a0, a1) = self.split_i32x16(a);
8112 let (b0, b1) = self.split_i32x16(b);
8113 self.combine_i32x8(self.shlv_i32x8(a0, b0), self.shlv_i32x8(a1, b1))
8114 }
8115 #[inline(always)]
8116 fn shr_i32x16(self, a: i32x16<Self>, shift: u32) -> i32x16<Self> {
8117 let (a0, a1) = self.split_i32x16(a);
8118 self.combine_i32x8(self.shr_i32x8(a0, shift), self.shr_i32x8(a1, shift))
8119 }
8120 #[inline(always)]
8121 fn shrv_i32x16(self, a: i32x16<Self>, b: i32x16<Self>) -> i32x16<Self> {
8122 let (a0, a1) = self.split_i32x16(a);
8123 let (b0, b1) = self.split_i32x16(b);
8124 self.combine_i32x8(self.shrv_i32x8(a0, b0), self.shrv_i32x8(a1, b1))
8125 }
8126 #[inline(always)]
8127 fn simd_eq_i32x16(self, a: i32x16<Self>, b: i32x16<Self>) -> mask32x16<Self> {
8128 let (a0, a1) = self.split_i32x16(a);
8129 let (b0, b1) = self.split_i32x16(b);
8130 self.combine_mask32x8(self.simd_eq_i32x8(a0, b0), self.simd_eq_i32x8(a1, b1))
8131 }
8132 #[inline(always)]
8133 fn simd_lt_i32x16(self, a: i32x16<Self>, b: i32x16<Self>) -> mask32x16<Self> {
8134 let (a0, a1) = self.split_i32x16(a);
8135 let (b0, b1) = self.split_i32x16(b);
8136 self.combine_mask32x8(self.simd_lt_i32x8(a0, b0), self.simd_lt_i32x8(a1, b1))
8137 }
8138 #[inline(always)]
8139 fn simd_le_i32x16(self, a: i32x16<Self>, b: i32x16<Self>) -> mask32x16<Self> {
8140 let (a0, a1) = self.split_i32x16(a);
8141 let (b0, b1) = self.split_i32x16(b);
8142 self.combine_mask32x8(self.simd_le_i32x8(a0, b0), self.simd_le_i32x8(a1, b1))
8143 }
8144 #[inline(always)]
8145 fn simd_ge_i32x16(self, a: i32x16<Self>, b: i32x16<Self>) -> mask32x16<Self> {
8146 let (a0, a1) = self.split_i32x16(a);
8147 let (b0, b1) = self.split_i32x16(b);
8148 self.combine_mask32x8(self.simd_ge_i32x8(a0, b0), self.simd_ge_i32x8(a1, b1))
8149 }
8150 #[inline(always)]
8151 fn simd_gt_i32x16(self, a: i32x16<Self>, b: i32x16<Self>) -> mask32x16<Self> {
8152 let (a0, a1) = self.split_i32x16(a);
8153 let (b0, b1) = self.split_i32x16(b);
8154 self.combine_mask32x8(self.simd_gt_i32x8(a0, b0), self.simd_gt_i32x8(a1, b1))
8155 }
8156 #[inline(always)]
8157 fn zip_low_i32x16(self, a: i32x16<Self>, b: i32x16<Self>) -> i32x16<Self> {
8158 let (a0, _) = self.split_i32x16(a);
8159 let (b0, _) = self.split_i32x16(b);
8160 self.combine_i32x8(self.zip_low_i32x8(a0, b0), self.zip_high_i32x8(a0, b0))
8161 }
8162 #[inline(always)]
8163 fn zip_high_i32x16(self, a: i32x16<Self>, b: i32x16<Self>) -> i32x16<Self> {
8164 let (_, a1) = self.split_i32x16(a);
8165 let (_, b1) = self.split_i32x16(b);
8166 self.combine_i32x8(self.zip_low_i32x8(a1, b1), self.zip_high_i32x8(a1, b1))
8167 }
8168 #[inline(always)]
8169 fn unzip_low_i32x16(self, a: i32x16<Self>, b: i32x16<Self>) -> i32x16<Self> {
8170 let (a0, a1) = self.split_i32x16(a);
8171 let (b0, b1) = self.split_i32x16(b);
8172 self.combine_i32x8(self.unzip_low_i32x8(a0, a1), self.unzip_low_i32x8(b0, b1))
8173 }
8174 #[inline(always)]
8175 fn unzip_high_i32x16(self, a: i32x16<Self>, b: i32x16<Self>) -> i32x16<Self> {
8176 let (a0, a1) = self.split_i32x16(a);
8177 let (b0, b1) = self.split_i32x16(b);
8178 self.combine_i32x8(self.unzip_high_i32x8(a0, a1), self.unzip_high_i32x8(b0, b1))
8179 }
8180 #[inline(always)]
8181 fn interleave_i32x16(self, a: i32x16<Self>, b: i32x16<Self>) -> (i32x16<Self>, i32x16<Self>) {
8182 let (a0, a1) = self.split_i32x16(a);
8183 let (b0, b1) = self.split_i32x16(b);
8184 let lo_lo = self.zip_low_i32x8(a0, b0);
8185 let lo_hi = self.zip_high_i32x8(a0, b0);
8186 let hi_lo = self.zip_low_i32x8(a1, b1);
8187 let hi_hi = self.zip_high_i32x8(a1, b1);
8188 (
8189 self.combine_i32x8(lo_lo, lo_hi),
8190 self.combine_i32x8(hi_lo, hi_hi),
8191 )
8192 }
8193 #[inline(always)]
8194 fn deinterleave_i32x16(self, a: i32x16<Self>, b: i32x16<Self>) -> (i32x16<Self>, i32x16<Self>) {
8195 let (a0, a1) = self.split_i32x16(a);
8196 let (b0, b1) = self.split_i32x16(b);
8197 let lo_even = self.unzip_low_i32x8(a0, a1);
8198 let lo_odd = self.unzip_high_i32x8(a0, a1);
8199 let hi_even = self.unzip_low_i32x8(b0, b1);
8200 let hi_odd = self.unzip_high_i32x8(b0, b1);
8201 (
8202 self.combine_i32x8(lo_even, hi_even),
8203 self.combine_i32x8(lo_odd, hi_odd),
8204 )
8205 }
8206 #[inline(always)]
8207 fn select_i32x16(self, a: mask32x16<Self>, b: i32x16<Self>, c: i32x16<Self>) -> i32x16<Self> {
8208 let (a0, a1) = self.split_mask32x16(a);
8209 let (b0, b1) = self.split_i32x16(b);
8210 let (c0, c1) = self.split_i32x16(c);
8211 self.combine_i32x8(self.select_i32x8(a0, b0, c0), self.select_i32x8(a1, b1, c1))
8212 }
8213 #[inline(always)]
8214 fn min_i32x16(self, a: i32x16<Self>, b: i32x16<Self>) -> i32x16<Self> {
8215 let (a0, a1) = self.split_i32x16(a);
8216 let (b0, b1) = self.split_i32x16(b);
8217 self.combine_i32x8(self.min_i32x8(a0, b0), self.min_i32x8(a1, b1))
8218 }
8219 #[inline(always)]
8220 fn max_i32x16(self, a: i32x16<Self>, b: i32x16<Self>) -> i32x16<Self> {
8221 let (a0, a1) = self.split_i32x16(a);
8222 let (b0, b1) = self.split_i32x16(b);
8223 self.combine_i32x8(self.max_i32x8(a0, b0), self.max_i32x8(a1, b1))
8224 }
8225 #[inline(always)]
8226 fn split_i32x16(self, a: i32x16<Self>) -> (i32x8<Self>, i32x8<Self>) {
8227 (
8228 i32x8 {
8229 val: crate::support::Aligned256(int32x4x2_t(a.val.0.0, a.val.0.1)),
8230 simd: self,
8231 },
8232 i32x8 {
8233 val: crate::support::Aligned256(int32x4x2_t(a.val.0.2, a.val.0.3)),
8234 simd: self,
8235 },
8236 )
8237 }
8238 #[inline(always)]
8239 fn neg_i32x16(self, a: i32x16<Self>) -> i32x16<Self> {
8240 let (a0, a1) = self.split_i32x16(a);
8241 self.combine_i32x8(self.neg_i32x8(a0), self.neg_i32x8(a1))
8242 }
8243 #[inline(always)]
8244 fn reinterpret_u8_i32x16(self, a: i32x16<Self>) -> u8x64<Self> {
8245 let (a0, a1) = self.split_i32x16(a);
8246 self.combine_u8x32(self.reinterpret_u8_i32x8(a0), self.reinterpret_u8_i32x8(a1))
8247 }
8248 #[inline(always)]
8249 fn reinterpret_u32_i32x16(self, a: i32x16<Self>) -> u32x16<Self> {
8250 let (a0, a1) = self.split_i32x16(a);
8251 self.combine_u32x8(
8252 self.reinterpret_u32_i32x8(a0),
8253 self.reinterpret_u32_i32x8(a1),
8254 )
8255 }
8256 #[inline(always)]
8257 fn cvt_f32_i32x16(self, a: i32x16<Self>) -> f32x16<Self> {
8258 let (a0, a1) = self.split_i32x16(a);
8259 self.combine_f32x8(self.cvt_f32_i32x8(a0), self.cvt_f32_i32x8(a1))
8260 }
8261 #[inline(always)]
8262 fn splat_u32x16(self, val: u32) -> u32x16<Self> {
8263 let half = self.splat_u32x8(val);
8264 self.combine_u32x8(half, half)
8265 }
8266 #[inline(always)]
8267 fn load_array_u32x16(self, val: [u32; 16usize]) -> u32x16<Self> {
8268 u32x16 {
8269 val: unsafe { core::mem::transmute_copy(&val) },
8270 simd: self,
8271 }
8272 }
8273 #[inline(always)]
8274 fn load_array_ref_u32x16(self, val: &[u32; 16usize]) -> u32x16<Self> {
8275 u32x16 {
8276 val: unsafe { core::mem::transmute_copy(val) },
8277 simd: self,
8278 }
8279 }
8280 #[inline(always)]
8281 fn as_array_u32x16(self, a: u32x16<Self>) -> [u32; 16usize] {
8282 unsafe { core::mem::transmute::<uint32x4x4_t, [u32; 16usize]>(a.val.0) }
8283 }
8284 #[inline(always)]
8285 fn as_array_ref_u32x16(self, a: &u32x16<Self>) -> &[u32; 16usize] {
8286 unsafe { core::mem::transmute::<&uint32x4x4_t, &[u32; 16usize]>(&a.val.0) }
8287 }
8288 #[inline(always)]
8289 fn as_array_mut_u32x16(self, a: &mut u32x16<Self>) -> &mut [u32; 16usize] {
8290 unsafe { core::mem::transmute::<&mut uint32x4x4_t, &mut [u32; 16usize]>(&mut a.val.0) }
8291 }
8292 #[inline(always)]
8293 fn store_array_u32x16(self, a: u32x16<Self>, dest: &mut [u32; 16usize]) -> () {
8294 unsafe {
8295 core::ptr::copy_nonoverlapping(
8296 (&raw const a.val.0) as *const u32,
8297 dest.as_mut_ptr(),
8298 16usize,
8299 );
8300 }
8301 }
8302 #[inline(always)]
8303 fn cvt_from_bytes_u32x16(self, a: u8x64<Self>) -> u32x16<Self> {
8304 unsafe {
8305 u32x16 {
8306 val: core::mem::transmute(a.val),
8307 simd: self,
8308 }
8309 }
8310 }
8311 #[inline(always)]
8312 fn cvt_to_bytes_u32x16(self, a: u32x16<Self>) -> u8x64<Self> {
8313 unsafe {
8314 u8x64 {
8315 val: core::mem::transmute(a.val),
8316 simd: self,
8317 }
8318 }
8319 }
8320 #[inline(always)]
8321 fn slide_u32x16<const SHIFT: usize>(self, a: u32x16<Self>, b: u32x16<Self>) -> u32x16<Self> {
8322 if SHIFT >= 16usize {
8323 return b;
8324 }
8325 let result = unsafe {
8326 let a_bytes = self.cvt_to_bytes_u32x16(a).val.0;
8327 let b_bytes = self.cvt_to_bytes_u32x16(b).val.0;
8328 let a_blocks = [a_bytes.0, a_bytes.1, a_bytes.2, a_bytes.3];
8329 let b_blocks = [b_bytes.0, b_bytes.1, b_bytes.2, b_bytes.3];
8330 let shift_bytes = SHIFT * 4usize;
8331 uint8x16x4_t(
8332 {
8333 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
8334 &a_blocks,
8335 &b_blocks,
8336 0,
8337 shift_bytes,
8338 );
8339 dyn_vext_128(lo, hi, shift_bytes % 16)
8340 },
8341 {
8342 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
8343 &a_blocks,
8344 &b_blocks,
8345 1,
8346 shift_bytes,
8347 );
8348 dyn_vext_128(lo, hi, shift_bytes % 16)
8349 },
8350 {
8351 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
8352 &a_blocks,
8353 &b_blocks,
8354 2,
8355 shift_bytes,
8356 );
8357 dyn_vext_128(lo, hi, shift_bytes % 16)
8358 },
8359 {
8360 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
8361 &a_blocks,
8362 &b_blocks,
8363 3,
8364 shift_bytes,
8365 );
8366 dyn_vext_128(lo, hi, shift_bytes % 16)
8367 },
8368 )
8369 };
8370 self.cvt_from_bytes_u32x16(u8x64 {
8371 val: crate::support::Aligned512(result),
8372 simd: self,
8373 })
8374 }
8375 #[inline(always)]
8376 fn slide_within_blocks_u32x16<const SHIFT: usize>(
8377 self,
8378 a: u32x16<Self>,
8379 b: u32x16<Self>,
8380 ) -> u32x16<Self> {
8381 let (a0, a1) = self.split_u32x16(a);
8382 let (b0, b1) = self.split_u32x16(b);
8383 self.combine_u32x8(
8384 self.slide_within_blocks_u32x8::<SHIFT>(a0, b0),
8385 self.slide_within_blocks_u32x8::<SHIFT>(a1, b1),
8386 )
8387 }
8388 #[inline(always)]
8389 fn add_u32x16(self, a: u32x16<Self>, b: u32x16<Self>) -> u32x16<Self> {
8390 let (a0, a1) = self.split_u32x16(a);
8391 let (b0, b1) = self.split_u32x16(b);
8392 self.combine_u32x8(self.add_u32x8(a0, b0), self.add_u32x8(a1, b1))
8393 }
8394 #[inline(always)]
8395 fn sub_u32x16(self, a: u32x16<Self>, b: u32x16<Self>) -> u32x16<Self> {
8396 let (a0, a1) = self.split_u32x16(a);
8397 let (b0, b1) = self.split_u32x16(b);
8398 self.combine_u32x8(self.sub_u32x8(a0, b0), self.sub_u32x8(a1, b1))
8399 }
8400 #[inline(always)]
8401 fn mul_u32x16(self, a: u32x16<Self>, b: u32x16<Self>) -> u32x16<Self> {
8402 let (a0, a1) = self.split_u32x16(a);
8403 let (b0, b1) = self.split_u32x16(b);
8404 self.combine_u32x8(self.mul_u32x8(a0, b0), self.mul_u32x8(a1, b1))
8405 }
8406 #[inline(always)]
8407 fn and_u32x16(self, a: u32x16<Self>, b: u32x16<Self>) -> u32x16<Self> {
8408 let (a0, a1) = self.split_u32x16(a);
8409 let (b0, b1) = self.split_u32x16(b);
8410 self.combine_u32x8(self.and_u32x8(a0, b0), self.and_u32x8(a1, b1))
8411 }
8412 #[inline(always)]
8413 fn or_u32x16(self, a: u32x16<Self>, b: u32x16<Self>) -> u32x16<Self> {
8414 let (a0, a1) = self.split_u32x16(a);
8415 let (b0, b1) = self.split_u32x16(b);
8416 self.combine_u32x8(self.or_u32x8(a0, b0), self.or_u32x8(a1, b1))
8417 }
8418 #[inline(always)]
8419 fn xor_u32x16(self, a: u32x16<Self>, b: u32x16<Self>) -> u32x16<Self> {
8420 let (a0, a1) = self.split_u32x16(a);
8421 let (b0, b1) = self.split_u32x16(b);
8422 self.combine_u32x8(self.xor_u32x8(a0, b0), self.xor_u32x8(a1, b1))
8423 }
8424 #[inline(always)]
8425 fn not_u32x16(self, a: u32x16<Self>) -> u32x16<Self> {
8426 let (a0, a1) = self.split_u32x16(a);
8427 self.combine_u32x8(self.not_u32x8(a0), self.not_u32x8(a1))
8428 }
8429 #[inline(always)]
8430 fn shl_u32x16(self, a: u32x16<Self>, shift: u32) -> u32x16<Self> {
8431 let (a0, a1) = self.split_u32x16(a);
8432 self.combine_u32x8(self.shl_u32x8(a0, shift), self.shl_u32x8(a1, shift))
8433 }
8434 #[inline(always)]
8435 fn shlv_u32x16(self, a: u32x16<Self>, b: u32x16<Self>) -> u32x16<Self> {
8436 let (a0, a1) = self.split_u32x16(a);
8437 let (b0, b1) = self.split_u32x16(b);
8438 self.combine_u32x8(self.shlv_u32x8(a0, b0), self.shlv_u32x8(a1, b1))
8439 }
8440 #[inline(always)]
8441 fn shr_u32x16(self, a: u32x16<Self>, shift: u32) -> u32x16<Self> {
8442 let (a0, a1) = self.split_u32x16(a);
8443 self.combine_u32x8(self.shr_u32x8(a0, shift), self.shr_u32x8(a1, shift))
8444 }
8445 #[inline(always)]
8446 fn shrv_u32x16(self, a: u32x16<Self>, b: u32x16<Self>) -> u32x16<Self> {
8447 let (a0, a1) = self.split_u32x16(a);
8448 let (b0, b1) = self.split_u32x16(b);
8449 self.combine_u32x8(self.shrv_u32x8(a0, b0), self.shrv_u32x8(a1, b1))
8450 }
8451 #[inline(always)]
8452 fn simd_eq_u32x16(self, a: u32x16<Self>, b: u32x16<Self>) -> mask32x16<Self> {
8453 let (a0, a1) = self.split_u32x16(a);
8454 let (b0, b1) = self.split_u32x16(b);
8455 self.combine_mask32x8(self.simd_eq_u32x8(a0, b0), self.simd_eq_u32x8(a1, b1))
8456 }
8457 #[inline(always)]
8458 fn simd_lt_u32x16(self, a: u32x16<Self>, b: u32x16<Self>) -> mask32x16<Self> {
8459 let (a0, a1) = self.split_u32x16(a);
8460 let (b0, b1) = self.split_u32x16(b);
8461 self.combine_mask32x8(self.simd_lt_u32x8(a0, b0), self.simd_lt_u32x8(a1, b1))
8462 }
8463 #[inline(always)]
8464 fn simd_le_u32x16(self, a: u32x16<Self>, b: u32x16<Self>) -> mask32x16<Self> {
8465 let (a0, a1) = self.split_u32x16(a);
8466 let (b0, b1) = self.split_u32x16(b);
8467 self.combine_mask32x8(self.simd_le_u32x8(a0, b0), self.simd_le_u32x8(a1, b1))
8468 }
8469 #[inline(always)]
8470 fn simd_ge_u32x16(self, a: u32x16<Self>, b: u32x16<Self>) -> mask32x16<Self> {
8471 let (a0, a1) = self.split_u32x16(a);
8472 let (b0, b1) = self.split_u32x16(b);
8473 self.combine_mask32x8(self.simd_ge_u32x8(a0, b0), self.simd_ge_u32x8(a1, b1))
8474 }
8475 #[inline(always)]
8476 fn simd_gt_u32x16(self, a: u32x16<Self>, b: u32x16<Self>) -> mask32x16<Self> {
8477 let (a0, a1) = self.split_u32x16(a);
8478 let (b0, b1) = self.split_u32x16(b);
8479 self.combine_mask32x8(self.simd_gt_u32x8(a0, b0), self.simd_gt_u32x8(a1, b1))
8480 }
8481 #[inline(always)]
8482 fn zip_low_u32x16(self, a: u32x16<Self>, b: u32x16<Self>) -> u32x16<Self> {
8483 let (a0, _) = self.split_u32x16(a);
8484 let (b0, _) = self.split_u32x16(b);
8485 self.combine_u32x8(self.zip_low_u32x8(a0, b0), self.zip_high_u32x8(a0, b0))
8486 }
8487 #[inline(always)]
8488 fn zip_high_u32x16(self, a: u32x16<Self>, b: u32x16<Self>) -> u32x16<Self> {
8489 let (_, a1) = self.split_u32x16(a);
8490 let (_, b1) = self.split_u32x16(b);
8491 self.combine_u32x8(self.zip_low_u32x8(a1, b1), self.zip_high_u32x8(a1, b1))
8492 }
8493 #[inline(always)]
8494 fn unzip_low_u32x16(self, a: u32x16<Self>, b: u32x16<Self>) -> u32x16<Self> {
8495 let (a0, a1) = self.split_u32x16(a);
8496 let (b0, b1) = self.split_u32x16(b);
8497 self.combine_u32x8(self.unzip_low_u32x8(a0, a1), self.unzip_low_u32x8(b0, b1))
8498 }
8499 #[inline(always)]
8500 fn unzip_high_u32x16(self, a: u32x16<Self>, b: u32x16<Self>) -> u32x16<Self> {
8501 let (a0, a1) = self.split_u32x16(a);
8502 let (b0, b1) = self.split_u32x16(b);
8503 self.combine_u32x8(self.unzip_high_u32x8(a0, a1), self.unzip_high_u32x8(b0, b1))
8504 }
8505 #[inline(always)]
8506 fn interleave_u32x16(self, a: u32x16<Self>, b: u32x16<Self>) -> (u32x16<Self>, u32x16<Self>) {
8507 let (a0, a1) = self.split_u32x16(a);
8508 let (b0, b1) = self.split_u32x16(b);
8509 let lo_lo = self.zip_low_u32x8(a0, b0);
8510 let lo_hi = self.zip_high_u32x8(a0, b0);
8511 let hi_lo = self.zip_low_u32x8(a1, b1);
8512 let hi_hi = self.zip_high_u32x8(a1, b1);
8513 (
8514 self.combine_u32x8(lo_lo, lo_hi),
8515 self.combine_u32x8(hi_lo, hi_hi),
8516 )
8517 }
8518 #[inline(always)]
8519 fn deinterleave_u32x16(self, a: u32x16<Self>, b: u32x16<Self>) -> (u32x16<Self>, u32x16<Self>) {
8520 let (a0, a1) = self.split_u32x16(a);
8521 let (b0, b1) = self.split_u32x16(b);
8522 let lo_even = self.unzip_low_u32x8(a0, a1);
8523 let lo_odd = self.unzip_high_u32x8(a0, a1);
8524 let hi_even = self.unzip_low_u32x8(b0, b1);
8525 let hi_odd = self.unzip_high_u32x8(b0, b1);
8526 (
8527 self.combine_u32x8(lo_even, hi_even),
8528 self.combine_u32x8(lo_odd, hi_odd),
8529 )
8530 }
8531 #[inline(always)]
8532 fn select_u32x16(self, a: mask32x16<Self>, b: u32x16<Self>, c: u32x16<Self>) -> u32x16<Self> {
8533 let (a0, a1) = self.split_mask32x16(a);
8534 let (b0, b1) = self.split_u32x16(b);
8535 let (c0, c1) = self.split_u32x16(c);
8536 self.combine_u32x8(self.select_u32x8(a0, b0, c0), self.select_u32x8(a1, b1, c1))
8537 }
8538 #[inline(always)]
8539 fn min_u32x16(self, a: u32x16<Self>, b: u32x16<Self>) -> u32x16<Self> {
8540 let (a0, a1) = self.split_u32x16(a);
8541 let (b0, b1) = self.split_u32x16(b);
8542 self.combine_u32x8(self.min_u32x8(a0, b0), self.min_u32x8(a1, b1))
8543 }
8544 #[inline(always)]
8545 fn max_u32x16(self, a: u32x16<Self>, b: u32x16<Self>) -> u32x16<Self> {
8546 let (a0, a1) = self.split_u32x16(a);
8547 let (b0, b1) = self.split_u32x16(b);
8548 self.combine_u32x8(self.max_u32x8(a0, b0), self.max_u32x8(a1, b1))
8549 }
8550 #[inline(always)]
8551 fn split_u32x16(self, a: u32x16<Self>) -> (u32x8<Self>, u32x8<Self>) {
8552 (
8553 u32x8 {
8554 val: crate::support::Aligned256(uint32x4x2_t(a.val.0.0, a.val.0.1)),
8555 simd: self,
8556 },
8557 u32x8 {
8558 val: crate::support::Aligned256(uint32x4x2_t(a.val.0.2, a.val.0.3)),
8559 simd: self,
8560 },
8561 )
8562 }
8563 #[inline(always)]
8564 fn load_interleaved_128_u32x16(self, src: &[u32; 16usize]) -> u32x16<Self> {
8565 unsafe { vld4q_u32(src.as_ptr()).simd_into(self) }
8566 }
8567 #[inline(always)]
8568 fn store_interleaved_128_u32x16(self, a: u32x16<Self>, dest: &mut [u32; 16usize]) -> () {
8569 unsafe { vst4q_u32(dest.as_mut_ptr(), a.into()) }
8570 }
8571 #[inline(always)]
8572 fn reinterpret_u8_u32x16(self, a: u32x16<Self>) -> u8x64<Self> {
8573 let (a0, a1) = self.split_u32x16(a);
8574 self.combine_u8x32(self.reinterpret_u8_u32x8(a0), self.reinterpret_u8_u32x8(a1))
8575 }
8576 #[inline(always)]
8577 fn cvt_f32_u32x16(self, a: u32x16<Self>) -> f32x16<Self> {
8578 let (a0, a1) = self.split_u32x16(a);
8579 self.combine_f32x8(self.cvt_f32_u32x8(a0), self.cvt_f32_u32x8(a1))
8580 }
8581 #[inline(always)]
8582 fn splat_mask32x16(self, val: i32) -> mask32x16<Self> {
8583 let half = self.splat_mask32x8(val);
8584 self.combine_mask32x8(half, half)
8585 }
8586 #[inline(always)]
8587 fn load_array_mask32x16(self, val: [i32; 16usize]) -> mask32x16<Self> {
8588 mask32x16 {
8589 val: unsafe { core::mem::transmute_copy(&val) },
8590 simd: self,
8591 }
8592 }
8593 #[inline(always)]
8594 fn load_array_ref_mask32x16(self, val: &[i32; 16usize]) -> mask32x16<Self> {
8595 mask32x16 {
8596 val: unsafe { core::mem::transmute_copy(val) },
8597 simd: self,
8598 }
8599 }
8600 #[inline(always)]
8601 fn as_array_mask32x16(self, a: mask32x16<Self>) -> [i32; 16usize] {
8602 unsafe { core::mem::transmute::<int32x4x4_t, [i32; 16usize]>(a.val.0) }
8603 }
8604 #[inline(always)]
8605 fn as_array_ref_mask32x16(self, a: &mask32x16<Self>) -> &[i32; 16usize] {
8606 unsafe { core::mem::transmute::<&int32x4x4_t, &[i32; 16usize]>(&a.val.0) }
8607 }
8608 #[inline(always)]
8609 fn as_array_mut_mask32x16(self, a: &mut mask32x16<Self>) -> &mut [i32; 16usize] {
8610 unsafe { core::mem::transmute::<&mut int32x4x4_t, &mut [i32; 16usize]>(&mut a.val.0) }
8611 }
8612 #[inline(always)]
8613 fn store_array_mask32x16(self, a: mask32x16<Self>, dest: &mut [i32; 16usize]) -> () {
8614 unsafe {
8615 core::ptr::copy_nonoverlapping(
8616 (&raw const a.val.0) as *const i32,
8617 dest.as_mut_ptr(),
8618 16usize,
8619 );
8620 }
8621 }
8622 #[inline(always)]
8623 fn cvt_from_bytes_mask32x16(self, a: u8x64<Self>) -> mask32x16<Self> {
8624 unsafe {
8625 mask32x16 {
8626 val: core::mem::transmute(a.val),
8627 simd: self,
8628 }
8629 }
8630 }
8631 #[inline(always)]
8632 fn cvt_to_bytes_mask32x16(self, a: mask32x16<Self>) -> u8x64<Self> {
8633 unsafe {
8634 u8x64 {
8635 val: core::mem::transmute(a.val),
8636 simd: self,
8637 }
8638 }
8639 }
8640 #[inline(always)]
8641 fn slide_mask32x16<const SHIFT: usize>(
8642 self,
8643 a: mask32x16<Self>,
8644 b: mask32x16<Self>,
8645 ) -> mask32x16<Self> {
8646 if SHIFT >= 16usize {
8647 return b;
8648 }
8649 let result = unsafe {
8650 let a_bytes = self.cvt_to_bytes_mask32x16(a).val.0;
8651 let b_bytes = self.cvt_to_bytes_mask32x16(b).val.0;
8652 let a_blocks = [a_bytes.0, a_bytes.1, a_bytes.2, a_bytes.3];
8653 let b_blocks = [b_bytes.0, b_bytes.1, b_bytes.2, b_bytes.3];
8654 let shift_bytes = SHIFT * 4usize;
8655 uint8x16x4_t(
8656 {
8657 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
8658 &a_blocks,
8659 &b_blocks,
8660 0,
8661 shift_bytes,
8662 );
8663 dyn_vext_128(lo, hi, shift_bytes % 16)
8664 },
8665 {
8666 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
8667 &a_blocks,
8668 &b_blocks,
8669 1,
8670 shift_bytes,
8671 );
8672 dyn_vext_128(lo, hi, shift_bytes % 16)
8673 },
8674 {
8675 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
8676 &a_blocks,
8677 &b_blocks,
8678 2,
8679 shift_bytes,
8680 );
8681 dyn_vext_128(lo, hi, shift_bytes % 16)
8682 },
8683 {
8684 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
8685 &a_blocks,
8686 &b_blocks,
8687 3,
8688 shift_bytes,
8689 );
8690 dyn_vext_128(lo, hi, shift_bytes % 16)
8691 },
8692 )
8693 };
8694 self.cvt_from_bytes_mask32x16(u8x64 {
8695 val: crate::support::Aligned512(result),
8696 simd: self,
8697 })
8698 }
8699 #[inline(always)]
8700 fn slide_within_blocks_mask32x16<const SHIFT: usize>(
8701 self,
8702 a: mask32x16<Self>,
8703 b: mask32x16<Self>,
8704 ) -> mask32x16<Self> {
8705 let (a0, a1) = self.split_mask32x16(a);
8706 let (b0, b1) = self.split_mask32x16(b);
8707 self.combine_mask32x8(
8708 self.slide_within_blocks_mask32x8::<SHIFT>(a0, b0),
8709 self.slide_within_blocks_mask32x8::<SHIFT>(a1, b1),
8710 )
8711 }
8712 #[inline(always)]
8713 fn and_mask32x16(self, a: mask32x16<Self>, b: mask32x16<Self>) -> mask32x16<Self> {
8714 let (a0, a1) = self.split_mask32x16(a);
8715 let (b0, b1) = self.split_mask32x16(b);
8716 self.combine_mask32x8(self.and_mask32x8(a0, b0), self.and_mask32x8(a1, b1))
8717 }
8718 #[inline(always)]
8719 fn or_mask32x16(self, a: mask32x16<Self>, b: mask32x16<Self>) -> mask32x16<Self> {
8720 let (a0, a1) = self.split_mask32x16(a);
8721 let (b0, b1) = self.split_mask32x16(b);
8722 self.combine_mask32x8(self.or_mask32x8(a0, b0), self.or_mask32x8(a1, b1))
8723 }
8724 #[inline(always)]
8725 fn xor_mask32x16(self, a: mask32x16<Self>, b: mask32x16<Self>) -> mask32x16<Self> {
8726 let (a0, a1) = self.split_mask32x16(a);
8727 let (b0, b1) = self.split_mask32x16(b);
8728 self.combine_mask32x8(self.xor_mask32x8(a0, b0), self.xor_mask32x8(a1, b1))
8729 }
8730 #[inline(always)]
8731 fn not_mask32x16(self, a: mask32x16<Self>) -> mask32x16<Self> {
8732 let (a0, a1) = self.split_mask32x16(a);
8733 self.combine_mask32x8(self.not_mask32x8(a0), self.not_mask32x8(a1))
8734 }
8735 #[inline(always)]
8736 fn select_mask32x16(
8737 self,
8738 a: mask32x16<Self>,
8739 b: mask32x16<Self>,
8740 c: mask32x16<Self>,
8741 ) -> mask32x16<Self> {
8742 let (a0, a1) = self.split_mask32x16(a);
8743 let (b0, b1) = self.split_mask32x16(b);
8744 let (c0, c1) = self.split_mask32x16(c);
8745 self.combine_mask32x8(
8746 self.select_mask32x8(a0, b0, c0),
8747 self.select_mask32x8(a1, b1, c1),
8748 )
8749 }
8750 #[inline(always)]
8751 fn simd_eq_mask32x16(self, a: mask32x16<Self>, b: mask32x16<Self>) -> mask32x16<Self> {
8752 let (a0, a1) = self.split_mask32x16(a);
8753 let (b0, b1) = self.split_mask32x16(b);
8754 self.combine_mask32x8(self.simd_eq_mask32x8(a0, b0), self.simd_eq_mask32x8(a1, b1))
8755 }
8756 #[inline(always)]
8757 fn any_true_mask32x16(self, a: mask32x16<Self>) -> bool {
8758 let (a0, a1) = self.split_mask32x16(a);
8759 self.any_true_mask32x8(a0) || self.any_true_mask32x8(a1)
8760 }
8761 #[inline(always)]
8762 fn all_true_mask32x16(self, a: mask32x16<Self>) -> bool {
8763 let (a0, a1) = self.split_mask32x16(a);
8764 self.all_true_mask32x8(a0) && self.all_true_mask32x8(a1)
8765 }
8766 #[inline(always)]
8767 fn any_false_mask32x16(self, a: mask32x16<Self>) -> bool {
8768 let (a0, a1) = self.split_mask32x16(a);
8769 self.any_false_mask32x8(a0) || self.any_false_mask32x8(a1)
8770 }
8771 #[inline(always)]
8772 fn all_false_mask32x16(self, a: mask32x16<Self>) -> bool {
8773 let (a0, a1) = self.split_mask32x16(a);
8774 self.all_false_mask32x8(a0) && self.all_false_mask32x8(a1)
8775 }
8776 #[inline(always)]
8777 fn split_mask32x16(self, a: mask32x16<Self>) -> (mask32x8<Self>, mask32x8<Self>) {
8778 (
8779 mask32x8 {
8780 val: crate::support::Aligned256(int32x4x2_t(a.val.0.0, a.val.0.1)),
8781 simd: self,
8782 },
8783 mask32x8 {
8784 val: crate::support::Aligned256(int32x4x2_t(a.val.0.2, a.val.0.3)),
8785 simd: self,
8786 },
8787 )
8788 }
8789 #[inline(always)]
8790 fn splat_f64x8(self, val: f64) -> f64x8<Self> {
8791 let half = self.splat_f64x4(val);
8792 self.combine_f64x4(half, half)
8793 }
8794 #[inline(always)]
8795 fn load_array_f64x8(self, val: [f64; 8usize]) -> f64x8<Self> {
8796 f64x8 {
8797 val: unsafe { core::mem::transmute_copy(&val) },
8798 simd: self,
8799 }
8800 }
8801 #[inline(always)]
8802 fn load_array_ref_f64x8(self, val: &[f64; 8usize]) -> f64x8<Self> {
8803 f64x8 {
8804 val: unsafe { core::mem::transmute_copy(val) },
8805 simd: self,
8806 }
8807 }
8808 #[inline(always)]
8809 fn as_array_f64x8(self, a: f64x8<Self>) -> [f64; 8usize] {
8810 unsafe { core::mem::transmute::<float64x2x4_t, [f64; 8usize]>(a.val.0) }
8811 }
8812 #[inline(always)]
8813 fn as_array_ref_f64x8(self, a: &f64x8<Self>) -> &[f64; 8usize] {
8814 unsafe { core::mem::transmute::<&float64x2x4_t, &[f64; 8usize]>(&a.val.0) }
8815 }
8816 #[inline(always)]
8817 fn as_array_mut_f64x8(self, a: &mut f64x8<Self>) -> &mut [f64; 8usize] {
8818 unsafe { core::mem::transmute::<&mut float64x2x4_t, &mut [f64; 8usize]>(&mut a.val.0) }
8819 }
8820 #[inline(always)]
8821 fn store_array_f64x8(self, a: f64x8<Self>, dest: &mut [f64; 8usize]) -> () {
8822 unsafe {
8823 core::ptr::copy_nonoverlapping(
8824 (&raw const a.val.0) as *const f64,
8825 dest.as_mut_ptr(),
8826 8usize,
8827 );
8828 }
8829 }
8830 #[inline(always)]
8831 fn cvt_from_bytes_f64x8(self, a: u8x64<Self>) -> f64x8<Self> {
8832 unsafe {
8833 f64x8 {
8834 val: core::mem::transmute(a.val),
8835 simd: self,
8836 }
8837 }
8838 }
8839 #[inline(always)]
8840 fn cvt_to_bytes_f64x8(self, a: f64x8<Self>) -> u8x64<Self> {
8841 unsafe {
8842 u8x64 {
8843 val: core::mem::transmute(a.val),
8844 simd: self,
8845 }
8846 }
8847 }
8848 #[inline(always)]
8849 fn slide_f64x8<const SHIFT: usize>(self, a: f64x8<Self>, b: f64x8<Self>) -> f64x8<Self> {
8850 if SHIFT >= 8usize {
8851 return b;
8852 }
8853 let result = unsafe {
8854 let a_bytes = self.cvt_to_bytes_f64x8(a).val.0;
8855 let b_bytes = self.cvt_to_bytes_f64x8(b).val.0;
8856 let a_blocks = [a_bytes.0, a_bytes.1, a_bytes.2, a_bytes.3];
8857 let b_blocks = [b_bytes.0, b_bytes.1, b_bytes.2, b_bytes.3];
8858 let shift_bytes = SHIFT * 8usize;
8859 uint8x16x4_t(
8860 {
8861 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
8862 &a_blocks,
8863 &b_blocks,
8864 0,
8865 shift_bytes,
8866 );
8867 dyn_vext_128(lo, hi, shift_bytes % 16)
8868 },
8869 {
8870 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
8871 &a_blocks,
8872 &b_blocks,
8873 1,
8874 shift_bytes,
8875 );
8876 dyn_vext_128(lo, hi, shift_bytes % 16)
8877 },
8878 {
8879 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
8880 &a_blocks,
8881 &b_blocks,
8882 2,
8883 shift_bytes,
8884 );
8885 dyn_vext_128(lo, hi, shift_bytes % 16)
8886 },
8887 {
8888 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
8889 &a_blocks,
8890 &b_blocks,
8891 3,
8892 shift_bytes,
8893 );
8894 dyn_vext_128(lo, hi, shift_bytes % 16)
8895 },
8896 )
8897 };
8898 self.cvt_from_bytes_f64x8(u8x64 {
8899 val: crate::support::Aligned512(result),
8900 simd: self,
8901 })
8902 }
8903 #[inline(always)]
8904 fn slide_within_blocks_f64x8<const SHIFT: usize>(
8905 self,
8906 a: f64x8<Self>,
8907 b: f64x8<Self>,
8908 ) -> f64x8<Self> {
8909 let (a0, a1) = self.split_f64x8(a);
8910 let (b0, b1) = self.split_f64x8(b);
8911 self.combine_f64x4(
8912 self.slide_within_blocks_f64x4::<SHIFT>(a0, b0),
8913 self.slide_within_blocks_f64x4::<SHIFT>(a1, b1),
8914 )
8915 }
8916 #[inline(always)]
8917 fn abs_f64x8(self, a: f64x8<Self>) -> f64x8<Self> {
8918 let (a0, a1) = self.split_f64x8(a);
8919 self.combine_f64x4(self.abs_f64x4(a0), self.abs_f64x4(a1))
8920 }
8921 #[inline(always)]
8922 fn neg_f64x8(self, a: f64x8<Self>) -> f64x8<Self> {
8923 let (a0, a1) = self.split_f64x8(a);
8924 self.combine_f64x4(self.neg_f64x4(a0), self.neg_f64x4(a1))
8925 }
8926 #[inline(always)]
8927 fn sqrt_f64x8(self, a: f64x8<Self>) -> f64x8<Self> {
8928 let (a0, a1) = self.split_f64x8(a);
8929 self.combine_f64x4(self.sqrt_f64x4(a0), self.sqrt_f64x4(a1))
8930 }
8931 #[inline(always)]
8932 fn add_f64x8(self, a: f64x8<Self>, b: f64x8<Self>) -> f64x8<Self> {
8933 let (a0, a1) = self.split_f64x8(a);
8934 let (b0, b1) = self.split_f64x8(b);
8935 self.combine_f64x4(self.add_f64x4(a0, b0), self.add_f64x4(a1, b1))
8936 }
8937 #[inline(always)]
8938 fn sub_f64x8(self, a: f64x8<Self>, b: f64x8<Self>) -> f64x8<Self> {
8939 let (a0, a1) = self.split_f64x8(a);
8940 let (b0, b1) = self.split_f64x8(b);
8941 self.combine_f64x4(self.sub_f64x4(a0, b0), self.sub_f64x4(a1, b1))
8942 }
8943 #[inline(always)]
8944 fn mul_f64x8(self, a: f64x8<Self>, b: f64x8<Self>) -> f64x8<Self> {
8945 let (a0, a1) = self.split_f64x8(a);
8946 let (b0, b1) = self.split_f64x8(b);
8947 self.combine_f64x4(self.mul_f64x4(a0, b0), self.mul_f64x4(a1, b1))
8948 }
8949 #[inline(always)]
8950 fn div_f64x8(self, a: f64x8<Self>, b: f64x8<Self>) -> f64x8<Self> {
8951 let (a0, a1) = self.split_f64x8(a);
8952 let (b0, b1) = self.split_f64x8(b);
8953 self.combine_f64x4(self.div_f64x4(a0, b0), self.div_f64x4(a1, b1))
8954 }
8955 #[inline(always)]
8956 fn copysign_f64x8(self, a: f64x8<Self>, b: f64x8<Self>) -> f64x8<Self> {
8957 let (a0, a1) = self.split_f64x8(a);
8958 let (b0, b1) = self.split_f64x8(b);
8959 self.combine_f64x4(self.copysign_f64x4(a0, b0), self.copysign_f64x4(a1, b1))
8960 }
8961 #[inline(always)]
8962 fn simd_eq_f64x8(self, a: f64x8<Self>, b: f64x8<Self>) -> mask64x8<Self> {
8963 let (a0, a1) = self.split_f64x8(a);
8964 let (b0, b1) = self.split_f64x8(b);
8965 self.combine_mask64x4(self.simd_eq_f64x4(a0, b0), self.simd_eq_f64x4(a1, b1))
8966 }
8967 #[inline(always)]
8968 fn simd_lt_f64x8(self, a: f64x8<Self>, b: f64x8<Self>) -> mask64x8<Self> {
8969 let (a0, a1) = self.split_f64x8(a);
8970 let (b0, b1) = self.split_f64x8(b);
8971 self.combine_mask64x4(self.simd_lt_f64x4(a0, b0), self.simd_lt_f64x4(a1, b1))
8972 }
8973 #[inline(always)]
8974 fn simd_le_f64x8(self, a: f64x8<Self>, b: f64x8<Self>) -> mask64x8<Self> {
8975 let (a0, a1) = self.split_f64x8(a);
8976 let (b0, b1) = self.split_f64x8(b);
8977 self.combine_mask64x4(self.simd_le_f64x4(a0, b0), self.simd_le_f64x4(a1, b1))
8978 }
8979 #[inline(always)]
8980 fn simd_ge_f64x8(self, a: f64x8<Self>, b: f64x8<Self>) -> mask64x8<Self> {
8981 let (a0, a1) = self.split_f64x8(a);
8982 let (b0, b1) = self.split_f64x8(b);
8983 self.combine_mask64x4(self.simd_ge_f64x4(a0, b0), self.simd_ge_f64x4(a1, b1))
8984 }
8985 #[inline(always)]
8986 fn simd_gt_f64x8(self, a: f64x8<Self>, b: f64x8<Self>) -> mask64x8<Self> {
8987 let (a0, a1) = self.split_f64x8(a);
8988 let (b0, b1) = self.split_f64x8(b);
8989 self.combine_mask64x4(self.simd_gt_f64x4(a0, b0), self.simd_gt_f64x4(a1, b1))
8990 }
8991 #[inline(always)]
8992 fn zip_low_f64x8(self, a: f64x8<Self>, b: f64x8<Self>) -> f64x8<Self> {
8993 let (a0, _) = self.split_f64x8(a);
8994 let (b0, _) = self.split_f64x8(b);
8995 self.combine_f64x4(self.zip_low_f64x4(a0, b0), self.zip_high_f64x4(a0, b0))
8996 }
8997 #[inline(always)]
8998 fn zip_high_f64x8(self, a: f64x8<Self>, b: f64x8<Self>) -> f64x8<Self> {
8999 let (_, a1) = self.split_f64x8(a);
9000 let (_, b1) = self.split_f64x8(b);
9001 self.combine_f64x4(self.zip_low_f64x4(a1, b1), self.zip_high_f64x4(a1, b1))
9002 }
9003 #[inline(always)]
9004 fn unzip_low_f64x8(self, a: f64x8<Self>, b: f64x8<Self>) -> f64x8<Self> {
9005 let (a0, a1) = self.split_f64x8(a);
9006 let (b0, b1) = self.split_f64x8(b);
9007 self.combine_f64x4(self.unzip_low_f64x4(a0, a1), self.unzip_low_f64x4(b0, b1))
9008 }
9009 #[inline(always)]
9010 fn unzip_high_f64x8(self, a: f64x8<Self>, b: f64x8<Self>) -> f64x8<Self> {
9011 let (a0, a1) = self.split_f64x8(a);
9012 let (b0, b1) = self.split_f64x8(b);
9013 self.combine_f64x4(self.unzip_high_f64x4(a0, a1), self.unzip_high_f64x4(b0, b1))
9014 }
9015 #[inline(always)]
9016 fn interleave_f64x8(self, a: f64x8<Self>, b: f64x8<Self>) -> (f64x8<Self>, f64x8<Self>) {
9017 let (a0, a1) = self.split_f64x8(a);
9018 let (b0, b1) = self.split_f64x8(b);
9019 let lo_lo = self.zip_low_f64x4(a0, b0);
9020 let lo_hi = self.zip_high_f64x4(a0, b0);
9021 let hi_lo = self.zip_low_f64x4(a1, b1);
9022 let hi_hi = self.zip_high_f64x4(a1, b1);
9023 (
9024 self.combine_f64x4(lo_lo, lo_hi),
9025 self.combine_f64x4(hi_lo, hi_hi),
9026 )
9027 }
9028 #[inline(always)]
9029 fn deinterleave_f64x8(self, a: f64x8<Self>, b: f64x8<Self>) -> (f64x8<Self>, f64x8<Self>) {
9030 let (a0, a1) = self.split_f64x8(a);
9031 let (b0, b1) = self.split_f64x8(b);
9032 let lo_even = self.unzip_low_f64x4(a0, a1);
9033 let lo_odd = self.unzip_high_f64x4(a0, a1);
9034 let hi_even = self.unzip_low_f64x4(b0, b1);
9035 let hi_odd = self.unzip_high_f64x4(b0, b1);
9036 (
9037 self.combine_f64x4(lo_even, hi_even),
9038 self.combine_f64x4(lo_odd, hi_odd),
9039 )
9040 }
9041 #[inline(always)]
9042 fn max_f64x8(self, a: f64x8<Self>, b: f64x8<Self>) -> f64x8<Self> {
9043 let (a0, a1) = self.split_f64x8(a);
9044 let (b0, b1) = self.split_f64x8(b);
9045 self.combine_f64x4(self.max_f64x4(a0, b0), self.max_f64x4(a1, b1))
9046 }
9047 #[inline(always)]
9048 fn min_f64x8(self, a: f64x8<Self>, b: f64x8<Self>) -> f64x8<Self> {
9049 let (a0, a1) = self.split_f64x8(a);
9050 let (b0, b1) = self.split_f64x8(b);
9051 self.combine_f64x4(self.min_f64x4(a0, b0), self.min_f64x4(a1, b1))
9052 }
9053 #[inline(always)]
9054 fn max_precise_f64x8(self, a: f64x8<Self>, b: f64x8<Self>) -> f64x8<Self> {
9055 let (a0, a1) = self.split_f64x8(a);
9056 let (b0, b1) = self.split_f64x8(b);
9057 self.combine_f64x4(
9058 self.max_precise_f64x4(a0, b0),
9059 self.max_precise_f64x4(a1, b1),
9060 )
9061 }
9062 #[inline(always)]
9063 fn min_precise_f64x8(self, a: f64x8<Self>, b: f64x8<Self>) -> f64x8<Self> {
9064 let (a0, a1) = self.split_f64x8(a);
9065 let (b0, b1) = self.split_f64x8(b);
9066 self.combine_f64x4(
9067 self.min_precise_f64x4(a0, b0),
9068 self.min_precise_f64x4(a1, b1),
9069 )
9070 }
9071 #[inline(always)]
9072 fn mul_add_f64x8(self, a: f64x8<Self>, b: f64x8<Self>, c: f64x8<Self>) -> f64x8<Self> {
9073 let (a0, a1) = self.split_f64x8(a);
9074 let (b0, b1) = self.split_f64x8(b);
9075 let (c0, c1) = self.split_f64x8(c);
9076 self.combine_f64x4(
9077 self.mul_add_f64x4(a0, b0, c0),
9078 self.mul_add_f64x4(a1, b1, c1),
9079 )
9080 }
9081 #[inline(always)]
9082 fn mul_sub_f64x8(self, a: f64x8<Self>, b: f64x8<Self>, c: f64x8<Self>) -> f64x8<Self> {
9083 let (a0, a1) = self.split_f64x8(a);
9084 let (b0, b1) = self.split_f64x8(b);
9085 let (c0, c1) = self.split_f64x8(c);
9086 self.combine_f64x4(
9087 self.mul_sub_f64x4(a0, b0, c0),
9088 self.mul_sub_f64x4(a1, b1, c1),
9089 )
9090 }
9091 #[inline(always)]
9092 fn floor_f64x8(self, a: f64x8<Self>) -> f64x8<Self> {
9093 let (a0, a1) = self.split_f64x8(a);
9094 self.combine_f64x4(self.floor_f64x4(a0), self.floor_f64x4(a1))
9095 }
9096 #[inline(always)]
9097 fn ceil_f64x8(self, a: f64x8<Self>) -> f64x8<Self> {
9098 let (a0, a1) = self.split_f64x8(a);
9099 self.combine_f64x4(self.ceil_f64x4(a0), self.ceil_f64x4(a1))
9100 }
9101 #[inline(always)]
9102 fn round_ties_even_f64x8(self, a: f64x8<Self>) -> f64x8<Self> {
9103 let (a0, a1) = self.split_f64x8(a);
9104 self.combine_f64x4(
9105 self.round_ties_even_f64x4(a0),
9106 self.round_ties_even_f64x4(a1),
9107 )
9108 }
9109 #[inline(always)]
9110 fn fract_f64x8(self, a: f64x8<Self>) -> f64x8<Self> {
9111 let (a0, a1) = self.split_f64x8(a);
9112 self.combine_f64x4(self.fract_f64x4(a0), self.fract_f64x4(a1))
9113 }
9114 #[inline(always)]
9115 fn trunc_f64x8(self, a: f64x8<Self>) -> f64x8<Self> {
9116 let (a0, a1) = self.split_f64x8(a);
9117 self.combine_f64x4(self.trunc_f64x4(a0), self.trunc_f64x4(a1))
9118 }
9119 #[inline(always)]
9120 fn select_f64x8(self, a: mask64x8<Self>, b: f64x8<Self>, c: f64x8<Self>) -> f64x8<Self> {
9121 let (a0, a1) = self.split_mask64x8(a);
9122 let (b0, b1) = self.split_f64x8(b);
9123 let (c0, c1) = self.split_f64x8(c);
9124 self.combine_f64x4(self.select_f64x4(a0, b0, c0), self.select_f64x4(a1, b1, c1))
9125 }
9126 #[inline(always)]
9127 fn split_f64x8(self, a: f64x8<Self>) -> (f64x4<Self>, f64x4<Self>) {
9128 (
9129 f64x4 {
9130 val: crate::support::Aligned256(float64x2x2_t(a.val.0.0, a.val.0.1)),
9131 simd: self,
9132 },
9133 f64x4 {
9134 val: crate::support::Aligned256(float64x2x2_t(a.val.0.2, a.val.0.3)),
9135 simd: self,
9136 },
9137 )
9138 }
9139 #[inline(always)]
9140 fn reinterpret_f32_f64x8(self, a: f64x8<Self>) -> f32x16<Self> {
9141 let (a0, a1) = self.split_f64x8(a);
9142 self.combine_f32x8(
9143 self.reinterpret_f32_f64x4(a0),
9144 self.reinterpret_f32_f64x4(a1),
9145 )
9146 }
9147 #[inline(always)]
9148 fn splat_mask64x8(self, val: i64) -> mask64x8<Self> {
9149 let half = self.splat_mask64x4(val);
9150 self.combine_mask64x4(half, half)
9151 }
9152 #[inline(always)]
9153 fn load_array_mask64x8(self, val: [i64; 8usize]) -> mask64x8<Self> {
9154 mask64x8 {
9155 val: unsafe { core::mem::transmute_copy(&val) },
9156 simd: self,
9157 }
9158 }
9159 #[inline(always)]
9160 fn load_array_ref_mask64x8(self, val: &[i64; 8usize]) -> mask64x8<Self> {
9161 mask64x8 {
9162 val: unsafe { core::mem::transmute_copy(val) },
9163 simd: self,
9164 }
9165 }
9166 #[inline(always)]
9167 fn as_array_mask64x8(self, a: mask64x8<Self>) -> [i64; 8usize] {
9168 unsafe { core::mem::transmute::<int64x2x4_t, [i64; 8usize]>(a.val.0) }
9169 }
9170 #[inline(always)]
9171 fn as_array_ref_mask64x8(self, a: &mask64x8<Self>) -> &[i64; 8usize] {
9172 unsafe { core::mem::transmute::<&int64x2x4_t, &[i64; 8usize]>(&a.val.0) }
9173 }
9174 #[inline(always)]
9175 fn as_array_mut_mask64x8(self, a: &mut mask64x8<Self>) -> &mut [i64; 8usize] {
9176 unsafe { core::mem::transmute::<&mut int64x2x4_t, &mut [i64; 8usize]>(&mut a.val.0) }
9177 }
9178 #[inline(always)]
9179 fn store_array_mask64x8(self, a: mask64x8<Self>, dest: &mut [i64; 8usize]) -> () {
9180 unsafe {
9181 core::ptr::copy_nonoverlapping(
9182 (&raw const a.val.0) as *const i64,
9183 dest.as_mut_ptr(),
9184 8usize,
9185 );
9186 }
9187 }
9188 #[inline(always)]
9189 fn cvt_from_bytes_mask64x8(self, a: u8x64<Self>) -> mask64x8<Self> {
9190 unsafe {
9191 mask64x8 {
9192 val: core::mem::transmute(a.val),
9193 simd: self,
9194 }
9195 }
9196 }
9197 #[inline(always)]
9198 fn cvt_to_bytes_mask64x8(self, a: mask64x8<Self>) -> u8x64<Self> {
9199 unsafe {
9200 u8x64 {
9201 val: core::mem::transmute(a.val),
9202 simd: self,
9203 }
9204 }
9205 }
9206 #[inline(always)]
9207 fn slide_mask64x8<const SHIFT: usize>(
9208 self,
9209 a: mask64x8<Self>,
9210 b: mask64x8<Self>,
9211 ) -> mask64x8<Self> {
9212 if SHIFT >= 8usize {
9213 return b;
9214 }
9215 let result = unsafe {
9216 let a_bytes = self.cvt_to_bytes_mask64x8(a).val.0;
9217 let b_bytes = self.cvt_to_bytes_mask64x8(b).val.0;
9218 let a_blocks = [a_bytes.0, a_bytes.1, a_bytes.2, a_bytes.3];
9219 let b_blocks = [b_bytes.0, b_bytes.1, b_bytes.2, b_bytes.3];
9220 let shift_bytes = SHIFT * 8usize;
9221 uint8x16x4_t(
9222 {
9223 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
9224 &a_blocks,
9225 &b_blocks,
9226 0,
9227 shift_bytes,
9228 );
9229 dyn_vext_128(lo, hi, shift_bytes % 16)
9230 },
9231 {
9232 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
9233 &a_blocks,
9234 &b_blocks,
9235 1,
9236 shift_bytes,
9237 );
9238 dyn_vext_128(lo, hi, shift_bytes % 16)
9239 },
9240 {
9241 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
9242 &a_blocks,
9243 &b_blocks,
9244 2,
9245 shift_bytes,
9246 );
9247 dyn_vext_128(lo, hi, shift_bytes % 16)
9248 },
9249 {
9250 let [lo, hi] = crate::support::cross_block_slide_blocks_at(
9251 &a_blocks,
9252 &b_blocks,
9253 3,
9254 shift_bytes,
9255 );
9256 dyn_vext_128(lo, hi, shift_bytes % 16)
9257 },
9258 )
9259 };
9260 self.cvt_from_bytes_mask64x8(u8x64 {
9261 val: crate::support::Aligned512(result),
9262 simd: self,
9263 })
9264 }
9265 #[inline(always)]
9266 fn slide_within_blocks_mask64x8<const SHIFT: usize>(
9267 self,
9268 a: mask64x8<Self>,
9269 b: mask64x8<Self>,
9270 ) -> mask64x8<Self> {
9271 let (a0, a1) = self.split_mask64x8(a);
9272 let (b0, b1) = self.split_mask64x8(b);
9273 self.combine_mask64x4(
9274 self.slide_within_blocks_mask64x4::<SHIFT>(a0, b0),
9275 self.slide_within_blocks_mask64x4::<SHIFT>(a1, b1),
9276 )
9277 }
9278 #[inline(always)]
9279 fn and_mask64x8(self, a: mask64x8<Self>, b: mask64x8<Self>) -> mask64x8<Self> {
9280 let (a0, a1) = self.split_mask64x8(a);
9281 let (b0, b1) = self.split_mask64x8(b);
9282 self.combine_mask64x4(self.and_mask64x4(a0, b0), self.and_mask64x4(a1, b1))
9283 }
9284 #[inline(always)]
9285 fn or_mask64x8(self, a: mask64x8<Self>, b: mask64x8<Self>) -> mask64x8<Self> {
9286 let (a0, a1) = self.split_mask64x8(a);
9287 let (b0, b1) = self.split_mask64x8(b);
9288 self.combine_mask64x4(self.or_mask64x4(a0, b0), self.or_mask64x4(a1, b1))
9289 }
9290 #[inline(always)]
9291 fn xor_mask64x8(self, a: mask64x8<Self>, b: mask64x8<Self>) -> mask64x8<Self> {
9292 let (a0, a1) = self.split_mask64x8(a);
9293 let (b0, b1) = self.split_mask64x8(b);
9294 self.combine_mask64x4(self.xor_mask64x4(a0, b0), self.xor_mask64x4(a1, b1))
9295 }
9296 #[inline(always)]
9297 fn not_mask64x8(self, a: mask64x8<Self>) -> mask64x8<Self> {
9298 let (a0, a1) = self.split_mask64x8(a);
9299 self.combine_mask64x4(self.not_mask64x4(a0), self.not_mask64x4(a1))
9300 }
9301 #[inline(always)]
9302 fn select_mask64x8(
9303 self,
9304 a: mask64x8<Self>,
9305 b: mask64x8<Self>,
9306 c: mask64x8<Self>,
9307 ) -> mask64x8<Self> {
9308 let (a0, a1) = self.split_mask64x8(a);
9309 let (b0, b1) = self.split_mask64x8(b);
9310 let (c0, c1) = self.split_mask64x8(c);
9311 self.combine_mask64x4(
9312 self.select_mask64x4(a0, b0, c0),
9313 self.select_mask64x4(a1, b1, c1),
9314 )
9315 }
9316 #[inline(always)]
9317 fn simd_eq_mask64x8(self, a: mask64x8<Self>, b: mask64x8<Self>) -> mask64x8<Self> {
9318 let (a0, a1) = self.split_mask64x8(a);
9319 let (b0, b1) = self.split_mask64x8(b);
9320 self.combine_mask64x4(self.simd_eq_mask64x4(a0, b0), self.simd_eq_mask64x4(a1, b1))
9321 }
9322 #[inline(always)]
9323 fn any_true_mask64x8(self, a: mask64x8<Self>) -> bool {
9324 let (a0, a1) = self.split_mask64x8(a);
9325 self.any_true_mask64x4(a0) || self.any_true_mask64x4(a1)
9326 }
9327 #[inline(always)]
9328 fn all_true_mask64x8(self, a: mask64x8<Self>) -> bool {
9329 let (a0, a1) = self.split_mask64x8(a);
9330 self.all_true_mask64x4(a0) && self.all_true_mask64x4(a1)
9331 }
9332 #[inline(always)]
9333 fn any_false_mask64x8(self, a: mask64x8<Self>) -> bool {
9334 let (a0, a1) = self.split_mask64x8(a);
9335 self.any_false_mask64x4(a0) || self.any_false_mask64x4(a1)
9336 }
9337 #[inline(always)]
9338 fn all_false_mask64x8(self, a: mask64x8<Self>) -> bool {
9339 let (a0, a1) = self.split_mask64x8(a);
9340 self.all_false_mask64x4(a0) && self.all_false_mask64x4(a1)
9341 }
9342 #[inline(always)]
9343 fn split_mask64x8(self, a: mask64x8<Self>) -> (mask64x4<Self>, mask64x4<Self>) {
9344 (
9345 mask64x4 {
9346 val: crate::support::Aligned256(int64x2x2_t(a.val.0.0, a.val.0.1)),
9347 simd: self,
9348 },
9349 mask64x4 {
9350 val: crate::support::Aligned256(int64x2x2_t(a.val.0.2, a.val.0.3)),
9351 simd: self,
9352 },
9353 )
9354 }
9355 }
9356 impl<S: Simd> SimdFrom<float32x4_t, S> for f32x4<S> {
9357 #[inline(always)]
9358 fn simd_from(simd: S, arch: float32x4_t) -> Self {
9359 Self {
9360 val: unsafe { core::mem::transmute_copy(&arch) },
9361 simd,
9362 }
9363 }
9364 }
9365 impl<S: Simd> From<f32x4<S>> for float32x4_t {
9366 #[inline(always)]
9367 fn from(value: f32x4<S>) -> Self {
9368 unsafe { core::mem::transmute_copy(&value.val) }
9369 }
9370 }
9371 impl<S: Simd> SimdFrom<int8x16_t, S> for i8x16<S> {
9372 #[inline(always)]
9373 fn simd_from(simd: S, arch: int8x16_t) -> Self {
9374 Self {
9375 val: unsafe { core::mem::transmute_copy(&arch) },
9376 simd,
9377 }
9378 }
9379 }
9380 impl<S: Simd> From<i8x16<S>> for int8x16_t {
9381 #[inline(always)]
9382 fn from(value: i8x16<S>) -> Self {
9383 unsafe { core::mem::transmute_copy(&value.val) }
9384 }
9385 }
9386 impl<S: Simd> SimdFrom<uint8x16_t, S> for u8x16<S> {
9387 #[inline(always)]
9388 fn simd_from(simd: S, arch: uint8x16_t) -> Self {
9389 Self {
9390 val: unsafe { core::mem::transmute_copy(&arch) },
9391 simd,
9392 }
9393 }
9394 }
9395 impl<S: Simd> From<u8x16<S>> for uint8x16_t {
9396 #[inline(always)]
9397 fn from(value: u8x16<S>) -> Self {
9398 unsafe { core::mem::transmute_copy(&value.val) }
9399 }
9400 }
9401 impl<S: Simd> SimdFrom<int8x16_t, S> for mask8x16<S> {
9402 #[inline(always)]
9403 fn simd_from(simd: S, arch: int8x16_t) -> Self {
9404 Self {
9405 val: unsafe { core::mem::transmute_copy(&arch) },
9406 simd,
9407 }
9408 }
9409 }
9410 impl<S: Simd> From<mask8x16<S>> for int8x16_t {
9411 #[inline(always)]
9412 fn from(value: mask8x16<S>) -> Self {
9413 unsafe { core::mem::transmute_copy(&value.val) }
9414 }
9415 }
9416 impl<S: Simd> SimdFrom<int16x8_t, S> for i16x8<S> {
9417 #[inline(always)]
9418 fn simd_from(simd: S, arch: int16x8_t) -> Self {
9419 Self {
9420 val: unsafe { core::mem::transmute_copy(&arch) },
9421 simd,
9422 }
9423 }
9424 }
9425 impl<S: Simd> From<i16x8<S>> for int16x8_t {
9426 #[inline(always)]
9427 fn from(value: i16x8<S>) -> Self {
9428 unsafe { core::mem::transmute_copy(&value.val) }
9429 }
9430 }
9431 impl<S: Simd> SimdFrom<uint16x8_t, S> for u16x8<S> {
9432 #[inline(always)]
9433 fn simd_from(simd: S, arch: uint16x8_t) -> Self {
9434 Self {
9435 val: unsafe { core::mem::transmute_copy(&arch) },
9436 simd,
9437 }
9438 }
9439 }
9440 impl<S: Simd> From<u16x8<S>> for uint16x8_t {
9441 #[inline(always)]
9442 fn from(value: u16x8<S>) -> Self {
9443 unsafe { core::mem::transmute_copy(&value.val) }
9444 }
9445 }
9446 impl<S: Simd> SimdFrom<int16x8_t, S> for mask16x8<S> {
9447 #[inline(always)]
9448 fn simd_from(simd: S, arch: int16x8_t) -> Self {
9449 Self {
9450 val: unsafe { core::mem::transmute_copy(&arch) },
9451 simd,
9452 }
9453 }
9454 }
9455 impl<S: Simd> From<mask16x8<S>> for int16x8_t {
9456 #[inline(always)]
9457 fn from(value: mask16x8<S>) -> Self {
9458 unsafe { core::mem::transmute_copy(&value.val) }
9459 }
9460 }
9461 impl<S: Simd> SimdFrom<int32x4_t, S> for i32x4<S> {
9462 #[inline(always)]
9463 fn simd_from(simd: S, arch: int32x4_t) -> Self {
9464 Self {
9465 val: unsafe { core::mem::transmute_copy(&arch) },
9466 simd,
9467 }
9468 }
9469 }
9470 impl<S: Simd> From<i32x4<S>> for int32x4_t {
9471 #[inline(always)]
9472 fn from(value: i32x4<S>) -> Self {
9473 unsafe { core::mem::transmute_copy(&value.val) }
9474 }
9475 }
9476 impl<S: Simd> SimdFrom<uint32x4_t, S> for u32x4<S> {
9477 #[inline(always)]
9478 fn simd_from(simd: S, arch: uint32x4_t) -> Self {
9479 Self {
9480 val: unsafe { core::mem::transmute_copy(&arch) },
9481 simd,
9482 }
9483 }
9484 }
9485 impl<S: Simd> From<u32x4<S>> for uint32x4_t {
9486 #[inline(always)]
9487 fn from(value: u32x4<S>) -> Self {
9488 unsafe { core::mem::transmute_copy(&value.val) }
9489 }
9490 }
9491 impl<S: Simd> SimdFrom<int32x4_t, S> for mask32x4<S> {
9492 #[inline(always)]
9493 fn simd_from(simd: S, arch: int32x4_t) -> Self {
9494 Self {
9495 val: unsafe { core::mem::transmute_copy(&arch) },
9496 simd,
9497 }
9498 }
9499 }
9500 impl<S: Simd> From<mask32x4<S>> for int32x4_t {
9501 #[inline(always)]
9502 fn from(value: mask32x4<S>) -> Self {
9503 unsafe { core::mem::transmute_copy(&value.val) }
9504 }
9505 }
9506 impl<S: Simd> SimdFrom<float64x2_t, S> for f64x2<S> {
9507 #[inline(always)]
9508 fn simd_from(simd: S, arch: float64x2_t) -> Self {
9509 Self {
9510 val: unsafe { core::mem::transmute_copy(&arch) },
9511 simd,
9512 }
9513 }
9514 }
9515 impl<S: Simd> From<f64x2<S>> for float64x2_t {
9516 #[inline(always)]
9517 fn from(value: f64x2<S>) -> Self {
9518 unsafe { core::mem::transmute_copy(&value.val) }
9519 }
9520 }
9521 impl<S: Simd> SimdFrom<int64x2_t, S> for mask64x2<S> {
9522 #[inline(always)]
9523 fn simd_from(simd: S, arch: int64x2_t) -> Self {
9524 Self {
9525 val: unsafe { core::mem::transmute_copy(&arch) },
9526 simd,
9527 }
9528 }
9529 }
9530 impl<S: Simd> From<mask64x2<S>> for int64x2_t {
9531 #[inline(always)]
9532 fn from(value: mask64x2<S>) -> Self {
9533 unsafe { core::mem::transmute_copy(&value.val) }
9534 }
9535 }
9536 impl<S: Simd> SimdFrom<float32x4x2_t, S> for f32x8<S> {
9537 #[inline(always)]
9538 fn simd_from(simd: S, arch: float32x4x2_t) -> Self {
9539 Self {
9540 val: unsafe { core::mem::transmute_copy(&arch) },
9541 simd,
9542 }
9543 }
9544 }
9545 impl<S: Simd> From<f32x8<S>> for float32x4x2_t {
9546 #[inline(always)]
9547 fn from(value: f32x8<S>) -> Self {
9548 unsafe { core::mem::transmute_copy(&value.val) }
9549 }
9550 }
9551 impl<S: Simd> SimdFrom<int8x16x2_t, S> for i8x32<S> {
9552 #[inline(always)]
9553 fn simd_from(simd: S, arch: int8x16x2_t) -> Self {
9554 Self {
9555 val: unsafe { core::mem::transmute_copy(&arch) },
9556 simd,
9557 }
9558 }
9559 }
9560 impl<S: Simd> From<i8x32<S>> for int8x16x2_t {
9561 #[inline(always)]
9562 fn from(value: i8x32<S>) -> Self {
9563 unsafe { core::mem::transmute_copy(&value.val) }
9564 }
9565 }
9566 impl<S: Simd> SimdFrom<uint8x16x2_t, S> for u8x32<S> {
9567 #[inline(always)]
9568 fn simd_from(simd: S, arch: uint8x16x2_t) -> Self {
9569 Self {
9570 val: unsafe { core::mem::transmute_copy(&arch) },
9571 simd,
9572 }
9573 }
9574 }
9575 impl<S: Simd> From<u8x32<S>> for uint8x16x2_t {
9576 #[inline(always)]
9577 fn from(value: u8x32<S>) -> Self {
9578 unsafe { core::mem::transmute_copy(&value.val) }
9579 }
9580 }
9581 impl<S: Simd> SimdFrom<int8x16x2_t, S> for mask8x32<S> {
9582 #[inline(always)]
9583 fn simd_from(simd: S, arch: int8x16x2_t) -> Self {
9584 Self {
9585 val: unsafe { core::mem::transmute_copy(&arch) },
9586 simd,
9587 }
9588 }
9589 }
9590 impl<S: Simd> From<mask8x32<S>> for int8x16x2_t {
9591 #[inline(always)]
9592 fn from(value: mask8x32<S>) -> Self {
9593 unsafe { core::mem::transmute_copy(&value.val) }
9594 }
9595 }
9596 impl<S: Simd> SimdFrom<int16x8x2_t, S> for i16x16<S> {
9597 #[inline(always)]
9598 fn simd_from(simd: S, arch: int16x8x2_t) -> Self {
9599 Self {
9600 val: unsafe { core::mem::transmute_copy(&arch) },
9601 simd,
9602 }
9603 }
9604 }
9605 impl<S: Simd> From<i16x16<S>> for int16x8x2_t {
9606 #[inline(always)]
9607 fn from(value: i16x16<S>) -> Self {
9608 unsafe { core::mem::transmute_copy(&value.val) }
9609 }
9610 }
9611 impl<S: Simd> SimdFrom<uint16x8x2_t, S> for u16x16<S> {
9612 #[inline(always)]
9613 fn simd_from(simd: S, arch: uint16x8x2_t) -> Self {
9614 Self {
9615 val: unsafe { core::mem::transmute_copy(&arch) },
9616 simd,
9617 }
9618 }
9619 }
9620 impl<S: Simd> From<u16x16<S>> for uint16x8x2_t {
9621 #[inline(always)]
9622 fn from(value: u16x16<S>) -> Self {
9623 unsafe { core::mem::transmute_copy(&value.val) }
9624 }
9625 }
9626 impl<S: Simd> SimdFrom<int16x8x2_t, S> for mask16x16<S> {
9627 #[inline(always)]
9628 fn simd_from(simd: S, arch: int16x8x2_t) -> Self {
9629 Self {
9630 val: unsafe { core::mem::transmute_copy(&arch) },
9631 simd,
9632 }
9633 }
9634 }
9635 impl<S: Simd> From<mask16x16<S>> for int16x8x2_t {
9636 #[inline(always)]
9637 fn from(value: mask16x16<S>) -> Self {
9638 unsafe { core::mem::transmute_copy(&value.val) }
9639 }
9640 }
9641 impl<S: Simd> SimdFrom<int32x4x2_t, S> for i32x8<S> {
9642 #[inline(always)]
9643 fn simd_from(simd: S, arch: int32x4x2_t) -> Self {
9644 Self {
9645 val: unsafe { core::mem::transmute_copy(&arch) },
9646 simd,
9647 }
9648 }
9649 }
9650 impl<S: Simd> From<i32x8<S>> for int32x4x2_t {
9651 #[inline(always)]
9652 fn from(value: i32x8<S>) -> Self {
9653 unsafe { core::mem::transmute_copy(&value.val) }
9654 }
9655 }
9656 impl<S: Simd> SimdFrom<uint32x4x2_t, S> for u32x8<S> {
9657 #[inline(always)]
9658 fn simd_from(simd: S, arch: uint32x4x2_t) -> Self {
9659 Self {
9660 val: unsafe { core::mem::transmute_copy(&arch) },
9661 simd,
9662 }
9663 }
9664 }
9665 impl<S: Simd> From<u32x8<S>> for uint32x4x2_t {
9666 #[inline(always)]
9667 fn from(value: u32x8<S>) -> Self {
9668 unsafe { core::mem::transmute_copy(&value.val) }
9669 }
9670 }
9671 impl<S: Simd> SimdFrom<int32x4x2_t, S> for mask32x8<S> {
9672 #[inline(always)]
9673 fn simd_from(simd: S, arch: int32x4x2_t) -> Self {
9674 Self {
9675 val: unsafe { core::mem::transmute_copy(&arch) },
9676 simd,
9677 }
9678 }
9679 }
9680 impl<S: Simd> From<mask32x8<S>> for int32x4x2_t {
9681 #[inline(always)]
9682 fn from(value: mask32x8<S>) -> Self {
9683 unsafe { core::mem::transmute_copy(&value.val) }
9684 }
9685 }
9686 impl<S: Simd> SimdFrom<float64x2x2_t, S> for f64x4<S> {
9687 #[inline(always)]
9688 fn simd_from(simd: S, arch: float64x2x2_t) -> Self {
9689 Self {
9690 val: unsafe { core::mem::transmute_copy(&arch) },
9691 simd,
9692 }
9693 }
9694 }
9695 impl<S: Simd> From<f64x4<S>> for float64x2x2_t {
9696 #[inline(always)]
9697 fn from(value: f64x4<S>) -> Self {
9698 unsafe { core::mem::transmute_copy(&value.val) }
9699 }
9700 }
9701 impl<S: Simd> SimdFrom<int64x2x2_t, S> for mask64x4<S> {
9702 #[inline(always)]
9703 fn simd_from(simd: S, arch: int64x2x2_t) -> Self {
9704 Self {
9705 val: unsafe { core::mem::transmute_copy(&arch) },
9706 simd,
9707 }
9708 }
9709 }
9710 impl<S: Simd> From<mask64x4<S>> for int64x2x2_t {
9711 #[inline(always)]
9712 fn from(value: mask64x4<S>) -> Self {
9713 unsafe { core::mem::transmute_copy(&value.val) }
9714 }
9715 }
9716 impl<S: Simd> SimdFrom<float32x4x4_t, S> for f32x16<S> {
9717 #[inline(always)]
9718 fn simd_from(simd: S, arch: float32x4x4_t) -> Self {
9719 Self {
9720 val: unsafe { core::mem::transmute_copy(&arch) },
9721 simd,
9722 }
9723 }
9724 }
9725 impl<S: Simd> From<f32x16<S>> for float32x4x4_t {
9726 #[inline(always)]
9727 fn from(value: f32x16<S>) -> Self {
9728 unsafe { core::mem::transmute_copy(&value.val) }
9729 }
9730 }
9731 impl<S: Simd> SimdFrom<int8x16x4_t, S> for i8x64<S> {
9732 #[inline(always)]
9733 fn simd_from(simd: S, arch: int8x16x4_t) -> Self {
9734 Self {
9735 val: unsafe { core::mem::transmute_copy(&arch) },
9736 simd,
9737 }
9738 }
9739 }
9740 impl<S: Simd> From<i8x64<S>> for int8x16x4_t {
9741 #[inline(always)]
9742 fn from(value: i8x64<S>) -> Self {
9743 unsafe { core::mem::transmute_copy(&value.val) }
9744 }
9745 }
9746 impl<S: Simd> SimdFrom<uint8x16x4_t, S> for u8x64<S> {
9747 #[inline(always)]
9748 fn simd_from(simd: S, arch: uint8x16x4_t) -> Self {
9749 Self {
9750 val: unsafe { core::mem::transmute_copy(&arch) },
9751 simd,
9752 }
9753 }
9754 }
9755 impl<S: Simd> From<u8x64<S>> for uint8x16x4_t {
9756 #[inline(always)]
9757 fn from(value: u8x64<S>) -> Self {
9758 unsafe { core::mem::transmute_copy(&value.val) }
9759 }
9760 }
9761 impl<S: Simd> SimdFrom<int8x16x4_t, S> for mask8x64<S> {
9762 #[inline(always)]
9763 fn simd_from(simd: S, arch: int8x16x4_t) -> Self {
9764 Self {
9765 val: unsafe { core::mem::transmute_copy(&arch) },
9766 simd,
9767 }
9768 }
9769 }
9770 impl<S: Simd> From<mask8x64<S>> for int8x16x4_t {
9771 #[inline(always)]
9772 fn from(value: mask8x64<S>) -> Self {
9773 unsafe { core::mem::transmute_copy(&value.val) }
9774 }
9775 }
9776 impl<S: Simd> SimdFrom<int16x8x4_t, S> for i16x32<S> {
9777 #[inline(always)]
9778 fn simd_from(simd: S, arch: int16x8x4_t) -> Self {
9779 Self {
9780 val: unsafe { core::mem::transmute_copy(&arch) },
9781 simd,
9782 }
9783 }
9784 }
9785 impl<S: Simd> From<i16x32<S>> for int16x8x4_t {
9786 #[inline(always)]
9787 fn from(value: i16x32<S>) -> Self {
9788 unsafe { core::mem::transmute_copy(&value.val) }
9789 }
9790 }
9791 impl<S: Simd> SimdFrom<uint16x8x4_t, S> for u16x32<S> {
9792 #[inline(always)]
9793 fn simd_from(simd: S, arch: uint16x8x4_t) -> Self {
9794 Self {
9795 val: unsafe { core::mem::transmute_copy(&arch) },
9796 simd,
9797 }
9798 }
9799 }
9800 impl<S: Simd> From<u16x32<S>> for uint16x8x4_t {
9801 #[inline(always)]
9802 fn from(value: u16x32<S>) -> Self {
9803 unsafe { core::mem::transmute_copy(&value.val) }
9804 }
9805 }
9806 impl<S: Simd> SimdFrom<int16x8x4_t, S> for mask16x32<S> {
9807 #[inline(always)]
9808 fn simd_from(simd: S, arch: int16x8x4_t) -> Self {
9809 Self {
9810 val: unsafe { core::mem::transmute_copy(&arch) },
9811 simd,
9812 }
9813 }
9814 }
9815 impl<S: Simd> From<mask16x32<S>> for int16x8x4_t {
9816 #[inline(always)]
9817 fn from(value: mask16x32<S>) -> Self {
9818 unsafe { core::mem::transmute_copy(&value.val) }
9819 }
9820 }
9821 impl<S: Simd> SimdFrom<int32x4x4_t, S> for i32x16<S> {
9822 #[inline(always)]
9823 fn simd_from(simd: S, arch: int32x4x4_t) -> Self {
9824 Self {
9825 val: unsafe { core::mem::transmute_copy(&arch) },
9826 simd,
9827 }
9828 }
9829 }
9830 impl<S: Simd> From<i32x16<S>> for int32x4x4_t {
9831 #[inline(always)]
9832 fn from(value: i32x16<S>) -> Self {
9833 unsafe { core::mem::transmute_copy(&value.val) }
9834 }
9835 }
9836 impl<S: Simd> SimdFrom<uint32x4x4_t, S> for u32x16<S> {
9837 #[inline(always)]
9838 fn simd_from(simd: S, arch: uint32x4x4_t) -> Self {
9839 Self {
9840 val: unsafe { core::mem::transmute_copy(&arch) },
9841 simd,
9842 }
9843 }
9844 }
9845 impl<S: Simd> From<u32x16<S>> for uint32x4x4_t {
9846 #[inline(always)]
9847 fn from(value: u32x16<S>) -> Self {
9848 unsafe { core::mem::transmute_copy(&value.val) }
9849 }
9850 }
9851 impl<S: Simd> SimdFrom<int32x4x4_t, S> for mask32x16<S> {
9852 #[inline(always)]
9853 fn simd_from(simd: S, arch: int32x4x4_t) -> Self {
9854 Self {
9855 val: unsafe { core::mem::transmute_copy(&arch) },
9856 simd,
9857 }
9858 }
9859 }
9860 impl<S: Simd> From<mask32x16<S>> for int32x4x4_t {
9861 #[inline(always)]
9862 fn from(value: mask32x16<S>) -> Self {
9863 unsafe { core::mem::transmute_copy(&value.val) }
9864 }
9865 }
9866 impl<S: Simd> SimdFrom<float64x2x4_t, S> for f64x8<S> {
9867 #[inline(always)]
9868 fn simd_from(simd: S, arch: float64x2x4_t) -> Self {
9869 Self {
9870 val: unsafe { core::mem::transmute_copy(&arch) },
9871 simd,
9872 }
9873 }
9874 }
9875 impl<S: Simd> From<f64x8<S>> for float64x2x4_t {
9876 #[inline(always)]
9877 fn from(value: f64x8<S>) -> Self {
9878 unsafe { core::mem::transmute_copy(&value.val) }
9879 }
9880 }
9881 impl<S: Simd> SimdFrom<int64x2x4_t, S> for mask64x8<S> {
9882 #[inline(always)]
9883 fn simd_from(simd: S, arch: int64x2x4_t) -> Self {
9884 Self {
9885 val: unsafe { core::mem::transmute_copy(&arch) },
9886 simd,
9887 }
9888 }
9889 }
9890 impl<S: Simd> From<mask64x8<S>> for int64x2x4_t {
9891 #[inline(always)]
9892 fn from(value: mask64x8<S>) -> Self {
9893 unsafe { core::mem::transmute_copy(&value.val) }
9894 }
9895 }
9896 #[doc = r" This is a version of the `vext` intrinsic that takes a non-const shift argument. The shift is still"]
9897 #[doc = r" expected to be constant in practice, so the match statement will be optimized out. This exists because"]
9898 #[doc = r" Rust doesn't currently let you do math on const generics."]
9899 #[inline(always)]
9900 unsafe fn dyn_vext_128(a: uint8x16_t, b: uint8x16_t, shift: usize) -> uint8x16_t {
9901 unsafe {
9902 match shift {
9903 0usize => vextq_u8::<0i32>(a, b),
9904 1usize => vextq_u8::<1i32>(a, b),
9905 2usize => vextq_u8::<2i32>(a, b),
9906 3usize => vextq_u8::<3i32>(a, b),
9907 4usize => vextq_u8::<4i32>(a, b),
9908 5usize => vextq_u8::<5i32>(a, b),
9909 6usize => vextq_u8::<6i32>(a, b),
9910 7usize => vextq_u8::<7i32>(a, b),
9911 8usize => vextq_u8::<8i32>(a, b),
9912 9usize => vextq_u8::<9i32>(a, b),
9913 10usize => vextq_u8::<10i32>(a, b),
9914 11usize => vextq_u8::<11i32>(a, b),
9915 12usize => vextq_u8::<12i32>(a, b),
9916 13usize => vextq_u8::<13i32>(a, b),
9917 14usize => vextq_u8::<14i32>(a, b),
9918 15usize => vextq_u8::<15i32>(a, b),
9919 _ => unreachable!(),
9920 }
9921 }
9922 }