diff options
| author | James Miller <bladeon@gmail.com> | 2013-06-16 11:58:51 +1200 |
|---|---|---|
| committer | James Miller <bladeon@gmail.com> | 2013-06-22 12:26:33 +1200 |
| commit | befbd3a680e79672108845e1b2d9d5278f92659c (patch) | |
| tree | ecf891b159e62121fad0c601ecd2d7dbba508abf /src/libstd | |
| parent | fd83b92b598219d74317406a25234d572de584e0 (diff) | |
| download | rust-befbd3a680e79672108845e1b2d9d5278f92659c.tar.gz rust-befbd3a680e79672108845e1b2d9d5278f92659c.zip | |
Add the rest of the atomic operations.
This makes the handling of atomic operations more generic, which does impose a specific naming convention for the intrinsics, but that seems ok with me, rather than having an individual case for each name. It also adds the intrinsics to the the intrinsics file.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/unstable/intrinsics.rs | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/src/libstd/unstable/intrinsics.rs b/src/libstd/unstable/intrinsics.rs index 13425007785..e1daf6c81b2 100644 --- a/src/libstd/unstable/intrinsics.rs +++ b/src/libstd/unstable/intrinsics.rs @@ -42,22 +42,38 @@ pub extern "rust-intrinsic" { /// Atomic compare and exchange, release ordering. pub fn atomic_cxchg_rel(dst: &mut int, old: int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_cxchg_acqrel(dst: &mut int, old: int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_cxchg_relaxed(dst: &mut int, old: int, src: int) -> int; + + /// Atomic load, sequentially consistent. pub fn atomic_load(src: &int) -> int; /// Atomic load, acquire ordering. pub fn atomic_load_acq(src: &int) -> int; + #[cfg(not(stage0))] + pub fn atomic_load_relaxed(src: &int) -> int; + /// Atomic store, sequentially consistent. pub fn atomic_store(dst: &mut int, val: int); /// Atomic store, release ordering. pub fn atomic_store_rel(dst: &mut int, val: int); + #[cfg(not(stage0))] + pub fn atomic_store_relaxed(dst: &mut int, val: int); + /// Atomic exchange, sequentially consistent. pub fn atomic_xchg(dst: &mut int, src: int) -> int; /// Atomic exchange, acquire ordering. pub fn atomic_xchg_acq(dst: &mut int, src: int) -> int; /// Atomic exchange, release ordering. pub fn atomic_xchg_rel(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_xchg_acqrel(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_xchg_relaxed(dst: &mut int, src: int) -> int; /// Atomic addition, sequentially consistent. pub fn atomic_xadd(dst: &mut int, src: int) -> int; @@ -65,6 +81,10 @@ pub extern "rust-intrinsic" { pub fn atomic_xadd_acq(dst: &mut int, src: int) -> int; /// Atomic addition, release ordering. pub fn atomic_xadd_rel(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_xadd_acqrel(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_xadd_relaxed(dst: &mut int, src: int) -> int; /// Atomic subtraction, sequentially consistent. pub fn atomic_xsub(dst: &mut int, src: int) -> int; @@ -72,6 +92,98 @@ pub extern "rust-intrinsic" { pub fn atomic_xsub_acq(dst: &mut int, src: int) -> int; /// Atomic subtraction, release ordering. pub fn atomic_xsub_rel(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_xsub_acqrel(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_xsub_relaxed(dst: &mut int, src: int) -> int; + + #[cfg(not(stage0))] + pub fn atomic_and(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_and_acq(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_and_rel(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_and_acqrel(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_and_relaxed(dst: &mut int, src: int) -> int; + + #[cfg(not(stage0))] + pub fn atomic_nand(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_nand_acq(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_nand_rel(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_nand_acqrel(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_nand_relaxed(dst: &mut int, src: int) -> int; + + #[cfg(not(stage0))] + pub fn atomic_or(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_or_acq(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_or_rel(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_or_acqrel(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_or_relaxed(dst: &mut int, src: int) -> int; + + #[cfg(not(stage0))] + pub fn atomic_xor(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_xor_acq(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_xor_rel(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_xor_acqrel(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_xor_relaxed(dst: &mut int, src: int) -> int; + + #[cfg(not(stage0))] + pub fn atomic_max(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_max_acq(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_max_rel(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_max_acqrel(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_max_relaxed(dst: &mut int, src: int) -> int; + + #[cfg(not(stage0))] + pub fn atomic_min(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_min_acq(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_min_rel(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_min_acqrel(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_min_relaxed(dst: &mut int, src: int) -> int; + + #[cfg(not(stage0))] + pub fn atomic_umin(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_umin_acq(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_umin_rel(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_umin_acqrel(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_umin_relaxed(dst: &mut int, src: int) -> int; + + #[cfg(not(stage0))] + pub fn atomic_umin(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_umin_acq(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_umin_rel(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_umin_acqrel(dst: &mut int, src: int) -> int; + #[cfg(not(stage0))] + pub fn atomic_umin_relaxed(dst: &mut int, src: int) -> int; /// The size of a type in bytes. /// |
