Skip to content

Commit 8168c7c

Browse files
slpandreeaflorescu
authored andcommitted
atomic: enable 64 bit atomics on ppc64le and s390x
Add ppc64le (powerpc64) and s390x to the list of arches that support AtomicI64 and AtomicU64. Signed-off-by: Sergio Lopez <[email protected]>
1 parent 781d300 commit 8168c7c

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

src/atomic_integer.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,23 @@ macro_rules! impl_atomic_integer_ops {
5353
impl_atomic_integer_ops!(std::sync::atomic::AtomicI8, i8);
5454
impl_atomic_integer_ops!(std::sync::atomic::AtomicI16, i16);
5555
impl_atomic_integer_ops!(std::sync::atomic::AtomicI32, i32);
56-
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
56+
#[cfg(any(
57+
target_arch = "x86_64",
58+
target_arch = "aarch64",
59+
target_arch = "powerpc64",
60+
target_arch = "s390x"
61+
))]
5762
impl_atomic_integer_ops!(std::sync::atomic::AtomicI64, i64);
5863

5964
impl_atomic_integer_ops!(std::sync::atomic::AtomicU8, u8);
6065
impl_atomic_integer_ops!(std::sync::atomic::AtomicU16, u16);
6166
impl_atomic_integer_ops!(std::sync::atomic::AtomicU32, u32);
62-
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
67+
#[cfg(any(
68+
target_arch = "x86_64",
69+
target_arch = "aarch64",
70+
target_arch = "powerpc64",
71+
target_arch = "s390x"
72+
))]
6373
impl_atomic_integer_ops!(std::sync::atomic::AtomicU64, u64);
6474

6575
impl_atomic_integer_ops!(std::sync::atomic::AtomicIsize, isize);

src/bytes.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,23 @@ macro_rules! impl_atomic_access {
181181
impl_atomic_access!(i8, std::sync::atomic::AtomicI8);
182182
impl_atomic_access!(i16, std::sync::atomic::AtomicI16);
183183
impl_atomic_access!(i32, std::sync::atomic::AtomicI32);
184-
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
184+
#[cfg(any(
185+
target_arch = "x86_64",
186+
target_arch = "aarch64",
187+
target_arch = "powerpc64",
188+
target_arch = "s390x"
189+
))]
185190
impl_atomic_access!(i64, std::sync::atomic::AtomicI64);
186191

187192
impl_atomic_access!(u8, std::sync::atomic::AtomicU8);
188193
impl_atomic_access!(u16, std::sync::atomic::AtomicU16);
189194
impl_atomic_access!(u32, std::sync::atomic::AtomicU32);
190-
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
195+
#[cfg(any(
196+
target_arch = "x86_64",
197+
target_arch = "aarch64",
198+
target_arch = "powerpc64",
199+
target_arch = "s390x"
200+
))]
191201
impl_atomic_access!(u64, std::sync::atomic::AtomicU64);
192202

193203
impl_atomic_access!(isize, std::sync::atomic::AtomicIsize);

0 commit comments

Comments
 (0)