2 * Written by J.T. Conklin <jtc@NetBSD.org>.
4 * Adapted for NetBSD/x86_64 by Frank van der Linden <fvdl@wasabisystems.com>
7 #include <machine/asm.h>
11 RCSID("$NetBSD: bzero.S,v 1.2 2003/07/26 19:24:38 salo Exp $")
15 cld /* set fill direction forward */
16 xorq %rax,%rax /* set fill data to 0 */
19 * if the string is too short, it's really not worth the overhead
20 * of aligning to word boundries, etc. So we jump to a plain
26 movq %rdi,%rcx /* compute misalignment */
30 rep /* zero until word aligned */
33 movq %rsi,%rcx /* zero by words */
39 L1: movq %rsi,%rcx /* zero remainder by bytes */