Skip to content

Commit

Permalink
fix: removed x86 CRC32 computation
Browse files Browse the repository at this point in the history
Intel implementation uses a different polynomial (CRC-32/ISCSI or CRC32-C (Castagnoli)) so I had to remove the support.
  • Loading branch information
joamag committed Aug 4, 2024
1 parent 6d96fae commit 86ff777
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions crates/hashing/src/crc32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
//! This implementation is optimized for modern CPUs by using hardware acceleration
//! when available.

#[cfg(target_arch = "x86_64")]
use std::arch::{is_x86_feature_detected, x86_64::_mm_crc32_u8};

#[cfg(target_arch = "aarch64")]
use std::arch::{aarch64::__crc32b, is_aarch64_feature_detected};

Expand Down Expand Up @@ -78,16 +75,6 @@ impl Crc32 {
}

pub fn update(&mut self, bytes: &[u8]) {
#[cfg(target_arch = "x86_64")]
{
if is_x86_feature_detected!("sse4.2") {
unsafe {
self.update_hw_x86(bytes);
}
return;
}
}

#[cfg(target_arch = "aarch64")]
{
if is_aarch64_feature_detected!("crc") {
Expand Down

0 comments on commit 86ff777

Please sign in to comment.