binius_hash/groestl/arch/
mod.rs

1// Copyright 2024-2025 Irreducible Inc.
2use cfg_if::cfg_if;
3
4// We will choose the AVX512 Implementation of Grøstl if our machine supports the various AVX512
5// extensions, otherwise defaults to the portable implementation which was found to be fast in most
6// machines
7
8cfg_if! {
9	if #[cfg(all(feature = "nightly_features", target_arch = "x86_64", target_feature = "avx2", target_feature = "gfni",))] {
10		mod groestl_multi_avx2;
11		pub use groestl_multi_avx2::Groestl256Parallel;
12	} else {
13		use super::Groestl256;
14		pub type Groestl256Parallel = Groestl256;
15	}
16}
17
18cfg_if! {
19	if #[cfg(all(feature = "nightly_features", target_arch = "x86_64",target_feature = "avx512bw",target_feature = "avx512vbmi",target_feature = "avx512f",target_feature = "gfni",))] {
20		mod groestl_avx512;
21		pub use groestl_avx512::GroestlShortImpl;
22	} else {
23		mod portable;
24		pub use portable::GroestlShortImpl;
25	}
26}