@@ -54,42 +54,62 @@ fn powerpc64_linux() {
5454#[ test]
5555#[ cfg( any( target_arch = "x86" , target_arch = "x86_64" ) ) ]
5656fn x86_all ( ) {
57+ // the below is the set of features we can test at runtime, but don't actually
58+ // use to gate anything and are thus not part of the X86_ALLOWED_FEATURES list
59+
60+ println ! ( "abm: {:?}" , is_x86_feature_detected!( "abm" ) ) ; // this is a synonym for lzcnt but we test it anyways
61+ println ! ( "mmx: {:?}" , is_x86_feature_detected!( "mmx" ) ) ;
62+ println ! ( "tsc: {:?}" , is_x86_feature_detected!( "tsc" ) ) ;
63+
64+ // the below is in alphabetical order and matches
65+ // the order of X86_ALLOWED_FEATURES in rustc_codegen_ssa's target_features.rs
66+
67+ println ! ( "adx: {:?}" , is_x86_feature_detected!( "adx" ) ) ;
5768 println ! ( "aes: {:?}" , is_x86_feature_detected!( "aes" ) ) ;
58- println ! ( "pcmulqdq: {:?}" , is_x86_feature_detected!( "pclmulqdq" ) ) ;
69+ println ! ( "avx: {:?}" , is_x86_feature_detected!( "avx" ) ) ;
70+ println ! ( "avx2: {:?}" , is_x86_feature_detected!( "avx2" ) ) ;
71+ println ! ( "avx512bf16: {:?}" , is_x86_feature_detected!( "avx512bf16" ) ) ;
72+ println ! ( "avx512bitalg: {:?}" , is_x86_feature_detected!( "avx512bitalg" ) ) ;
73+ println ! ( "avx512bw: {:?}" , is_x86_feature_detected!( "avx512bw" ) ) ;
74+ println ! ( "avx512cd: {:?}" , is_x86_feature_detected!( "avx512cd" ) ) ;
75+ println ! ( "avx512dq: {:?}" , is_x86_feature_detected!( "avx512dq" ) ) ;
76+ println ! ( "avx512er: {:?}" , is_x86_feature_detected!( "avx512er" ) ) ;
77+ println ! ( "avx512f: {:?}" , is_x86_feature_detected!( "avx512f" ) ) ;
78+ println ! ( "avx512gfni: {:?}" , is_x86_feature_detected!( "avx512gfni" ) ) ;
79+ println ! ( "avx512ifma: {:?}" , is_x86_feature_detected!( "avx512ifma" ) ) ;
80+ println ! ( "avx512pf: {:?}" , is_x86_feature_detected!( "avx512pf" ) ) ;
81+ println ! ( "avx512vaes: {:?}" , is_x86_feature_detected!( "avx512vaes" ) ) ;
82+ println ! ( "avx512vbmi: {:?}" , is_x86_feature_detected!( "avx512vbmi" ) ) ;
83+ println ! ( "avx512vbmi2: {:?}" , is_x86_feature_detected!( "avx512vbmi2" ) ) ;
84+ println ! ( "avx512vl: {:?}" , is_x86_feature_detected!( "avx512vl" ) ) ;
85+ println ! ( "avx512vnni: {:?}" , is_x86_feature_detected!( "avx512vnni" ) ) ;
86+ println ! ( "avx512vp2intersect: {:?}" , is_x86_feature_detected!( "avx512vp2intersect" ) ) ;
87+ println ! ( "avx512vpclmulqdq: {:?}" , is_x86_feature_detected!( "avx512vpclmulqdq" ) ) ;
88+ println ! ( "avx512vpopcntdq: {:?}" , is_x86_feature_detected!( "avx512vpopcntdq" ) ) ;
89+ println ! ( "bmi1: {:?}" , is_x86_feature_detected!( "bmi1" ) ) ;
90+ println ! ( "bmi2: {:?}" , is_x86_feature_detected!( "bmi2" ) ) ;
91+ println ! ( "cmpxchg16b: {:?}" , is_x86_feature_detected!( "cmpxchg16b" ) ) ;
92+ println ! ( "f16c: {:?}" , is_x86_feature_detected!( "f16c" ) ) ;
93+ println ! ( "fma: {:?}" , is_x86_feature_detected!( "fma" ) ) ;
94+ println ! ( "fxsr: {:?}" , is_x86_feature_detected!( "fxsr" ) ) ;
95+ println ! ( "lzcnt: {:?}" , is_x86_feature_detected!( "lzcnt" ) ) ;
96+ //println!("movbe: {:?}", is_x86_feature_detected!("movbe")); // movbe is unsupported as a target feature
97+ println ! ( "pclmulqdq: {:?}" , is_x86_feature_detected!( "pclmulqdq" ) ) ;
98+ println ! ( "popcnt: {:?}" , is_x86_feature_detected!( "popcnt" ) ) ;
5999 println ! ( "rdrand: {:?}" , is_x86_feature_detected!( "rdrand" ) ) ;
60100 println ! ( "rdseed: {:?}" , is_x86_feature_detected!( "rdseed" ) ) ;
61- println ! ( "tsc : {:?}" , is_x86_feature_detected!( "tsc " ) ) ;
62- println ! ( "mmx : {:?}" , is_x86_feature_detected!( "mmx " ) ) ;
101+ println ! ( "rtm : {:?}" , is_x86_feature_detected!( "rtm " ) ) ;
102+ println ! ( "sha : {:?}" , is_x86_feature_detected!( "sha " ) ) ;
63103 println ! ( "sse: {:?}" , is_x86_feature_detected!( "sse" ) ) ;
64104 println ! ( "sse2: {:?}" , is_x86_feature_detected!( "sse2" ) ) ;
65105 println ! ( "sse3: {:?}" , is_x86_feature_detected!( "sse3" ) ) ;
66- println ! ( "ssse3: {:?}" , is_x86_feature_detected!( "ssse3" ) ) ;
67106 println ! ( "sse4.1: {:?}" , is_x86_feature_detected!( "sse4.1" ) ) ;
68107 println ! ( "sse4.2: {:?}" , is_x86_feature_detected!( "sse4.2" ) ) ;
69108 println ! ( "sse4a: {:?}" , is_x86_feature_detected!( "sse4a" ) ) ;
70- println ! ( "sha: {:?}" , is_x86_feature_detected!( "sha" ) ) ;
71- println ! ( "avx: {:?}" , is_x86_feature_detected!( "avx" ) ) ;
72- println ! ( "avx2: {:?}" , is_x86_feature_detected!( "avx2" ) ) ;
73- println ! ( "avx512f {:?}" , is_x86_feature_detected!( "avx512f" ) ) ;
74- println ! ( "avx512cd {:?}" , is_x86_feature_detected!( "avx512cd" ) ) ;
75- println ! ( "avx512er {:?}" , is_x86_feature_detected!( "avx512er" ) ) ;
76- println ! ( "avx512pf {:?}" , is_x86_feature_detected!( "avx512pf" ) ) ;
77- println ! ( "avx512bw {:?}" , is_x86_feature_detected!( "avx512bw" ) ) ;
78- println ! ( "avx512dq {:?}" , is_x86_feature_detected!( "avx512dq" ) ) ;
79- println ! ( "avx512vl {:?}" , is_x86_feature_detected!( "avx512vl" ) ) ;
80- println ! ( "avx512_ifma {:?}" , is_x86_feature_detected!( "avx512ifma" ) ) ;
81- println ! ( "avx512_vbmi {:?}" , is_x86_feature_detected!( "avx512vbmi" ) ) ;
82- println ! ( "avx512_vpopcntdq {:?}" , is_x86_feature_detected!( "avx512vpopcntdq" ) ) ;
83- println ! ( "fma: {:?}" , is_x86_feature_detected!( "fma" ) ) ;
84- println ! ( "bmi1: {:?}" , is_x86_feature_detected!( "bmi1" ) ) ;
85- println ! ( "bmi2: {:?}" , is_x86_feature_detected!( "bmi2" ) ) ;
86- println ! ( "abm: {:?}" , is_x86_feature_detected!( "abm" ) ) ;
87- println ! ( "lzcnt: {:?}" , is_x86_feature_detected!( "lzcnt" ) ) ;
109+ println ! ( "ssse3: {:?}" , is_x86_feature_detected!( "ssse3" ) ) ;
88110 println ! ( "tbm: {:?}" , is_x86_feature_detected!( "tbm" ) ) ;
89- println ! ( "popcnt: {:?}" , is_x86_feature_detected!( "popcnt" ) ) ;
90- println ! ( "fxsr: {:?}" , is_x86_feature_detected!( "fxsr" ) ) ;
91111 println ! ( "xsave: {:?}" , is_x86_feature_detected!( "xsave" ) ) ;
112+ println ! ( "xsavec: {:?}" , is_x86_feature_detected!( "xsavec" ) ) ;
92113 println ! ( "xsaveopt: {:?}" , is_x86_feature_detected!( "xsaveopt" ) ) ;
93114 println ! ( "xsaves: {:?}" , is_x86_feature_detected!( "xsaves" ) ) ;
94- println ! ( "xsavec: {:?}" , is_x86_feature_detected!( "xsavec" ) ) ;
95115}
0 commit comments