shithub: riscv

ref: d65589c29941b16a5239f6f2e9c8f6fea5c863a2
dir: /sys/src/libc/amd64/strlen.s/

View raw version
	TEXT	strlen(SB),$0

	MOVL	$0, AX
	MOVQ	$-1, CX
	CLD
/*
 * look for end of string
 */

	MOVQ	RARG, DI
	REPN;	SCASB

	MOVQ	DI, AX
	SUBQ	RARG, AX
	SUBQ	$1, AX
	RET