Skip to content

Releases: taiki-e/portable-atomic

1.3.0

06 May 21:57
Compare
Choose a tag to compare
  • Add require-cas feature. (#100)

    If your crate supports no-std environment and requires atomic CAS, enabling this feature will allow the portable-atomic to 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_core cfg 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) and mipsel-sony-psx (tier 3) when critical-section feature 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 cmpxchg16b target 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 the atomic128 module's readme for more. (8418235, 31d0862)

1.2.0

25 Mar 21:17
Compare
Choose a tag to compare
  • 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.0

24 Mar 19:44
Compare
Choose a tag to compare
  • Add Atomic{I,U}*::bit_{set,clear,toggle} and AtomicPtr::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 on AtomicI* and AtomicF*.

  • Add as_ptr method to all atomic types. (#79)

  • Make AtomicF{32,64}::as_bits const on Rust 1.58+. (#79)

  • Relax ordering in Serialize impl 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 feature detection is not available. (#80)
  • Optimize aarch64 outline-atomics for 128-bit atomics.

  • Performance improvements. (#70, #81, 6c189ae, 13c92b0, etc.)

  • Improve support for old nightly. (#73, 872feb9)

  • Documentation improvements.

1.0.1

21 Jan 13:55
Compare
Choose a tag to compare
  • Optimize Atomic{I,U}*::{fetch_not,not} methods. (#62)

1.0.0

15 Jan 07:28
Compare
Choose a tag to compare
  • Add critical-section feature 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_core can'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-atomics feature. This was no-op since 0.3.19.

  • Documentation improvements.

0.3.19

25 Dec 10:35
Compare
Choose a tag to compare
  • Add AtomicI*::{fetch_neg,neg} and AtomicF*::fetch_neg methods. (#54)

    AtomicI*::neg are equivalent to the corresponding fetch_* 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's lock neg.

    Currently, optimizations by these methods (neg) are only guaranteed for x86.

  • Add Atomic{I,U}*::{fetch_not,not} methods. (#54)

    Atomic{I,U}*::not are equivalent to the corresponding fetch_* 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's lock not, MSP430's inv.

    Currently, optimizations by these methods (not) are only guaranteed for x86 and MSP430.

    (Note: AtomicBool already has fetch_not and not methods.)

  • Enable outline-atomics for 128-bit atomics by default. (#57) See #57 for more.

  • Improve support for old nightly compilers.

0.3.18

15 Dec 12:20
Compare
Choose a tag to compare
  • Fix build error when not using portable_atomic_unsafe_assume_single_core cfg 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.17

14 Dec 20:59
Compare
Choose a tag to compare
  • Optimize x86_64 128-bit atomic load/store on AMD CPU with AVX. (#49)

  • Improve support for custom targets on old rustc.

0.3.16

09 Dec 16:19
Compare
Choose a tag to compare
  • Add Atomic{I,U}*::{add,sub,and,or,xor} and AtomicBool::{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.

  • Various improvements to portable_atomic_unsafe_assume_single_core cfg. (#44, #40)

    • Support disabling FIQs on pre-v6 ARM under portable_atomic_disable_fiq cfg.
    • Support RISC-V supervisor mode under portable_atomic_s_mode cfg.
    • Optimize interrupt restore on AVR and MSP430. (#40)
    • Documentation improvements.

    See #44 for more.

0.3.15

09 Sep 02:59
Compare
Choose a tag to compare
  • 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.