- 
                Notifications
    
You must be signed in to change notification settings  - Fork 13.9k
 
Description
This is a tracking issue for the #[target_feature] segment of RFC 2045 (rust-lang/rfcs#2045).
#[cfg(target_feature)] was tracked in #29717 and has since been stabilized.
This tracks the following feature gates: aarch64_unstable_target_feature, aarch64_ver_target_feature, arm_target_feature, bpf_target_feature, csky_target_feature, ermsb_target_feature, hexagon_target_feature, lahfsahf_target_feature, loongarch_target_feature, mips_target_feature, powerpc_target_feature, prfchw_target_feature, riscv_target_feature, rtm_target_feature, s390x_target_feature, sse4a_target_feature, tbm_target_feature, wasm_target_feature, x87_target_feature.
Steps
-  Implement the proposed 
#[target_feature]semantics -  Document these semantics: Document 
target_featureandcfg_target_feature. reference#545 -  Stabilize
- x86_64 & i686
- The basic set (sse–sse4.2, avx, avx2, ...) (Stabilize x86/x86_64 SIMD #49664)
 - adx: Stabilize ADX target feature #93745
 - avx512
 -  
mmx(never going to be stabilized) - sse4a
 - tbm
 - lahfsahf
 - prfchw
 
 - arm
 - aarch64
 - hexagon
 - powerpc
 - mips
 
 - x86_64 & i686
 
@gnzlbg have anything else you want filled out here?
(below added from comments on PR)
- consensus on the API for run-time feature detection
 -  should 
cfg!(feature)work across #[inline(always)] functions, generics, etc? 
And some related tasks:
-  API breaking change: allow 
#[target_feature]on unsafe functions only -  API breaking change: 
#[target_feature = "+feature"]=>#[target_feature(enable = "feature")] -  fix bug: 
cfg_target_featureandtarget_featuredon't interact properly #42515 - resolve bug: repr(simd) is unsound #44367
 -  When should 
cfg(target_feature = "backchain")(s390x target feature) be enabled? #142412