shithub: riscv

ref: 403fef45c1a65aa74c449764e2857597fc03290a
dir: /sys/src/ape/lib/ap/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