@@ -187,7 +187,6 @@ pub fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> SmallVec<[&'a str; 2]
187
187
( "x86" , "avx512vaes" ) => smallvec ! [ "vaes" ] ,
188
188
( "x86" , "avx512gfni" ) => smallvec ! [ "gfni" ] ,
189
189
( "x86" , "avx512vpclmulqdq" ) => smallvec ! [ "vpclmulqdq" ] ,
190
- ( "aarch64" , "fp" ) => smallvec ! [ "fp-armv8" ] ,
191
190
( "aarch64" , "rcpc2" ) => smallvec ! [ "rcpc-immo" ] ,
192
191
( "aarch64" , "dpb" ) => smallvec ! [ "ccpp" ] ,
193
192
( "aarch64" , "dpb2" ) => smallvec ! [ "ccdp" ] ,
@@ -230,6 +229,8 @@ pub fn check_tied_features(
230
229
None
231
230
}
232
231
232
+ // Used to generate cfg variables and apply features
233
+ // Must express features in the way Rust understands them
233
234
pub fn target_features ( sess : & Session ) -> Vec < Symbol > {
234
235
let target_machine = create_informational_target_machine ( sess) ;
235
236
let mut features: Vec < Symbol > =
@@ -239,13 +240,14 @@ pub fn target_features(sess: &Session) -> Vec<Symbol> {
239
240
if sess. is_nightly_build ( ) || gate. is_none ( ) { Some ( feature) } else { None }
240
241
} )
241
242
. filter ( |feature| {
243
+ // check that all features in a given smallvec are enabled
242
244
for llvm_feature in to_llvm_features ( sess, feature) {
243
245
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 ;
246
248
}
247
249
}
248
- false
250
+ true
249
251
} )
250
252
. map ( |feature| Symbol :: intern ( feature) )
251
253
. collect ( ) ;
0 commit comments