ref: 2a948f8b3b3250a31a2c7b8d9d655c576ecb5975
parent: f0dddfd4e582a14aa03b142902d5cf72fc3661ac
author: Ori Bernstein <[email protected]>
date: Tue Dec 19 22:22:17 EST 2023
atomic-amd64: return value after adding, not before, in ainc
--- a/atomic-amd64.s
+++ b/atomic-amd64.s
@@ -21,13 +21,18 @@
/* inc variants */
TEXT aincl+0(SB),1,$0
- MOVQ v+8(FP), AX
+ MOVQ v+8(FP), BX
+ MOVQ BX, AX
LOCK; XADDL AX, (RARG)
+ ADDQ BX, AX
RET
+
TEXT aincv+0(SB),1,$0
TEXT aincp+0(SB),1,$0
- MOVQ v+8(FP), AX
+ MOVQ v+8(FP), BX
+ MOVQ BX, AX
LOCK; XADDQ AX, (RARG)
+ ADDQ BX, AX
RET
/* cas variants */