From 1b6a04ca5504955c571d1c97504fb45ea0befee4 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Mon, 8 Jan 2024 01:21:28 +0400 Subject: Initial vendor packages Signed-off-by: Valentin Popov --- vendor/simd-adler32/src/imp/mod.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 vendor/simd-adler32/src/imp/mod.rs (limited to 'vendor/simd-adler32/src/imp/mod.rs') 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) +} -- cgit v1.2.3