You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
compiler-builtins: plumb LSE support for aarch64 on linux/gnu
Add dynamic support for aarch64 LSE atomic ops on linux/gnu targets
when optimized-compiler-builtins is not enabled.
The resulting asm should exactly match that of LLVM's compiler-rt
builtins, though the symbol naming for the support function and
global does not.
Copy file name to clipboardExpand all lines: library/compiler-builtins/compiler-builtins/src/aarch64_linux.rs
+97-9Lines changed: 97 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,6 @@
6
6
//! which is supported on the current CPU.
7
7
//! See <https://community.arm.com/arm-community-blogs/b/tools-software-ides-blog/posts/making-the-most-of-the-arm-architecture-in-gcc-10#:~:text=out%20of%20line%20atomics> for more discussion.
8
8
//!
9
-
//! Currently we only support LL/SC, because LSE requires `getauxval` from libc in order to do runtime detection.
10
-
//! Use the `compiler-rt` intrinsics if you want LSE support.
11
-
//!
12
9
//! Ported from `aarch64/lse.S` in LLVM's compiler-rt.
13
10
//!
14
11
//! Generate functions for each of the following symbols:
@@ -24,7 +21,38 @@
24
21
//! We do something similar, but with macro arguments.
25
22
#![cfg_attr(feature = "c", allow(unused_macros))]// avoid putting the macros into a submodule
26
23
27
-
// We don't do runtime dispatch so we don't have to worry about the `__aarch64_have_lse_atomics` global ctor.
24
+
/// non-zero if the host supports LSE atomics.
25
+
#[cfg(not(feature = "c"))]
26
+
staticmutHAVE_LSE_ATOMICS:u8 = 0;
27
+
28
+
/// This calls into libc's getauxval to check hwcap bits for LSE support. Note, at this time
29
+
/// outline-atomics are only enabled on gnu targets.
0 commit comments