[gcc/devel/rust/master] Merge #1615

Thomas Schwinge tschwinge@gcc.gnu.org
Thu Oct 27 07:50:12 GMT 2022


https://gcc.gnu.org/g:2bc1c5309206169776bdcab862aa2b3da7fc8c95

commit 2bc1c5309206169776bdcab862aa2b3da7fc8c95
Merge: 14c942c3eb0 4d42744aa5d
Author: bors[bot] <26634292+bors[bot]@users.noreply.github.com>
Date:   Wed Oct 26 08:56:37 2022 +0000

    Merge #1615
    
    1615: intrinsics: Add early implementation for atomic_store_{seqcst, relaxed, release} r=CohenArthur a=CohenArthur
    
    Needs #1614 so ignore the first commit
    
    This commit adds support for three `atomic_store_*` intrinsics declared
    in the core library. The mapping is as follows:
    
    - atomic_store_seqcst(dst, val) -> __atomic_store_n(dst, val,
      __ATOMIC_SEQ_CST)
    - atomic_store_relaxed(dst, val) -> __atomic_store_n(dst, val,
      __ATOMIC_RELAXED)
    - atomic_store_release(dst, val) -> __atomic_store_n(dst, val,
      __ATOMIC_RELEASE)
    
    The one remaining question is whether `atomic_store_unordered` can be
    abstracted as an atomic store with the __ATOMIC_RELAXED ordering.
    
    This commit also performs the overloading "by hand": Replacing
    `atomic_store_release<i32>` with `__atomic_store_4` as I cannot get the
    generic version to work. This will be done in future improvements.
    
    Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>

Diff:

 gcc/rust/backend/rust-builtins.cc                  |  36 +++++
 gcc/rust/backend/rust-builtins.h                   |   2 +-
 gcc/rust/backend/rust-compile-intrinsic.cc         | 165 ++++++++++++++++++---
 gcc/testsuite/rust/compile/torture/intrinsics-4.rs |  20 +++
 gcc/testsuite/rust/compile/torture/intrinsics-5.rs |  35 +++++
 gcc/testsuite/rust/execute/torture/atomic_store.rs |  32 ++++
 6 files changed, 268 insertions(+), 22 deletions(-)


More information about the Gcc-cvs mailing list