Skip to content

Commit 1371051

Browse files
committed
Import the AVX2 engine into the module tree
1 parent 3caf7a8 commit 1371051

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ rstest_reuse = "0.1.3"
2828
default = ["std"]
2929
alloc = []
3030
std = []
31+
unsafe = []
32+
avx2 = ["unsafe"]
3133

3234
[profile.bench]
3335
# Useful for better disassembly when using `perf record` and `perf annotate`

src/engine/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ use crate::{alphabet, DecodeError};
44

55
pub mod fast_portable;
66

7+
#[cfg(all(any(target_arch = "x86", target_arch = "x86_64"),
8+
target_feature = "avx2",
9+
feature = "avx2"))]
10+
pub mod avx2;
11+
712
#[cfg(test)]
813
mod naive;
914

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
variant_size_differences,
8686
warnings
8787
)]
88-
#![forbid(unsafe_code)]
88+
#![cfg_attr(not(feature = "unsafe"), forbid(unsafe_code))]
8989
#![cfg_attr(not(any(feature = "std", test)), no_std)]
9090

9191
#[cfg(all(feature = "alloc", not(any(feature = "std", test))))]

0 commit comments

Comments
 (0)