github.com/songzhibin97/go-baseutils@v0.0.2-0.20240302024150-487d8ce9c082/structure/queues/lscq/asm.s (about) 1 2 3 // +build amd64,!gccgo,!appengine 4 5 #include "textflag.h" 6 7 TEXT ·compareAndSwapUint128(SB),NOSPLIT,$0 8 MOVQ addr+0(FP), R8 9 MOVQ old1+8(FP), AX 10 MOVQ old2+16(FP), DX 11 MOVQ new1+24(FP), BX 12 MOVQ new2+32(FP), CX 13 LOCK 14 CMPXCHG16B (R8) 15 SETEQ swapped+40(FP) 16 RET 17 18 TEXT ·loadUint128(SB),NOSPLIT,$0 19 MOVQ addr+0(FP), R8 20 XORQ AX, AX 21 XORQ DX, DX 22 XORQ BX, BX 23 XORQ CX, CX 24 LOCK 25 CMPXCHG16B (R8) 26 MOVQ AX, val_0+8(FP) 27 MOVQ DX, val_1+16(FP) 28 RET 29 30 TEXT ·loadSCQNodeUint64(SB),NOSPLIT,$0 31 JMP ·loadUint128(SB) 32 33 TEXT ·loadSCQNodePointer(SB),NOSPLIT,$0 34 JMP ·loadUint128(SB) 35 36 TEXT ·atomicTestAndSetFirstBit(SB),NOSPLIT,$0 37 MOVQ addr+0(FP), DX 38 LOCK 39 BTSQ $63,(DX) 40 MOVQ AX, val+8(FP) 41 RET 42 43 TEXT ·atomicTestAndSetSecondBit(SB),NOSPLIT,$0 44 MOVQ addr+0(FP), DX 45 LOCK 46 BTSQ $62,(DX) 47 MOVQ AX, val+8(FP) 48 RET 49 50 TEXT ·resetNode(SB),NOSPLIT,$0 51 MOVQ addr+0(FP), DX 52 MOVQ $0, 8(DX) 53 LOCK 54 BTSQ $62, (DX) 55 RET 56 57 TEXT ·runtimeEnableWriteBarrier(SB),NOSPLIT,$0 58 MOVL runtime·writeBarrier(SB), AX 59 MOVB AX, ret+0(FP) 60 RET