$20 GRAYBYTE WORDPRESS FILE MANAGER $40

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/lib/golang/src/internal/bytealg/

HOME
Current File : /lib/golang/src/internal/bytealg//equal_arm64.s
// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

#include "go_asm.h"
#include "textflag.h"

// memequal_varlen(a, b unsafe.Pointer) bool
TEXT runtime·memequal_varlen<ABIInternal>(SB),NOSPLIT,$0-17
	MOVD	8(R26), R2    // compiler stores size at offset 8 in the closure
	CBZ	R2, eq
	B	runtime·memequal<ABIInternal>(SB)
eq:
	MOVD	$1, R0
	RET

// input:
// R0: pointer a
// R1: pointer b
// R2: data len
// at return: result in R0
// memequal(a, b unsafe.Pointer, size uintptr) bool
TEXT runtime·memequal<ABIInternal>(SB),NOSPLIT|NOFRAME,$0-25
	// short path to handle 0-byte case
	CBZ     R2, equal
	// short path to handle equal pointers
	CMP     R0, R1
	BEQ     equal
	CMP	$1, R2
	// handle 1-byte special case for better performance
	BEQ	one
	CMP	$16, R2
	// handle specially if length < 16
	BLO	tail
	BIC	$0x3f, R2, R3
	CBZ	R3, chunk16
	// work with 64-byte chunks
	ADD	R3, R0, R6	// end of chunks
chunk64_loop:
	VLD1.P	(R0), [V0.D2, V1.D2, V2.D2, V3.D2]
	VLD1.P	(R1), [V4.D2, V5.D2, V6.D2, V7.D2]
	VCMEQ	V0.D2, V4.D2, V8.D2
	VCMEQ	V1.D2, V5.D2, V9.D2
	VCMEQ	V2.D2, V6.D2, V10.D2
	VCMEQ	V3.D2, V7.D2, V11.D2
	VAND	V8.B16, V9.B16, V8.B16
	VAND	V8.B16, V10.B16, V8.B16
	VAND	V8.B16, V11.B16, V8.B16
	CMP	R0, R6
	VMOV	V8.D[0], R4
	VMOV	V8.D[1], R5
	CBZ	R4, not_equal
	CBZ	R5, not_equal
	BNE	chunk64_loop
	AND	$0x3f, R2, R2
	CBZ	R2, equal
chunk16:
	// work with 16-byte chunks
	BIC	$0xf, R2, R3
	CBZ	R3, tail
	ADD	R3, R0, R6	// end of chunks
chunk16_loop:
	LDP.P	16(R0), (R4, R5)
	LDP.P	16(R1), (R7, R9)
	EOR	R4, R7
	CBNZ	R7, not_equal
	EOR	R5, R9
	CBNZ	R9, not_equal
	CMP	R0, R6
	BNE	chunk16_loop
	AND	$0xf, R2, R2
	CBZ	R2, equal
tail:
	// special compare of tail with length < 16
	TBZ	$3, R2, lt_8
	MOVD	(R0), R4
	MOVD	(R1), R5
	EOR	R4, R5
	CBNZ	R5, not_equal
	SUB	$8, R2, R6	// offset of the last 8 bytes
	MOVD	(R0)(R6), R4
	MOVD	(R1)(R6), R5
	EOR	R4, R5
	CBNZ	R5, not_equal
	B	equal
	PCALIGN	$16
lt_8:
	TBZ	$2, R2, lt_4
	MOVWU	(R0), R4
	MOVWU	(R1), R5
	EOR	R4, R5
	CBNZ	R5, not_equal
	SUB	$4, R2, R6	// offset of the last 4 bytes
	MOVWU	(R0)(R6), R4
	MOVWU	(R1)(R6), R5
	EOR	R4, R5
	CBNZ	R5, not_equal
	B	equal
	PCALIGN	$16
lt_4:
	TBZ	$1, R2, lt_2
	MOVHU.P	2(R0), R4
	MOVHU.P	2(R1), R5
	CMP	R4, R5
	BNE	not_equal
lt_2:
	TBZ	$0, R2, equal
one:
	MOVBU	(R0), R4
	MOVBU	(R1), R5
	CMP	R4, R5
	BNE	not_equal
equal:
	MOVD	$1, R0
	RET
