diff options
Diffstat (limited to 'src/pkg/sync/atomic/asm_amd64.s')
-rw-r--r-- | src/pkg/sync/atomic/asm_amd64.s | 74 |
1 files changed, 51 insertions, 23 deletions
diff --git a/src/pkg/sync/atomic/asm_amd64.s b/src/pkg/sync/atomic/asm_amd64.s index 58bda9e4f..0900492dc 100644 --- a/src/pkg/sync/atomic/asm_amd64.s +++ b/src/pkg/sync/atomic/asm_amd64.s @@ -4,10 +4,38 @@ // +build !race -TEXT ·CompareAndSwapInt32(SB),7,$0 +#include "../../../cmd/ld/textflag.h" + +TEXT ·SwapInt32(SB),NOSPLIT,$0-20 + JMP ·SwapUint32(SB) + +TEXT ·SwapUint32(SB),NOSPLIT,$0-20 + MOVQ addr+0(FP), BP + MOVL new+8(FP), AX + XCHGL AX, 0(BP) + MOVL AX, new+16(FP) + RET + +TEXT ·SwapInt64(SB),NOSPLIT,$0-24 + JMP ·SwapUint64(SB) + +TEXT ·SwapUint64(SB),NOSPLIT,$0-24 + MOVQ addr+0(FP), BP + MOVQ new+8(FP), AX + XCHGQ AX, 0(BP) + MOVQ AX, new+16(FP) + RET + +TEXT ·SwapUintptr(SB),NOSPLIT,$0-24 + JMP ·SwapUint64(SB) + +TEXT ·SwapPointer(SB),NOSPLIT,$0-24 + JMP ·SwapUint64(SB) + +TEXT ·CompareAndSwapInt32(SB),NOSPLIT,$0-17 JMP ·CompareAndSwapUint32(SB) -TEXT ·CompareAndSwapUint32(SB),7,$0 +TEXT ·CompareAndSwapUint32(SB),NOSPLIT,$0-17 MOVQ addr+0(FP), BP MOVL old+8(FP), AX MOVL new+12(FP), CX @@ -16,16 +44,16 @@ TEXT ·CompareAndSwapUint32(SB),7,$0 SETEQ swapped+16(FP) RET -TEXT ·CompareAndSwapUintptr(SB),7,$0 +TEXT ·CompareAndSwapUintptr(SB),NOSPLIT,$0-25 JMP ·CompareAndSwapUint64(SB) -TEXT ·CompareAndSwapPointer(SB),7,$0 +TEXT ·CompareAndSwapPointer(SB),NOSPLIT,$0-25 JMP ·CompareAndSwapUint64(SB) -TEXT ·CompareAndSwapInt64(SB),7,$0 +TEXT ·CompareAndSwapInt64(SB),NOSPLIT,$0-25 JMP ·CompareAndSwapUint64(SB) -TEXT ·CompareAndSwapUint64(SB),7,$0 +TEXT ·CompareAndSwapUint64(SB),NOSPLIT,$0-25 MOVQ addr+0(FP), BP MOVQ old+8(FP), AX MOVQ new+16(FP), CX @@ -34,10 +62,10 @@ TEXT ·CompareAndSwapUint64(SB),7,$0 SETEQ swapped+24(FP) RET -TEXT ·AddInt32(SB),7,$0 +TEXT ·AddInt32(SB),NOSPLIT,$0-20 JMP ·AddUint32(SB) -TEXT ·AddUint32(SB),7,$0 +TEXT ·AddUint32(SB),NOSPLIT,$0-20 MOVQ addr+0(FP), BP MOVL delta+8(FP), AX MOVL AX, CX @@ -47,13 +75,13 @@ TEXT ·AddUint32(SB),7,$0 MOVL CX, new+16(FP) RET -TEXT ·AddUintptr(SB),7,$0 +TEXT ·AddUintptr(SB),NOSPLIT,$0-24 JMP ·AddUint64(SB) -TEXT ·AddInt64(SB),7,$0 +TEXT ·AddInt64(SB),NOSPLIT,$0-24 JMP ·AddUint64(SB) -TEXT ·AddUint64(SB),7,$0 +TEXT ·AddUint64(SB),NOSPLIT,$0-24 MOVQ addr+0(FP), BP MOVQ delta+8(FP), AX MOVQ AX, CX @@ -63,55 +91,55 @@ TEXT ·AddUint64(SB),7,$0 MOVQ CX, new+16(FP) RET -TEXT ·LoadInt32(SB),7,$0 +TEXT ·LoadInt32(SB),NOSPLIT,$0-12 JMP ·LoadUint32(SB) -TEXT ·LoadUint32(SB),7,$0 +TEXT ·LoadUint32(SB),NOSPLIT,$0-12 MOVQ addr+0(FP), AX MOVL 0(AX), AX MOVL AX, val+8(FP) RET -TEXT ·LoadInt64(SB),7,$0 +TEXT ·LoadInt64(SB),NOSPLIT,$0-16 JMP ·LoadUint64(SB) -TEXT ·LoadUint64(SB),7,$0 +TEXT ·LoadUint64(SB),NOSPLIT,$0-16 MOVQ addr+0(FP), AX MOVQ 0(AX), AX MOVQ AX, val+8(FP) RET -TEXT ·LoadUintptr(SB),7,$0 +TEXT ·LoadUintptr(SB),NOSPLIT,$0-16 JMP ·LoadPointer(SB) -TEXT ·LoadPointer(SB),7,$0 +TEXT ·LoadPointer(SB),NOSPLIT,$0-16 MOVQ addr+0(FP), AX MOVQ 0(AX), AX MOVQ AX, val+8(FP) RET -TEXT ·StoreInt32(SB),7,$0 +TEXT ·StoreInt32(SB),NOSPLIT,$0-12 JMP ·StoreUint32(SB) -TEXT ·StoreUint32(SB),7,$0 +TEXT ·StoreUint32(SB),NOSPLIT,$0-12 MOVQ addr+0(FP), BP MOVL val+8(FP), AX XCHGL AX, 0(BP) RET -TEXT ·StoreInt64(SB),7,$0 +TEXT ·StoreInt64(SB),NOSPLIT,$0-16 JMP ·StoreUint64(SB) -TEXT ·StoreUint64(SB),7,$0 +TEXT ·StoreUint64(SB),NOSPLIT,$0-16 MOVQ addr+0(FP), BP MOVQ val+8(FP), AX XCHGQ AX, 0(BP) RET -TEXT ·StoreUintptr(SB),7,$0 +TEXT ·StoreUintptr(SB),NOSPLIT,$0-16 JMP ·StorePointer(SB) -TEXT ·StorePointer(SB),7,$0 +TEXT ·StorePointer(SB),NOSPLIT,$0-16 MOVQ addr+0(FP), BP MOVQ val+8(FP), AX XCHGQ AX, 0(BP) |