Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ jobs:
matrix:
os: [ubuntu-22.04-arm, ubuntu-24.04-arm, macos-14, macos-15, macos-26, macos-latest, windows-11-arm]
rust-toolchain:
- "1.81" # minimum for this crate
- "1.89" # when AVX-512 VPCLMULQDQ was stabilized
- "1.89" # minimum for this crate, when AVX-512 VPCLMULQDQ was stabilized
- "stable"
- "nightly"
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -43,8 +42,7 @@ jobs:
matrix:
os: [ ubuntu-latest, ubuntu-22.04, ubuntu-24.04, macos-15-intel, windows-2022, windows-2025, windows-latest ]
rust-toolchain:
- "1.81" # minimum for this crate
- "1.89" # when AVX-512 VPCLMULQDQ was stabilized
- "1.89" # minimum for this crate, when AVX-512 VPCLMULQDQ was stabilized
- "stable"
- "nightly"
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -75,8 +73,7 @@ jobs:
matrix:
target: [i586-unknown-linux-gnu, i686-unknown-linux-gnu]
rust-toolchain:
- "1.81" # minimum for this crate
- "1.89" # when AVX-512 VPCLMULQDQ was stabilized
- "1.89" # minimum for this crate, when AVX-512 VPCLMULQDQ was stabilized
- "stable"
- "nightly"
steps:
Expand All @@ -101,8 +98,7 @@ jobs:
matrix:
target: [powerpc-unknown-linux-gnu, powerpc64-unknown-linux-gnu]
rust-toolchain:
- "1.81" # minimum for this crate
- "1.89" # when AVX-512 VPCLMULQDQ was stabilized
- "1.89" # minimum for this crate, when AVX-512 VPCLMULQDQ was stabilized
- "stable"
- "nightly"
steps:
Expand Down
8 changes: 3 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 1 addition & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ readme = "README.md"
# 1.69.0 added VPCLMULQDQ x86 detection support
# 1.70.0 added LLVM 16 which supports PMULL2 on Aarch64
# 1.89.0 stabilized AVX-512 intrinsics, including VPCLMULQDQ
rust-version = "1.81"
rust-version = "1.89"

[lib]
name = "crc_fast"
Expand All @@ -25,12 +25,6 @@ bench = true
crc = "3"
digest = { version = "0.10", features = ["alloc"] }

# will be removed once Rust 1.89 is the minimum supported version
rustversion = "1.0"

# constrain indexmap (transitive) to a version compatible with Rust 1.81.0
indexmap = { version = ">=2.11.0, <2.12.0", optional = true }

[dev-dependencies]
criterion = "0.7"
cbindgen = "0.29"
Expand Down
23 changes: 1 addition & 22 deletions src/arch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,10 @@ unsafe fn update_aarch64_aes_sha3(
}
}

/// Main entry point for x86/x86_64 (Rust 1.89+ which supports AVX-512)
/// Main entry point for x86/x86_64
///
/// # Safety
/// May use native CPU features
#[rustversion::since(1.89)]
#[inline(always)]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub(crate) unsafe fn update(state: u64, bytes: &[u8], params: CrcParams) -> u64 {
Expand Down Expand Up @@ -117,26 +116,6 @@ pub(crate) unsafe fn update(state: u64, bytes: &[u8], params: CrcParams) -> u64
}
}

/// Main entry point for x86/x86_64 (Rust < 1.89 with no AVX-512 support)
///
/// # Safety
/// May use native CPU features
#[rustversion::before(1.89)]
#[inline(always)]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub(crate) unsafe fn update(state: u64, bytes: &[u8], params: CrcParams) -> u64 {
use crate::feature_detection::{get_arch_ops, ArchOpsInstance};

match get_arch_ops() {
ArchOpsInstance::X86SsePclmulqdq(ops) => match params.width {
64 => algorithm::update::<_, Width64>(state, bytes, params, ops),
32 => algorithm::update::<_, Width32>(state as u32, bytes, params, ops) as u64,
_ => panic!("Unsupported CRC width: {}", params.width),
},
ArchOpsInstance::SoftwareFallback => crate::arch::software::update(state, bytes, params),
}
}

#[inline]
#[cfg(all(
not(target_arch = "x86"),
Expand Down
Loading
Loading