shithub: riscv

ref: 0a7d581eec1319c643337d302176b3f9ba565ea5
dir: /sys/src/libc/sparc/memccpy.s/

View raw version
	TEXT	memccpy(SB), $0

MOVW	R7, 0(FP)
	MOVW	n+12(FP), R7
	SUBCC	R0,R7, R0
	BE	ret
	MOVW	s1+0(FP), R9
	MOVW	s2+4(FP), R8
	MOVBU	c+11(FP), R10
	ADD	R7,R8, R11

l1:	MOVBU	(R8), R12
	ADD	$1, R8
	MOVBU	R12, (R9)
	ADD	$1, R9
	SUBCC	R10,R12, R0
	BE	eq
	SUBCC	R8,R11, R0
	BNE	l1
	MOVW	R0, R7
	RETURN

eq:
	MOVW	R9, R7

ret:
	RETURN