@@ -326,8 +326,9 @@ macro_rules! debug_assert_rcpc3 {
326
326
//
327
327
// This is similar to #[target_feature(enable = "lse")], except that there are
328
328
// 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
331
332
//
332
333
// The .arch_extension directive is effective until the end of the assembly block and
333
334
// is not propagated to subsequent code, so the end_lse macro is unneeded.
@@ -339,9 +340,6 @@ macro_rules! debug_assert_rcpc3 {
339
340
// The .arch directive has a similar effect, but we don't use it due to the following issue:
340
341
// https://github.com/torvalds/linux/commit/dd1f6308b28edf0452dd5dc7877992903ec61e69
341
342
//
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
- //
345
343
// Note: If FEAT_LSE is not available at compile-time, we must guarantee that
346
344
// the function that uses it is not inlined into a function where it is not
347
345
// 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 {
547
545
atomic_load_no_lse2_seqcst = atomic_load_no_lse2( Ordering :: SeqCst ) ;
548
546
}
549
547
// 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.
551
549
unsafe {
552
550
match order {
553
551
Ordering :: Relaxed => {
@@ -732,7 +730,7 @@ unsafe fn _atomic_load_ldiapp(src: *mut u128, order: Ordering) -> u128 {
732
730
// https://github.com/llvm/llvm-project/commit/a6aaa969f7caec58a994142f8d855861cf3a1463
733
731
#[ cfg( portable_atomic_pre_llvm_16) ]
734
732
asm ! (
735
- // 0: d9411800 ldiapp x0, x1, [x0]
733
+ // ldiapp x0, x1, [x0]
736
734
".inst 0xd9411800" ,
737
735
in( "x0" ) ptr_reg!( src) ,
738
736
lateout( "x1" ) out_hi,
@@ -761,7 +759,7 @@ unsafe fn _atomic_load_ldiapp(src: *mut u128, order: Ordering) -> u128 {
761
759
// ldar (or dmb ishld) is required to prevent reordering with preceding stlxp.
762
760
// See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108891 for details.
763
761
"ldar {tmp}, [x0]" ,
764
- // 0: d9411800 ldiapp x0, x1, [x0]
762
+ // ldiapp x0, x1, [x0]
765
763
".inst 0xd9411800" ,
766
764
tmp = out( reg) _,
767
765
in( "x0" ) ptr_reg!( src) ,
@@ -972,7 +970,7 @@ unsafe fn atomic_store(dst: *mut u128, val: u128, order: Ordering) {
972
970
atomic_store_no_lse2_seqcst = atomic_store_no_lse2( Ordering :: SeqCst ) ;
973
971
}
974
972
// 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.
976
974
unsafe {
977
975
match order {
978
976
Ordering :: Relaxed => {
@@ -1173,7 +1171,7 @@ unsafe fn _atomic_store_stilp(dst: *mut u128, val: u128, order: Ordering) {
1173
1171
// https://github.com/llvm/llvm-project/commit/a6aaa969f7caec58a994142f8d855861cf3a1463
1174
1172
#[ cfg( portable_atomic_pre_llvm_16) ]
1175
1173
asm!(
1176
- // 0: d9031802 stilp x2, x3, [x0]
1174
+ // stilp x2, x3, [x0]
1177
1175
".inst 0xd9031802" ,
1178
1176
$acquire,
1179
1177
in( "x0" ) ptr_reg!( dst) ,
@@ -1631,7 +1629,7 @@ unsafe fn _atomic_swap_swpp(dst: *mut u128, val: u128, order: Ordering) -> u128
1631
1629
macro_rules! swap {
1632
1630
( $order: tt, $fence: tt) => {
1633
1631
asm!(
1634
- // 4: 19{2,a,6,e}18002 swpp{,a,l,al} x2, x1, [x0]
1632
+ // swpp{,a,l,al} x2, x1, [x0]
1635
1633
concat!( ".inst 0x19" , $order, "18002" ) ,
1636
1634
$fence,
1637
1635
in( "x0" ) ptr_reg!( dst) ,
@@ -2052,7 +2050,7 @@ unsafe fn atomic_and(dst: *mut u128, val: u128, order: Ordering) -> u128 {
2052
2050
macro_rules! clear {
2053
2051
( $order: tt, $fence: tt) => {
2054
2052
asm!(
2055
- // 8: 19{2,a,6,e}11008 ldclrp{,a,l,al} x8, x1, [x0]
2053
+ // ldclrp{,a,l,al} x8, x1, [x0]
2056
2054
concat!( ".inst 0x19" , $order, "11008" ) ,
2057
2055
$fence,
2058
2056
in( "x0" ) ptr_reg!( dst) ,
@@ -2130,7 +2128,7 @@ unsafe fn atomic_or(dst: *mut u128, val: u128, order: Ordering) -> u128 {
2130
2128
macro_rules! or {
2131
2129
( $order: tt, $fence: tt) => {
2132
2130
asm!(
2133
- // 4: 19{2,a,6,e}13002 ldsetp{,a,l,al} x2, x1, [x0]
2131
+ // ldsetp{,a,l,al} x2, x1, [x0]
2134
2132
concat!( ".inst 0x19" , $order, "13002" ) ,
2135
2133
$fence,
2136
2134
in( "x0" ) ptr_reg!( dst) ,
0 commit comments