@@ -187,7 +187,6 @@ pub fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> SmallVec<[&'a str; 2]
187187 ( "x86" , "avx512vaes" ) => smallvec ! [ "vaes" ] ,
188188 ( "x86" , "avx512gfni" ) => smallvec ! [ "gfni" ] ,
189189 ( "x86" , "avx512vpclmulqdq" ) => smallvec ! [ "vpclmulqdq" ] ,
190- ( "aarch64" , "fp" ) => smallvec ! [ "fp-armv8" ] ,
191190 ( "aarch64" , "rcpc2" ) => smallvec ! [ "rcpc-immo" ] ,
192191 ( "aarch64" , "dpb" ) => smallvec ! [ "ccpp" ] ,
193192 ( "aarch64" , "dpb2" ) => smallvec ! [ "ccdp" ] ,
@@ -230,6 +229,8 @@ pub fn check_tied_features(
230229 None
231230}
232231
232+ // Used to generate cfg variables and apply features
233+ // Must express features in the way Rust understands them
233234pub fn target_features ( sess : & Session ) -> Vec < Symbol > {
234235 let target_machine = create_informational_target_machine ( sess) ;
235236 let mut features: Vec < Symbol > =
@@ -239,13 +240,14 @@ pub fn target_features(sess: &Session) -> Vec<Symbol> {
239240 if sess. is_nightly_build ( ) || gate. is_none ( ) { Some ( feature) } else { None }
240241 } )
241242 . filter ( |feature| {
243+ // check that all features in a given smallvec are enabled
242244 for llvm_feature in to_llvm_features ( sess, feature) {
243245 let cstr = SmallCStr :: new ( llvm_feature) ;
244- if unsafe { llvm:: LLVMRustHasFeature ( target_machine, cstr. as_ptr ( ) ) } {
245- return true ;
246+ if ! unsafe { llvm:: LLVMRustHasFeature ( target_machine, cstr. as_ptr ( ) ) } {
247+ return false ;
246248 }
247249 }
248- false
250+ true
249251 } )
250252 . map ( |feature| Symbol :: intern ( feature) )
251253 . collect ( ) ;
0 commit comments