14
14
#[ cfg( all( target_arch = "arm" , any( target_os = "linux" , target_os = "android" ) ) ) ]
15
15
fn arm_linux ( ) {
16
16
use std:: arch:: is_arm_feature_detected;
17
+ // tidy-alphabetical-start
18
+ println ! ( "aes: {}" , is_arm_feature_detected!( "aes" ) ) ;
19
+ println ! ( "crc: {}" , is_arm_feature_detected!( "crc" ) ) ;
20
+ println ! ( "crypto: {}" , is_arm_feature_detected!( "crypto" ) ) ;
17
21
println ! ( "neon: {}" , is_arm_feature_detected!( "neon" ) ) ;
18
22
println ! ( "pmull: {}" , is_arm_feature_detected!( "pmull" ) ) ;
19
- println ! ( "crypto: {}" , is_arm_feature_detected!( "crypto" ) ) ;
20
- println ! ( "crc: {}" , is_arm_feature_detected!( "crc" ) ) ;
21
- println ! ( "aes: {}" , is_arm_feature_detected!( "aes" ) ) ;
22
23
println ! ( "sha2: {}" , is_arm_feature_detected!( "sha2" ) ) ;
24
+ // tidy-alphabetical-end
23
25
}
24
26
25
27
#[ test]
26
28
#[ cfg( all( target_arch = "aarch64" , any( target_os = "linux" , target_os = "android" ) ) ) ]
27
29
fn aarch64_linux ( ) {
28
30
use std:: arch:: is_aarch64_feature_detected;
29
- println ! ( "neon: {}" , is_aarch64_feature_detected!( "neon" ) ) ;
31
+ // tidy-alphabetical-start
32
+ println ! ( "aes: {}" , is_aarch64_feature_detected!( "aes" ) ) ;
30
33
println ! ( "asimd: {}" , is_aarch64_feature_detected!( "asimd" ) ) ;
31
- println ! ( "pmull: {}" , is_aarch64_feature_detected!( "pmull" ) ) ;
32
- println ! ( "fp16: {}" , is_aarch64_feature_detected!( "fp16" ) ) ;
33
- println ! ( "sve: {}" , is_aarch64_feature_detected!( "sve" ) ) ;
34
+ println ! ( "bf16: {}" , is_aarch64_feature_detected!( "bf16" ) ) ;
35
+ println ! ( "bti: {}" , is_aarch64_feature_detected!( "bti" ) ) ;
34
36
println ! ( "crc: {}" , is_aarch64_feature_detected!( "crc" ) ) ;
35
- println ! ( "lse: {}" , is_aarch64_feature_detected!( "lse" ) ) ;
36
- println ! ( "lse2: {}" , is_aarch64_feature_detected!( "lse2" ) ) ;
37
- println ! ( "rdm: {}" , is_aarch64_feature_detected!( "rdm" ) ) ;
38
- println ! ( "rcpc: {}" , is_aarch64_feature_detected!( "rcpc" ) ) ;
39
- println ! ( "rcpc2: {}" , is_aarch64_feature_detected!( "rcpc2" ) ) ;
37
+ println ! ( "dit: {}" , is_aarch64_feature_detected!( "dit" ) ) ;
40
38
println ! ( "dotprod: {}" , is_aarch64_feature_detected!( "dotprod" ) ) ;
41
- println ! ( "tme: {}" , is_aarch64_feature_detected!( "tme" ) ) ;
39
+ println ! ( "dpb2: {}" , is_aarch64_feature_detected!( "dpb2" ) ) ;
40
+ println ! ( "dpb: {}" , is_aarch64_feature_detected!( "dpb" ) ) ;
41
+ println ! ( "f32mm: {}" , is_aarch64_feature_detected!( "f32mm" ) ) ;
42
+ println ! ( "f64mm: {}" , is_aarch64_feature_detected!( "f64mm" ) ) ;
43
+ println ! ( "fcma: {}" , is_aarch64_feature_detected!( "fcma" ) ) ;
42
44
println ! ( "fhm: {}" , is_aarch64_feature_detected!( "fhm" ) ) ;
43
- println ! ( "dit: {}" , is_aarch64_feature_detected!( "dit" ) ) ;
44
45
println ! ( "flagm: {}" , is_aarch64_feature_detected!( "flagm" ) ) ;
45
- println ! ( "ssbs: {}" , is_aarch64_feature_detected!( "ssbs" ) ) ;
46
- println ! ( "sb: {}" , is_aarch64_feature_detected!( "sb" ) ) ;
47
- println ! ( "paca: {}" , is_aarch64_feature_detected!( "paca" ) ) ;
48
- println ! ( "pacg: {}" , is_aarch64_feature_detected!( "pacg" ) ) ;
49
- println ! ( "dpb: {}" , is_aarch64_feature_detected!( "dpb" ) ) ;
50
- println ! ( "dpb2: {}" , is_aarch64_feature_detected!( "dpb2" ) ) ;
51
- println ! ( "sve2: {}" , is_aarch64_feature_detected!( "sve2" ) ) ;
52
- println ! ( "sve2-aes: {}" , is_aarch64_feature_detected!( "sve2-aes" ) ) ;
53
- println ! ( "sve2-sm4: {}" , is_aarch64_feature_detected!( "sve2-sm4" ) ) ;
54
- println ! ( "sve2-sha3: {}" , is_aarch64_feature_detected!( "sve2-sha3" ) ) ;
55
- println ! ( "sve2-bitperm: {}" , is_aarch64_feature_detected!( "sve2-bitperm" ) ) ;
46
+ println ! ( "fp16: {}" , is_aarch64_feature_detected!( "fp16" ) ) ;
56
47
println ! ( "frintts: {}" , is_aarch64_feature_detected!( "frintts" ) ) ;
57
48
println ! ( "i8mm: {}" , is_aarch64_feature_detected!( "i8mm" ) ) ;
58
- println ! ( "f32mm: {}" , is_aarch64_feature_detected!( "f32mm" ) ) ;
59
- println ! ( "f64mm: {}" , is_aarch64_feature_detected!( "f64mm" ) ) ;
60
- println ! ( "bf16: {}" , is_aarch64_feature_detected!( "bf16" ) ) ;
61
- println ! ( "rand: {}" , is_aarch64_feature_detected!( "rand" ) ) ;
62
- println ! ( "bti: {}" , is_aarch64_feature_detected!( "bti" ) ) ;
63
- println ! ( "mte: {}" , is_aarch64_feature_detected!( "mte" ) ) ;
64
49
println ! ( "jsconv: {}" , is_aarch64_feature_detected!( "jsconv" ) ) ;
65
- println ! ( "fcma: {}" , is_aarch64_feature_detected!( "fcma" ) ) ;
66
- println ! ( "aes: {}" , is_aarch64_feature_detected!( "aes" ) ) ;
50
+ println ! ( "lse2: {}" , is_aarch64_feature_detected!( "lse2" ) ) ;
51
+ println ! ( "lse: {}" , is_aarch64_feature_detected!( "lse" ) ) ;
52
+ println ! ( "mte: {}" , is_aarch64_feature_detected!( "mte" ) ) ;
53
+ println ! ( "neon: {}" , is_aarch64_feature_detected!( "neon" ) ) ;
54
+ println ! ( "paca: {}" , is_aarch64_feature_detected!( "paca" ) ) ;
55
+ println ! ( "pacg: {}" , is_aarch64_feature_detected!( "pacg" ) ) ;
56
+ println ! ( "pmull: {}" , is_aarch64_feature_detected!( "pmull" ) ) ;
57
+ println ! ( "rand: {}" , is_aarch64_feature_detected!( "rand" ) ) ;
58
+ println ! ( "rcpc2: {}" , is_aarch64_feature_detected!( "rcpc2" ) ) ;
59
+ println ! ( "rcpc: {}" , is_aarch64_feature_detected!( "rcpc" ) ) ;
60
+ println ! ( "rdm: {}" , is_aarch64_feature_detected!( "rdm" ) ) ;
61
+ println ! ( "sb: {}" , is_aarch64_feature_detected!( "sb" ) ) ;
67
62
println ! ( "sha2: {}" , is_aarch64_feature_detected!( "sha2" ) ) ;
68
63
println ! ( "sha3: {}" , is_aarch64_feature_detected!( "sha3" ) ) ;
69
64
println ! ( "sm4: {}" , is_aarch64_feature_detected!( "sm4" ) ) ;
65
+ println ! ( "ssbs: {}" , is_aarch64_feature_detected!( "ssbs" ) ) ;
66
+ println ! ( "sve2-aes: {}" , is_aarch64_feature_detected!( "sve2-aes" ) ) ;
67
+ println ! ( "sve2-bitperm: {}" , is_aarch64_feature_detected!( "sve2-bitperm" ) ) ;
68
+ println ! ( "sve2-sha3: {}" , is_aarch64_feature_detected!( "sve2-sha3" ) ) ;
69
+ println ! ( "sve2-sm4: {}" , is_aarch64_feature_detected!( "sve2-sm4" ) ) ;
70
+ println ! ( "sve2: {}" , is_aarch64_feature_detected!( "sve2" ) ) ;
71
+ println ! ( "sve: {}" , is_aarch64_feature_detected!( "sve" ) ) ;
72
+ println ! ( "tme: {}" , is_aarch64_feature_detected!( "tme" ) ) ;
73
+ // tidy-alphabetical-end
70
74
}
71
75
72
76
#[ test]
73
77
#[ cfg( all( target_arch = "powerpc" , target_os = "linux" ) ) ]
74
78
fn powerpc_linux ( ) {
75
79
use std:: arch:: is_powerpc_feature_detected;
80
+ // tidy-alphabetical-start
76
81
println ! ( "altivec: {}" , is_powerpc_feature_detected!( "altivec" ) ) ;
77
- println ! ( "vsx: {}" , is_powerpc_feature_detected!( "vsx" ) ) ;
78
82
println ! ( "power8: {}" , is_powerpc_feature_detected!( "power8" ) ) ;
83
+ println ! ( "vsx: {}" , is_powerpc_feature_detected!( "vsx" ) ) ;
84
+ // tidy-alphabetical-end
79
85
}
80
86
81
87
#[ test]
82
88
#[ cfg( all( target_arch = "powerpc64" , target_os = "linux" ) ) ]
83
89
fn powerpc64_linux ( ) {
84
90
use std:: arch:: is_powerpc64_feature_detected;
91
+ // tidy-alphabetical-start
85
92
println ! ( "altivec: {}" , is_powerpc64_feature_detected!( "altivec" ) ) ;
86
- println ! ( "vsx: {}" , is_powerpc64_feature_detected!( "vsx" ) ) ;
87
93
println ! ( "power8: {}" , is_powerpc64_feature_detected!( "power8" ) ) ;
94
+ println ! ( "vsx: {}" , is_powerpc64_feature_detected!( "vsx" ) ) ;
95
+ // tidy-alphabetical-end
88
96
}
89
97
90
98
#[ test]
@@ -102,9 +110,9 @@ fn x86_all() {
102
110
// the below is in alphabetical order and matches
103
111
// the order of X86_ALLOWED_FEATURES in rustc_codegen_ssa's target_features.rs
104
112
113
+ // tidy-alphabetical-start
105
114
println ! ( "adx: {:?}" , is_x86_feature_detected!( "adx" ) ) ;
106
115
println ! ( "aes: {:?}" , is_x86_feature_detected!( "aes" ) ) ;
107
- println ! ( "avx: {:?}" , is_x86_feature_detected!( "avx" ) ) ;
108
116
println ! ( "avx2: {:?}" , is_x86_feature_detected!( "avx2" ) ) ;
109
117
println ! ( "avx512bf16: {:?}" , is_x86_feature_detected!( "avx512bf16" ) ) ;
110
118
println ! ( "avx512bitalg: {:?}" , is_x86_feature_detected!( "avx512bitalg" ) ) ;
@@ -117,13 +125,14 @@ fn x86_all() {
117
125
println ! ( "avx512ifma: {:?}" , is_x86_feature_detected!( "avx512ifma" ) ) ;
118
126
println ! ( "avx512pf: {:?}" , is_x86_feature_detected!( "avx512pf" ) ) ;
119
127
println ! ( "avx512vaes: {:?}" , is_x86_feature_detected!( "avx512vaes" ) ) ;
120
- println ! ( "avx512vbmi: {:?}" , is_x86_feature_detected!( "avx512vbmi" ) ) ;
121
128
println ! ( "avx512vbmi2: {:?}" , is_x86_feature_detected!( "avx512vbmi2" ) ) ;
129
+ println ! ( "avx512vbmi: {:?}" , is_x86_feature_detected!( "avx512vbmi" ) ) ;
122
130
println ! ( "avx512vl: {:?}" , is_x86_feature_detected!( "avx512vl" ) ) ;
123
131
println ! ( "avx512vnni: {:?}" , is_x86_feature_detected!( "avx512vnni" ) ) ;
124
132
println ! ( "avx512vp2intersect: {:?}" , is_x86_feature_detected!( "avx512vp2intersect" ) ) ;
125
133
println ! ( "avx512vpclmulqdq: {:?}" , is_x86_feature_detected!( "avx512vpclmulqdq" ) ) ;
126
134
println ! ( "avx512vpopcntdq: {:?}" , is_x86_feature_detected!( "avx512vpopcntdq" ) ) ;
135
+ println ! ( "avx: {:?}" , is_x86_feature_detected!( "avx" ) ) ;
127
136
println ! ( "bmi1: {:?}" , is_x86_feature_detected!( "bmi1" ) ) ;
128
137
println ! ( "bmi2: {:?}" , is_x86_feature_detected!( "bmi2" ) ) ;
129
138
println ! ( "cmpxchg16b: {:?}" , is_x86_feature_detected!( "cmpxchg16b" ) ) ;
@@ -138,16 +147,17 @@ fn x86_all() {
138
147
println ! ( "rdseed: {:?}" , is_x86_feature_detected!( "rdseed" ) ) ;
139
148
println ! ( "rtm: {:?}" , is_x86_feature_detected!( "rtm" ) ) ;
140
149
println ! ( "sha: {:?}" , is_x86_feature_detected!( "sha" ) ) ;
141
- println ! ( "sse: {:?}" , is_x86_feature_detected!( "sse" ) ) ;
142
150
println ! ( "sse2: {:?}" , is_x86_feature_detected!( "sse2" ) ) ;
143
151
println ! ( "sse3: {:?}" , is_x86_feature_detected!( "sse3" ) ) ;
144
152
println ! ( "sse4.1: {:?}" , is_x86_feature_detected!( "sse4.1" ) ) ;
145
153
println ! ( "sse4.2: {:?}" , is_x86_feature_detected!( "sse4.2" ) ) ;
146
154
println ! ( "sse4a: {:?}" , is_x86_feature_detected!( "sse4a" ) ) ;
155
+ println ! ( "sse: {:?}" , is_x86_feature_detected!( "sse" ) ) ;
147
156
println ! ( "ssse3: {:?}" , is_x86_feature_detected!( "ssse3" ) ) ;
148
157
println ! ( "tbm: {:?}" , is_x86_feature_detected!( "tbm" ) ) ;
149
158
println ! ( "xsave: {:?}" , is_x86_feature_detected!( "xsave" ) ) ;
150
159
println ! ( "xsavec: {:?}" , is_x86_feature_detected!( "xsavec" ) ) ;
151
160
println ! ( "xsaveopt: {:?}" , is_x86_feature_detected!( "xsaveopt" ) ) ;
152
161
println ! ( "xsaves: {:?}" , is_x86_feature_detected!( "xsaves" ) ) ;
162
+ // tidy-alphabetical-end
153
163
}
0 commit comments