github.com/gagliardetto/golang-go@v0.0.0-20201020153340-53909ea70814/not-internal/bytealg/equal_mips64x.s (about)

     1  // Copyright 2018 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  // +build mips64 mips64le
     6  
     7  #include "go_asm.h"
     8  #include "textflag.h"
     9  
    10  #define	REGCTXT	R22
    11  
    12  // memequal(a, b unsafe.Pointer, size uintptr) bool
    13  TEXT runtime·memequal(SB),NOSPLIT|NOFRAME,$0-25
    14  	MOVV	a+0(FP), R1
    15  	MOVV	b+8(FP), R2
    16  	BEQ	R1, R2, eq
    17  	MOVV	size+16(FP), R3
    18  	ADDV	R1, R3, R4
    19  loop:
    20  	BNE	R1, R4, test
    21  	MOVV	$1, R1
    22  	MOVB	R1, ret+24(FP)
    23  	RET
    24  test:
    25  	MOVBU	(R1), R6
    26  	ADDV	$1, R1
    27  	MOVBU	(R2), R7
    28  	ADDV	$1, R2
    29  	BEQ	R6, R7, loop
    30  
    31  	MOVB	R0, ret+24(FP)
    32  	RET
    33  eq:
    34  	MOVV	$1, R1
    35  	MOVB	R1, ret+24(FP)
    36  	RET
    37  
    38  // memequal_varlen(a, b unsafe.Pointer) bool
    39  TEXT runtime·memequal_varlen(SB),NOSPLIT,$40-17
    40  	MOVV	a+0(FP), R1
    41  	MOVV	b+8(FP), R2
    42  	BEQ	R1, R2, eq
    43  	MOVV	8(REGCTXT), R3    // compiler stores size at offset 8 in the closure
    44  	MOVV	R1, 8(R29)
    45  	MOVV	R2, 16(R29)
    46  	MOVV	R3, 24(R29)
    47  	JAL	runtime·memequal(SB)
    48  	MOVBU	32(R29), R1
    49  	MOVB	R1, ret+16(FP)
    50  	RET
    51  eq:
    52  	MOVV	$1, R1
    53  	MOVB	R1, ret+16(FP)
    54  	RET