1 | pub mod avx2; |
2 | pub mod avx512; |
3 | pub mod scalar; |
4 | pub mod sse2; |
5 | pub mod ssse3; |
6 | pub mod wasm; |
7 | |
8 | pub type Adler32Imp = fn(u16, u16, &[u8]) -> (u16, u16); |
9 | |
10 | #[inline ] |
11 | #[allow (non_snake_case)] |
12 | pub const fn _MM_SHUFFLE(z: u32, y: u32, x: u32, w: u32) -> i32 { |
13 | ((z << 6) | (y << 4) | (x << 2) | w) as i32 |
14 | } |
15 | |
16 | pub fn get_imp() -> Adler32Imp { |
17 | avx512::get_imp() |
18 | .or_else(avx2::get_imp) |
19 | .or_else(ssse3::get_imp) |
20 | .or_else(sse2::get_imp) |
21 | .or_else(wasm::get_imp) |
22 | .unwrap_or(default:scalar::update) |
23 | } |
24 | |