Skip to content

Commit

Permalink
resolved comments
Browse files Browse the repository at this point in the history
  • Loading branch information
prabhavdogra committed Mar 6, 2025
1 parent 24a25d0 commit abf1a5a
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 24 deletions.
3 changes: 2 additions & 1 deletion src/internal/runtime/atomic/atomic_amd64.s
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ TEXT ·Cas64(SB), NOSPLIT, $0-25
// if *val == old {
// *val = new
// return true
// } else
// } else {
// return false
// }
TEXT ·Casp1(SB), NOSPLIT, $0-25
MOVQ ptr+0(FP), BX
MOVQ old+8(FP), AX
Expand Down
2 changes: 1 addition & 1 deletion src/internal/runtime/atomic/atomic_arm.s
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// if *val == old {
// *val = new
// return true
// } else
// } else {
// return false
// }
//
Expand Down
12 changes: 6 additions & 6 deletions src/internal/runtime/atomic/atomic_arm64.s
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ load_store_loop:
RET
#endif

// func Cas(val *uint32, old, new uint32) bool
// func Cas(ptr *uint32, old, new uint32) bool
// Atomically:
// if *val == old {
// *val = new
// if *ptr == old {
// *ptr = new
// return true
// } else {
// return false
Expand Down Expand Up @@ -227,10 +227,10 @@ ok:
RET
#endif

// func Cas64(val *uint64, old, new uint64) bool
// func Cas64(ptr *uint64, old, new uint64) bool
// Atomically:
// if *val == old {
// *val = new
// if *ptr == old {
// *ptr = new
// return true
// } else {
// return false
Expand Down
12 changes: 6 additions & 6 deletions src/internal/runtime/atomic/atomic_mips64x.s
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

#define SYNC WORD $0xf

// func cas(val *uint32, old, new uint32) bool
// func cas(ptr *uint32, old, new uint32) bool
// Atomically:
// if *val == old {
// *val = new
// if *ptr == old {
// *ptr = new
// return true
// } else {
// return false
Expand All @@ -35,10 +35,10 @@ cas_fail:
MOVV $0, R1
JMP -4(PC)

// func Cas64(val *uint64, old, new uint64) bool
// func Cas64(ptr *uint64, old, new uint64) bool
// Atomically:
// if *val == old {
// *val = new
// if *ptr == old {
// *ptr = new
// return true
// } else {
// return false
Expand Down
2 changes: 1 addition & 1 deletion src/internal/runtime/atomic/atomic_mipsx.s
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// if *val == old {
// *val = new
// return true
// } else
// } else {
// return false
// }
TEXT ·Cas(SB),NOSPLIT,$0-13
Expand Down
12 changes: 6 additions & 6 deletions src/internal/runtime/atomic/atomic_ppc64x.s
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ TEXT ·LoadAcq64(SB),NOSPLIT|NOFRAME,$-8-16
MOVD R3, ret+8(FP)
RET

// func Cas(val *int32, old, new int32) bool
// func Cas(ptr *int32, old, new int32) bool
// Atomically:
// if *val == old {
// *val = new
// if *ptr == old {
// *ptr = new
// return true
// } else {
// return false
Expand All @@ -106,10 +106,10 @@ cas_fail:
MOVB R0, ret+16(FP)
RET

// func Cas64(val *uint64, old, new uint64) bool
// func Cas64(ptr *uint64, old, new uint64) bool
// Atomically:
// if *val == old {
// *val = new
// if *ptr == old {
// *ptr = new
// return true
// } else {
// return false
Expand Down
6 changes: 3 additions & 3 deletions src/internal/runtime/atomic/atomic_riscv64.s
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@

#include "textflag.h"

// func Cas(val *uint64, old, new uint64) bool
// func Cas(ptr *uint64, old, new uint64) bool
// Atomically:
// if *val == old {
// *val = new
// if *ptr == old {
// *ptr = new
// return true
// } else {
// return false
Expand Down

0 comments on commit abf1a5a

Please sign in to comment.