portable-atomic
Portable atomic types including support for 128-bit atomics, atomic float, etc.
1.15.0
409M downloads/mo
#280 most downloaded on crates.io
taiki-e/portable-atomic
What this package is like to depend on
Last release 14 days ago
09 Aug 2026
Ships fairly regularly
a new release about every 2 months
Nearly every release is documented
notes for 49 of 49 stable releases
5 versions withdrawn
withdrawn after publishing
4 years old
54 releases · first in 2022
5 releases in the last 12 months
see the full history below
Release timeline
54 releases · Feb 2022 to Aug 2026Releases
latest 54-
1.15.009 Aug 2026Release notes
Open source →-
Work around
core::sync::atomicbug which may cause data races with non-relaxed load/CAS on pre-v6 ARM Linux/Android due to missing memory barrier. (#112) -
Make {8,16,32}-bit non-relaxed load compatible with read-only memory on pre-v6 ARM Linux/Android. Previously only relaxed load was compatible with read-only memory. (#112)
-
Make
from_ptrconst fnon Rust 1.58+. Previously it wasconst fnonly on Rust 1.83+. (c09d0e6) -
Optimize non-relaxed load/store on pre-v6 ARM Linux/Android. (#112)
-
Optimize fence on pre-v6 ARM Linux/Android. (#112)
-
Optimize 128-bit CAS/swap/min/max on s390x. This also includes removing the code complexity that caused the bug fixed in 1.14.0. (33cd7e5, 6c8f764)
-
Documentation improvements.
Release notes
Open source →-
Work around
core::sync::atomicbug which may cause data races with non-relaxed load/CAS on pre-v6 ARM Linux/Android due to missing memory barrier. (#112) -
Make {8,16,32}-bit non-relaxed load compatible with read-only memory on pre-v6 ARM Linux/Android. Previously only relaxed load was compatible with read-only memory. (#112)
-
Make
from_ptrconst fnon Rust 1.58+. Previously it wasconst fnonly on Rust 1.83+. (c09d0e6) -
Optimize non-relaxed load/store on pre-v6 ARM Linux/Android. (#112)
-
Optimize fence on pre-v6 ARM Linux/Android. (#112)
-
Optimize 128-bit CAS/swap/min/max on s390x. This also includes removing the code complexity that caused the bug fixed in 1.14.0. (33cd7e5, 6c8f764)
-
Documentation improvements.
-
-
1.14.017 Jul 2026Release notes
Open source →-
Guarantee that
is_lock_freeto always return the same result. (e74f384) -
Fix bug in 128-bit
fetch_{min,max}on pre-z196 s390x. (a6c6c4b) -
Fix bug in atomic float
fetch_{add,sub,max,min}on AArch64 when FEAT_LSFE is enabled. (There are currently no known CPUs that support FEAT_LSFE.) (b105f9bc) -
Fix panic in build script when custom target with non-standard name on non-nightly rustc. (02ca737)
-
Improve robustness of interrupt disable/restore on RISC-V and Xtensa. (88cb3d5)
-
Optimize SeqCst fence on x86. (9127b31)
-
Optimize 128-bit CAS when FEAT_LSE is not enabled. (671b9a89)
-
Optimize SeqCst atomics on AArch64 Windows MSVC. (671b9a89)
-
Optimize 8-bit fetch_and/fetch_or/fetch_xor/fetch_not on AVR when RMW instructions available. (6f2f11f2)
-
Optimize 128-bit RMW on s390x. (b8c502a9)
-
Optimize run-time CPU feature detection. (cae7032)
-
Enable run-time detection by default on AArch64 Apple targets. (6c92015)
-
Enable run-time detection by default on AArch64 illumos. (59e3636b)
-
aarch64: Support run-time detection of FEAT_LSE2 on Windows. (16bc44f0)
-
Make
portable_atomic_no_outline_atomicscfg no-op instead of compile error on unsupported architectures. (6b8e3eb) -
Improve compile-time detection of AVR target features. (2b5a9a4f)
-
Documentation improvements.
Release notes
Open source →-
Guarantee that
is_lock_freeto always return the same result. (e74f384) -
Fix bug in 128-bit
fetch_{min,max}on pre-z196 s390x. (a6c6c4b) -
Fix bug in atomic float
fetch_{add,sub,max,min}on AArch64 when FEAT_LSFE is enabled. (There are currently no known CPUs that support FEAT_LSFE.) (b105f9bc) -
Fix panic in build script when custom target with non-standard name on non-nightly rustc. (02ca737)
-
Improve robustness of interrupt disable/restore on RISC-V and Xtensa. (88cb3d5)
-
Optimize SeqCst fence on x86. (9127b31)
-
Optimize 128-bit CAS when FEAT_LSE is not enabled. (671b9a89)
-
Optimize SeqCst atomics on AArch64 Windows MSVC. (671b9a89)
-
Optimize 8-bit fetch_and/fetch_or/fetch_xor/fetch_not on AVR when RMW instructions available. (6f2f11f2)
-
Optimize 128-bit RMW on s390x. (b8c502a9)
-
Optimize run-time CPU feature detection. (cae7032)
-
Enable run-time detection by default on AArch64 Apple targets. (6c92015)
-
Enable run-time detection by default on AArch64 illumos. (59e3636b)
-
aarch64: Support run-time detection of FEAT_LSE2 on Windows. (16bc44f0)
-
Make
portable_atomic_no_outline_atomicscfg no-op instead of compile error on unsupported architectures. (6b8e3eb) -
Improve compile-time detection of AVR target features. (2b5a9a4f)
-
Documentation improvements.
-
-
1.13.131 Jan 2026Release notes
Open source →-
Work around rustc_codegen_gcc bugs on x86_64. (ae4c501)
-
Improve compile-time detection of RISC-V target features. (535fced)
-
Enable release immutability.
Release notes
Open source →-
Work around rustc_codegen_gcc bugs on x86_64. (ae4c501)
-
Improve compile-time detection of RISC-V target features. (535fced)
-
Enable release immutability.
-
1.13.027 Dec 2025Release notes
Open source →-
Add
unsafe-assume-privilegedfeature /portable_atomic_unsafe_assume_privilegedcfg for safer lock-based fallback on multi-core privileged environments. (b084ee1) -
Support
unsafe-assume-single-core/unsafe-assume-privilegedon all 32-bit Arm targets. Previously it was only M-profile and pre-v6 targets. (7e07f5e) -
Make
AtomicPtr::fetch_*strict-provenance compatible on all environments. Previously it was only strict-provenance compatible oncfg(miri)and otherwise permissive-provenance compatible. (4306943) -
Ensure sequential consistency in lock-based fallback when SeqCst is used. (7e80742)
-
Support compile-time detection for x86_64 VMOVDQA. (f7bb1aa)
-
Improve compile-time detection of s390x miscellaneous-extensions-3. (11045fe)
-
Optimize AVR 8-bit swap when RMW instructions available. (8cedb34)
-
Optimize interrupt restore on RISC-V. (9b97a2a)
Release notes
Open source →-
Add
unsafe-assume-privilegedfeature /portable_atomic_unsafe_assume_privilegedcfg for safer lock-based fallback on multi-core privileged environments. (b084ee1) -
Support
unsafe-assume-single-core/unsafe-assume-privilegedon all 32-bit Arm targets. Previously it was only M-profile and pre-v6 targets. (7e07f5e) -
Make
AtomicPtr::fetch_*strict-provenance compatible on all environments. Previously it was only strict-provenance compatible oncfg(miri)and otherwise permissive-provenance compatible. (4306943) -
Ensure sequential consistency in lock-based fallback when SeqCst is used. (7e80742)
-
Support compile-time detection for x86_64 VMOVDQA. (f7bb1aa)
-
Improve compile-time detection of s390x miscellaneous-extensions-3. (11045fe)
-
Optimize AVR 8-bit swap when RMW instructions available. (8cedb34)
-
Optimize interrupt restore on RISC-V. (9b97a2a)
-
-
1.12.019 Dec 2025Release notes
Open source →-
Fix build error on no-std pre-v6 Arm targets due to the recent upstream change. (83f6f3e)
-
Support
unsafe-assume-single-corefeature /portable_atomic_unsafe_assume_single_corecfg for targets with CAS. (38e9572) -
Improve compile-time detection of s390x target feature. (5ae0ef5)
-
Documentation improvements. (c84f720)
Release notes
Open source →-
Fix build error on no-std pre-v6 Arm targets due to the recent upstream change. (83f6f3e)
-
Support
unsafe-assume-single-corefeature /portable_atomic_unsafe_assume_single_corecfg for targets with CAS. (38e9572) -
Improve compile-time detection of s390x target feature. (5ae0ef5)
-
Documentation improvements. (c84f720)
-
-
1.11.106 Jun 2025Release notes
Open source →-
Fix build error when building aarch64/arm64ec/powerpc64/s390x targets for Miri or ThreadSanitizer since nightly-2025-05-31.
-
aarch64: Optimize atomic floats when FEAT_LSFE is enabled. (#201)
-
Improve compile-time detection of RISC-V Zacas extension. (b7634e2)
-
Improve run-time detection on linux-musl. (7fdad7f)
Release notes
Open source →-
Fix build error when building aarch64/arm64ec/powerpc64/s390x targets for Miri or ThreadSanitizer since nightly-2025-05-31.
-
aarch64: Optimize atomic floats when FEAT_LSFE is enabled. (#201)
-
Improve compile-time detection of RISC-V Zacas extension. (b7634e2)
-
Improve run-time detection on linux-musl. (7fdad7f)
-
Optimize interrupt restore on thumbv6m. (dd2004a)
-
-
1.11.024 Feb 2025Release notes
Open source →-
Work around nightly-2025-02-24 rustc regression causing "cannot use value of type
*mut Tfor inline assembly" error on RISC-V without A extension, MSP430, and pre-v6 no-std Arm targets. (eeb0235) -
Support
AtomicF16andAtomicF128for unstablef16andf128under unstable cfgs. (#200) -
RISC-V Zacas extension support is no longer experimental. (#206)
-
Improve support of run-time detection and outline-atomics:
- riscv: Enable run-time detection of Zacas extension by default on Linux/Android. (#207)
- aarch64: Support run-time detection of FEAT_LRCPC3/FEAT_LSE128 on FreeBSD. (6a5075d)
- powerpc64: Support run-time detection of quadword-atomics on AIX (currently disabled by default because detection support for AIX is experimental). (#102)
Release notes
Open source →-
Work around nightly-2025-02-24 rustc regression causing "cannot use value of type
*mut Tfor inline assembly" error on RISC-V without A extension, MSP430, and pre-v6 no-std Arm targets. (eeb0235) -
Support
AtomicF16andAtomicF128for unstablef16andf128under unstable cfgs. (#200) -
RISC-V Zacas extension support is no longer experimental. (#206)
-
Improve support of run-time detection and outline-atomics:
- riscv: Enable run-time detection of Zacas extension by default on Linux/Android. (#207)
- aarch64: Support run-time detection of FEAT_LRCPC3/FEAT_LSE128 on FreeBSD. (6a5075d)
- powerpc64: Support run-time detection of quadword-atomics on AIX (currently disabled by default because detection support for AIX is experimental). (#102)
-
-
1.10.023 Nov 2024Release notes
Open source →-
Update to stabilized s390x and Arm64EC inline assembly. (97645c1, e1d1a97)
-
Make
get_mutconst fnon Rust 1.83+. (0dea68c) -
Make
from_ptrconst fnon Rust 1.83+. (align to the std atomic change in Rust 1.84) (50532d8) -
Various optimizations:
-
Improve support of run-time detection and outline-atomics:
-
Support RISC-V Zacas extension on pre-1.82 rustc. (#194)
-
Improve compile-time detection of RISC-V Zaamo/Zabha extensions. (673137a)
-
Respect
RUSTC_BOOTSTRAP=-1recently added in nightly in rustc version detection. (5b2847a)
Release notes
Open source →-
Update to stabilized s390x and Arm64EC inline assembly. (97645c1, e1d1a97)
-
Make
get_mutconst fnon Rust 1.83+. (0dea68c) -
Make
from_ptrconst fnon Rust 1.83+. (align to the std atomic change in Rust 1.84) (50532d8) -
Various optimizations:
-
Improve support of run-time detection and outline-atomics:
-
Support RISC-V Zacas extension on pre-1.82 rustc. (#194)
-
Improve compile-time detection of RISC-V Zaamo/Zabha extensions. (673137a)
-
Respect
RUSTC_BOOTSTRAP=-1recently added in nightly in rustc version detection. (5b2847a)
-
-
1.9.028 Sep 2024Release notes
Open source →-
RISC-V without A-extension: Support RMW when Zaamo extension enabled (even when
unsafe-assume-single-coredisabled). (#185, 9983a8b) See "operations don't require disabling interrupts" list ininterruptmodule's readme for the operations provided. -
Support run-time detection of RISC-V Zacas extension (currently disabled by default). (#183)
-
Support 128-bit atomics on Arm64EC (currently nightly-only) (#184)
-
Improve compile-time detection of powerpc64 quadword-atomics. (3eb8507)
-
-
1.8.020 Sep 2024Release notes
Open source →-
Improve diagnostics when method that requires CAS is unavailable. (#181)
Before:
error[E0599]: no method named `compare_exchange` found for struct `portable_atomic::AtomicUsize` in the current scope --> src/race.rs:60:24 | 60 | self.inner.compare_exchange(0, value.get(), Ordering::AcqRel, Ordering::Acquire); | ^^^^^^^^^^^^^^^^ method not found in `AtomicUsize`After:
error[E0277]: `compare_exchange` requires atomic CAS but not available on this target by default --> src/race.rs:60:24 | 60 | self.inner.compare_exchange(0, value.get(), Ordering::AcqRel, Ordering::Acquire); | ^^^^^^^^^^^^^^^^ this associated function is not available on this target by default | = help: the trait `HasCompareExchange` is not implemented for `&portable_atomic::AtomicUsize` = note: consider enabling one of the `unsafe-assume-single-core` or `critical-section` Cargo features = note: see <https://docs.rs/portable-atomic/latest/portable_atomic/#optional-features> for more. -
Improve compile error messages for some other cases (19716ac, 61dcaaa)
-
Various improvements to RISC-V.
- riscv64: Support 128-bit atomics when Zacas extension enabled. (173) This is currently marked as experimental because LLVM marking the corresponding target feature as experimental.
- riscv32: Support 64-bit atomics when Zacas extension enabled. (173) This is currently marked as experimental because LLVM marking the corresponding target feature as experimental.
- Improvements for RISC-V without A-extension:
- Support zaamo target feature. When building for single-core RISC-V without A-extension, this is equivalent to force-amo feature (8abba4b)
- Support zabha target feature. (694364a)
- Strengthen SeqCst store to improve compatibility with code that uses atomic instruction mapping that differs from LLVM and GCC. (5b10b15)
-
Improve support of run-time detection and outline-atomics:
- aarch64: Support run-time detection of FEAT_LRCPC3/FEAT_LSE128 for load/store. (#174)
- aarch64: Support run-time detection of FEAT_LSE2 on OpenBSD. (4f8c735)
- aarch64: Support run-time detection of FEAT_LSE/FEAT_LSE2 on illumos (currently disabled by default because illumos AArch64 port is experimental). (#175)
- powerpc64: Support run-time detection on OpenBSD 7.6+ (currently disabled by default for compatibility with old versions). (09a967b)
-
Support AArch64 FEAT_LRCPC3/FEAT_LSE128 with pre-16 LLVM. (#178)
-
Improve compile-time detection of AArch64 FEAT_LSE2/FEAT_LRCPC3/FEAT_LSE128. (10d47de)
-
Relax minimal version of
serde(supported via optional feature) to 1.0.60.
-
-
1.7.019 Jul 2024Release notes
Open source →-
Support run-time detection for cmpxchg16b on x86_64 on pre-1.69 rustc. (#154)
-
Make
into_innerconst fnon Rust 1.56+. (align to the std atomic change in Rust 1.79) (dee1f89) -
Work around rustc_codegen_gcc bug on x86_64. (d938f77)
-
Optimize x86_64 atomics.
-
Make rustc version detection robust for custom toolchains. (f8ea85e)
-
Respect
RUSTC_WRAPPERin rustc version detection. -
Our build script is now less likely to be re-run unnecessarily in versions where the cargo bug fix is available (cargo 1.79+). (52c277b)
-
-
1.6.006 Dec 2023Release notes
Open source →-
Add
cfg_{has,no}_atomic_{8,16,32,64,128,ptr}macros to enable code when the corresponding atomic implementation is available/unavailable. -
Add
cfg_{has,no}_atomic_casmacros to enable code when atomic CAS/RMW implementation is available/unavailable. -
Improve support for RISC-V targets without atomic CAS.
-
-
1.5.129 Oct 2023Release notes
Open source →-
Fix bug in
i{8,16}fetch_{or,xor}on RISC-V without A-extension whereunsafe-assume-single-coreandforce-amoare enabled. -
Optimize
swapfor targets that do not have native atomic CAS instructions.
-
-
1.5.023 Oct 2023 withdrawnRelease notes
Open source →Note: This release has been yanked due to a bug fixed in 1.5.1.
-
Add
from_ptr. -
Add
force-amofeature (portable_atomic_force_amocfg) for single-core RISC-V without A-extension. (#124) -
Support run-time detection on AArch64 on pre-1.61 rustc. (#98)
This also solves a compatibility issue with rustc_codegen_cranelift.
-
Support run-time detection of FEAT_LSE2. (#126)
-
Support run-time detection of FEAT_LSE on AArch64 NetBSD. (#66)
-
Acknowledge ESP-IDF targets' 64-bit atomics are not lock-free. See #122 for more.
-
Optimize 128-bit weak CAS on powerpc64.
-
Optimize interrupt disable on no-std pre-v6 Arm where
unsafe-assume-single-coreanddisable-fiqare enabled. (771c45d) -
Improve detection of Apple hardware. (5c3a43b)
-
Improve compatibility with the future version of Miri.
-
-
1.4.325 Aug 2023 -
1.4.227 Jul 2023Release notes
Open source →- Optimize
AtomicBoolon RISC-V/LoongArch64. This is the same as rust-lang/rust#114034, but is available for all rustc versions.
- Optimize
-
1.4.115 Jul 2023 -
1.4.011 Jul 2023Release notes
Open source →-
Allow using embedded-related cfgs as Cargo features. (#94, thanks @Dirbaio)
Originally, we were providing these as cfgs instead of features, but based on a strong request from the embedded ecosystem, we have agreed to provide them as features as well. See #94 for more.
cfgs are kept and can be used as aliases for features.
-
Acknowledge all x86_64 Apple targets support 128-bit atomics.
Our code already recognizes this via
cfg(target_feature), so this only affects docs and users using pre-1.69 stable rustc.See also rust-lang/rust#112150.
-
Optimize 128-bit atomics on AArch64/s390x.
-
-
1.3.331 May 2023Release notes
Open source →-
Fix build error on AArch64 ILP32 ABI targets (tier 3).
-
Optimize 128-bit atomics on s390x.
-
-
1.3.209 May 2023Release notes
Open source →-
Fix bug in powerpc64/s390x 128-bit atomic RMWs on old nightly.
-
Optimize 128-bit atomics on powerpc64/s390x.
-
-
1.3.107 May 2023 -
1.3.006 May 2023Release notes
Open source →-
Add
require-casfeature. (#100)If your crate supports no-std environment and requires atomic CAS, enabling this feature will allow the
portable-atomicto display helpful error messages to users on targets requiring additional action on the user side to provide atomic CAS.[dependencies] portable-atomic = { version = "1.3", default-features = false, features = ["require-cas"] }See #100 for more.
-
Support
portable_atomic_unsafe_assume_single_corecfg on Xtensa targets without atomic CAS. (#86) -
Fix bug in AArch64 128-bit SeqCst load when FEAT_LSE2 is enabled at compile-time. This is the same bug that was fixed in the recently released GCC 13.1. LLVM also has the same bug, which had not yet been fixed when the patch was created; I will open a bug report if necessary after looking into the situation in LLVM. (a29154b)
-
Fix compile error on
bpf{eb,el}-unknown-none(tier 3) andmipsel-sony-psx(tier 3) whencritical-sectionfeature is disabled. -
Various optimizations
- Optimize x86_64 128-bit outline-atomics. This improves performance by up to 15% in concurrent RMW/store for cases where the
cmpxchg16btarget feature is not available at compile-time. (40c4cd4) - Optimize x86_64 128-bit load that uses cmpxchg16b. (40c4cd4)
- Optimize AArch64 128-bit load that uses FEAT_LSE. (40c4cd4)
- Optimize pre-Armv6 Linux/Android 64-bit atomics. (efacc89)
- Support outline-atomics for powerpc64 128-bit atomics. This is currently disabled by default, and can be enabled by
--cfg portable_atomic_outline_atomics. (#90) - Optimize AArch64 outline-atomics on linux-musl. On linux-musl, outline-atomics is enabled by default only when dynamic linking is enabled. When static linking is enabled, this can be enabled by
--cfg portable_atomic_outline_atomics. See theatomic128module's readme for more. (8418235, 31d0862)
- Optimize x86_64 128-bit outline-atomics. This improves performance by up to 15% in concurrent RMW/store for cases where the
-
-
1.2.025 Mar 2023Release notes
Open source →-
Make 64-bit atomics lock-free on Arm Linux/Android targets that do not have 64-bit atomics (e.g., armv5te-unknown-linux-gnueabi, arm-linux-androideabi, etc.) when the kernel version is 3.1 or later. (#82)
-
Fix AArch64 128-bit atomics performance regression on Apple hardware. (#89)
-
Optimize 128-bit atomics on AArch64, x86_64, powerpc64, and s390x.
-
-
1.1.024 Mar 2023Release notes
Open source →-
Add
Atomic{I,U}*::bit_{set,clear,toggle}andAtomicPtr::bit_{set,clear,toggle}. (#72)They correspond to x86's
lock bt{s,r,c}, and the implementation calls them on x86/x86_64. -
Add
AtomicU*::{fetch_neg,neg}methods. Previously it was only available onAtomicI*andAtomicF*. -
Add
as_ptrmethod to all atomic types. (#79) -
Make
AtomicF{32,64}::as_bitsconst fnon Rust 1.58+. (#79) -
Relax ordering in
Serializeimpl to reflect the upstream change. -
Optimize x86_64 outline-atomics for 128-bit atomics.
- Support outline-atomics for cmpxchg16b on Rust 1.69+ (i.e., on Rust 1.69+, x86_64 128-bit atomics is lock-free on all Intel chips and almost all AMD chips, even if cmpxchg16b is not available at compile-time.). Previously it was only nightly. (#80)
- portable-atomic no longer enables outline-atomics on target where run-time CPU feature detection is not available. (#80)
-
Optimize AArch64 outline-atomics for 128-bit atomics.
- Support more targets and improve performance. (#63, #64, #67, #69, #75, #76, #77)
See the
atomic128module's readme for a list of platforms that support outline-atomics. Most of these improvements have already been submitted and accepted in rust-lang/stdarch and will soon be available instd::arch::is_aarch64_feature_detected. - portable-atomic no longer enables outline-atomics on target where run-time CPU feature detection is not available.
- Support more targets and improve performance. (#63, #64, #67, #69, #75, #76, #77)
See the
-
Performance improvements. (#70, #81, 6c189ae, 13c92b0, etc.)
-
Documentation improvements.
-
-
1.0.121 Jan 2023 -
1.0.015 Jan 2023Release notes
Open source →-
Add
critical-sectionfeature to use critical-section on targets where atomic CAS is not natively available. (#51, thanks @Dirbaio)This is useful to get atomic CAS when
--cfg portable_atomic_unsafe_assume_single_corecan't be used, such as multi-core targets, unprivileged code running under some RTOS, or environments where disabling interrupts needs extra care due to e.g. real-time requirements.See documentation for more.
-
Remove
outline-atomicsfeature. This was no-op since 0.3.19. -
Documentation improvements.
-
-
0.3.2007 May 2023Release notes
Open source →The latest version of portable-atomic is 1.x. This release makes portable-atomic 0.3 is built on top of portable-atomic 1.x to make bug fixes and improvements such as support for new targets in 1.x available to the ecosystem that depends on older portable-atomic. portable-atomic 0.3 is still maintained passively, but upgrading to portable-atomic 1.x is recommended. (There are no breaking changes from 0.3, except that a deprecated no-op
outline-atomicsCargo feature has been removed.) (#99) -
0.3.1925 Dec 2022Release notes
Open source →-
Add
AtomicI*::{fetch_neg,neg}andAtomicF*::fetch_negmethods. (#54)AtomicI*::negare equivalent to the correspondingfetch_*methods, but do not return the previous value. They are intended for optimization on platforms that have atomic instructions for the corresponding operation, such as x86'slock neg.Currently, optimizations by these methods (
neg) are only guaranteed for x86/x86_64. -
Add
Atomic{I,U}*::{fetch_not,not}methods. (#54)Atomic{I,U}*::notare equivalent to the correspondingfetch_*methods, but do not return the previous value. They are intended for optimization on platforms that have atomic instructions for the corresponding operation, such as x86'slock not, MSP430'sinv.Currently, optimizations by these methods (
not) are only guaranteed for x86/x86_64 and MSP430.(Note:
AtomicBoolalready hasfetch_notandnotmethods.) -
Enable outline-atomics for 128-bit atomics by default. (#57) See #57 for more.
-
Improve support for old nightly compilers.
-
-
0.3.1815 Dec 2022Release notes
Open source →-
Fix build error when not using
portable_atomic_unsafe_assume_single_corecfg on AVR and MSP430 custom targets. (#50)Since 0.3.11, atomic CAS was supported without the cfg on AVR and MSP430 builtin targets, but that change was not applied to custom targets.
-
-
0.3.1714 Dec 2022Release notes
Open source →-
Optimize x86_64 128-bit atomic load/store on AMD CPU with AVX. (#49)
-
Improve support for custom targets on old rustc.
-
-
0.3.1609 Dec 2022Release notes
Open source →-
Add
Atomic{I,U}*::{add,sub,and,or,xor}andAtomicBool::{and,or,xor}methods. (#47)They are equivalent to the corresponding
fetch_*methods, but do not return the previous value. They are intended for optimization on platforms that implement atomics using inline assembly, such as the MSP430.Currently, optimizations by these methods (
add,sub,and,or,xor) are only guaranteed for MSP430; on x86/x86_64, LLVM can optimize in most cases, so cases, where this would improve things, should be rare. -
Various improvements to
portable_atomic_unsafe_assume_single_corecfg. (#44, #40)- Support disabling FIQs on pre-v6 Arm under
portable_atomic_disable_fiqcfg. - Support RISC-V supervisor mode under
portable_atomic_s_modecfg. - Optimize interrupt restore on AVR and MSP430. (#40)
- Documentation improvements.
See #44 for more.
- Support disabling FIQs on pre-v6 Arm under
-
-
0.3.1509 Sep 2022Release notes
Open source →-
Implement workaround for std cpuid bug due to LLVM bug (rust-lang/rust#101346, llvm/llvm-project#57550).
- Our use case is likely not affected, but we implement this just in case.
- We've confirmed that the uses of inline assembly in this crate are not affected by this LLVM bug.
-
-
0.3.1404 Sep 2022Release notes
Open source →-
Optimize atomic load/store on no-std pre-v6 Arm when
portable_atomic_unsafe_assume_single_corecfg is used. (#36) -
Support pre-power8 powerpc64le. powerpc64le's default cpu version is power8, but you can technically compile it for the old cpu using the unsafe
-C target-cpurustc flag.
-
-
0.3.1315 Aug 2022Release notes
Open source →-
Use track_caller when debug assertions are enabled on Rust 1.46+.
-
Make powerpc64 128-bit atomics compatible with Miri and ThreadSanitizer on LLVM 15+.
-
Document that 128-bit atomics are compatible with Miri and ThreadSanitizer on recent nightly.
-
-
0.3.1213 Aug 2022Release notes
Open source →- Support atomic CAS on no-std pre-v6 Arm targets (e.g., thumbv4t-none-eabi) under unsafe cfg
portable_atomic_unsafe_assume_single_core. (#28)
- Support atomic CAS on no-std pre-v6 Arm targets (e.g., thumbv4t-none-eabi) under unsafe cfg
-
0.3.1112 Aug 2022Release notes
Open source →-
Always provide atomic CAS for MSP430 and AVR. (#31)
This previously required unsafe cfg
portable_atomic_unsafe_assume_single_core, but since all MSP430 and AVR are single-core, we can safely provide atomic CAS based on disabling interrupts. -
Support
fenceandcompiler_fenceon MSP430. (On MSP430, the standard library's fences are currently unavailable due to LLVM errors.) -
Update safety requirements for unsafe cfg
portable_atomic_unsafe_assume_single_coreto mention use of privileged instructions to disable interrupts. -
Atomic operations based on disabling interrupts on single-core systems are now considered lock-free.
The previous behavior was inconsistent because we consider the pre-v6 Arm Linux's atomic operations provided in a similar way by the Linux kernel to be lock-free.
-
Respect
-Z allow-features.
-
-
0.3.1003 Aug 2022Release notes
Open source →- Optimize AArch64 128-bit atomic load when the
lsetarget feature is enabled at compile-time. (#20)
- Optimize AArch64 128-bit atomic load when the
-
0.3.903 Aug 2022 -
0.3.802 Aug 2022Release notes
Open source →- Make AArch64 and s390x 128-bit atomics compatible with Miri and ThreadSanitizer.
-
0.3.731 Jul 2022Release notes
Open source →-
Provide stable equivalent of
#![feature(strict_provenance_atomic_ptr)]. (#23)AtomicPtr::fetch_ptr_{add,sub}AtomicPtr::fetch_byte_{add,sub}AtomicPtr::fetch_{or,and,xor}
These APIs are compatible with strict-provenance on
cfg(miri). Otherwise, they are compatible with permissive-provenance. Once#![feature(strict_provenance_atomic_ptr)]is stabilized, these APIs will be strict-provenance compatible in all cases from the version in which it is stabilized. -
Provide stable equivalent of
#![feature(atomic_bool_fetch_not)]. (#24)AtomicBool::fetch_not
-
Optimize x86_64 128-bit RMWs. (#22)
-
Optimize x86_64 outline-atomics.
-
Optimize inline assemblies on Arm and AArch64.
-
Revert thumbv6m atomic load/store changes made in 0.3.5. This is because rust-lang/rust#99595 has been reverted, so this is no longer needed.
-
-
0.3.626 Jul 2022Release notes
Open source →-
Fix build failure due to the existence of the
specsdirectory. -
Documentation improvements.
-
Optimize inline assemblies on x86_64, RISC-V, and MSP430.
-
-
0.3.523 Jul 2022 withdrawnRelease notes
Open source →Note: This release has been yanked due to a bug fixed in 0.3.6.
-
Provide thumbv6m atomic load/store which is planned to be removed from the standard library in rust-lang/rust#99595. (#18)
-
Optimize inline assemblies on AArch64, RISC-V, and powerpc64.
-
-
0.3.425 Jun 2022 -
0.3.324 Jun 2022 -
0.3.219 Jun 2022 -
0.3.116 Jun 2022 -
0.3.025 Mar 2022Release notes
Open source →-
Support native 128-bit atomic operations for s390x (currently nightly-only).
-
Add
AtomicF{32,64}::fetch_abs. -
Add
#[must_use]to constructors. -
Use 128-bit atomic operation mappings same as LLVM on AArch64.
-
Remove
parking_lotoptional feature to allow the use of this crate within global allocators.
-
-
0.2.117 Mar 2022 -
0.2.010 Mar 2022Release notes
Open source →-
Remove
i128feature.Atomic{I,U}128are now always enabled. -
Add
outline-atomicsfeature. Currently, this is the same as the 0.1'si128-dynamic, except thatfallbackfeature is not implicitly enabled. -
Remove
i128-dynamicfeature in favor ofoutline-atomicsfeature. -
Add
AtomicF{32,64}::as_bits.
-
-
0.1.402 Mar 2022Release notes
Open source →- Support native 128-bit atomic operations for AArch64 at Rust 1.59+. This was previously supported only on nightly. (#6)
-
0.1.328 Feb 2022 -
0.1.226 Feb 2022 withdrawnRelease notes
Open source →Note: This release has been yanked due to a bug fixed in 0.1.3.
-
Add
parking_lotfeature to use parking_lot in global locks of fallback implementation. -
Fix bug in cmpxchg16b support. (#5)
-
-
0.1.125 Feb 2022 withdrawnRelease notes
Open source →Note: This release has been yanked due to a bug fixed in 0.1.3.
- Fix doc cfg on
Atomic{I,U}128.
- Fix doc cfg on
-
0.1.024 Feb 2022 withdrawnRelease notes
Open source →Note: This release has been yanked due to a bug fixed in 0.1.3.
Initial release