@@ -47,18 +47,18 @@ fn main() {
47
47
48
48
if version. minor >= 80 {
49
49
println ! (
50
- r#"cargo:rustc-check-cfg=cfg(target_feature,values("experimental-zacas","fast-serialization","load-store-on-cond","distinct-ops","miscellaneous-extensions-3"))"#
50
+ r#"cargo:rustc-check-cfg=cfg(target_feature,values("lsfe"," experimental-zacas","fast-serialization","load-store-on-cond","distinct-ops","miscellaneous-extensions-3"))"#
51
51
) ;
52
52
53
53
// Custom cfgs set by build script. Not public API.
54
54
// grep -F 'cargo:rustc-cfg=' build.rs | grep -Ev '^ *//' | sed -E 's/^.*cargo:rustc-cfg=//; s/(=\\)?".*$//' | LC_ALL=C sort -u | tr '\n' ',' | sed -E 's/,$/\n/'
55
55
println ! (
56
- "cargo:rustc-check-cfg=cfg(portable_atomic_disable_fiq,portable_atomic_force_amo,portable_atomic_ll_sc_rmw,portable_atomic_new_atomic_intrinsics,portable_atomic_no_asm,portable_atomic_no_asm_maybe_uninit,portable_atomic_no_atomic_64,portable_atomic_no_atomic_cas,portable_atomic_no_atomic_load_store,portable_atomic_no_atomic_min_max,portable_atomic_no_cfg_target_has_atomic,portable_atomic_no_cmpxchg16b_intrinsic,portable_atomic_no_cmpxchg16b_target_feature,portable_atomic_no_const_mut_refs,portable_atomic_no_const_raw_ptr_deref,portable_atomic_no_const_transmute,portable_atomic_no_core_unwind_safe,portable_atomic_no_diagnostic_namespace,portable_atomic_no_offset_of,portable_atomic_no_strict_provenance,portable_atomic_no_stronger_failure_ordering,portable_atomic_no_track_caller,portable_atomic_no_unsafe_op_in_unsafe_fn,portable_atomic_pre_llvm_15,portable_atomic_pre_llvm_16,portable_atomic_pre_llvm_18,portable_atomic_s_mode,portable_atomic_sanitize_thread,portable_atomic_target_feature,portable_atomic_unsafe_assume_single_core,portable_atomic_unstable_asm,portable_atomic_unstable_asm_experimental_arch,portable_atomic_unstable_cfg_target_has_atomic,portable_atomic_unstable_isa_attribute)"
56
+ "cargo:rustc-check-cfg=cfg(portable_atomic_disable_fiq,portable_atomic_force_amo,portable_atomic_ll_sc_rmw,portable_atomic_new_atomic_intrinsics,portable_atomic_no_asm,portable_atomic_no_asm_maybe_uninit,portable_atomic_no_atomic_64,portable_atomic_no_atomic_cas,portable_atomic_no_atomic_load_store,portable_atomic_no_atomic_min_max,portable_atomic_no_cfg_target_has_atomic,portable_atomic_no_cmpxchg16b_intrinsic,portable_atomic_no_cmpxchg16b_target_feature,portable_atomic_no_const_mut_refs,portable_atomic_no_const_raw_ptr_deref,portable_atomic_no_const_transmute,portable_atomic_no_core_unwind_safe,portable_atomic_no_diagnostic_namespace,portable_atomic_no_offset_of,portable_atomic_no_strict_provenance,portable_atomic_no_stronger_failure_ordering,portable_atomic_no_track_caller,portable_atomic_no_unsafe_op_in_unsafe_fn,portable_atomic_pre_llvm_15,portable_atomic_pre_llvm_16,portable_atomic_pre_llvm_18,portable_atomic_pre_llvm_20,portable_atomic_s_mode,portable_atomic_sanitize_thread,portable_atomic_target_feature,portable_atomic_unsafe_assume_single_core,portable_atomic_unstable_asm,portable_atomic_unstable_asm_experimental_arch,portable_atomic_unstable_cfg_target_has_atomic,portable_atomic_unstable_isa_attribute)"
57
57
) ;
58
58
// TODO: handle multi-line target_feature_fallback
59
59
// grep -F 'target_feature_fallback("' build.rs | grep -Ev '^ *//' | sed -E 's/^.*target_feature_fallback\(//; s/",.*$/"/' | LC_ALL=C sort -u | tr '\n' ',' | sed -E 's/,$/\n/'
60
60
println ! (
61
- r#"cargo:rustc-check-cfg=cfg(portable_atomic_target_feature,values("cmpxchg16b","distinct-ops","experimental-zacas","fast-serialization","load-store-on-cond","lse","lse128","lse2","mclass","miscellaneous-extensions-3","quadword-atomics","rcpc3","v6","zaamo","zabha"))"#
61
+ r#"cargo:rustc-check-cfg=cfg(portable_atomic_target_feature,values("cmpxchg16b","distinct-ops","experimental-zacas","fast-serialization","load-store-on-cond","lse","lse128","lse2","lsfe"," mclass","miscellaneous-extensions-3","quadword-atomics","rcpc3","v6","zaamo","zabha"))"#
62
62
) ;
63
63
}
64
64
@@ -206,12 +206,15 @@ fn main() {
206
206
println ! ( "cargo:rustc-cfg=portable_atomic_no_atomic_load_store" ) ;
207
207
}
208
208
209
- if version. llvm < 18 {
210
- println ! ( "cargo:rustc-cfg=portable_atomic_pre_llvm_18" ) ;
211
- if version. llvm < 16 {
212
- println ! ( "cargo:rustc-cfg=portable_atomic_pre_llvm_16" ) ;
213
- if version. llvm < 15 {
214
- println ! ( "cargo:rustc-cfg=portable_atomic_pre_llvm_15" ) ;
209
+ if version. llvm < 20 {
210
+ println ! ( "cargo:rustc-cfg=portable_atomic_pre_llvm_20" ) ;
211
+ if version. llvm < 18 {
212
+ println ! ( "cargo:rustc-cfg=portable_atomic_pre_llvm_18" ) ;
213
+ if version. llvm < 16 {
214
+ println ! ( "cargo:rustc-cfg=portable_atomic_pre_llvm_16" ) ;
215
+ if version. llvm < 15 {
216
+ println ! ( "cargo:rustc-cfg=portable_atomic_pre_llvm_15" ) ;
217
+ }
215
218
}
216
219
}
217
220
}
@@ -282,6 +285,9 @@ fn main() {
282
285
target_feature_fallback ( "lse" , lse) ;
283
286
}
284
287
}
288
+ // As of rustc 1.84, target_feature "lsfe" is not available on rustc side:
289
+ // https://github.com/rust-lang/rust/blob/1.84.0/compiler/rustc_target/src/target_features.rs
290
+ target_feature_fallback ( "lsfe" , false ) ;
285
291
286
292
// As of Apple M1/M1 Pro, on Apple hardware, CAS-loop-based RMW is much slower than
287
293
// LL/SC-loop-based RMW: https://github.com/taiki-e/portable-atomic/pull/89
0 commit comments