@@ -37,14 +37,15 @@ impl Simd256 {
37
37
}
38
38
39
39
#[ inline]
40
- #[ target_feature( enable = "avx2" , enable = "vpclmulqdq" ) ]
41
- unsafe fn fold_32 ( & self , coeff : & Self ) -> Self {
42
- let result = _mm256_xor_si256 (
40
+ #[ target_feature( enable = "avx2,avx512f,avx512vl,vpclmulqdq" ) ]
41
+ unsafe fn fold_32 ( & self , coeff : & Self , new_data : & Self ) -> Self {
42
+ // XOR3
43
+ Self ( _mm256_ternarylogic_epi64 (
43
44
_mm256_clmulepi64_epi128 ( self . 0 , coeff. 0 , 0x00 ) ,
44
45
_mm256_clmulepi64_epi128 ( self . 0 , coeff. 0 , 0x11 ) ,
45
- ) ;
46
-
47
- Self ( result )
46
+ new_data . 0 ,
47
+ 0x96 ,
48
+ ) )
48
49
}
49
50
50
51
#[ inline]
@@ -118,7 +119,7 @@ impl Simd256 {
118
119
impl VpclmulqdqOps {
119
120
/// Process aligned blocks using VPCLMULQDQ
120
121
#[ inline]
121
- #[ target_feature( enable = "avx2,vpclmulqdq,sse2,sse4.1,pclmulqdq" ) ]
122
+ #[ target_feature( enable = "avx2,vpclmulqdq,sse2,sse4.1,pclmulqdq,avx512f,avx512vl " ) ]
122
123
unsafe fn process_vpclmulqdq_blocks < W : EnhancedCrcWidth > (
123
124
& self ,
124
125
state : & mut CrcState < <VpclmulqdqOps as ArchOps >:: Vector > ,
@@ -165,7 +166,7 @@ impl VpclmulqdqOps {
165
166
Simd256 :: from_m128i_pair ( block[ i * 2 + 1 ] , block[ i * 2 ] ) ,
166
167
) ;
167
168
168
- * chunk = chunk. fold_32 ( & coeff) . xor ( & reflected_chunk) ;
169
+ * chunk = chunk. fold_32 ( & coeff, & reflected_chunk) ;
169
170
}
170
171
}
171
172
@@ -325,7 +326,7 @@ impl ArchOps for VpclmulqdqOps {
325
326
type Vector = __m128i ;
326
327
327
328
#[ inline]
328
- #[ target_feature( enable = "avx2,vpclmulqdq,sse2,sse4.1,pclmulqdq" ) ]
329
+ #[ target_feature( enable = "avx2,vpclmulqdq,sse2,sse4.1,pclmulqdq,avx512f,avx512vl " ) ]
329
330
unsafe fn process_enhanced_simd_blocks < W : EnhancedCrcWidth > (
330
331
& self ,
331
332
state : & mut CrcState < Self :: Vector > ,
@@ -535,4 +536,15 @@ impl ArchOps for VpclmulqdqOps {
535
536
unsafe fn carryless_mul_11 ( & self , a : Self :: Vector , b : Self :: Vector ) -> Self :: Vector {
536
537
self . 0 . carryless_mul_11 ( a, b)
537
538
}
539
+
540
+ #[ inline]
541
+ #[ target_feature( enable = "avx2,vpclmulqdq,avx512f,avx512vl" ) ]
542
+ unsafe fn xor3_vectors (
543
+ & self ,
544
+ a : Self :: Vector ,
545
+ b : Self :: Vector ,
546
+ c : Self :: Vector ,
547
+ ) -> Self :: Vector {
548
+ self . 0 . xor3_vectors ( a, b, c)
549
+ }
538
550
}
0 commit comments