$19 GRAYBYTE WORDPRESS FILE MANAGER $66

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

/usr/lib/golang/src/internal/bytealg/

HOME
Current File : /usr/lib/golang/src/internal/bytealg//compare_386.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"

TEXT ·Compare(SB),NOSPLIT,$0-28
	MOVL	a_base+0(FP), SI
	MOVL	a_len+4(FP), BX
	MOVL	b_base+12(FP), DI
	MOVL	b_len+16(FP), DX
	LEAL	ret+24(FP), AX
	JMP	cmpbody<>(SB)

TEXT runtime·cmpstring(SB),NOSPLIT,$0-20
	MOVL	a_base+0(FP), SI
	MOVL	a_len+4(FP), BX
	MOVL	b_base+8(FP), DI
	MOVL	b_len+12(FP), DX
	LEAL	ret+16(FP), AX
	JMP	cmpbody<>(SB)

// input:
//   SI = a
//   DI = b
//   BX = alen
//   DX = blen
//   AX = address of return word (set to 1/0/-1)
TEXT cmpbody<>(SB),NOSPLIT,$0-0
	MOVL	DX, BP
	SUBL	BX, DX // DX = blen-alen
	JLE	2(PC)
	MOVL	BX, BP // BP = min(alen, blen)
	CMPL	SI, DI
	JEQ	allsame
	CMPL	BP, $4
	JB	small
#ifdef GO386_softfloat
	JMP	mediumloop
#endif
largeloop:
	CMPL	BP, $16
	JB	mediumloop
	MOVOU	(SI), X0
	MOVOU	(DI), X1
	PCMPEQB X0, X1
	PMOVMSKB X1, BX
	XORL	$0xffff, BX	// convert EQ to NE
	JNE	diff16	// branch if at least one byte is not equal
	ADDL	$16, SI
	ADDL	$16, DI
	SUBL	$16, BP
	JMP	largeloop

diff16:
	BSFL	BX, BX	// index of first byte that differs
	XORL	DX, DX
	MOVB	(SI)(BX*1), CX
	CMPB	CX, (DI)(BX*1)
	SETHI	DX
	LEAL	-1(DX*2), DX	// convert 1/0 to +1/-1
	MOVL	DX, (AX)
	RET

mediumloop:
	CMPL	BP, $4
	JBE	_0through4
	MOVL	(SI), BX
	MOVL	(DI), CX
	CMPL	BX, CX
	JNE	diff4
	ADDL	$4, SI
	ADDL	$4, DI
	SUBL	$4, BP
	JMP	mediumloop

_0through4:
	MOVL	-4(SI)(BP*1), BX
	MOVL	-4(DI)(BP*1), CX
	CMPL	BX, CX
	JEQ	allsame

diff4:
	BSWAPL	BX	// reverse order of bytes
	BSWAPL	CX
	XORL	BX, CX	// find bit differences
	BSRL	CX, CX	// index of highest bit difference
	SHRL	CX, BX	// move a's bit to bottom
	ANDL	$1, BX	// mask bit
	LEAL	-1(BX*2), BX // 1/0 => +1/-1
	MOVL	BX, (AX)
	RET

	// 0-3 bytes in common
small:
	LEAL	(BP*8), CX
	NEGL	CX
	JEQ	allsame

	// load si
	CMPB	SI, $0xfc
	JA	si_high
	MOVL	(SI), SI
	JMP	si_finish
si_high:
	MOVL	-4(SI)(BP*1), SI
	SHRL	CX, SI
si_finish:
	SHLL	CX, SI

	// same for di
	CMPB	DI, $0xfc
	JA	di_high
	MOVL	(DI), DI
	JMP	di_finish
di_high:
	MOVL	-4(DI)(BP*1), DI
	SHRL	CX, DI
di_finish:
	SHLL	CX, DI

	BSWAPL	SI	// reverse order of bytes
	BSWAPL	DI
	XORL	SI, DI	// find bit differences
	JEQ	allsame
	BSRL	DI, CX	// index of highest bit difference
	SHRL	CX, SI	// move a's bit to bottom
	ANDL	$1, SI	// mask bit
	LEAL	-1(SI*2), BX // 1/0 => +1/-1
	MOVL	BX, (AX)
	RET

	// all the bytes in common are the same, so we just need
	// to compare the lengths.
allsame:
	XORL	BX, BX
	XORL	CX, CX
	TESTL	DX, DX
	SETLT	BX	// 1 if alen > blen
	SETEQ	CX	// 1 if alen == blen
	LEAL	-1(CX)(BX*2), BX	// 1,0,-1 result
	MOVL	BX, (AX)
	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