@@ -14,36 +14,61 @@ use stdsimd_test::assert_instr;
14
14
// Verify that supported hardware compiles rotates into single instructions
15
15
16
16
#[ inline]
17
- #[ cfg_attr( any( target_arch = "x86" , target_arch = "x86_64" ) , target_feature( enable = "avx512f" ) ) ]
18
- #[ cfg_attr( any( target_arch = "x86" , target_arch = "x86_64" ) , assert_instr( vpro) ) ]
17
+ #[ cfg_attr(
18
+ all(
19
+ any( target_arch = "x86" , target_arch = "x86_64" ) ,
20
+ target_feature( enable = "avx512f" )
21
+ ) ,
22
+ assert_instr( vpro)
23
+ ) ]
19
24
unsafe fn rotate_right_variable ( x : u64x8 ) -> u64x8 {
20
25
x. rotate_right ( u64x8:: new ( 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 ) )
21
26
}
22
27
23
28
#[ inline]
24
- #[ cfg_attr( any( target_arch = "x86" , target_arch = "x86_64" ) , target_feature( enable = "avx512f" ) ) ]
25
- #[ cfg_attr( any( target_arch = "x86" , target_arch = "x86_64" ) , assert_instr( vpro) ) ]
29
+ #[ cfg_attr(
30
+ all(
31
+ any( target_arch = "x86" , target_arch = "x86_64" ) ,
32
+ target_feature( enable = "avx512f" )
33
+ ) ,
34
+ assert_instr( vpro)
35
+ ) ]
26
36
unsafe fn rotate_left_variable ( x : u64x8 ) -> u64x8 {
27
37
x. rotate_left ( u64x8:: new ( 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 ) )
28
38
}
29
39
30
40
#[ inline]
31
- #[ cfg_attr( any( target_arch = "x86" , target_arch = "x86_64" ) , target_feature( enable = "avx512f" ) ) ]
32
- #[ cfg_attr( any( target_arch = "x86" , target_arch = "x86_64" ) , assert_instr( vpro) ) ]
41
+ #[ cfg_attr(
42
+ all(
43
+ any( target_arch = "x86" , target_arch = "x86_64" ) ,
44
+ target_feature( enable = "avx512f" )
45
+ ) ,
46
+ assert_instr( vpro)
47
+ ) ]
33
48
unsafe fn rotate_right ( x : u64x8 ) -> u64x8 {
34
49
x. rotate_right ( u64x8:: splat ( 12 ) )
35
50
}
36
51
37
52
#[ inline]
38
- #[ cfg_attr( any( target_arch = "x86" , target_arch = "x86_64" ) , target_feature( enable = "avx512f" ) ) ]
39
- #[ cfg_attr( any( target_arch = "x86" , target_arch = "x86_64" ) , assert_instr( vpro) ) ]
53
+ #[ cfg_attr(
54
+ all(
55
+ any( target_arch = "x86" , target_arch = "x86_64" ) ,
56
+ target_feature( enable = "avx512f" )
57
+ ) ,
58
+ assert_instr( vpro)
59
+ ) ]
40
60
unsafe fn rotate_left ( x : u64x8 ) -> u64x8 {
41
61
x. rotate_left ( u64x8:: splat ( 12 ) )
42
62
}
43
63
44
64
#[ inline]
45
- #[ cfg_attr( any( target_arch = "x86" , target_arch = "x86_64" ) , target_feature( enable = "avx512f" ) ) ]
46
- #[ cfg_attr( any( target_arch = "x86" , target_arch = "x86_64" ) , assert_instr( vpro) ) ]
65
+ #[ cfg_attr(
66
+ all(
67
+ any( target_arch = "x86" , target_arch = "x86_64" ) ,
68
+ target_feature( enable = "avx512f" )
69
+ ) ,
70
+ assert_instr( vpro)
71
+ ) ]
47
72
unsafe fn rotate_left_x2 ( x : u64x2 ) -> u64x2 {
48
73
x. rotate_left ( u64x2:: splat ( 12 ) )
49
74
}
0 commit comments