cryprot_core/
transpose.rs1#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
4pub mod avx2;
5pub mod portable;
6
7#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
8cpufeatures::new!(target_feature_avx2, "avx2");
9
10pub fn transpose_bitmatrix(input: &[u8], output: &mut [u8], rows: usize) {
16 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
17 if target_feature_avx2::get() {
18 unsafe { avx2::transpose_bitmatrix(input, output, rows) }
19 } else {
20 portable::transpose_bitmatrix(input, output, rows);
21 }
22 #[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
23 portable::transpose_bitmatrix(input, output, rows);
24}