github.com/bytedance/gopkg@v0.0.0-20240514070511-01b2cbcf35e1/collection/lscq/asm_arm64.s (about)

     1  #include "textflag.h"
     2  #include "funcdata.h"
     3  
     4  TEXT ·compareAndSwapUint128(SB), NOSPLIT, $0-41
     5  	MOVD	addr+0(FP), R0
     6  	MOVD	old1+8(FP), R2
     7  	MOVD	old2+16(FP), R3
     8  	MOVD	new1+24(FP), R4
     9  	MOVD	new2+32(FP), R5
    10  	MOVBU	·arm64HasAtomics+0(SB), R1
    11  	CBZ 	R1, load_store_loop
    12  	MOVD	R2, R6
    13  	MOVD	R3, R7
    14  	CASPD	(R2, R3), (R0), (R4, R5)
    15  	CMP 	R2, R6
    16  	BNE 	ok
    17  	CMP 	R3, R7
    18  	CSET	EQ, R0
    19  	MOVB	R0, ret+40(FP)
    20  	RET
    21  load_store_loop:
    22  	LDAXP	(R0), (R6, R7)
    23  	CMP 	R2, R6
    24  	BNE 	ok
    25  	CMP 	R3, R7
    26  	BNE 	ok
    27  	STLXP	(R4, R5), (R0), R6
    28  	CBNZ	R6, load_store_loop
    29  ok:
    30  	CSET	EQ, R0
    31  	MOVB	R0, ret+40(FP)
    32  	RET
    33  
    34  TEXT ·loadUint128(SB),NOSPLIT,$0-24
    35  	MOVD	ptr+0(FP), R0
    36  	LDAXP	(R0), (R0, R1)
    37  	MOVD	R0, ret+8(FP)
    38  	MOVD	R1, ret+16(FP)
    39  	RET
    40  
    41  TEXT ·loadSCQNodeUint64(SB),NOSPLIT,$0
    42  	MOVD	ptr+0(FP), R0
    43  	LDAXP	(R0), (R0, R1)
    44  	MOVD	R0, ret+8(FP)
    45  	MOVD	R1, ret+16(FP)
    46  	RET
    47  
    48  TEXT ·loadSCQNodePointer(SB),NOSPLIT,$0
    49  	MOVD	ptr+0(FP), R0
    50  	LDAXP	(R0), (R0, R1)
    51  	MOVD	R0, ret+8(FP)
    52  	MOVD	R1, ret+16(FP)
    53  	RET
    54  
    55  TEXT ·atomicTestAndSetFirstBit(SB),NOSPLIT,$0
    56  	MOVD	addr+0(FP), R0
    57  load_store_loop:
    58  	LDAXR	(R0), R1
    59  	ORR 	$(1<<63), R1, R1
    60  	STLXR	R1, (R0), R2
    61  	CBNZ	R2, load_store_loop
    62  	MOVD	R1, val+8(FP)
    63  	RET
    64  
    65  
    66  TEXT ·atomicTestAndSetSecondBit(SB),NOSPLIT,$0
    67  	MOVD	addr+0(FP), R0
    68  load_store_loop:
    69  	LDAXR	(R0), R1
    70  	ORR 	$(1<<62), R1, R1
    71  	STLXR	R1, (R0), R2
    72  	CBNZ	R2, load_store_loop
    73  	MOVD	R1, val+8(FP)
    74  	RET
    75  
    76  TEXT ·resetNode(SB),NOSPLIT,$0
    77  	MOVD	addr+0(FP), R0
    78  	MOVD	$0, 8(R0)
    79  load_store_loop:
    80  	LDAXR	(R0), R1
    81  	ORR 	$(1<<62), R1, R1
    82  	STLXR	R1, (R0), R2
    83  	CBNZ	R2, load_store_loop
    84  	RET
    85  
    86  TEXT ·runtimeEnableWriteBarrier(SB),NOSPLIT,$0
    87  	MOVW	runtime·writeBarrier(SB), R0
    88  	MOVB	R0, ret+0(FP)
    89  	RET