4
4
//!
5
5
//! It performs folding using 4 x ZMM registers of 512-bits each.
6
6
7
- #![ cfg( all ( target_arch = "x86_64" , feature = "vpclmulqdq" ) ) ]
7
+ #![ cfg( target_arch = "x86_64" ) ]
8
8
9
- // #[rustversion::since(1.89)]
9
+ #[ rustversion:: since( 1.89 ) ]
10
10
use crate :: arch:: x86:: X86Ops ;
11
11
12
- // #[rustversion::since(1.89)]
12
+ #[ rustversion:: since( 1.89 ) ]
13
13
use crate :: enums:: Reflector ;
14
14
15
- // #[rustversion::since(1.89)]
15
+ #[ rustversion:: since( 1.89 ) ]
16
16
use crate :: structs:: CrcState ;
17
17
18
- // #[rustversion::since(1.89)]
18
+ #[ rustversion:: since( 1.89 ) ]
19
19
use crate :: traits:: { ArchOps , EnhancedCrcWidth } ;
20
20
21
- // #[rustversion::since(1.89)]
21
+ #[ rustversion:: since( 1.89 ) ]
22
22
use std:: arch:: x86_64:: * ;
23
23
24
- // #[rustversion::since(1.89)]
24
+ #[ rustversion:: since( 1.89 ) ]
25
25
use std:: ops:: BitXor ;
26
26
27
27
/// Implements the ArchOps trait using 512-bit AVX-512 and VPCLMULQDQ instructions at 512 bits.
28
28
/// Delegates to X86Ops for standard 128-bit operations
29
- // #[rustversion::since(1.89)]
29
+ #[ rustversion:: since( 1.89 ) ]
30
30
#[ derive( Debug , Copy , Clone ) ]
31
31
pub struct Vpclmulqdq512Ops ( X86Ops ) ;
32
32
33
- // #[rustversion::since(1.89)]
33
+ #[ rustversion:: since( 1.89 ) ]
34
34
impl Vpclmulqdq512Ops {
35
35
#[ inline( always) ]
36
36
pub fn new ( ) -> Self {
@@ -39,11 +39,11 @@ impl Vpclmulqdq512Ops {
39
39
}
40
40
41
41
// Wrapper for __m512i to make it easier to work with
42
- // #[rustversion::since(1.89)]
42
+ #[ rustversion:: since( 1.89 ) ]
43
43
#[ derive( Debug , Copy , Clone ) ]
44
44
struct Simd512 ( __m512i ) ;
45
45
46
- // #[rustversion::since(1.89)]
46
+ #[ rustversion:: since( 1.89 ) ]
47
47
impl Simd512 {
48
48
#[ inline]
49
49
#[ target_feature( enable = "avx512f" ) ]
@@ -112,7 +112,7 @@ impl Simd512 {
112
112
}
113
113
}
114
114
115
- // #[rustversion::since(1.89)]
115
+ #[ rustversion:: since( 1.89 ) ]
116
116
impl Vpclmulqdq512Ops {
117
117
/// Process aligned blocks using VPCLMULQDQ with 4 x 512-bit registers
118
118
///
@@ -339,15 +339,15 @@ impl Vpclmulqdq512Ops {
339
339
}
340
340
341
341
// 512-bit version of the Reflector
342
- // #[rustversion::since(1.89)]
342
+ #[ rustversion:: since( 1.89 ) ]
343
343
#[ derive( Clone , Copy ) ]
344
344
enum Reflector512 {
345
345
NoReflector ,
346
346
ForwardReflector { smask : Simd512 } ,
347
347
}
348
348
349
349
// Function to create the appropriate reflector based on CRC parameters
350
- // #[rustversion::since(1.89)]
350
+ #[ rustversion:: since( 1.89 ) ]
351
351
#[ inline( always) ]
352
352
unsafe fn create_reflector512 ( reflected : bool ) -> Reflector512 {
353
353
if reflected {
@@ -369,7 +369,7 @@ unsafe fn create_reflector512(reflected: bool) -> Reflector512 {
369
369
}
370
370
371
371
// Function to apply reflection to a 512-bit vector
372
- // #[rustversion::since(1.89)]
372
+ #[ rustversion:: since( 1.89 ) ]
373
373
#[ inline( always) ]
374
374
unsafe fn reflect_bytes512 ( reflector : & Reflector512 , data : Simd512 ) -> Simd512 {
375
375
match reflector {
@@ -379,12 +379,12 @@ unsafe fn reflect_bytes512(reflector: &Reflector512, data: Simd512) -> Simd512 {
379
379
}
380
380
381
381
// pre-compute the reverse indices for 512-bit shuffling
382
- // #[rustversion::since(1.89)]
382
+ #[ rustversion:: since( 1.89 ) ]
383
383
static REVERSE_INDICES_512 : __m512i =
384
384
unsafe { std:: mem:: transmute ( [ 7u64 , 6u64 , 5u64 , 4u64 , 3u64 , 2u64 , 1u64 , 0u64 ] ) } ;
385
385
386
386
// Implement a 512-bit byte shuffle function
387
- // #[rustversion::since(1.89)]
387
+ #[ rustversion:: since( 1.89 ) ]
388
388
#[ inline]
389
389
#[ target_feature( enable = "avx512f,avx512bw" ) ]
390
390
unsafe fn shuffle_bytes512 ( data : Simd512 , mask : Simd512 ) -> Simd512 {
@@ -396,7 +396,7 @@ unsafe fn shuffle_bytes512(data: Simd512, mask: Simd512) -> Simd512 {
396
396
}
397
397
398
398
// Delegate all ArchOps methods to the inner X86Ops instance
399
- // #[rustversion::since(1.89)]
399
+ #[ rustversion:: since( 1.89 ) ]
400
400
impl ArchOps for Vpclmulqdq512Ops {
401
401
type Vector = __m128i ;
402
402
0 commit comments