]>
Commit | Line | Data |
---|---|---|
c295e0f8 | 1 | From ad7ffe71baba46865f2e65266ab025920dfdc20b Mon Sep 17 00:00:00 2001 |
6a06907d XL |
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 | |
5 | ||
6 | Cranelift doesn't support them yet | |
7 | --- | |
94222f64 XL |
8 | library/core/src/panic/unwind_safe.rs | 6 ----- |
9 | library/core/src/sync/atomic.rs | 38 --------------------------- | |
10 | library/core/tests/atomic.rs | 4 --- | |
c295e0f8 XL |
11 | library/std/src/time/monotonic.rs | 6 +++-- |
12 | 4 files changed, 4 insertions(+), 50 deletions(-) | |
6a06907d | 13 | |
94222f64 XL |
14 | diff --git a/library/core/src/panic/unwind_safe.rs b/library/core/src/panic/unwind_safe.rs |
15 | index 092b7cf..158cf71 100644 | |
16 | --- a/library/core/src/panic/unwind_safe.rs | |
17 | +++ b/library/core/src/panic/unwind_safe.rs | |
18 | @@ -216,9 +216,6 @@ impl RefUnwindSafe for crate::sync::atomic::AtomicI32 {} | |
19 | #[cfg(target_has_atomic_load_store = "64")] | |
20 | #[stable(feature = "integer_atomics_stable", since = "1.34.0")] | |
21 | impl RefUnwindSafe for crate::sync::atomic::AtomicI64 {} | |
22 | -#[cfg(target_has_atomic_load_store = "128")] | |
23 | -#[unstable(feature = "integer_atomics", issue = "32976")] | |
24 | -impl RefUnwindSafe for crate::sync::atomic::AtomicI128 {} | |
25 | ||
26 | #[cfg(target_has_atomic_load_store = "ptr")] | |
27 | #[stable(feature = "unwind_safe_atomic_refs", since = "1.14.0")] | |
28 | @@ -235,9 +232,6 @@ impl RefUnwindSafe for crate::sync::atomic::AtomicU32 {} | |
29 | #[cfg(target_has_atomic_load_store = "64")] | |
30 | #[stable(feature = "integer_atomics_stable", since = "1.34.0")] | |
31 | impl RefUnwindSafe for crate::sync::atomic::AtomicU64 {} | |
32 | -#[cfg(target_has_atomic_load_store = "128")] | |
33 | -#[unstable(feature = "integer_atomics", issue = "32976")] | |
34 | -impl RefUnwindSafe for crate::sync::atomic::AtomicU128 {} | |
35 | ||
36 | #[cfg(target_has_atomic_load_store = "8")] | |
37 | #[stable(feature = "unwind_safe_atomic_refs", since = "1.14.0")] | |
6a06907d | 38 | diff --git a/library/core/src/sync/atomic.rs b/library/core/src/sync/atomic.rs |
c295e0f8 | 39 | index d9de37e..8293fce 100644 |
6a06907d XL |
40 | --- a/library/core/src/sync/atomic.rs |
41 | +++ b/library/core/src/sync/atomic.rs | |
c295e0f8 | 42 | @@ -2234,44 +2234,6 @@ atomic_int! { |
6a06907d XL |
43 | "AtomicU64::new(0)", |
44 | u64 AtomicU64 ATOMIC_U64_INIT | |
45 | } | |
46 | -#[cfg(target_has_atomic_load_store = "128")] | |
47 | -atomic_int! { | |
48 | - cfg(target_has_atomic = "128"), | |
49 | - cfg(target_has_atomic_equal_alignment = "128"), | |
50 | - unstable(feature = "integer_atomics", issue = "32976"), | |
51 | - unstable(feature = "integer_atomics", issue = "32976"), | |
52 | - unstable(feature = "integer_atomics", issue = "32976"), | |
53 | - unstable(feature = "integer_atomics", issue = "32976"), | |
54 | - unstable(feature = "integer_atomics", issue = "32976"), | |
55 | - unstable(feature = "integer_atomics", issue = "32976"), | |
56 | - rustc_const_stable(feature = "const_integer_atomics", since = "1.34.0"), | |
57 | - unstable(feature = "integer_atomics", issue = "32976"), | |
58 | - "i128", | |
59 | - "#![feature(integer_atomics)]\n\n", | |
60 | - atomic_min, atomic_max, | |
61 | - 16, | |
62 | - "AtomicI128::new(0)", | |
63 | - i128 AtomicI128 ATOMIC_I128_INIT | |
64 | -} | |
65 | -#[cfg(target_has_atomic_load_store = "128")] | |
66 | -atomic_int! { | |
67 | - cfg(target_has_atomic = "128"), | |
68 | - cfg(target_has_atomic_equal_alignment = "128"), | |
69 | - unstable(feature = "integer_atomics", issue = "32976"), | |
70 | - unstable(feature = "integer_atomics", issue = "32976"), | |
71 | - unstable(feature = "integer_atomics", issue = "32976"), | |
72 | - unstable(feature = "integer_atomics", issue = "32976"), | |
73 | - unstable(feature = "integer_atomics", issue = "32976"), | |
74 | - unstable(feature = "integer_atomics", issue = "32976"), | |
75 | - rustc_const_stable(feature = "const_integer_atomics", since = "1.34.0"), | |
76 | - unstable(feature = "integer_atomics", issue = "32976"), | |
77 | - "u128", | |
78 | - "#![feature(integer_atomics)]\n\n", | |
79 | - atomic_umin, atomic_umax, | |
80 | - 16, | |
81 | - "AtomicU128::new(0)", | |
82 | - u128 AtomicU128 ATOMIC_U128_INIT | |
83 | -} | |
84 | ||
85 | macro_rules! atomic_int_ptr_sized { | |
86 | ( $($target_pointer_width:literal $align:literal)* ) => { $( | |
87 | diff --git a/library/core/tests/atomic.rs b/library/core/tests/atomic.rs | |
94222f64 | 88 | index b735957..ea728b6 100644 |
6a06907d XL |
89 | --- a/library/core/tests/atomic.rs |
90 | +++ b/library/core/tests/atomic.rs | |
94222f64 | 91 | @@ -185,10 +185,6 @@ fn atomic_alignment() { |
6a06907d XL |
92 | assert_eq!(align_of::<AtomicU64>(), size_of::<AtomicU64>()); |
93 | #[cfg(target_has_atomic = "64")] | |
94 | assert_eq!(align_of::<AtomicI64>(), size_of::<AtomicI64>()); | |
95 | - #[cfg(target_has_atomic = "128")] | |
96 | - assert_eq!(align_of::<AtomicU128>(), size_of::<AtomicU128>()); | |
97 | - #[cfg(target_has_atomic = "128")] | |
98 | - assert_eq!(align_of::<AtomicI128>(), size_of::<AtomicI128>()); | |
99 | #[cfg(target_has_atomic = "ptr")] | |
100 | assert_eq!(align_of::<AtomicUsize>(), size_of::<AtomicUsize>()); | |
101 | #[cfg(target_has_atomic = "ptr")] | |
c295e0f8 XL |
102 | diff --git a/library/std/src/time/monotonic.rs b/library/std/src/time/monotonic.rs |
103 | index fa96b7a..2854f9c 100644 | |
104 | --- a/library/std/src/time/monotonic.rs | |
105 | +++ b/library/std/src/time/monotonic.rs | |
106 | @@ -5,7 +5,7 @@ pub(super) fn monotonize(raw: time::Instant) -> time::Instant { | |
107 | inner::monotonize(raw) | |
108 | } | |
109 | ||
a2a8927a | 110 | -#[cfg(any(all(target_has_atomic = "64", not(target_has_atomic = "128")), target_arch = "aarch64"))] |
c295e0f8 XL |
111 | +#[cfg(target_has_atomic = "64")] |
112 | pub mod inner { | |
113 | use crate::sync::atomic::AtomicU64; | |
114 | use crate::sync::atomic::Ordering::*; | |
115 | @@ -70,6 +70,7 @@ pub mod inner { | |
116 | } | |
117 | } | |
118 | ||
119 | +/* | |
a2a8927a | 120 | #[cfg(all(target_has_atomic = "128", not(target_arch = "aarch64")))] |
c295e0f8 XL |
121 | pub mod inner { |
122 | use crate::sync::atomic::AtomicU128; | |
123 | @@ -94,8 +95,9 @@ pub mod inner { | |
124 | ZERO.checked_add_duration(&Duration::new(secs, nanos)).unwrap() | |
125 | } | |
126 | } | |
127 | +*/ | |
128 | ||
129 | -#[cfg(not(any(target_has_atomic = "64", target_has_atomic = "128")))] | |
130 | +#[cfg(not(target_has_atomic = "64"))] | |
131 | pub mod inner { | |
132 | use crate::cmp; | |
133 | use crate::sys::time; | |
6a06907d XL |
134 | -- |
135 | 2.26.2.7.g19db9cfb68 | |
136 |