rust/library/std/src
Matthias Krüger 76370238b0
Rollup merge of #144938 - tgross35:more-outline-atomics, r=davidtwco
Enable `outline-atomics` by default on more AArch64 platforms

The baseline Armv8.0 ISA doesn't have atomics instructions, but in
practice most hardware is at least Armv8.1-A (2014), which includes
single-instruction atomics as part of the LSE feature. As a performance
optimization for these cases, GCC and LLVM have the `-moutline-atomics` flag
to turn atomic operations into calls to symbols like `__aarch64_cas1_acq`.
These can do runtime feature detection and use the LSE instructions if
available, falling back to more portable load-exclusive/store-exclusive
loops.

Since the recent 3b50253b57 ("compiler-builtins: plumb LSE support
for aarch64 on linux") our builtins support this LSE optimization, and
since 6936bb975a ("Dynamically enable LSE for aarch64 rust provided
intrinsics"), std will set the flag as part of its startup code. The first
commit in this PR configures this to work on all platforms built with
`outline-atomics`, not just Linux.

Thus, enable `outline-atomics` by default on Android, OpenBSD, Windows,
and Fuchsia platforms that don't have LSE in the baseline. The feature is
already enabled on Linux. Platform-specific details are included in each
commit message.

The current implementation can still be accessed by setting
`-Ctarget-feature=-outline-atomics`. Setting `-Ctarget-feature=+lse` or
a relevant CPU will use the single-instruction atomics without the call
overhead. https://rust.godbolt.org/z/dsdrzszoe

Link: https://learn.arm.com/learning-paths/servers-and-cloud-computing/lse/intro/
Original Clang outline-atomics benchmarks: https://reviews.llvm.org/D91157#2435844

try-job: aarch64-msvc-*
try-job: arm-android
try-job: dist-android
try-job: dist-aarch64-llvm-mingw
try-job: dist-aarch64-msvc
try-job: dist-various-*
try-job: test-various
2025-12-09 17:36:47 +01:00
..
backtrace remove redundant imports 2023-12-10 10:56:22 +08:00
collections Rollup merge of #149204 - winningMove:patch-1, r=chenyukang 2025-11-22 18:41:25 +01:00
ffi Rework c_variadic 2025-12-04 10:51:34 +01:00
fs Rollup merge of #148937 - joshtriplett:borrowed-buf-no-init-tracking, r=Amanieu 2025-12-03 07:36:12 +01:00
hash remove const_hash feature leftovers 2024-11-02 11:27:14 +01:00
io Rollup merge of #149521 - a1phyr:improve_io_error, r=joboet 2025-12-04 09:22:10 +01:00
net Remove initialized-bytes tracking from BorrowedBuf and BorrowedCursor 2025-12-02 01:32:27 -08:00
num Rollup merge of #148935 - Wilfred:fix_remainder_docs, r=Mark-Simulacrum 2025-12-08 11:46:22 +11:00
os std: Use more unix.rs code on WASI targets 2025-12-08 06:46:28 -08:00
prelude Make derive_const usable within libcore again 2025-07-17 15:42:54 +00:00
process Remove initialized-bytes tracking from BorrowedBuf and BorrowedCursor 2025-12-02 01:32:27 -08:00
sync Clarify edge cases for Barrier::new 2025-11-30 17:14:46 +08:00
sys Rollup merge of #144938 - tgross35:more-outline-atomics, r=davidtwco 2025-12-09 17:36:47 +01:00
sys_common Implement Debug for EncodeWide 2025-09-16 13:11:34 -06:00
thread ThreadId generation fallback path: avoid spurious yields 2025-11-30 22:52:28 +01:00
alloc.rs Auto merge of #144465 - orlp:system-alloc-tls, r=Mark-Simulacrum 2025-11-29 02:08:53 +00:00
ascii.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
backtrace.rs Fix new function_casts_as_integer lint errors in core, std, panic_unwind and compiler crates 2025-11-10 16:38:28 +01:00
bstr.rs Implement ByteStr and ByteString types 2025-01-11 06:35:21 +02:00
env.rs Fix missing double-quote in std::env::consts::OS values 2025-11-24 18:02:24 +01:00
error.rs Move std::error unit tests to integration tests 2025-01-26 10:28:04 +00:00
fs.rs Fix typo "an" → "and" 2025-12-08 18:52:46 +01:00
keyword_docs.rs Document fully-qualified syntax in as' keyword doc 2025-10-03 17:31:55 +03:00
lib.miri.rs add 'x.py miri', and make it work for 'library/{core,alloc,std}' 2024-04-03 20:27:20 +02:00
lib.rs Rollup merge of #149102 - bend-n:maybe_uninit_slice, r=joboet 2025-12-01 17:55:06 +01:00
macros.rs Revert "feat: implement hash_map! macro" 2025-10-23 12:37:53 -07:00
panic.rs Update CURRENT_RUSTC_VERSION post-bump 2025-09-26 18:41:32 -04:00
panicking.rs Show backtrace on allocation failures when possible 2025-11-26 14:02:37 +00:00
pat.rs Add pattern types to parser 2024-04-08 11:57:17 +00:00
path.rs Implement some conversions using Box::clone_from_ref 2025-11-19 13:34:03 -06:00
process.rs Add Command::get_env_clear 2025-11-18 19:37:52 -06:00
random.rs random: Provide a Distribution<T> trait 2025-07-11 10:21:34 -07:00
rt.rs remember the main thread ID before performing platform initialisation 2025-12-02 18:03:33 +01:00
test_helpers.rs std: get rid of sys_common::io 2025-02-07 16:54:07 +01:00
time.rs Fix documentation of Instant::now on mac 2025-10-10 20:01:03 +01:00