Skip to content

Commit 9d65f58

Browse files
committed
aarch64: Update comments
1 parent b6699b4 commit 9d65f58

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

src/imp/atomic128/aarch64.rs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,9 @@ macro_rules! debug_assert_rcpc3 {
326326
//
327327
// This is similar to #[target_feature(enable = "lse")], except that there are
328328
// no compiler guarantees regarding (un)inlining, and the scope is within an asm
329-
// block rather than a function. We use this directive to support outline-atomics
330-
// on pre-1.61 rustc (aarch64_target_feature stabilized in Rust 1.61).
329+
// block rather than a function. We use this directive because #[target_feature(enable = "lse")]
330+
// is unstable on pre-1.61 rustc and incompatible with rustc_codegen_cranelift:
331+
// https://github.com/rust-lang/rustc_codegen_cranelift/issues/1400#issuecomment-1774599775
331332
//
332333
// The .arch_extension directive is effective until the end of the assembly block and
333334
// is not propagated to subsequent code, so the end_lse macro is unneeded.
@@ -339,9 +340,6 @@ macro_rules! debug_assert_rcpc3 {
339340
// The .arch directive has a similar effect, but we don't use it due to the following issue:
340341
// https://github.com/torvalds/linux/commit/dd1f6308b28edf0452dd5dc7877992903ec61e69
341342
//
342-
// This is also needed for compatibility with rustc_codegen_cranelift:
343-
// https://github.com/rust-lang/rustc_codegen_cranelift/issues/1400#issuecomment-1774599775
344-
//
345343
// Note: If FEAT_LSE is not available at compile-time, we must guarantee that
346344
// the function that uses it is not inlined into a function where it is not
347345
// clear whether FEAT_LSE is available. Otherwise, (even if we checked whether
@@ -547,7 +545,7 @@ unsafe fn atomic_load(src: *mut u128, order: Ordering) -> u128 {
547545
atomic_load_no_lse2_seqcst = atomic_load_no_lse2(Ordering::SeqCst);
548546
}
549547
// SAFETY: the caller must uphold the safety contract.
550-
// and we've checked if FEAT_LSE2 is available.
548+
// and we've checked if FEAT_LSE2/FEAT_LRCPC3 is available.
551549
unsafe {
552550
match order {
553551
Ordering::Relaxed => {
@@ -732,7 +730,7 @@ unsafe fn _atomic_load_ldiapp(src: *mut u128, order: Ordering) -> u128 {
732730
// https://github.com/llvm/llvm-project/commit/a6aaa969f7caec58a994142f8d855861cf3a1463
733731
#[cfg(portable_atomic_pre_llvm_16)]
734732
asm!(
735-
// 0: d9411800 ldiapp x0, x1, [x0]
733+
// ldiapp x0, x1, [x0]
736734
".inst 0xd9411800",
737735
in("x0") ptr_reg!(src),
738736
lateout("x1") out_hi,
@@ -761,7 +759,7 @@ unsafe fn _atomic_load_ldiapp(src: *mut u128, order: Ordering) -> u128 {
761759
// ldar (or dmb ishld) is required to prevent reordering with preceding stlxp.
762760
// See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108891 for details.
763761
"ldar {tmp}, [x0]",
764-
// 0: d9411800 ldiapp x0, x1, [x0]
762+
// ldiapp x0, x1, [x0]
765763
".inst 0xd9411800",
766764
tmp = out(reg) _,
767765
in("x0") ptr_reg!(src),
@@ -972,7 +970,7 @@ unsafe fn atomic_store(dst: *mut u128, val: u128, order: Ordering) {
972970
atomic_store_no_lse2_seqcst = atomic_store_no_lse2(Ordering::SeqCst);
973971
}
974972
// SAFETY: the caller must uphold the safety contract.
975-
// and we've checked if FEAT_LSE2 is available.
973+
// and we've checked if FEAT_LSE2/FEAT_LRCPC3/FEAT_LSE128 is available.
976974
unsafe {
977975
match order {
978976
Ordering::Relaxed => {
@@ -1173,7 +1171,7 @@ unsafe fn _atomic_store_stilp(dst: *mut u128, val: u128, order: Ordering) {
11731171
// https://github.com/llvm/llvm-project/commit/a6aaa969f7caec58a994142f8d855861cf3a1463
11741172
#[cfg(portable_atomic_pre_llvm_16)]
11751173
asm!(
1176-
// 0: d9031802 stilp x2, x3, [x0]
1174+
// stilp x2, x3, [x0]
11771175
".inst 0xd9031802",
11781176
$acquire,
11791177
in("x0") ptr_reg!(dst),
@@ -1631,7 +1629,7 @@ unsafe fn _atomic_swap_swpp(dst: *mut u128, val: u128, order: Ordering) -> u128
16311629
macro_rules! swap {
16321630
($order:tt, $fence:tt) => {
16331631
asm!(
1634-
// 4: 19{2,a,6,e}18002 swpp{,a,l,al} x2, x1, [x0]
1632+
// swpp{,a,l,al} x2, x1, [x0]
16351633
concat!(".inst 0x19", $order, "18002"),
16361634
$fence,
16371635
in("x0") ptr_reg!(dst),
@@ -2052,7 +2050,7 @@ unsafe fn atomic_and(dst: *mut u128, val: u128, order: Ordering) -> u128 {
20522050
macro_rules! clear {
20532051
($order:tt, $fence:tt) => {
20542052
asm!(
2055-
// 8: 19{2,a,6,e}11008 ldclrp{,a,l,al} x8, x1, [x0]
2053+
// ldclrp{,a,l,al} x8, x1, [x0]
20562054
concat!(".inst 0x19", $order, "11008"),
20572055
$fence,
20582056
in("x0") ptr_reg!(dst),
@@ -2130,7 +2128,7 @@ unsafe fn atomic_or(dst: *mut u128, val: u128, order: Ordering) -> u128 {
21302128
macro_rules! or {
21312129
($order:tt, $fence:tt) => {
21322130
asm!(
2133-
// 4: 19{2,a,6,e}13002 ldsetp{,a,l,al} x2, x1, [x0]
2131+
// ldsetp{,a,l,al} x2, x1, [x0]
21342132
concat!(".inst 0x19", $order, "13002"),
21352133
$fence,
21362134
in("x0") ptr_reg!(dst),

0 commit comments

Comments
 (0)