diff options
author | Valentin Popov <valentin@popov.link> | 2024-01-08 00:21:28 +0300 |
---|---|---|
committer | Valentin Popov <valentin@popov.link> | 2024-01-08 00:21:28 +0300 |
commit | 1b6a04ca5504955c571d1c97504fb45ea0befee4 (patch) | |
tree | 7579f518b23313e8a9748a88ab6173d5e030b227 /vendor/simd-adler32/src/imp/mod.rs | |
parent | 5ecd8cf2cba827454317368b68571df0d13d7842 (diff) | |
download | fparkan-1b6a04ca5504955c571d1c97504fb45ea0befee4.tar.xz fparkan-1b6a04ca5504955c571d1c97504fb45ea0befee4.zip |
Initial vendor packages
Signed-off-by: Valentin Popov <valentin@popov.link>
Diffstat (limited to 'vendor/simd-adler32/src/imp/mod.rs')
-rw-r--r-- | vendor/simd-adler32/src/imp/mod.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/vendor/simd-adler32/src/imp/mod.rs b/vendor/simd-adler32/src/imp/mod.rs new file mode 100644 index 0000000..957b50a --- /dev/null +++ b/vendor/simd-adler32/src/imp/mod.rs @@ -0,0 +1,23 @@ +pub mod avx2; +pub mod avx512; +pub mod scalar; +pub mod sse2; +pub mod ssse3; +pub mod wasm; + +pub type Adler32Imp = fn(u16, u16, &[u8]) -> (u16, u16); + +#[inline] +#[allow(non_snake_case)] +pub const fn _MM_SHUFFLE(z: u32, y: u32, x: u32, w: u32) -> i32 { + ((z << 6) | (y << 4) | (x << 2) | w) as i32 +} + +pub fn get_imp() -> Adler32Imp { + avx512::get_imp() + .or_else(avx2::get_imp) + .or_else(ssse3::get_imp) + .or_else(sse2::get_imp) + .or_else(wasm::get_imp) + .unwrap_or(scalar::update) +} |