diff options
author | Arthur Cohen <arthur.cohen@embecosm.com> | 2022-10-25 11:24:10 +0200 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2022-10-26 09:58:05 +0200 |
commit | 4d42744aa5d5778975d46ac9f5c945f9c7ec2ffa (patch) | |
tree | 2ff9ff65e2f5155b0b344f9e75fff884344e9ffe /gcc/rust/backend/rust-builtins.h | |
parent | 83e5265d6af48e1572cbe019b4b7f7a5603086a9 (diff) | |
download | gcc-4d42744aa5d5778975d46ac9f5c945f9c7ec2ffa.zip gcc-4d42744aa5d5778975d46ac9f5c945f9c7ec2ffa.tar.gz gcc-4d42744aa5d5778975d46ac9f5c945f9c7ec2ffa.tar.bz2 |
intrinsics: Add early implementation for atomic_store_{seqcst, relaxed, release}
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_release(dst, val) -> __atomic_store_n(dst, val,
__ATOMIC_RELEASE)
- atomic_store_relaxed(dst, val) -> __atomic_store_n(dst, val,
__ATOMIC_RELAXED)
- atomic_store_unordered(dst, val) -> __atomic_store_n(dst, val,
__ATOMIC_RELAXED)
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.
Because of this, size type atomics are not handled and result in a call
to `rust_sorry_at`.
Co-authored-by: bjorn3 <bjorn3@github.com>
Co-authored-by: dafaust <dafaust@github.com>
Diffstat (limited to 'gcc/rust/backend/rust-builtins.h')
-rw-r--r-- | gcc/rust/backend/rust-builtins.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/rust/backend/rust-builtins.h b/gcc/rust/backend/rust-builtins.h index e421fa4..c282510 100644 --- a/gcc/rust/backend/rust-builtins.h +++ b/gcc/rust/backend/rust-builtins.h @@ -86,8 +86,8 @@ private: BuiltinsContext (); void setup_overflow_fns (); - void setup_math_fns (); + void setup_atomic_fns (); void setup (); |