Last active
May 25, 2019 00:27
-
-
Save CAFxX/53fdd7db4349e0490b884194c2b84678 to your computer and use it in GitHub Desktop.
All the missing AMD64 atomic instructions for Golang
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code generated by command: go run gen.go -out asm.s -stubs stub.go. DO NOT EDIT. | |
#include "textflag.h" | |
// func AddInt8(addr *int8, a0 int8) | |
TEXT ·AddInt8(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVB a0+8(FP), CL | |
LOCK | |
ADDB CL, (AX) | |
RET | |
// func AddUint8(addr *uint8, a0 uint8) | |
TEXT ·AddUint8(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVB a0+8(FP), CL | |
LOCK | |
ADDB CL, (AX) | |
RET | |
// func AddInt16(addr *int16, a0 int16) | |
TEXT ·AddInt16(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVW a0+8(FP), CX | |
LOCK | |
ADDW CX, (AX) | |
RET | |
// func AddUint16(addr *uint16, a0 uint16) | |
TEXT ·AddUint16(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVW a0+8(FP), CX | |
LOCK | |
ADDW CX, (AX) | |
RET | |
// func AddInt32(addr *int32, a0 int32) | |
TEXT ·AddInt32(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVL a0+8(FP), CX | |
LOCK | |
ADDL CX, (AX) | |
RET | |
// func AddUint32(addr *uint32, a0 uint32) | |
TEXT ·AddUint32(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVL a0+8(FP), CX | |
LOCK | |
ADDL CX, (AX) | |
RET | |
// func AddInt64(addr *int64, a0 int64) | |
TEXT ·AddInt64(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
ADDQ CX, (AX) | |
RET | |
// func AddUint64(addr *uint64, a0 uint64) | |
TEXT ·AddUint64(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
ADDQ CX, (AX) | |
RET | |
// func AddInt(addr *int, a0 int) | |
TEXT ·AddInt(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
ADDQ CX, (AX) | |
RET | |
// func AddUintptr(addr *uintptr, a0 uintptr) | |
TEXT ·AddUintptr(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
ADDQ CX, (AX) | |
RET | |
// func AddWithCarryInt8(addr *int8, a0 int8) | |
TEXT ·AddWithCarryInt8(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVB a0+8(FP), CL | |
LOCK | |
ADCB CL, (AX) | |
RET | |
// func AddWithCarryUint8(addr *uint8, a0 uint8) | |
TEXT ·AddWithCarryUint8(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVB a0+8(FP), CL | |
LOCK | |
ADCB CL, (AX) | |
RET | |
// func AddWithCarryInt16(addr *int16, a0 int16) | |
TEXT ·AddWithCarryInt16(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVW a0+8(FP), CX | |
LOCK | |
ADCW CX, (AX) | |
RET | |
// func AddWithCarryUint16(addr *uint16, a0 uint16) | |
TEXT ·AddWithCarryUint16(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVW a0+8(FP), CX | |
LOCK | |
ADCW CX, (AX) | |
RET | |
// func AddWithCarryInt32(addr *int32, a0 int32) | |
TEXT ·AddWithCarryInt32(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVL a0+8(FP), CX | |
LOCK | |
ADCL CX, (AX) | |
RET | |
// func AddWithCarryUint32(addr *uint32, a0 uint32) | |
TEXT ·AddWithCarryUint32(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVL a0+8(FP), CX | |
LOCK | |
ADCL CX, (AX) | |
RET | |
// func AddWithCarryInt64(addr *int64, a0 int64) | |
TEXT ·AddWithCarryInt64(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
ADCQ CX, (AX) | |
RET | |
// func AddWithCarryUint64(addr *uint64, a0 uint64) | |
TEXT ·AddWithCarryUint64(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
ADCQ CX, (AX) | |
RET | |
// func AddWithCarryInt(addr *int, a0 int) | |
TEXT ·AddWithCarryInt(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
ADCQ CX, (AX) | |
RET | |
// func AddWithCarryUintptr(addr *uintptr, a0 uintptr) | |
TEXT ·AddWithCarryUintptr(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
ADCQ CX, (AX) | |
RET | |
// func AndInt8(addr *int8, a0 int8) | |
TEXT ·AndInt8(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVB a0+8(FP), CL | |
LOCK | |
ANDB CL, (AX) | |
RET | |
// func AndUint8(addr *uint8, a0 uint8) | |
TEXT ·AndUint8(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVB a0+8(FP), CL | |
LOCK | |
ANDB CL, (AX) | |
RET | |
// func AndInt16(addr *int16, a0 int16) | |
TEXT ·AndInt16(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVW a0+8(FP), CX | |
LOCK | |
ANDW CX, (AX) | |
RET | |
// func AndUint16(addr *uint16, a0 uint16) | |
TEXT ·AndUint16(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVW a0+8(FP), CX | |
LOCK | |
ANDW CX, (AX) | |
RET | |
// func AndInt32(addr *int32, a0 int32) | |
TEXT ·AndInt32(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVL a0+8(FP), CX | |
LOCK | |
ANDL CX, (AX) | |
RET | |
// func AndUint32(addr *uint32, a0 uint32) | |
TEXT ·AndUint32(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVL a0+8(FP), CX | |
LOCK | |
ANDL CX, (AX) | |
RET | |
// func AndInt64(addr *int64, a0 int64) | |
TEXT ·AndInt64(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
ANDQ CX, (AX) | |
RET | |
// func AndUint64(addr *uint64, a0 uint64) | |
TEXT ·AndUint64(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
ANDQ CX, (AX) | |
RET | |
// func AndInt(addr *int, a0 int) | |
TEXT ·AndInt(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
ANDQ CX, (AX) | |
RET | |
// func AndUintptr(addr *uintptr, a0 uintptr) | |
TEXT ·AndUintptr(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
ANDQ CX, (AX) | |
RET | |
// func BitTestAndComplementInt16(addr *int16, a0 int16) int16 | |
TEXT ·BitTestAndComplementInt16(SB), NOSPLIT, $0-18 | |
MOVQ addr+0(FP), AX | |
MOVW a0+8(FP), CX | |
LOCK | |
BTCW CX, (AX) | |
SETCS DL | |
MOVW DX, ret+16(FP) | |
RET | |
// func BitTestAndComplementUint16(addr *uint16, a0 uint16) uint16 | |
TEXT ·BitTestAndComplementUint16(SB), NOSPLIT, $0-18 | |
MOVQ addr+0(FP), AX | |
MOVW a0+8(FP), CX | |
LOCK | |
BTCW CX, (AX) | |
SETCS DL | |
MOVW DX, ret+16(FP) | |
RET | |
// func BitTestAndComplementInt32(addr *int32, a0 int32) int32 | |
TEXT ·BitTestAndComplementInt32(SB), NOSPLIT, $0-20 | |
MOVQ addr+0(FP), AX | |
MOVL a0+8(FP), CX | |
LOCK | |
BTCL CX, (AX) | |
SETCS DL | |
MOVL DX, ret+16(FP) | |
RET | |
// func BitTestAndComplementUint32(addr *uint32, a0 uint32) uint32 | |
TEXT ·BitTestAndComplementUint32(SB), NOSPLIT, $0-20 | |
MOVQ addr+0(FP), AX | |
MOVL a0+8(FP), CX | |
LOCK | |
BTCL CX, (AX) | |
SETCS DL | |
MOVL DX, ret+16(FP) | |
RET | |
// func BitTestAndComplementInt64(addr *int64, a0 int64) int64 | |
TEXT ·BitTestAndComplementInt64(SB), NOSPLIT, $0-24 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
BTCQ CX, (AX) | |
SETCS DL | |
MOVQ DX, ret+16(FP) | |
RET | |
// func BitTestAndComplementUint64(addr *uint64, a0 uint64) uint64 | |
TEXT ·BitTestAndComplementUint64(SB), NOSPLIT, $0-24 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
BTCQ CX, (AX) | |
SETCS DL | |
MOVQ DX, ret+16(FP) | |
RET | |
// func BitTestAndComplementInt(addr *int, a0 int) int | |
TEXT ·BitTestAndComplementInt(SB), NOSPLIT, $0-24 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
BTCQ CX, (AX) | |
SETCS DL | |
MOVQ DX, ret+16(FP) | |
RET | |
// func BitTestAndComplementUintptr(addr *uintptr, a0 uintptr) uintptr | |
TEXT ·BitTestAndComplementUintptr(SB), NOSPLIT, $0-24 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
BTCQ CX, (AX) | |
SETCS DL | |
MOVQ DX, ret+16(FP) | |
RET | |
// func BitTestAndResetInt16(addr *int16, a0 int16) int16 | |
TEXT ·BitTestAndResetInt16(SB), NOSPLIT, $0-18 | |
MOVQ addr+0(FP), AX | |
MOVW a0+8(FP), CX | |
LOCK | |
BTRW CX, (AX) | |
SETCS DL | |
MOVW DX, ret+16(FP) | |
RET | |
// func BitTestAndResetUint16(addr *uint16, a0 uint16) uint16 | |
TEXT ·BitTestAndResetUint16(SB), NOSPLIT, $0-18 | |
MOVQ addr+0(FP), AX | |
MOVW a0+8(FP), CX | |
LOCK | |
BTRW CX, (AX) | |
SETCS DL | |
MOVW DX, ret+16(FP) | |
RET | |
// func BitTestAndResetInt32(addr *int32, a0 int32) int32 | |
TEXT ·BitTestAndResetInt32(SB), NOSPLIT, $0-20 | |
MOVQ addr+0(FP), AX | |
MOVL a0+8(FP), CX | |
LOCK | |
BTRL CX, (AX) | |
SETCS DL | |
MOVL DX, ret+16(FP) | |
RET | |
// func BitTestAndResetUint32(addr *uint32, a0 uint32) uint32 | |
TEXT ·BitTestAndResetUint32(SB), NOSPLIT, $0-20 | |
MOVQ addr+0(FP), AX | |
MOVL a0+8(FP), CX | |
LOCK | |
BTRL CX, (AX) | |
SETCS DL | |
MOVL DX, ret+16(FP) | |
RET | |
// func BitTestAndResetInt64(addr *int64, a0 int64) int64 | |
TEXT ·BitTestAndResetInt64(SB), NOSPLIT, $0-24 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
BTRQ CX, (AX) | |
SETCS DL | |
MOVQ DX, ret+16(FP) | |
RET | |
// func BitTestAndResetUint64(addr *uint64, a0 uint64) uint64 | |
TEXT ·BitTestAndResetUint64(SB), NOSPLIT, $0-24 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
BTRQ CX, (AX) | |
SETCS DL | |
MOVQ DX, ret+16(FP) | |
RET | |
// func BitTestAndResetInt(addr *int, a0 int) int | |
TEXT ·BitTestAndResetInt(SB), NOSPLIT, $0-24 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
BTRQ CX, (AX) | |
SETCS DL | |
MOVQ DX, ret+16(FP) | |
RET | |
// func BitTestAndResetUintptr(addr *uintptr, a0 uintptr) uintptr | |
TEXT ·BitTestAndResetUintptr(SB), NOSPLIT, $0-24 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
BTRQ CX, (AX) | |
SETCS DL | |
MOVQ DX, ret+16(FP) | |
RET | |
// func BitTestAndSetInt16(addr *int16, a0 int16) int16 | |
TEXT ·BitTestAndSetInt16(SB), NOSPLIT, $0-18 | |
MOVQ addr+0(FP), AX | |
MOVW a0+8(FP), CX | |
LOCK | |
BTSW CX, (AX) | |
SETCS DL | |
MOVW DX, ret+16(FP) | |
RET | |
// func BitTestAndSetUint16(addr *uint16, a0 uint16) uint16 | |
TEXT ·BitTestAndSetUint16(SB), NOSPLIT, $0-18 | |
MOVQ addr+0(FP), AX | |
MOVW a0+8(FP), CX | |
LOCK | |
BTSW CX, (AX) | |
SETCS DL | |
MOVW DX, ret+16(FP) | |
RET | |
// func BitTestAndSetInt32(addr *int32, a0 int32) int32 | |
TEXT ·BitTestAndSetInt32(SB), NOSPLIT, $0-20 | |
MOVQ addr+0(FP), AX | |
MOVL a0+8(FP), CX | |
LOCK | |
BTSL CX, (AX) | |
SETCS DL | |
MOVL DX, ret+16(FP) | |
RET | |
// func BitTestAndSetUint32(addr *uint32, a0 uint32) uint32 | |
TEXT ·BitTestAndSetUint32(SB), NOSPLIT, $0-20 | |
MOVQ addr+0(FP), AX | |
MOVL a0+8(FP), CX | |
LOCK | |
BTSL CX, (AX) | |
SETCS DL | |
MOVL DX, ret+16(FP) | |
RET | |
// func BitTestAndSetInt64(addr *int64, a0 int64) int64 | |
TEXT ·BitTestAndSetInt64(SB), NOSPLIT, $0-24 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
BTSQ CX, (AX) | |
SETCS DL | |
MOVQ DX, ret+16(FP) | |
RET | |
// func BitTestAndSetUint64(addr *uint64, a0 uint64) uint64 | |
TEXT ·BitTestAndSetUint64(SB), NOSPLIT, $0-24 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
BTSQ CX, (AX) | |
SETCS DL | |
MOVQ DX, ret+16(FP) | |
RET | |
// func BitTestAndSetInt(addr *int, a0 int) int | |
TEXT ·BitTestAndSetInt(SB), NOSPLIT, $0-24 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
BTSQ CX, (AX) | |
SETCS DL | |
MOVQ DX, ret+16(FP) | |
RET | |
// func BitTestAndSetUintptr(addr *uintptr, a0 uintptr) uintptr | |
TEXT ·BitTestAndSetUintptr(SB), NOSPLIT, $0-24 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
BTSQ CX, (AX) | |
SETCS DL | |
MOVQ DX, ret+16(FP) | |
RET | |
// func CompareAndSwapInt8(addr *int8, a0 int8, a1 int8) int8 | |
TEXT ·CompareAndSwapInt8(SB), NOSPLIT, $0-17 | |
MOVQ addr+0(FP), CX | |
MOVB a0+8(FP), AL | |
MOVB a1+9(FP), DL | |
LOCK | |
CMPXCHGB DL, (CX) | |
MOVB AL, ret+16(FP) | |
RET | |
// func CompareAndSwapUint8(addr *uint8, a0 uint8, a1 uint8) uint8 | |
TEXT ·CompareAndSwapUint8(SB), NOSPLIT, $0-17 | |
MOVQ addr+0(FP), CX | |
MOVB a0+8(FP), AL | |
MOVB a1+9(FP), DL | |
LOCK | |
CMPXCHGB DL, (CX) | |
MOVB AL, ret+16(FP) | |
RET | |
// func CompareAndSwapInt16(addr *int16, a0 int16, a1 int16) int16 | |
TEXT ·CompareAndSwapInt16(SB), NOSPLIT, $0-18 | |
MOVQ addr+0(FP), CX | |
MOVW a0+8(FP), AX | |
MOVW a1+10(FP), DX | |
LOCK | |
CMPXCHGW DX, (CX) | |
MOVW AX, ret+16(FP) | |
RET | |
// func CompareAndSwapUint16(addr *uint16, a0 uint16, a1 uint16) uint16 | |
TEXT ·CompareAndSwapUint16(SB), NOSPLIT, $0-18 | |
MOVQ addr+0(FP), CX | |
MOVW a0+8(FP), AX | |
MOVW a1+10(FP), DX | |
LOCK | |
CMPXCHGW DX, (CX) | |
MOVW AX, ret+16(FP) | |
RET | |
// func CompareAndSwapInt32(addr *int32, a0 int32, a1 int32) int32 | |
TEXT ·CompareAndSwapInt32(SB), NOSPLIT, $0-20 | |
MOVQ addr+0(FP), CX | |
MOVL a0+8(FP), AX | |
MOVL a1+12(FP), DX | |
LOCK | |
CMPXCHGL DX, (CX) | |
MOVL AX, ret+16(FP) | |
RET | |
// func CompareAndSwapUint32(addr *uint32, a0 uint32, a1 uint32) uint32 | |
TEXT ·CompareAndSwapUint32(SB), NOSPLIT, $0-20 | |
MOVQ addr+0(FP), CX | |
MOVL a0+8(FP), AX | |
MOVL a1+12(FP), DX | |
LOCK | |
CMPXCHGL DX, (CX) | |
MOVL AX, ret+16(FP) | |
RET | |
// func CompareAndSwapInt64(addr *int64, a0 int64, a1 int64) int64 | |
TEXT ·CompareAndSwapInt64(SB), NOSPLIT, $0-32 | |
MOVQ addr+0(FP), CX | |
MOVQ a0+8(FP), AX | |
MOVQ a1+16(FP), DX | |
LOCK | |
CMPXCHGQ DX, (CX) | |
MOVQ AX, ret+24(FP) | |
RET | |
// func CompareAndSwapUint64(addr *uint64, a0 uint64, a1 uint64) uint64 | |
TEXT ·CompareAndSwapUint64(SB), NOSPLIT, $0-32 | |
MOVQ addr+0(FP), CX | |
MOVQ a0+8(FP), AX | |
MOVQ a1+16(FP), DX | |
LOCK | |
CMPXCHGQ DX, (CX) | |
MOVQ AX, ret+24(FP) | |
RET | |
// func CompareAndSwapInt(addr *int, a0 int, a1 int) int | |
TEXT ·CompareAndSwapInt(SB), NOSPLIT, $0-32 | |
MOVQ addr+0(FP), CX | |
MOVQ a0+8(FP), AX | |
MOVQ a1+16(FP), DX | |
LOCK | |
CMPXCHGQ DX, (CX) | |
MOVQ AX, ret+24(FP) | |
RET | |
// func CompareAndSwapUintptr(addr *uintptr, a0 uintptr, a1 uintptr) uintptr | |
TEXT ·CompareAndSwapUintptr(SB), NOSPLIT, $0-32 | |
MOVQ addr+0(FP), CX | |
MOVQ a0+8(FP), AX | |
MOVQ a1+16(FP), DX | |
LOCK | |
CMPXCHGQ DX, (CX) | |
MOVQ AX, ret+24(FP) | |
RET | |
// func CompareAndSwap2xInt64(addr *int64, a0 int64, a1 int64, a2 int64, a3 int64) (int64, int64) | |
TEXT ·CompareAndSwap2xInt64(SB), NOSPLIT, $0-56 | |
MOVQ addr+0(FP), BP | |
MOVQ a0+8(FP), AX | |
MOVQ a1+16(FP), DX | |
MOVQ a2+24(FP), BX | |
MOVQ a3+32(FP), CX | |
MOVQ DX, DX | |
MOVQ CX, CX | |
LOCK | |
CMPXCHG16B (BP) | |
MOVQ AX, ret+40(FP) | |
MOVQ DX, ret1+48(FP) | |
RET | |
// func CompareAndSwap2xUint64(addr *uint64, a0 uint64, a1 uint64, a2 uint64, a3 uint64) (uint64, uint64) | |
TEXT ·CompareAndSwap2xUint64(SB), NOSPLIT, $0-56 | |
MOVQ addr+0(FP), BP | |
MOVQ a0+8(FP), AX | |
MOVQ a1+16(FP), DX | |
MOVQ a2+24(FP), BX | |
MOVQ a3+32(FP), CX | |
MOVQ DX, DX | |
MOVQ CX, CX | |
LOCK | |
CMPXCHG16B (BP) | |
MOVQ AX, ret+40(FP) | |
MOVQ DX, ret1+48(FP) | |
RET | |
// func CompareAndSwap2xInt(addr *int, a0 int, a1 int, a2 int, a3 int) (int, int) | |
TEXT ·CompareAndSwap2xInt(SB), NOSPLIT, $0-56 | |
MOVQ addr+0(FP), BP | |
MOVQ a0+8(FP), AX | |
MOVQ a1+16(FP), DX | |
MOVQ a2+24(FP), BX | |
MOVQ a3+32(FP), CX | |
MOVQ DX, DX | |
MOVQ CX, CX | |
LOCK | |
CMPXCHG16B (BP) | |
MOVQ AX, ret+40(FP) | |
MOVQ DX, ret1+48(FP) | |
RET | |
// func CompareAndSwap2xUintptr(addr *uintptr, a0 uintptr, a1 uintptr, a2 uintptr, a3 uintptr) (uintptr, uintptr) | |
TEXT ·CompareAndSwap2xUintptr(SB), NOSPLIT, $0-56 | |
MOVQ addr+0(FP), BP | |
MOVQ a0+8(FP), AX | |
MOVQ a1+16(FP), DX | |
MOVQ a2+24(FP), BX | |
MOVQ a3+32(FP), CX | |
MOVQ DX, DX | |
MOVQ CX, CX | |
LOCK | |
CMPXCHG16B (BP) | |
MOVQ AX, ret+40(FP) | |
MOVQ DX, ret1+48(FP) | |
RET | |
// func DecrementInt8(addr *int8) | |
TEXT ·DecrementInt8(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
DECB (AX) | |
RET | |
// func DecrementUint8(addr *uint8) | |
TEXT ·DecrementUint8(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
DECB (AX) | |
RET | |
// func DecrementInt16(addr *int16) | |
TEXT ·DecrementInt16(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
DECW (AX) | |
RET | |
// func DecrementUint16(addr *uint16) | |
TEXT ·DecrementUint16(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
DECW (AX) | |
RET | |
// func DecrementInt32(addr *int32) | |
TEXT ·DecrementInt32(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
DECL (AX) | |
RET | |
// func DecrementUint32(addr *uint32) | |
TEXT ·DecrementUint32(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
DECL (AX) | |
RET | |
// func DecrementInt64(addr *int64) | |
TEXT ·DecrementInt64(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
DECQ (AX) | |
RET | |
// func DecrementUint64(addr *uint64) | |
TEXT ·DecrementUint64(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
DECQ (AX) | |
RET | |
// func DecrementInt(addr *int) | |
TEXT ·DecrementInt(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
DECQ (AX) | |
RET | |
// func DecrementUintptr(addr *uintptr) | |
TEXT ·DecrementUintptr(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
DECQ (AX) | |
RET | |
// func DecrementAndCheckZeroInt8(addr *int8) int8 | |
TEXT ·DecrementAndCheckZeroInt8(SB), NOSPLIT, $0-9 | |
MOVQ addr+0(FP), AX | |
LOCK | |
DECB (AX) | |
SETEQ AL | |
MOVB AL, ret+8(FP) | |
RET | |
// func DecrementAndCheckZeroUint8(addr *uint8) uint8 | |
TEXT ·DecrementAndCheckZeroUint8(SB), NOSPLIT, $0-9 | |
MOVQ addr+0(FP), AX | |
LOCK | |
DECB (AX) | |
SETEQ AL | |
MOVB AL, ret+8(FP) | |
RET | |
// func DecrementAndCheckZeroInt16(addr *int16) int16 | |
TEXT ·DecrementAndCheckZeroInt16(SB), NOSPLIT, $0-10 | |
MOVQ addr+0(FP), AX | |
LOCK | |
DECW (AX) | |
SETEQ CL | |
MOVW CX, ret+8(FP) | |
RET | |
// func DecrementAndCheckZeroUint16(addr *uint16) uint16 | |
TEXT ·DecrementAndCheckZeroUint16(SB), NOSPLIT, $0-10 | |
MOVQ addr+0(FP), AX | |
LOCK | |
DECW (AX) | |
SETEQ CL | |
MOVW CX, ret+8(FP) | |
RET | |
// func DecrementAndCheckZeroInt32(addr *int32) int32 | |
TEXT ·DecrementAndCheckZeroInt32(SB), NOSPLIT, $0-12 | |
MOVQ addr+0(FP), AX | |
LOCK | |
DECL (AX) | |
SETEQ CL | |
MOVL CX, ret+8(FP) | |
RET | |
// func DecrementAndCheckZeroUint32(addr *uint32) uint32 | |
TEXT ·DecrementAndCheckZeroUint32(SB), NOSPLIT, $0-12 | |
MOVQ addr+0(FP), AX | |
LOCK | |
DECL (AX) | |
SETEQ CL | |
MOVL CX, ret+8(FP) | |
RET | |
// func DecrementAndCheckZeroInt64(addr *int64) int64 | |
TEXT ·DecrementAndCheckZeroInt64(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
LOCK | |
DECQ (AX) | |
SETEQ CL | |
MOVQ CX, ret+8(FP) | |
RET | |
// func DecrementAndCheckZeroUint64(addr *uint64) uint64 | |
TEXT ·DecrementAndCheckZeroUint64(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
LOCK | |
DECQ (AX) | |
SETEQ CL | |
MOVQ CX, ret+8(FP) | |
RET | |
// func DecrementAndCheckZeroInt(addr *int) int | |
TEXT ·DecrementAndCheckZeroInt(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
LOCK | |
DECQ (AX) | |
SETEQ CL | |
MOVQ CX, ret+8(FP) | |
RET | |
// func DecrementAndCheckZeroUintptr(addr *uintptr) uintptr | |
TEXT ·DecrementAndCheckZeroUintptr(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
LOCK | |
DECQ (AX) | |
SETEQ CL | |
MOVQ CX, ret+8(FP) | |
RET | |
// func IncrementInt8(addr *int8) | |
TEXT ·IncrementInt8(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
INCB (AX) | |
RET | |
// func IncrementUint8(addr *uint8) | |
TEXT ·IncrementUint8(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
INCB (AX) | |
RET | |
// func IncrementInt16(addr *int16) | |
TEXT ·IncrementInt16(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
INCW (AX) | |
RET | |
// func IncrementUint16(addr *uint16) | |
TEXT ·IncrementUint16(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
INCW (AX) | |
RET | |
// func IncrementInt32(addr *int32) | |
TEXT ·IncrementInt32(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
INCL (AX) | |
RET | |
// func IncrementUint32(addr *uint32) | |
TEXT ·IncrementUint32(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
INCL (AX) | |
RET | |
// func IncrementInt64(addr *int64) | |
TEXT ·IncrementInt64(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
INCQ (AX) | |
RET | |
// func IncrementUint64(addr *uint64) | |
TEXT ·IncrementUint64(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
INCQ (AX) | |
RET | |
// func IncrementInt(addr *int) | |
TEXT ·IncrementInt(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
INCQ (AX) | |
RET | |
// func IncrementUintptr(addr *uintptr) | |
TEXT ·IncrementUintptr(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
INCQ (AX) | |
RET | |
// func IncrementAndCheckZeroInt8(addr *int8) int8 | |
TEXT ·IncrementAndCheckZeroInt8(SB), NOSPLIT, $0-9 | |
MOVQ addr+0(FP), AX | |
LOCK | |
INCB (AX) | |
SETEQ AL | |
MOVB AL, ret+8(FP) | |
RET | |
// func IncrementAndCheckZeroUint8(addr *uint8) uint8 | |
TEXT ·IncrementAndCheckZeroUint8(SB), NOSPLIT, $0-9 | |
MOVQ addr+0(FP), AX | |
LOCK | |
INCB (AX) | |
SETEQ AL | |
MOVB AL, ret+8(FP) | |
RET | |
// func IncrementAndCheckZeroInt16(addr *int16) int16 | |
TEXT ·IncrementAndCheckZeroInt16(SB), NOSPLIT, $0-10 | |
MOVQ addr+0(FP), AX | |
LOCK | |
INCW (AX) | |
SETEQ CL | |
MOVW CX, ret+8(FP) | |
RET | |
// func IncrementAndCheckZeroUint16(addr *uint16) uint16 | |
TEXT ·IncrementAndCheckZeroUint16(SB), NOSPLIT, $0-10 | |
MOVQ addr+0(FP), AX | |
LOCK | |
INCW (AX) | |
SETEQ CL | |
MOVW CX, ret+8(FP) | |
RET | |
// func IncrementAndCheckZeroInt32(addr *int32) int32 | |
TEXT ·IncrementAndCheckZeroInt32(SB), NOSPLIT, $0-12 | |
MOVQ addr+0(FP), AX | |
LOCK | |
INCL (AX) | |
SETEQ CL | |
MOVL CX, ret+8(FP) | |
RET | |
// func IncrementAndCheckZeroUint32(addr *uint32) uint32 | |
TEXT ·IncrementAndCheckZeroUint32(SB), NOSPLIT, $0-12 | |
MOVQ addr+0(FP), AX | |
LOCK | |
INCL (AX) | |
SETEQ CL | |
MOVL CX, ret+8(FP) | |
RET | |
// func IncrementAndCheckZeroInt64(addr *int64) int64 | |
TEXT ·IncrementAndCheckZeroInt64(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
LOCK | |
INCQ (AX) | |
SETEQ CL | |
MOVQ CX, ret+8(FP) | |
RET | |
// func IncrementAndCheckZeroUint64(addr *uint64) uint64 | |
TEXT ·IncrementAndCheckZeroUint64(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
LOCK | |
INCQ (AX) | |
SETEQ CL | |
MOVQ CX, ret+8(FP) | |
RET | |
// func IncrementAndCheckZeroInt(addr *int) int | |
TEXT ·IncrementAndCheckZeroInt(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
LOCK | |
INCQ (AX) | |
SETEQ CL | |
MOVQ CX, ret+8(FP) | |
RET | |
// func IncrementAndCheckZeroUintptr(addr *uintptr) uintptr | |
TEXT ·IncrementAndCheckZeroUintptr(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
LOCK | |
INCQ (AX) | |
SETEQ CL | |
MOVQ CX, ret+8(FP) | |
RET | |
// func NegateInt8(addr *int8) | |
TEXT ·NegateInt8(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
NEGB (AX) | |
RET | |
// func NegateUint8(addr *uint8) | |
TEXT ·NegateUint8(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
NEGB (AX) | |
RET | |
// func NegateInt16(addr *int16) | |
TEXT ·NegateInt16(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
NEGW (AX) | |
RET | |
// func NegateUint16(addr *uint16) | |
TEXT ·NegateUint16(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
NEGW (AX) | |
RET | |
// func NegateInt32(addr *int32) | |
TEXT ·NegateInt32(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
NEGL (AX) | |
RET | |
// func NegateUint32(addr *uint32) | |
TEXT ·NegateUint32(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
NEGL (AX) | |
RET | |
// func NegateInt64(addr *int64) | |
TEXT ·NegateInt64(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
NEGQ (AX) | |
RET | |
// func NegateUint64(addr *uint64) | |
TEXT ·NegateUint64(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
NEGQ (AX) | |
RET | |
// func NegateInt(addr *int) | |
TEXT ·NegateInt(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
NEGQ (AX) | |
RET | |
// func NegateUintptr(addr *uintptr) | |
TEXT ·NegateUintptr(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
NEGQ (AX) | |
RET | |
// func NotInt8(addr *int8) | |
TEXT ·NotInt8(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
NOTB (AX) | |
RET | |
// func NotUint8(addr *uint8) | |
TEXT ·NotUint8(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
NOTB (AX) | |
RET | |
// func NotInt16(addr *int16) | |
TEXT ·NotInt16(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
NOTW (AX) | |
RET | |
// func NotUint16(addr *uint16) | |
TEXT ·NotUint16(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
NOTW (AX) | |
RET | |
// func NotInt32(addr *int32) | |
TEXT ·NotInt32(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
NOTL (AX) | |
RET | |
// func NotUint32(addr *uint32) | |
TEXT ·NotUint32(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
NOTL (AX) | |
RET | |
// func NotInt64(addr *int64) | |
TEXT ·NotInt64(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
NOTQ (AX) | |
RET | |
// func NotUint64(addr *uint64) | |
TEXT ·NotUint64(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
NOTQ (AX) | |
RET | |
// func NotInt(addr *int) | |
TEXT ·NotInt(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
NOTQ (AX) | |
RET | |
// func NotUintptr(addr *uintptr) | |
TEXT ·NotUintptr(SB), NOSPLIT, $0-8 | |
MOVQ addr+0(FP), AX | |
LOCK | |
NOTQ (AX) | |
RET | |
// func OrInt8(addr *int8, a0 int8) | |
TEXT ·OrInt8(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVB a0+8(FP), CL | |
LOCK | |
ORB CL, (AX) | |
RET | |
// func OrUint8(addr *uint8, a0 uint8) | |
TEXT ·OrUint8(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVB a0+8(FP), CL | |
LOCK | |
ORB CL, (AX) | |
RET | |
// func OrInt16(addr *int16, a0 int16) | |
TEXT ·OrInt16(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVW a0+8(FP), CX | |
LOCK | |
ORW CX, (AX) | |
RET | |
// func OrUint16(addr *uint16, a0 uint16) | |
TEXT ·OrUint16(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVW a0+8(FP), CX | |
LOCK | |
ORW CX, (AX) | |
RET | |
// func OrInt32(addr *int32, a0 int32) | |
TEXT ·OrInt32(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVL a0+8(FP), CX | |
LOCK | |
ORL CX, (AX) | |
RET | |
// func OrUint32(addr *uint32, a0 uint32) | |
TEXT ·OrUint32(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVL a0+8(FP), CX | |
LOCK | |
ORL CX, (AX) | |
RET | |
// func OrInt64(addr *int64, a0 int64) | |
TEXT ·OrInt64(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
ORQ CX, (AX) | |
RET | |
// func OrUint64(addr *uint64, a0 uint64) | |
TEXT ·OrUint64(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
ORQ CX, (AX) | |
RET | |
// func OrInt(addr *int, a0 int) | |
TEXT ·OrInt(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
ORQ CX, (AX) | |
RET | |
// func OrUintptr(addr *uintptr, a0 uintptr) | |
TEXT ·OrUintptr(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
ORQ CX, (AX) | |
RET | |
// func SubtractWithBorrowInt8(addr *int8, a0 int8) | |
TEXT ·SubtractWithBorrowInt8(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVB a0+8(FP), CL | |
LOCK | |
SBBB CL, (AX) | |
RET | |
// func SubtractWithBorrowUint8(addr *uint8, a0 uint8) | |
TEXT ·SubtractWithBorrowUint8(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVB a0+8(FP), CL | |
LOCK | |
SBBB CL, (AX) | |
RET | |
// func SubtractWithBorrowInt16(addr *int16, a0 int16) | |
TEXT ·SubtractWithBorrowInt16(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVW a0+8(FP), CX | |
LOCK | |
SBBW CX, (AX) | |
RET | |
// func SubtractWithBorrowUint16(addr *uint16, a0 uint16) | |
TEXT ·SubtractWithBorrowUint16(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVW a0+8(FP), CX | |
LOCK | |
SBBW CX, (AX) | |
RET | |
// func SubtractWithBorrowInt32(addr *int32, a0 int32) | |
TEXT ·SubtractWithBorrowInt32(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVL a0+8(FP), CX | |
LOCK | |
SBBL CX, (AX) | |
RET | |
// func SubtractWithBorrowUint32(addr *uint32, a0 uint32) | |
TEXT ·SubtractWithBorrowUint32(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVL a0+8(FP), CX | |
LOCK | |
SBBL CX, (AX) | |
RET | |
// func SubtractWithBorrowInt64(addr *int64, a0 int64) | |
TEXT ·SubtractWithBorrowInt64(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
SBBQ CX, (AX) | |
RET | |
// func SubtractWithBorrowUint64(addr *uint64, a0 uint64) | |
TEXT ·SubtractWithBorrowUint64(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
SBBQ CX, (AX) | |
RET | |
// func SubtractWithBorrowInt(addr *int, a0 int) | |
TEXT ·SubtractWithBorrowInt(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
SBBQ CX, (AX) | |
RET | |
// func SubtractWithBorrowUintptr(addr *uintptr, a0 uintptr) | |
TEXT ·SubtractWithBorrowUintptr(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
SBBQ CX, (AX) | |
RET | |
// func SubtractInt8(addr *int8, a0 int8) | |
TEXT ·SubtractInt8(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVB a0+8(FP), CL | |
LOCK | |
SUBB CL, (AX) | |
RET | |
// func SubtractUint8(addr *uint8, a0 uint8) | |
TEXT ·SubtractUint8(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVB a0+8(FP), CL | |
LOCK | |
SUBB CL, (AX) | |
RET | |
// func SubtractInt16(addr *int16, a0 int16) | |
TEXT ·SubtractInt16(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVW a0+8(FP), CX | |
LOCK | |
SUBW CX, (AX) | |
RET | |
// func SubtractUint16(addr *uint16, a0 uint16) | |
TEXT ·SubtractUint16(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVW a0+8(FP), CX | |
LOCK | |
SUBW CX, (AX) | |
RET | |
// func SubtractInt32(addr *int32, a0 int32) | |
TEXT ·SubtractInt32(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVL a0+8(FP), CX | |
LOCK | |
SUBL CX, (AX) | |
RET | |
// func SubtractUint32(addr *uint32, a0 uint32) | |
TEXT ·SubtractUint32(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVL a0+8(FP), CX | |
LOCK | |
SUBL CX, (AX) | |
RET | |
// func SubtractInt64(addr *int64, a0 int64) | |
TEXT ·SubtractInt64(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
SUBQ CX, (AX) | |
RET | |
// func SubtractUint64(addr *uint64, a0 uint64) | |
TEXT ·SubtractUint64(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
SUBQ CX, (AX) | |
RET | |
// func SubtractInt(addr *int, a0 int) | |
TEXT ·SubtractInt(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
SUBQ CX, (AX) | |
RET | |
// func SubtractUintptr(addr *uintptr, a0 uintptr) | |
TEXT ·SubtractUintptr(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
SUBQ CX, (AX) | |
RET | |
// func XorInt8(addr *int8, a0 int8) | |
TEXT ·XorInt8(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVB a0+8(FP), CL | |
LOCK | |
XORB CL, (AX) | |
RET | |
// func XorUint8(addr *uint8, a0 uint8) | |
TEXT ·XorUint8(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVB a0+8(FP), CL | |
LOCK | |
XORB CL, (AX) | |
RET | |
// func XorInt16(addr *int16, a0 int16) | |
TEXT ·XorInt16(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVW a0+8(FP), CX | |
LOCK | |
XORW CX, (AX) | |
RET | |
// func XorUint16(addr *uint16, a0 uint16) | |
TEXT ·XorUint16(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVW a0+8(FP), CX | |
LOCK | |
XORW CX, (AX) | |
RET | |
// func XorInt32(addr *int32, a0 int32) | |
TEXT ·XorInt32(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVL a0+8(FP), CX | |
LOCK | |
XORL CX, (AX) | |
RET | |
// func XorUint32(addr *uint32, a0 uint32) | |
TEXT ·XorUint32(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVL a0+8(FP), CX | |
LOCK | |
XORL CX, (AX) | |
RET | |
// func XorInt64(addr *int64, a0 int64) | |
TEXT ·XorInt64(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
XORQ CX, (AX) | |
RET | |
// func XorUint64(addr *uint64, a0 uint64) | |
TEXT ·XorUint64(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
XORQ CX, (AX) | |
RET | |
// func XorInt(addr *int, a0 int) | |
TEXT ·XorInt(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
XORQ CX, (AX) | |
RET | |
// func XorUintptr(addr *uintptr, a0 uintptr) | |
TEXT ·XorUintptr(SB), NOSPLIT, $0-16 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
XORQ CX, (AX) | |
RET | |
// func AddAndSwapInt8(addr *int8, a0 int8) int8 | |
TEXT ·AddAndSwapInt8(SB), NOSPLIT, $0-17 | |
MOVQ addr+0(FP), AX | |
MOVB a0+8(FP), CL | |
LOCK | |
XADDB CL, (AX) | |
MOVB CL, ret+16(FP) | |
RET | |
// func AddAndSwapUint8(addr *uint8, a0 uint8) uint8 | |
TEXT ·AddAndSwapUint8(SB), NOSPLIT, $0-17 | |
MOVQ addr+0(FP), AX | |
MOVB a0+8(FP), CL | |
LOCK | |
XADDB CL, (AX) | |
MOVB CL, ret+16(FP) | |
RET | |
// func AddAndSwapInt16(addr *int16, a0 int16) int16 | |
TEXT ·AddAndSwapInt16(SB), NOSPLIT, $0-18 | |
MOVQ addr+0(FP), AX | |
MOVW a0+8(FP), CX | |
LOCK | |
XADDW CX, (AX) | |
MOVW CX, ret+16(FP) | |
RET | |
// func AddAndSwapUint16(addr *uint16, a0 uint16) uint16 | |
TEXT ·AddAndSwapUint16(SB), NOSPLIT, $0-18 | |
MOVQ addr+0(FP), AX | |
MOVW a0+8(FP), CX | |
LOCK | |
XADDW CX, (AX) | |
MOVW CX, ret+16(FP) | |
RET | |
// func AddAndSwapInt32(addr *int32, a0 int32) int32 | |
TEXT ·AddAndSwapInt32(SB), NOSPLIT, $0-20 | |
MOVQ addr+0(FP), AX | |
MOVL a0+8(FP), CX | |
LOCK | |
XADDL CX, (AX) | |
MOVL CX, ret+16(FP) | |
RET | |
// func AddAndSwapUint32(addr *uint32, a0 uint32) uint32 | |
TEXT ·AddAndSwapUint32(SB), NOSPLIT, $0-20 | |
MOVQ addr+0(FP), AX | |
MOVL a0+8(FP), CX | |
LOCK | |
XADDL CX, (AX) | |
MOVL CX, ret+16(FP) | |
RET | |
// func AddAndSwapInt64(addr *int64, a0 int64) int64 | |
TEXT ·AddAndSwapInt64(SB), NOSPLIT, $0-24 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
XADDQ CX, (AX) | |
MOVQ CX, ret+16(FP) | |
RET | |
// func AddAndSwapUint64(addr *uint64, a0 uint64) uint64 | |
TEXT ·AddAndSwapUint64(SB), NOSPLIT, $0-24 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
XADDQ CX, (AX) | |
MOVQ CX, ret+16(FP) | |
RET | |
// func AddAndSwapInt(addr *int, a0 int) int | |
TEXT ·AddAndSwapInt(SB), NOSPLIT, $0-24 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
XADDQ CX, (AX) | |
MOVQ CX, ret+16(FP) | |
RET | |
// func AddAndSwapUintptr(addr *uintptr, a0 uintptr) uintptr | |
TEXT ·AddAndSwapUintptr(SB), NOSPLIT, $0-24 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
LOCK | |
XADDQ CX, (AX) | |
MOVQ CX, ret+16(FP) | |
RET | |
// func SwapInt8(addr *int8, a0 int8) int8 | |
TEXT ·SwapInt8(SB), NOSPLIT, $0-17 | |
MOVQ addr+0(FP), AX | |
MOVB a0+8(FP), CL | |
XCHGB CL, (AX) | |
MOVB CL, ret+16(FP) | |
RET | |
// func SwapUint8(addr *uint8, a0 uint8) uint8 | |
TEXT ·SwapUint8(SB), NOSPLIT, $0-17 | |
MOVQ addr+0(FP), AX | |
MOVB a0+8(FP), CL | |
XCHGB CL, (AX) | |
MOVB CL, ret+16(FP) | |
RET | |
// func SwapInt16(addr *int16, a0 int16) int16 | |
TEXT ·SwapInt16(SB), NOSPLIT, $0-18 | |
MOVQ addr+0(FP), AX | |
MOVW a0+8(FP), CX | |
XCHGW CX, (AX) | |
MOVW CX, ret+16(FP) | |
RET | |
// func SwapUint16(addr *uint16, a0 uint16) uint16 | |
TEXT ·SwapUint16(SB), NOSPLIT, $0-18 | |
MOVQ addr+0(FP), AX | |
MOVW a0+8(FP), CX | |
XCHGW CX, (AX) | |
MOVW CX, ret+16(FP) | |
RET | |
// func SwapInt32(addr *int32, a0 int32) int32 | |
TEXT ·SwapInt32(SB), NOSPLIT, $0-20 | |
MOVQ addr+0(FP), AX | |
MOVL a0+8(FP), CX | |
XCHGL CX, (AX) | |
MOVL CX, ret+16(FP) | |
RET | |
// func SwapUint32(addr *uint32, a0 uint32) uint32 | |
TEXT ·SwapUint32(SB), NOSPLIT, $0-20 | |
MOVQ addr+0(FP), AX | |
MOVL a0+8(FP), CX | |
XCHGL CX, (AX) | |
MOVL CX, ret+16(FP) | |
RET | |
// func SwapInt64(addr *int64, a0 int64) int64 | |
TEXT ·SwapInt64(SB), NOSPLIT, $0-24 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
XCHGQ CX, (AX) | |
MOVQ CX, ret+16(FP) | |
RET | |
// func SwapUint64(addr *uint64, a0 uint64) uint64 | |
TEXT ·SwapUint64(SB), NOSPLIT, $0-24 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
XCHGQ CX, (AX) | |
MOVQ CX, ret+16(FP) | |
RET | |
// func SwapInt(addr *int, a0 int) int | |
TEXT ·SwapInt(SB), NOSPLIT, $0-24 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
XCHGQ CX, (AX) | |
MOVQ CX, ret+16(FP) | |
RET | |
// func SwapUintptr(addr *uintptr, a0 uintptr) uintptr | |
TEXT ·SwapUintptr(SB), NOSPLIT, $0-24 | |
MOVQ addr+0(FP), AX | |
MOVQ a0+8(FP), CX | |
XCHGQ CX, (AX) | |
MOVQ CX, ret+16(FP) | |
RET |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//go:generate go run gen.go -out asm.s -stubs stub.go | |
// +build ignore | |
package main | |
import ( | |
"bytes" | |
"fmt" | |
"io/ioutil" | |
"strings" | |
. "github.com/mmcloughlin/avo/build" | |
"github.com/mmcloughlin/avo/operand" | |
"github.com/mmcloughlin/avo/reg" | |
) | |
type R operand.Op | |
type Fn func(R, []R) []R | |
func main() { | |
cases := []struct { | |
Name string | |
NArgs int | |
NRets int | |
B int | |
Fn Fn | |
}{ | |
{"Add", 1, 0, 8, NRV(func(p R, r []R) { LOCK(); ADDB(r[0], p) })}, | |
{"Add", 1, 0, 16, NRV(func(p R, r []R) { LOCK(); ADDW(r[0], p) })}, | |
{"Add", 1, 0, 32, NRV(func(p R, r []R) { LOCK(); ADDL(r[0], p) })}, | |
{"Add", 1, 0, 64, NRV(func(p R, r []R) { LOCK(); ADDQ(r[0], p) })}, | |
{"AddWithCarry", 1, 0, 8, NRV(func(p R, r []R) { LOCK(); ADCB(r[0], p) })}, | |
{"AddWithCarry", 1, 0, 16, NRV(func(p R, r []R) { LOCK(); ADCW(r[0], p) })}, | |
{"AddWithCarry", 1, 0, 32, NRV(func(p R, r []R) { LOCK(); ADCL(r[0], p) })}, | |
{"AddWithCarry", 1, 0, 64, NRV(func(p R, r []R) { LOCK(); ADCQ(r[0], p) })}, | |
{"And", 1, 0, 8, NRV(func(p R, r []R) { LOCK(); ANDB(r[0], p) })}, | |
{"And", 1, 0, 16, NRV(func(p R, r []R) { LOCK(); ANDW(r[0], p) })}, | |
{"And", 1, 0, 32, NRV(func(p R, r []R) { LOCK(); ANDL(r[0], p) })}, | |
{"And", 1, 0, 64, NRV(func(p R, r []R) { LOCK(); ANDQ(r[0], p) })}, | |
{"BitTestAndComplement", 1, 1, 16, func(p R, r []R) []R { LOCK(); BTCW(r[0], p); return FLAG(SETCS, 16) }}, | |
{"BitTestAndComplement", 1, 1, 32, func(p R, r []R) []R { LOCK(); BTCL(r[0], p); return FLAG(SETCS, 32) }}, | |
{"BitTestAndComplement", 1, 1, 64, func(p R, r []R) []R { LOCK(); BTCQ(r[0], p); return FLAG(SETCS, 64) }}, | |
{"BitTestAndReset", 1, 1, 16, func(p R, r []R) []R { LOCK(); BTRW(r[0], p); return FLAG(SETCS, 16) }}, | |
{"BitTestAndReset", 1, 1, 32, func(p R, r []R) []R { LOCK(); BTRL(r[0], p); return FLAG(SETCS, 32) }}, | |
{"BitTestAndReset", 1, 1, 64, func(p R, r []R) []R { LOCK(); BTRQ(r[0], p); return FLAG(SETCS, 64) }}, | |
{"BitTestAndSet", 1, 1, 16, func(p R, r []R) []R { LOCK(); BTSW(r[0], p); return FLAG(SETCS, 16) }}, | |
{"BitTestAndSet", 1, 1, 32, func(p R, r []R) []R { LOCK(); BTSL(r[0], p); return FLAG(SETCS, 32) }}, | |
{"BitTestAndSet", 1, 1, 64, func(p R, r []R) []R { LOCK(); BTSQ(r[0], p); return FLAG(SETCS, 64) }}, | |
{"CompareAndSwap", 2, 1, 8, func(p R, r []R) []R { | |
MOVB(r[0], reg.AL) | |
LOCK() | |
CMPXCHGB(r[1], p) | |
return []R{reg.AL} | |
}}, | |
{"CompareAndSwap", 2, 1, 16, func(p R, r []R) []R { | |
MOVW(r[0], reg.AX) | |
LOCK() | |
CMPXCHGW(r[1], p) | |
return []R{reg.AX} | |
}}, | |
{"CompareAndSwap", 2, 1, 32, func(p R, r []R) []R { | |
MOVL(r[0], reg.EAX) | |
LOCK() | |
CMPXCHGL(r[1], p) | |
return []R{reg.EAX} | |
}}, | |
{"CompareAndSwap", 2, 1, 64, func(p R, r []R) []R { | |
MOVQ(r[0], reg.RAX) | |
LOCK() | |
CMPXCHGQ(r[1], p) | |
return []R{reg.RAX} | |
}}, | |
{"CompareAndSwap2x", 4, 2, 64, func(p R, r []R) []R { | |
MOVQ(r[0], reg.RAX) | |
MOVQ(r[1], reg.RDX) | |
MOVQ(r[2], reg.RBX) | |
MOVQ(r[3], reg.RCX) | |
LOCK() | |
CMPXCHG16B(p) | |
return []R{reg.RAX, reg.RDX} | |
}}, | |
{"Decrement", 0, 0, 8, NRV(func(p R, r []R) { LOCK(); DECB(p) })}, | |
{"Decrement", 0, 0, 16, NRV(func(p R, r []R) { LOCK(); DECW(p) })}, | |
{"Decrement", 0, 0, 32, NRV(func(p R, r []R) { LOCK(); DECL(p) })}, | |
{"Decrement", 0, 0, 64, NRV(func(p R, r []R) { LOCK(); DECQ(p) })}, | |
{"DecrementAndCheckZero", 0, 1, 8, func(p R, r []R) []R { LOCK(); DECB(p); return FLAG(SETEQ, 8) }}, | |
{"DecrementAndCheckZero", 0, 1, 16, func(p R, r []R) []R { LOCK(); DECW(p); return FLAG(SETEQ, 16) }}, | |
{"DecrementAndCheckZero", 0, 1, 32, func(p R, r []R) []R { LOCK(); DECL(p); return FLAG(SETEQ, 32) }}, | |
{"DecrementAndCheckZero", 0, 1, 64, func(p R, r []R) []R { LOCK(); DECQ(p); return FLAG(SETEQ, 64) }}, | |
{"Increment", 0, 0, 8, NRV(func(p R, r []R) { LOCK(); INCB(p) })}, | |
{"Increment", 0, 0, 16, NRV(func(p R, r []R) { LOCK(); INCW(p) })}, | |
{"Increment", 0, 0, 32, NRV(func(p R, r []R) { LOCK(); INCL(p) })}, | |
{"Increment", 0, 0, 64, NRV(func(p R, r []R) { LOCK(); INCQ(p) })}, | |
{"IncrementAndCheckZero", 0, 1, 8, func(p R, r []R) []R { LOCK(); INCB(p); return FLAG(SETEQ, 8) }}, | |
{"IncrementAndCheckZero", 0, 1, 16, func(p R, r []R) []R { LOCK(); INCW(p); return FLAG(SETEQ, 16) }}, | |
{"IncrementAndCheckZero", 0, 1, 32, func(p R, r []R) []R { LOCK(); INCL(p); return FLAG(SETEQ, 32) }}, | |
{"IncrementAndCheckZero", 0, 1, 64, func(p R, r []R) []R { LOCK(); INCQ(p); return FLAG(SETEQ, 64) }}, | |
{"Negate", 0, 0, 8, NRV(func(p R, r []R) { LOCK(); NEGB(p) })}, | |
{"Negate", 0, 0, 16, NRV(func(p R, r []R) { LOCK(); NEGW(p) })}, | |
{"Negate", 0, 0, 32, NRV(func(p R, r []R) { LOCK(); NEGL(p) })}, | |
{"Negate", 0, 0, 64, NRV(func(p R, r []R) { LOCK(); NEGQ(p) })}, | |
{"Not", 0, 0, 8, NRV(func(p R, r []R) { LOCK(); NOTB(p) })}, | |
{"Not", 0, 0, 16, NRV(func(p R, r []R) { LOCK(); NOTW(p) })}, | |
{"Not", 0, 0, 32, NRV(func(p R, r []R) { LOCK(); NOTL(p) })}, | |
{"Not", 0, 0, 64, NRV(func(p R, r []R) { LOCK(); NOTQ(p) })}, | |
{"Or", 1, 0, 8, NRV(func(p R, r []R) { LOCK(); ORB(r[0], p) })}, | |
{"Or", 1, 0, 16, NRV(func(p R, r []R) { LOCK(); ORW(r[0], p) })}, | |
{"Or", 1, 0, 32, NRV(func(p R, r []R) { LOCK(); ORL(r[0], p) })}, | |
{"Or", 1, 0, 64, NRV(func(p R, r []R) { LOCK(); ORQ(r[0], p) })}, | |
{"SubtractWithBorrow", 1, 0, 8, NRV(func(p R, r []R) { LOCK(); SBBB(r[0], p) })}, | |
{"SubtractWithBorrow", 1, 0, 16, NRV(func(p R, r []R) { LOCK(); SBBW(r[0], p) })}, | |
{"SubtractWithBorrow", 1, 0, 32, NRV(func(p R, r []R) { LOCK(); SBBL(r[0], p) })}, | |
{"SubtractWithBorrow", 1, 0, 64, NRV(func(p R, r []R) { LOCK(); SBBQ(r[0], p) })}, | |
{"Subtract", 1, 0, 8, NRV(func(p R, r []R) { LOCK(); SUBB(r[0], p) })}, | |
{"Subtract", 1, 0, 16, NRV(func(p R, r []R) { LOCK(); SUBW(r[0], p) })}, | |
{"Subtract", 1, 0, 32, NRV(func(p R, r []R) { LOCK(); SUBL(r[0], p) })}, | |
{"Subtract", 1, 0, 64, NRV(func(p R, r []R) { LOCK(); SUBQ(r[0], p) })}, | |
{"Xor", 1, 0, 8, NRV(func(p R, r []R) { LOCK(); XORB(r[0], p) })}, | |
{"Xor", 1, 0, 16, NRV(func(p R, r []R) { LOCK(); XORW(r[0], p) })}, | |
{"Xor", 1, 0, 32, NRV(func(p R, r []R) { LOCK(); XORL(r[0], p) })}, | |
{"Xor", 1, 0, 64, NRV(func(p R, r []R) { LOCK(); XORQ(r[0], p) })}, | |
{"AddAndSwap", 1, 1, 8, func(p R, r []R) []R { LOCK(); XADDB(r[0], p); return []R{r[0]} }}, | |
{"AddAndSwap", 1, 1, 16, func(p R, r []R) []R { LOCK(); XADDW(r[0], p); return []R{r[0]} }}, | |
{"AddAndSwap", 1, 1, 32, func(p R, r []R) []R { LOCK(); XADDL(r[0], p); return []R{r[0]} }}, | |
{"AddAndSwap", 1, 1, 64, func(p R, r []R) []R { LOCK(); XADDQ(r[0], p); return []R{r[0]} }}, | |
{"Swap", 1, 1, 8, func(p R, r []R) []R { XCHGB(r[0], p); return []R{r[0]} }}, | |
{"Swap", 1, 1, 16, func(p R, r []R) []R { XCHGW(r[0], p); return []R{r[0]} }}, | |
{"Swap", 1, 1, 32, func(p R, r []R) []R { XCHGL(r[0], p); return []R{r[0]} }}, | |
{"Swap", 1, 1, 64, func(p R, r []R) []R { XCHGQ(r[0], p); return []R{r[0]} }}, | |
} | |
// ADD, ADC, AND, BTC, BTR, BTS, CMPXCHG, CMPXCH8B, CMPXCHG16B, DEC, INC, NEG, NOT, OR, SBB, SUB, XOR, XADD, and XCHG | |
const natB = 64 | |
for _, c := range cases { | |
for _, s := range []string{"Int", "Uint"} { | |
t := fmt.Sprintf("%s%d", strings.ToLower(s), c.B) | |
T := fmt.Sprintf("%s%d", s, c.B) | |
gen(c.Name, c.NArgs, c.NRets, t, T, c.B, c.Fn) | |
} | |
if c.B == natB { | |
gen(c.Name, c.NArgs, c.NRets, "int", "Int", c.B, c.Fn) | |
gen(c.Name, c.NArgs, c.NRets, "uintptr", "Uintptr", c.B, c.Fn) | |
} | |
} | |
Generate() | |
asm, err := ioutil.ReadFile("asm.s") | |
if err != nil { | |
panic(err) | |
} | |
asm = bytes.ReplaceAll(asm, []byte("// LOCK //"), []byte("LOCK")) | |
err = ioutil.WriteFile("asm.s", []byte(asm), 0) | |
if err != nil { | |
panic(err) | |
} | |
} | |
func gp(b int) reg.GPVirtual { | |
switch b { | |
case 8: | |
return GP8() | |
case 16: | |
return GP16() | |
case 32: | |
return GP32() | |
case 64: | |
return GP64() | |
default: | |
panic("unknown bit size") | |
} | |
} | |
func arg(n int) string { | |
return fmt.Sprintf("a%d", n) | |
} | |
func gen(name string, nargs, nrets int, t, T string, b int, fn Fn) { | |
_args := []string{} | |
for i := 0; i < nargs; i++ { | |
_args = append(_args, arg(i)) | |
} | |
args := ", " + strings.Join(_args, ", ") + " " + t | |
if nargs == 0 { | |
args = "" | |
} | |
_rets := []string{} | |
for i := 0; i < nrets; i++ { | |
_rets = append(_rets, t) | |
} | |
rets := "(" + strings.Join(_rets, ", ") + ")" | |
signature := fmt.Sprintf("func(addr *%s %s) %s", t, args, rets) | |
TEXT(name+T, NOSPLIT, signature) | |
p := operand.Mem{Base: Load(Param("addr"), GP64())} | |
var r []R | |
for i := 0; i < nargs; i++ { | |
r = append(r, Load(ParamIndex(i+1), gp(b))) | |
} | |
r = fn(p, r) | |
for i, o := range r { | |
Store(o.(reg.Register), ReturnIndex(i)) | |
} | |
RET() | |
} | |
func LOCK() { | |
Comment("LOCK //") | |
} | |
func NRV(f func(R, []R)) func(R, []R) []R { | |
return func(p R, r []R) []R { | |
f(p, r) | |
return nil | |
} | |
} | |
func FLAG(flagFn func(operand.Op), bits int) []R { | |
r := gp(bits) | |
if bits == 8 { | |
flagFn(r) | |
} else { | |
flagFn(r.As8()) | |
} | |
return []R{r} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code generated by command: go run gen.go -out asm.s -stubs stub.go. DO NOT EDIT. | |
package main | |
func AddInt8(addr *int8, a0 int8) | |
func AddUint8(addr *uint8, a0 uint8) | |
func AddInt16(addr *int16, a0 int16) | |
func AddUint16(addr *uint16, a0 uint16) | |
func AddInt32(addr *int32, a0 int32) | |
func AddUint32(addr *uint32, a0 uint32) | |
func AddInt64(addr *int64, a0 int64) | |
func AddUint64(addr *uint64, a0 uint64) | |
func AddInt(addr *int, a0 int) | |
func AddUintptr(addr *uintptr, a0 uintptr) | |
func AddWithCarryInt8(addr *int8, a0 int8) | |
func AddWithCarryUint8(addr *uint8, a0 uint8) | |
func AddWithCarryInt16(addr *int16, a0 int16) | |
func AddWithCarryUint16(addr *uint16, a0 uint16) | |
func AddWithCarryInt32(addr *int32, a0 int32) | |
func AddWithCarryUint32(addr *uint32, a0 uint32) | |
func AddWithCarryInt64(addr *int64, a0 int64) | |
func AddWithCarryUint64(addr *uint64, a0 uint64) | |
func AddWithCarryInt(addr *int, a0 int) | |
func AddWithCarryUintptr(addr *uintptr, a0 uintptr) | |
func AndInt8(addr *int8, a0 int8) | |
func AndUint8(addr *uint8, a0 uint8) | |
func AndInt16(addr *int16, a0 int16) | |
func AndUint16(addr *uint16, a0 uint16) | |
func AndInt32(addr *int32, a0 int32) | |
func AndUint32(addr *uint32, a0 uint32) | |
func AndInt64(addr *int64, a0 int64) | |
func AndUint64(addr *uint64, a0 uint64) | |
func AndInt(addr *int, a0 int) | |
func AndUintptr(addr *uintptr, a0 uintptr) | |
func BitTestAndComplementInt16(addr *int16, a0 int16) int16 | |
func BitTestAndComplementUint16(addr *uint16, a0 uint16) uint16 | |
func BitTestAndComplementInt32(addr *int32, a0 int32) int32 | |
func BitTestAndComplementUint32(addr *uint32, a0 uint32) uint32 | |
func BitTestAndComplementInt64(addr *int64, a0 int64) int64 | |
func BitTestAndComplementUint64(addr *uint64, a0 uint64) uint64 | |
func BitTestAndComplementInt(addr *int, a0 int) int | |
func BitTestAndComplementUintptr(addr *uintptr, a0 uintptr) uintptr | |
func BitTestAndResetInt16(addr *int16, a0 int16) int16 | |
func BitTestAndResetUint16(addr *uint16, a0 uint16) uint16 | |
func BitTestAndResetInt32(addr *int32, a0 int32) int32 | |
func BitTestAndResetUint32(addr *uint32, a0 uint32) uint32 | |
func BitTestAndResetInt64(addr *int64, a0 int64) int64 | |
func BitTestAndResetUint64(addr *uint64, a0 uint64) uint64 | |
func BitTestAndResetInt(addr *int, a0 int) int | |
func BitTestAndResetUintptr(addr *uintptr, a0 uintptr) uintptr | |
func BitTestAndSetInt16(addr *int16, a0 int16) int16 | |
func BitTestAndSetUint16(addr *uint16, a0 uint16) uint16 | |
func BitTestAndSetInt32(addr *int32, a0 int32) int32 | |
func BitTestAndSetUint32(addr *uint32, a0 uint32) uint32 | |
func BitTestAndSetInt64(addr *int64, a0 int64) int64 | |
func BitTestAndSetUint64(addr *uint64, a0 uint64) uint64 | |
func BitTestAndSetInt(addr *int, a0 int) int | |
func BitTestAndSetUintptr(addr *uintptr, a0 uintptr) uintptr | |
func CompareAndSwapInt8(addr *int8, a0 int8, a1 int8) int8 | |
func CompareAndSwapUint8(addr *uint8, a0 uint8, a1 uint8) uint8 | |
func CompareAndSwapInt16(addr *int16, a0 int16, a1 int16) int16 | |
func CompareAndSwapUint16(addr *uint16, a0 uint16, a1 uint16) uint16 | |
func CompareAndSwapInt32(addr *int32, a0 int32, a1 int32) int32 | |
func CompareAndSwapUint32(addr *uint32, a0 uint32, a1 uint32) uint32 | |
func CompareAndSwapInt64(addr *int64, a0 int64, a1 int64) int64 | |
func CompareAndSwapUint64(addr *uint64, a0 uint64, a1 uint64) uint64 | |
func CompareAndSwapInt(addr *int, a0 int, a1 int) int | |
func CompareAndSwapUintptr(addr *uintptr, a0 uintptr, a1 uintptr) uintptr | |
func CompareAndSwap2xInt64(addr *int64, a0 int64, a1 int64, a2 int64, a3 int64) (int64, int64) | |
func CompareAndSwap2xUint64(addr *uint64, a0 uint64, a1 uint64, a2 uint64, a3 uint64) (uint64, uint64) | |
func CompareAndSwap2xInt(addr *int, a0 int, a1 int, a2 int, a3 int) (int, int) | |
func CompareAndSwap2xUintptr(addr *uintptr, a0 uintptr, a1 uintptr, a2 uintptr, a3 uintptr) (uintptr, uintptr) | |
func DecrementInt8(addr *int8) | |
func DecrementUint8(addr *uint8) | |
func DecrementInt16(addr *int16) | |
func DecrementUint16(addr *uint16) | |
func DecrementInt32(addr *int32) | |
func DecrementUint32(addr *uint32) | |
func DecrementInt64(addr *int64) | |
func DecrementUint64(addr *uint64) | |
func DecrementInt(addr *int) | |
func DecrementUintptr(addr *uintptr) | |
func DecrementAndCheckZeroInt8(addr *int8) int8 | |
func DecrementAndCheckZeroUint8(addr *uint8) uint8 | |
func DecrementAndCheckZeroInt16(addr *int16) int16 | |
func DecrementAndCheckZeroUint16(addr *uint16) uint16 | |
func DecrementAndCheckZeroInt32(addr *int32) int32 | |
func DecrementAndCheckZeroUint32(addr *uint32) uint32 | |
func DecrementAndCheckZeroInt64(addr *int64) int64 | |
func DecrementAndCheckZeroUint64(addr *uint64) uint64 | |
func DecrementAndCheckZeroInt(addr *int) int | |
func DecrementAndCheckZeroUintptr(addr *uintptr) uintptr | |
func IncrementInt8(addr *int8) | |
func IncrementUint8(addr *uint8) | |
func IncrementInt16(addr *int16) | |
func IncrementUint16(addr *uint16) | |
func IncrementInt32(addr *int32) | |
func IncrementUint32(addr *uint32) | |
func IncrementInt64(addr *int64) | |
func IncrementUint64(addr *uint64) | |
func IncrementInt(addr *int) | |
func IncrementUintptr(addr *uintptr) | |
func IncrementAndCheckZeroInt8(addr *int8) int8 | |
func IncrementAndCheckZeroUint8(addr *uint8) uint8 | |
func IncrementAndCheckZeroInt16(addr *int16) int16 | |
func IncrementAndCheckZeroUint16(addr *uint16) uint16 | |
func IncrementAndCheckZeroInt32(addr *int32) int32 | |
func IncrementAndCheckZeroUint32(addr *uint32) uint32 | |
func IncrementAndCheckZeroInt64(addr *int64) int64 | |
func IncrementAndCheckZeroUint64(addr *uint64) uint64 | |
func IncrementAndCheckZeroInt(addr *int) int | |
func IncrementAndCheckZeroUintptr(addr *uintptr) uintptr | |
func NegateInt8(addr *int8) | |
func NegateUint8(addr *uint8) | |
func NegateInt16(addr *int16) | |
func NegateUint16(addr *uint16) | |
func NegateInt32(addr *int32) | |
func NegateUint32(addr *uint32) | |
func NegateInt64(addr *int64) | |
func NegateUint64(addr *uint64) | |
func NegateInt(addr *int) | |
func NegateUintptr(addr *uintptr) | |
func NotInt8(addr *int8) | |
func NotUint8(addr *uint8) | |
func NotInt16(addr *int16) | |
func NotUint16(addr *uint16) | |
func NotInt32(addr *int32) | |
func NotUint32(addr *uint32) | |
func NotInt64(addr *int64) | |
func NotUint64(addr *uint64) | |
func NotInt(addr *int) | |
func NotUintptr(addr *uintptr) | |
func OrInt8(addr *int8, a0 int8) | |
func OrUint8(addr *uint8, a0 uint8) | |
func OrInt16(addr *int16, a0 int16) | |
func OrUint16(addr *uint16, a0 uint16) | |
func OrInt32(addr *int32, a0 int32) | |
func OrUint32(addr *uint32, a0 uint32) | |
func OrInt64(addr *int64, a0 int64) | |
func OrUint64(addr *uint64, a0 uint64) | |
func OrInt(addr *int, a0 int) | |
func OrUintptr(addr *uintptr, a0 uintptr) | |
func SubtractWithBorrowInt8(addr *int8, a0 int8) | |
func SubtractWithBorrowUint8(addr *uint8, a0 uint8) | |
func SubtractWithBorrowInt16(addr *int16, a0 int16) | |
func SubtractWithBorrowUint16(addr *uint16, a0 uint16) | |
func SubtractWithBorrowInt32(addr *int32, a0 int32) | |
func SubtractWithBorrowUint32(addr *uint32, a0 uint32) | |
func SubtractWithBorrowInt64(addr *int64, a0 int64) | |
func SubtractWithBorrowUint64(addr *uint64, a0 uint64) | |
func SubtractWithBorrowInt(addr *int, a0 int) | |
func SubtractWithBorrowUintptr(addr *uintptr, a0 uintptr) | |
func SubtractInt8(addr *int8, a0 int8) | |
func SubtractUint8(addr *uint8, a0 uint8) | |
func SubtractInt16(addr *int16, a0 int16) | |
func SubtractUint16(addr *uint16, a0 uint16) | |
func SubtractInt32(addr *int32, a0 int32) | |
func SubtractUint32(addr *uint32, a0 uint32) | |
func SubtractInt64(addr *int64, a0 int64) | |
func SubtractUint64(addr *uint64, a0 uint64) | |
func SubtractInt(addr *int, a0 int) | |
func SubtractUintptr(addr *uintptr, a0 uintptr) | |
func XorInt8(addr *int8, a0 int8) | |
func XorUint8(addr *uint8, a0 uint8) | |
func XorInt16(addr *int16, a0 int16) | |
func XorUint16(addr *uint16, a0 uint16) | |
func XorInt32(addr *int32, a0 int32) | |
func XorUint32(addr *uint32, a0 uint32) | |
func XorInt64(addr *int64, a0 int64) | |
func XorUint64(addr *uint64, a0 uint64) | |
func XorInt(addr *int, a0 int) | |
func XorUintptr(addr *uintptr, a0 uintptr) | |
func AddAndSwapInt8(addr *int8, a0 int8) int8 | |
func AddAndSwapUint8(addr *uint8, a0 uint8) uint8 | |
func AddAndSwapInt16(addr *int16, a0 int16) int16 | |
func AddAndSwapUint16(addr *uint16, a0 uint16) uint16 | |
func AddAndSwapInt32(addr *int32, a0 int32) int32 | |
func AddAndSwapUint32(addr *uint32, a0 uint32) uint32 | |
func AddAndSwapInt64(addr *int64, a0 int64) int64 | |
func AddAndSwapUint64(addr *uint64, a0 uint64) uint64 | |
func AddAndSwapInt(addr *int, a0 int) int | |
func AddAndSwapUintptr(addr *uintptr, a0 uintptr) uintptr | |
func SwapInt8(addr *int8, a0 int8) int8 | |
func SwapUint8(addr *uint8, a0 uint8) uint8 | |
func SwapInt16(addr *int16, a0 int16) int16 | |
func SwapUint16(addr *uint16, a0 uint16) uint16 | |
func SwapInt32(addr *int32, a0 int32) int32 | |
func SwapUint32(addr *uint32, a0 uint32) uint32 | |
func SwapInt64(addr *int64, a0 int64) int64 | |
func SwapUint64(addr *uint64, a0 uint64) uint64 | |
func SwapInt(addr *int, a0 int) int | |
func SwapUintptr(addr *uintptr, a0 uintptr) uintptr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
// XBEGIN starts a TSX RTM transaction. | |
// The processor must support TSX or the process will crash. | |
func XBEGIN() uint32 | |
// XEND commits a TSX RTM transaction. A transaction must be open. | |
// The processor must support TSX or the process will crash. | |
func XEND() | |
// XTEST returns true if we are currently inside a TSX RTM transaction. | |
// The processor must support TSX or the process will crash. | |
func XTEST() bool | |
// XABORT aborts the current TSX RTM transaction, if any. The provided | |
// reason will be available in the return value of XBEGIN. If no | |
// transaction is executing, it is a no-op. | |
// The processor must support TSX or the process will crash. | |
func XABORT(reason uint8) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "textflag.h" | |
// func XBEGIN() uint32 | |
TEXT ·XBEGIN(SB), NOSPLIT, $0-4 | |
MOVL $0xFFFFFFFF, ret+0(FP) | |
XBEGIN aborted | |
RET | |
aborted: | |
MOVL AX, ret+0(FP) | |
RET | |
// func XEND() | |
TEXT ·XEND(SB), NOSPLIT, $0 | |
XEND | |
RET | |
// func XTEST() bool | |
TEXT ·XTEST(SB), NOSPLIT, $0-1 | |
XTEST | |
SETNE ret+0(FP) | |
RET | |
// func XABORT(reason uint8) | |
TEXT ·XABORT(SB), NOSPLIT, $0-1 | |
MOVB reason+0(FP), AX | |
// each XABORT <imm8> is 3 bytes long; we don't need to do bounds | |
// check because reason can only be [0, 255] and we have all the | |
// XABORT cases | |
MULW 3, AX | |
JMP AX | |
XABORT $0 | |
XABORT $1 | |
XABORT $2 | |
XABORT $3 | |
XABORT $4 | |
XABORT $5 | |
XABORT $6 | |
XABORT $7 | |
XABORT $8 | |
XABORT $9 | |
XABORT $10 | |
XABORT $11 | |
XABORT $12 | |
XABORT $13 | |
XABORT $14 | |
XABORT $15 | |
XABORT $16 | |
XABORT $17 | |
XABORT $18 | |
XABORT $19 | |
XABORT $20 | |
XABORT $21 | |
XABORT $22 | |
XABORT $23 | |
XABORT $24 | |
XABORT $25 | |
XABORT $26 | |
XABORT $27 | |
XABORT $28 | |
XABORT $29 | |
XABORT $30 | |
XABORT $31 | |
XABORT $32 | |
XABORT $33 | |
XABORT $34 | |
XABORT $35 | |
XABORT $36 | |
XABORT $37 | |
XABORT $38 | |
XABORT $39 | |
XABORT $40 | |
XABORT $41 | |
XABORT $42 | |
XABORT $43 | |
XABORT $44 | |
XABORT $45 | |
XABORT $46 | |
XABORT $47 | |
XABORT $48 | |
XABORT $49 | |
XABORT $50 | |
XABORT $51 | |
XABORT $52 | |
XABORT $53 | |
XABORT $54 | |
XABORT $55 | |
XABORT $56 | |
XABORT $57 | |
XABORT $58 | |
XABORT $59 | |
XABORT $60 | |
XABORT $61 | |
XABORT $62 | |
XABORT $63 | |
XABORT $64 | |
XABORT $65 | |
XABORT $66 | |
XABORT $67 | |
XABORT $68 | |
XABORT $69 | |
XABORT $70 | |
XABORT $71 | |
XABORT $72 | |
XABORT $73 | |
XABORT $74 | |
XABORT $75 | |
XABORT $76 | |
XABORT $77 | |
XABORT $78 | |
XABORT $79 | |
XABORT $80 | |
XABORT $81 | |
XABORT $82 | |
XABORT $83 | |
XABORT $84 | |
XABORT $85 | |
XABORT $86 | |
XABORT $87 | |
XABORT $88 | |
XABORT $89 | |
XABORT $90 | |
XABORT $91 | |
XABORT $92 | |
XABORT $93 | |
XABORT $94 | |
XABORT $95 | |
XABORT $96 | |
XABORT $97 | |
XABORT $98 | |
XABORT $99 | |
XABORT $100 | |
XABORT $101 | |
XABORT $102 | |
XABORT $103 | |
XABORT $104 | |
XABORT $105 | |
XABORT $106 | |
XABORT $107 | |
XABORT $108 | |
XABORT $109 | |
XABORT $110 | |
XABORT $111 | |
XABORT $112 | |
XABORT $113 | |
XABORT $114 | |
XABORT $115 | |
XABORT $116 | |
XABORT $117 | |
XABORT $118 | |
XABORT $119 | |
XABORT $120 | |
XABORT $121 | |
XABORT $122 | |
XABORT $123 | |
XABORT $124 | |
XABORT $125 | |
XABORT $126 | |
XABORT $127 | |
XABORT $128 | |
XABORT $129 | |
XABORT $130 | |
XABORT $131 | |
XABORT $132 | |
XABORT $133 | |
XABORT $134 | |
XABORT $135 | |
XABORT $136 | |
XABORT $137 | |
XABORT $138 | |
XABORT $139 | |
XABORT $140 | |
XABORT $141 | |
XABORT $142 | |
XABORT $143 | |
XABORT $144 | |
XABORT $145 | |
XABORT $146 | |
XABORT $147 | |
XABORT $148 | |
XABORT $149 | |
XABORT $150 | |
XABORT $151 | |
XABORT $152 | |
XABORT $153 | |
XABORT $154 | |
XABORT $155 | |
XABORT $156 | |
XABORT $157 | |
XABORT $158 | |
XABORT $159 | |
XABORT $160 | |
XABORT $161 | |
XABORT $162 | |
XABORT $163 | |
XABORT $164 | |
XABORT $165 | |
XABORT $166 | |
XABORT $167 | |
XABORT $168 | |
XABORT $169 | |
XABORT $170 | |
XABORT $171 | |
XABORT $172 | |
XABORT $173 | |
XABORT $174 | |
XABORT $175 | |
XABORT $176 | |
XABORT $177 | |
XABORT $178 | |
XABORT $179 | |
XABORT $180 | |
XABORT $181 | |
XABORT $182 | |
XABORT $183 | |
XABORT $184 | |
XABORT $185 | |
XABORT $186 | |
XABORT $187 | |
XABORT $188 | |
XABORT $189 | |
XABORT $190 | |
XABORT $191 | |
XABORT $192 | |
XABORT $193 | |
XABORT $194 | |
XABORT $195 | |
XABORT $196 | |
XABORT $197 | |
XABORT $198 | |
XABORT $199 | |
XABORT $200 | |
XABORT $201 | |
XABORT $202 | |
XABORT $203 | |
XABORT $204 | |
XABORT $205 | |
XABORT $206 | |
XABORT $207 | |
XABORT $208 | |
XABORT $209 | |
XABORT $210 | |
XABORT $211 | |
XABORT $212 | |
XABORT $213 | |
XABORT $214 | |
XABORT $215 | |
XABORT $216 | |
XABORT $217 | |
XABORT $218 | |
XABORT $219 | |
XABORT $220 | |
XABORT $221 | |
XABORT $222 | |
XABORT $223 | |
XABORT $224 | |
XABORT $225 | |
XABORT $226 | |
XABORT $227 | |
XABORT $228 | |
XABORT $229 | |
XABORT $230 | |
XABORT $231 | |
XABORT $232 | |
XABORT $233 | |
XABORT $234 | |
XABORT $235 | |
XABORT $236 | |
XABORT $237 | |
XABORT $238 | |
XABORT $239 | |
XABORT $240 | |
XABORT $241 | |
XABORT $242 | |
XABORT $243 | |
XABORT $244 | |
XABORT $245 | |
XABORT $246 | |
XABORT $247 | |
XABORT $248 | |
XABORT $249 | |
XABORT $250 | |
XABORT $251 | |
XABORT $252 | |
XABORT $253 | |
XABORT $254 | |
XABORT $255 | |
RET | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment