1 | // SPDX-License-Identifier: Apache-2.0 OR MIT |
2 | |
3 | /* |
4 | 128-bit atomic implementations on 64-bit architectures |
5 | |
6 | See README.md for details. |
7 | */ |
8 | |
9 | // AArch64 |
10 | #[cfg (any( |
11 | all(target_arch = "aarch64" , any(not(portable_atomic_no_asm), portable_atomic_unstable_asm)), |
12 | all(target_arch = "arm64ec" , not(portable_atomic_no_asm)) |
13 | ))] |
14 | // Use intrinsics.rs on Miri and Sanitizer that do not support inline assembly. |
15 | #[cfg_attr ( |
16 | all(any(miri, portable_atomic_sanitize_thread), portable_atomic_new_atomic_intrinsics), |
17 | path = "intrinsics.rs" |
18 | )] |
19 | pub(super) mod aarch64; |
20 | |
21 | // powerpc64 |
22 | #[cfg (all( |
23 | target_arch = "powerpc64" , |
24 | portable_atomic_unstable_asm_experimental_arch, |
25 | any( |
26 | target_feature = "quadword-atomics" , |
27 | portable_atomic_target_feature = "quadword-atomics" , |
28 | all( |
29 | feature = "fallback" , |
30 | not(portable_atomic_no_outline_atomics), |
31 | any( |
32 | all( |
33 | target_os = "linux" , |
34 | any( |
35 | all( |
36 | target_env = "gnu" , |
37 | any(target_endian = "little" , not(target_feature = "crt-static" )), |
38 | ), |
39 | all( |
40 | any(target_env = "musl" , target_env = "ohos" , target_env = "uclibc" ), |
41 | not(target_feature = "crt-static" ), |
42 | ), |
43 | portable_atomic_outline_atomics, |
44 | ), |
45 | ), |
46 | target_os = "android" , |
47 | target_os = "freebsd" , |
48 | target_os = "openbsd" , |
49 | all( |
50 | target_os = "aix" , |
51 | not(portable_atomic_pre_llvm_20), |
52 | any(test, portable_atomic_outline_atomics), // TODO(aix): currently disabled by default |
53 | ), |
54 | ), |
55 | not(any(miri, portable_atomic_sanitize_thread)), |
56 | ), |
57 | ), |
58 | ))] |
59 | // Use intrinsics.rs on Miri and Sanitizer that do not support inline assembly. |
60 | #[cfg_attr ( |
61 | all(any(miri, portable_atomic_sanitize_thread), not(portable_atomic_pre_llvm_15)), |
62 | path = "intrinsics.rs" |
63 | )] |
64 | pub(super) mod powerpc64; |
65 | |
66 | // riscv64 |
67 | #[cfg (all( |
68 | target_arch = "riscv64" , |
69 | not(any(miri, portable_atomic_sanitize_thread)), |
70 | any(not(portable_atomic_no_asm), portable_atomic_unstable_asm), |
71 | any( |
72 | target_feature = "zacas" , |
73 | portable_atomic_target_feature = "zacas" , |
74 | all( |
75 | feature = "fallback" , |
76 | not(portable_atomic_no_outline_atomics), |
77 | any(target_os = "linux" , target_os = "android" ), |
78 | ), |
79 | ), |
80 | ))] |
81 | pub(super) mod riscv64; |
82 | |
83 | // s390x |
84 | #[cfg (all(target_arch = "s390x" , not(portable_atomic_no_asm)))] |
85 | // Use intrinsics.rs on Miri and Sanitizer that do not support inline assembly. |
86 | #[cfg_attr (any(miri, portable_atomic_sanitize_thread), path = "intrinsics.rs" )] |
87 | pub(super) mod s390x; |
88 | |
89 | // x86_64 |
90 | #[cfg (all( |
91 | target_arch = "x86_64" , |
92 | not(all(any(miri, portable_atomic_sanitize_thread), portable_atomic_no_cmpxchg16b_intrinsic)), |
93 | any(not(portable_atomic_no_asm), portable_atomic_unstable_asm), |
94 | any( |
95 | target_feature = "cmpxchg16b" , |
96 | portable_atomic_target_feature = "cmpxchg16b" , |
97 | all( |
98 | feature = "fallback" , |
99 | not(portable_atomic_no_outline_atomics), |
100 | not(any(target_env = "sgx" , miri)), |
101 | ), |
102 | ), |
103 | ))] |
104 | // Use intrinsics.rs on Miri and Sanitizer that do not support inline assembly. |
105 | #[cfg_attr (any(miri, portable_atomic_sanitize_thread), path = "intrinsics.rs" )] |
106 | pub(super) mod x86_64; |
107 | |