Skip to content

Commit eb307ee

Browse files
committed
Improve parameter name
1 parent 481e76f commit eb307ee

File tree

6 files changed

+12
-10
lines changed

6 files changed

+12
-10
lines changed

src/algorithm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ where
325325
unsafe fn fold_and_xor<T: ArchOps, W: EnhancedCrcWidth>(
326326
current: T::Vector,
327327
coefficient: T::Vector,
328-
new_data: T::Vector,
328+
data_to_xor: T::Vector,
329329
reflected: bool,
330330
ops: &T,
331331
) -> T::Vector
@@ -339,7 +339,7 @@ where
339339
};
340340

341341
// Fold 16 bytes using width-specific method
342-
W::fold_16(&mut temp_state, coefficient, new_data, ops);
342+
W::fold_16(&mut temp_state, coefficient, data_to_xor, ops);
343343

344344
temp_state.value
345345
}

src/arch/vpclmulqdq.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ impl Simd256 {
3838

3939
#[inline]
4040
#[target_feature(enable = "avx2,avx512f,avx512vl,vpclmulqdq")]
41-
unsafe fn fold_32(&self, coeff: &Self, new_data: &Self) -> Self {
41+
unsafe fn fold_32(&self, coeff: &Self, data_to_xor: &Self) -> Self {
4242
// XOR3
4343
Self(_mm256_ternarylogic_epi64(
4444
_mm256_clmulepi64_epi128(self.0, coeff.0, 0x00),
4545
_mm256_clmulepi64_epi128(self.0, coeff.0, 0x11),
46-
new_data.0,
46+
data_to_xor.0,
4747
0x96,
4848
))
4949
}

src/arch/x86.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,9 @@ impl ArchOps for X86Ops {
244244
) -> Self::Vector {
245245
#[cfg(any(feature = "vpclmulqdq", feature = "avx512"))]
246246
if is_x86_feature_detected!("avx512f") && is_x86_feature_detected!("avx512vl") {
247-
return _mm_ternarylogic_epi64(a, b, c, 0x96);
247+
return _mm_ternarylogic_epi64(
248+
a, b, c, 0x96, // XOR3
249+
);
248250
}
249251

250252
// x86 doesn't have native XOR3 in SSE, use two XORs

src/crc32/algorithm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ impl EnhancedCrcWidth for crate::structs::Width32 {
7979
unsafe fn fold_16<T: ArchOps>(
8080
state: &mut CrcState<T::Vector>,
8181
coeff: T::Vector,
82-
new_data: T::Vector,
82+
data_to_xor: T::Vector,
8383
ops: &T,
8484
) where
8585
T::Vector: Copy,
@@ -99,7 +99,7 @@ impl EnhancedCrcWidth for crate::structs::Width32 {
9999
)
100100
};
101101

102-
state.value = ops.xor3_vectors(h, l, new_data);
102+
state.value = ops.xor3_vectors(h, l, data_to_xor);
103103
}
104104

105105
/// CRC-32 specific implementation for folding 8 bytes to 4 bytes

src/crc64/algorithm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl EnhancedCrcWidth for crate::structs::Width64 {
6060
unsafe fn fold_16<T: ArchOps>(
6161
state: &mut CrcState<T::Vector>,
6262
coeff: T::Vector,
63-
new_data: T::Vector,
63+
data_to_xor: T::Vector,
6464
ops: &T,
6565
) where
6666
T::Vector: Copy,
@@ -70,7 +70,7 @@ impl EnhancedCrcWidth for crate::structs::Width64 {
7070
ops.xor3_vectors(
7171
ops.carryless_mul_00(state.value, coeff),
7272
ops.carryless_mul_11(state.value, coeff),
73-
new_data,
73+
data_to_xor,
7474
)
7575
};
7676
}

src/traits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ pub trait EnhancedCrcWidth: CrcWidth {
260260
unsafe fn fold_16<T: ArchOps>(
261261
state: &mut CrcState<T::Vector>,
262262
coefficient: T::Vector,
263-
new_data: T::Vector,
263+
data_to_xor: T::Vector,
264264
ops: &T,
265265
) where
266266
T::Vector: Copy;

0 commit comments

Comments
 (0)