1 From ad7ffe71baba46865f2e65266ab025920dfdc20b Mon Sep 17 00:00:00 2001
2 From: bjorn3 <bjorn3@users.noreply.github.com>
3 Date: Thu, 18 Feb 2021 18:45:28 +0100
4 Subject: [PATCH] Disable 128bit atomic operations
6 Cranelift doesn't support them yet
8 library/core/src/panic/unwind_safe.rs | 6 -----
9 library/core/src/sync/atomic.rs | 38 ---------------------------
10 library/core/tests/atomic.rs | 4 ---
11 4 files changed, 4 insertions(+), 50 deletions(-)
13 diff --git a/library/core/src/panic/unwind_safe.rs b/library/core/src/panic/unwind_safe.rs
14 index 092b7cf..158cf71 100644
15 --- a/library/core/src/panic/unwind_safe.rs
16 +++ b/library/core/src/panic/unwind_safe.rs
17 @@ -216,9 +216,6 @@ impl RefUnwindSafe for crate::sync::atomic::AtomicI32 {}
18 #[cfg(target_has_atomic_load_store = "64")]
19 #[stable(feature = "integer_atomics_stable", since = "1.34.0")]
20 impl RefUnwindSafe for crate::sync::atomic::AtomicI64 {}
21 -#[cfg(target_has_atomic_load_store = "128")]
22 -#[unstable(feature = "integer_atomics", issue = "99069")]
23 -impl RefUnwindSafe for crate::sync::atomic::AtomicI128 {}
25 #[cfg(target_has_atomic_load_store = "ptr")]
26 #[stable(feature = "unwind_safe_atomic_refs", since = "1.14.0")]
27 @@ -235,9 +232,6 @@ impl RefUnwindSafe for crate::sync::atomic::AtomicU32 {}
28 #[cfg(target_has_atomic_load_store = "64")]
29 #[stable(feature = "integer_atomics_stable", since = "1.34.0")]
30 impl RefUnwindSafe for crate::sync::atomic::AtomicU64 {}
31 -#[cfg(target_has_atomic_load_store = "128")]
32 -#[unstable(feature = "integer_atomics", issue = "99069")]
33 -impl RefUnwindSafe for crate::sync::atomic::AtomicU128 {}
35 #[cfg(target_has_atomic_load_store = "8")]
36 #[stable(feature = "unwind_safe_atomic_refs", since = "1.14.0")]
37 diff --git a/library/core/src/sync/atomic.rs b/library/core/src/sync/atomic.rs
38 index d9de37e..8293fce 100644
39 --- a/library/core/src/sync/atomic.rs
40 +++ b/library/core/src/sync/atomic.rs
41 @@ -2234,46 +2234,6 @@ atomic_int! {
43 u64 AtomicU64 ATOMIC_U64_INIT
45 -#[cfg(target_has_atomic_load_store = "128")]
47 - cfg(target_has_atomic = "128"),
48 - cfg(target_has_atomic_equal_alignment = "128"),
49 - unstable(feature = "integer_atomics", issue = "99069"),
50 - unstable(feature = "integer_atomics", issue = "99069"),
51 - unstable(feature = "integer_atomics", issue = "99069"),
52 - unstable(feature = "integer_atomics", issue = "99069"),
53 - unstable(feature = "integer_atomics", issue = "99069"),
54 - unstable(feature = "integer_atomics", issue = "99069"),
55 - rustc_const_stable(feature = "const_integer_atomics", since = "1.34.0"),
56 - unstable(feature = "integer_atomics", issue = "99069"),
57 - cfg_attr(not(test), rustc_diagnostic_item = "AtomicI128"),
59 - "#![feature(integer_atomics)]\n\n",
60 - atomic_min, atomic_max,
62 - "AtomicI128::new(0)",
63 - i128 AtomicI128 ATOMIC_I128_INIT
65 -#[cfg(target_has_atomic_load_store = "128")]
67 - cfg(target_has_atomic = "128"),
68 - cfg(target_has_atomic_equal_alignment = "128"),
69 - unstable(feature = "integer_atomics", issue = "99069"),
70 - unstable(feature = "integer_atomics", issue = "99069"),
71 - unstable(feature = "integer_atomics", issue = "99069"),
72 - unstable(feature = "integer_atomics", issue = "99069"),
73 - unstable(feature = "integer_atomics", issue = "99069"),
74 - unstable(feature = "integer_atomics", issue = "99069"),
75 - rustc_const_stable(feature = "const_integer_atomics", since = "1.34.0"),
76 - unstable(feature = "integer_atomics", issue = "99069"),
77 - cfg_attr(not(test), rustc_diagnostic_item = "AtomicU128"),
79 - "#![feature(integer_atomics)]\n\n",
80 - atomic_umin, atomic_umax,
82 - "AtomicU128::new(0)",
83 - u128 AtomicU128 ATOMIC_U128_INIT
86 macro_rules! atomic_int_ptr_sized {
87 ( $($target_pointer_width:literal $align:literal)* ) => { $(
88 diff --git a/library/core/tests/atomic.rs b/library/core/tests/atomic.rs
89 index b735957..ea728b6 100644
90 --- a/library/core/tests/atomic.rs
91 +++ b/library/core/tests/atomic.rs
92 @@ -185,10 +185,6 @@ fn atomic_alignment() {
93 assert_eq!(align_of::<AtomicU64>(), size_of::<AtomicU64>());
94 #[cfg(target_has_atomic = "64")]
95 assert_eq!(align_of::<AtomicI64>(), size_of::<AtomicI64>());
96 - #[cfg(target_has_atomic = "128")]
97 - assert_eq!(align_of::<AtomicU128>(), size_of::<AtomicU128>());
98 - #[cfg(target_has_atomic = "128")]
99 - assert_eq!(align_of::<AtomicI128>(), size_of::<AtomicI128>());
100 #[cfg(target_has_atomic = "ptr")]
101 assert_eq!(align_of::<AtomicUsize>(), size_of::<AtomicUsize>());
102 #[cfg(target_has_atomic = "ptr")]