shithub: riscv

ref: f88a55e79b5bf656e7f9578d1318a955b9a4963a
dir: /sys/src/libc/riscv64/strcmp.s/

View raw version
TEXT	strcmp(SB), $0
	MOV	s2+XLEN(FP), R9

l1:
	MOVBU	(R9), R10
	MOVBU	(R8), R11
	ADD	$1, R8
	BEQ	R10, end
	ADD	$1, R9
	BEQ	R10, R11, l1

	SLTU	R11, R10, R8
	BNE	R8, ret
	MOV	$-1, R8
	RET

end:
	SLTU	R11, R10, R8
ret:
	RET