...
Run Format

Text file src/sync/atomic/asm_s390x.s

Documentation: sync/atomic

     1	// Copyright 2016 The Go Authors. All rights reserved.
     2	// Use of this source code is governed by a BSD-style
     3	// license that can be found in the LICENSE file.
     4	
     5	#include "textflag.h"
     6	
     7	TEXT ·SwapInt32(SB),NOSPLIT,$0-20
     8		BR	·SwapUint32(SB)
     9	
    10	TEXT ·SwapUint32(SB),NOSPLIT,$0-20
    11		MOVD	addr+0(FP), R3
    12		MOVWZ	new+8(FP), R4
    13		MOVWZ	(R3), R5
    14	repeat:
    15		CS	R5, R4, (R3) // if (R3)==R5 then (R3)=R4 else R5=(R3)
    16		BNE	repeat
    17		MOVW	R5, old+16(FP)
    18		RET
    19	
    20	TEXT ·SwapInt64(SB),NOSPLIT,$0-24
    21		BR	·SwapUint64(SB)
    22	
    23	TEXT ·SwapUint64(SB),NOSPLIT,$0-24
    24		MOVD	addr+0(FP), R3
    25		MOVD	new+8(FP), R4
    26		MOVD	(R3), R5
    27	repeat:
    28		CSG	R5, R4, (R3) // if (R3)==R5 then (R3)=R4 else R5=(R3)
    29		BNE	repeat
    30		MOVD	R5, old+16(FP)
    31		RET
    32	
    33	TEXT ·SwapUintptr(SB),NOSPLIT,$0-24
    34		BR	·SwapUint64(SB)
    35	
    36	TEXT ·CompareAndSwapInt32(SB),NOSPLIT,$0-17
    37		BR	·CompareAndSwapUint32(SB)
    38	
    39	TEXT ·CompareAndSwapUint32(SB),NOSPLIT,$0-17
    40		MOVD	addr+0(FP), R3
    41		MOVWZ	old+8(FP), R4
    42		MOVWZ	new+12(FP), R5
    43		CS	R4, R5, 0(R3) // if R4==(R3) then (R3)=R5 else R4=(R3)
    44		BNE	cas_fail
    45		MOVB	$1, swapped+16(FP)
    46		RET
    47	cas_fail:
    48		MOVB	$0, swapped+16(FP)
    49		RET
    50	
    51	TEXT ·CompareAndSwapUintptr(SB),NOSPLIT,$0-25
    52		BR	·CompareAndSwapUint64(SB)
    53	
    54	TEXT ·CompareAndSwapInt64(SB),NOSPLIT,$0-25
    55		BR	·CompareAndSwapUint64(SB)
    56	
    57	TEXT ·CompareAndSwapUint64(SB),NOSPLIT,$0-25
    58		MOVD	addr+0(FP), R3
    59		MOVD	old+8(FP), R4
    60		MOVD	new+16(FP), R5
    61		CSG	R4, R5, 0(R3) // if R4==(R3) then (R3)=R5 else R4=(R3)
    62		BNE	cas64_fail
    63		MOVB	$1, swapped+24(FP)
    64		RET
    65	cas64_fail:
    66		MOVB	$0, swapped+24(FP)
    67		RET
    68	
    69	TEXT ·AddInt32(SB),NOSPLIT,$0-20
    70		BR	·AddUint32(SB)
    71	
    72	TEXT ·AddUint32(SB),NOSPLIT,$0-20
    73		MOVD	addr+0(FP), R4
    74		MOVWZ	delta+8(FP), R5
    75		MOVWZ	(R4), R3
    76	repeat:
    77		ADD	R3, R5, R6
    78		CS	R3, R6, (R4) // if R3==(R4) then (R4)=R6 else R3=(R4)
    79		BNE	repeat
    80		MOVW	R6, new+16(FP)
    81		RET
    82	
    83	TEXT ·AddUintptr(SB),NOSPLIT,$0-24
    84		BR	·AddUint64(SB)
    85	
    86	TEXT ·AddInt64(SB),NOSPLIT,$0-24
    87		BR	·AddUint64(SB)
    88	
    89	TEXT ·AddUint64(SB),NOSPLIT,$0-24
    90		MOVD	addr+0(FP), R4
    91		MOVD	delta+8(FP), R5
    92		MOVD	(R4), R3
    93	repeat:
    94		ADD	R3, R5, R6
    95		CSG	R3, R6, (R4) // if R3==(R4) then (R4)=R6 else R3=(R4)
    96		BNE	repeat
    97		MOVD	R6, new+16(FP)
    98		RET
    99	
   100	TEXT ·LoadInt32(SB),NOSPLIT,$0-12
   101		BR	·LoadUint32(SB)
   102	
   103	TEXT ·LoadUint32(SB),NOSPLIT,$0-12
   104		MOVD	addr+0(FP), R3
   105		MOVW	0(R3), R4
   106		MOVW	R4, val+8(FP)
   107		RET
   108	
   109	TEXT ·LoadInt64(SB),NOSPLIT,$0-16
   110		BR	·LoadUint64(SB)
   111	
   112	TEXT ·LoadUint64(SB),NOSPLIT,$0-16
   113		MOVD	addr+0(FP), R3
   114		MOVD	0(R3), R4
   115		MOVD	R4, val+8(FP)
   116		RET
   117	
   118	TEXT ·LoadUintptr(SB),NOSPLIT,$0-16
   119		BR	·LoadPointer(SB)
   120	
   121	TEXT ·LoadPointer(SB),NOSPLIT,$0-16
   122		BR	·LoadUint64(SB)
   123	
   124	TEXT ·StoreInt32(SB),NOSPLIT,$0-12
   125		BR	·StoreUint32(SB)
   126	
   127	TEXT ·StoreUint32(SB),NOSPLIT,$0-12
   128		MOVD	addr+0(FP), R3
   129		MOVW	val+8(FP), R4
   130		MOVW	R4, 0(R3)
   131		RET
   132	
   133	TEXT ·StoreInt64(SB),NOSPLIT,$0-16
   134		BR	·StoreUint64(SB)
   135	
   136	TEXT ·StoreUint64(SB),NOSPLIT,$0-16
   137		MOVD	addr+0(FP), R3
   138		MOVD	val+8(FP), R4
   139		MOVD	R4, 0(R3)
   140		RET
   141	
   142	TEXT ·StoreUintptr(SB),NOSPLIT,$0-16
   143		BR	·StoreUint64(SB)

View as plain text