@@ -102,10 +102,9 @@ use rustc_codegen_ssa::back::write::{
102
102
CodegenContext , FatLtoInput , ModuleConfig , TargetMachineFactoryFn ,
103
103
} ;
104
104
use rustc_codegen_ssa:: base:: codegen_crate;
105
+ use rustc_codegen_ssa:: target_features:: cfg_target_feature;
105
106
use rustc_codegen_ssa:: traits:: { CodegenBackend , ExtraBackendMethods , WriteBackendMethods } ;
106
- use rustc_codegen_ssa:: {
107
- CodegenResults , CompiledModule , ModuleCodegen , TargetConfig , target_features,
108
- } ;
107
+ use rustc_codegen_ssa:: { CodegenResults , CompiledModule , ModuleCodegen , TargetConfig } ;
109
108
use rustc_data_structures:: fx:: FxIndexMap ;
110
109
use rustc_data_structures:: sync:: IntoDynSyncSend ;
111
110
use rustc_errors:: DiagCtxtHandle ;
@@ -478,25 +477,21 @@ fn to_gcc_opt_level(optlevel: Option<OptLevel>) -> OptimizationLevel {
478
477
479
478
/// Returns the features that should be set in `cfg(target_feature)`.
480
479
fn target_config ( sess : & Session , target_info : & LockedTargetInfo ) -> TargetConfig {
481
- let ( unstable_target_features, target_features) = target_features:: cfg_target_feature (
482
- sess,
483
- /* FIXME: we ignore `-Ctarget-feature` */ "" ,
484
- |feature| {
485
- // TODO: we disable Neon for now since we don't support the LLVM intrinsics for it.
486
- if feature == "neon" {
487
- return false ;
488
- }
489
- target_info. cpu_supports ( feature)
490
- // cSpell:disable
491
- /*
492
- adx, aes, avx, avx2, avx512bf16, avx512bitalg, avx512bw, avx512cd, avx512dq, avx512er, avx512f, avx512fp16, avx512ifma,
493
- avx512pf, avx512vbmi, avx512vbmi2, avx512vl, avx512vnni, avx512vp2intersect, avx512vpopcntdq,
494
- bmi1, bmi2, cmpxchg16b, ermsb, f16c, fma, fxsr, gfni, lzcnt, movbe, pclmulqdq, popcnt, rdrand, rdseed, rtm,
495
- sha, sse, sse2, sse3, sse4.1, sse4.2, sse4a, ssse3, tbm, vaes, vpclmulqdq, xsave, xsavec, xsaveopt, xsaves
496
- */
497
- // cSpell:enable
498
- } ,
499
- ) ;
480
+ let ( unstable_target_features, target_features) = cfg_target_feature ( sess, |feature| {
481
+ // TODO: we disable Neon for now since we don't support the LLVM intrinsics for it.
482
+ if feature == "neon" {
483
+ return false ;
484
+ }
485
+ target_info. cpu_supports ( feature)
486
+ // cSpell:disable
487
+ /*
488
+ adx, aes, avx, avx2, avx512bf16, avx512bitalg, avx512bw, avx512cd, avx512dq, avx512er, avx512f, avx512fp16, avx512ifma,
489
+ avx512pf, avx512vbmi, avx512vbmi2, avx512vl, avx512vnni, avx512vp2intersect, avx512vpopcntdq,
490
+ bmi1, bmi2, cmpxchg16b, ermsb, f16c, fma, fxsr, gfni, lzcnt, movbe, pclmulqdq, popcnt, rdrand, rdseed, rtm,
491
+ sha, sse, sse2, sse3, sse4.1, sse4.2, sse4a, ssse3, tbm, vaes, vpclmulqdq, xsave, xsavec, xsaveopt, xsaves
492
+ */
493
+ // cSpell:enable
494
+ } ) ;
500
495
501
496
let has_reliable_f16 = target_info. supports_target_dependent_type ( CType :: Float16 ) ;
502
497
let has_reliable_f128 = target_info. supports_target_dependent_type ( CType :: Float128 ) ;
0 commit comments