not_equal:
	MOVB	ZR, R0
	RET

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
16 Dec 2025 9.30 PM
root / root
0755
bytealg.go
3.186 KB
4 Dec 2025 6.06 PM
root / root
0644
compare_386.s
2.628 KB
4 Dec 2025 6.06 PM
root / root
0644
compare_amd64.s
4.295 KB
4 Dec 2025 6.06 PM
root / root
0644
compare_arm.s
1.753 KB
4 Dec 2025 6.06 PM
root / root
0644
compare_arm64.s
2.129 KB
4 Dec 2025 6.06 PM
root / root
0644
compare_generic.go
1.49 KB
4 Dec 2025 6.06 PM
root / root
0644
compare_loong64.s
5.86 KB
4 Dec 2025 6.06 PM
root / root
0644
compare_mips64x.s
1.662 KB
4 Dec 2025 6.06 PM
root / root
0644
compare_mipsx.s
1.393 KB
4 Dec 2025 6.06 PM
root / root
0644
compare_native.go
0.709 KB
4 Dec 2025 6.06 PM
root / root
0644
compare_ppc64x.s
6.686 KB
4 Dec 2025 6.06 PM
root / root
0644
compare_riscv64.s
3.778 KB
4 Dec 2025 6.06 PM
root / root
0644
compare_s390x.s
1.186 KB
4 Dec 2025 6.06 PM
root / root
0644
compare_wasm.s
1.436 KB
4 Dec 2025 6.06 PM
root / root
0644
count_amd64.s
4.673 KB
4 Dec 2025 6.06 PM
root / root
0644
count_arm.s
0.896 KB
4 Dec 2025 6.06 PM
root / root
0644
count_arm64.s
2.088 KB
4 Dec 2025 6.06 PM
root / root
0644
count_generic.go
0.512 KB
4 Dec 2025 6.06 PM
root / root
0644
count_loong64.s
4.01 KB
4 Dec 2025 6.06 PM
root / root
0644
count_mips64x.s
0.86 KB
4 Dec 2025 6.06 PM
root / root
0644
count_native.go
0.66 KB
4 Dec 2025 6.06 PM
root / root
0644
count_ppc64x.s
3.636 KB
4 Dec 2025 6.06 PM
root / root
0644
count_riscv64.s
0.685 KB
4 Dec 2025 6.06 PM
root / root
0644
count_s390x.s
5.385 KB
4 Dec 2025 6.06 PM
root / root
0644
equal_386.s
2.129 KB
4 Dec 2025 6.06 PM
root / root
0644
equal_amd64.s
2.775 KB
4 Dec 2025 6.06 PM
root / root
0644
equal_arm.s
1.814 KB
4 Dec 2025 6.06 PM
root / root
0644
equal_arm64.s
2.413 KB
4 Dec 2025 6.06 PM
root / root
0644
equal_generic.go
0.613 KB
4 Dec 2025 6.06 PM
root / root
0644
equal_loong64.s
4.726 KB
4 Dec 2025 6.06 PM
root / root
0644
equal_mips64x.s
1.995 KB
4 Dec 2025 6.06 PM
root / root
0644
equal_mipsx.s
1.069 KB
4 Dec 2025 6.06 PM
root / root
0644
equal_native.go
0.771 KB
4 Dec 2025 6.06 PM
root / root
0644
equal_ppc64x.s
4.873 KB
4 Dec 2025 6.06 PM
root / root
0644
equal_riscv64.s
2.274 KB
4 Dec 2025 6.06 PM
root / root
0644
equal_s390x.s
1.767 KB
4 Dec 2025 6.06 PM
root / root
0644
equal_wasm.s
1.099 KB
4 Dec 2025 6.06 PM
root / root
0644
index_amd64.go
0.603 KB
4 Dec 2025 6.06 PM
root / root
0644
index_amd64.s
5.053 KB
4 Dec 2025 6.06 PM
root / root
0644
index_arm64.go
0.689 KB
4 Dec 2025 6.06 PM
root / root
0644
index_arm64.s
3.96 KB
4 Dec 2025 6.06 PM
root / root
0644
index_generic.go
0.88 KB
4 Dec 2025 6.06 PM
root / root
0644
index_native.go
0.576 KB
4 Dec 2025 6.06 PM
root / root
0644
index_ppc64x.go
0.622 KB
4 Dec 2025 6.06 PM
root / root
0644
index_ppc64x.s
31.564 KB
4 Dec 2025 6.06 PM
root / root
0644
index_s390x.go
0.987 KB
4 Dec 2025 6.06 PM
root / root
0644
index_s390x.s
5.496 KB
4 Dec 2025 6.06 PM
root / root
0644
indexbyte_386.s
0.632 KB
4 Dec 2025 6.06 PM
root / root
0644
indexbyte_amd64.s
3.138 KB
4 Dec 2025 6.06 PM
root / root
0644
indexbyte_arm.s
0.929 KB
4 Dec 2025 6.06 PM
root / root
0644
indexbyte_arm64.s
3.313 KB
4 Dec 2025 6.06 PM
root / root
0644
indexbyte_generic.go
0.758 KB
4 Dec 2025 6.06 PM
root / root
0644
indexbyte_loong64.s
4.135 KB
4 Dec 2025 6.06 PM
root / root
0644
indexbyte_mips64x.s
0.962 KB
4 Dec 2025 6.06 PM
root / root
0644
indexbyte_mipsx.s
0.988 KB
4 Dec 2025 6.06 PM
root / root
0644
indexbyte_native.go
0.428 KB
4 Dec 2025 6.06 PM
root / root
0644
indexbyte_ppc64x.s
6.267 KB
4 Dec 2025 6.06 PM
root / root
0644
indexbyte_riscv64.s
2.786 KB
4 Dec 2025 6.06 PM
root / root
0644
indexbyte_s390x.s
2.489 KB
4 Dec 2025 6.06 PM
root / root
0644
indexbyte_wasm.s
2.539 KB
4 Dec 2025 6.06 PM
root / root
0644
lastindexbyte_generic.go
0.43 KB
4 Dec 2025 6.06 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF