memset.S revision 1.1
11.1Suwe/* $NetBSD: memset.S,v 1.1 2010/03/12 09:12:34 uwe Exp $ */ 21.1Suwe/*- 31.1Suwe * Copyright (c) 1990, 1993 41.1Suwe * The Regents of the University of California. All rights reserved. 51.1Suwe * 61.1Suwe * Redistribution and use in source and binary forms, with or without 71.1Suwe * modification, are permitted provided that the following conditions 81.1Suwe * are met: 91.1Suwe * 1. Redistributions of source code must retain the above copyright 101.1Suwe * notice, this list of conditions and the following disclaimer. 111.1Suwe * 2. Redistributions in binary form must reproduce the above copyright 121.1Suwe * notice, this list of conditions and the following disclaimer in the 131.1Suwe * documentation and/or other materials provided with the distribution. 141.1Suwe * 3. Neither the name of the University nor the names of its contributors 151.1Suwe * may be used to endorse or promote products derived from this software 161.1Suwe * without specific prior written permission. 171.1Suwe * 181.1Suwe * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 191.1Suwe * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 201.1Suwe * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 211.1Suwe * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 221.1Suwe * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 231.1Suwe * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 241.1Suwe * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 251.1Suwe * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 261.1Suwe * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 271.1Suwe * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 281.1Suwe * SUCH DAMAGE. 291.1Suwe */ 301.1Suwe 311.1Suwe#if defined(LIBC_SCCS) && !defined(lint) 321.1Suwe .asciz "@(#)memset.s 8.1 (Berkeley) 6/4/93" 331.1Suwe#endif /* LIBC_SCCS and not lint */ 341.1Suwe 351.1Suwe/* void *memset(base, c, length) */ 361.1Suwe 371.1Suwe#include <machine/asm.h> 381.1Suwe 391.1SuweENTRY(memset, 0) 401.1Suwe movl 4(%ap),%r3 411.1Suwe1: 421.1Suwe movzwl $65535,%r0 431.1Suwe movq 8(%ap),%r1 441.1Suwe cmpl %r2,%r0 451.1Suwe jgtru 2f 461.1Suwe movc5 $0,(%r3),%r1,%r2,(%r3) 471.1Suwe movl %r1,%r0 481.1Suwe ret 491.1Suwe2: 501.1Suwe subl2 %r0,12(%ap) 511.1Suwe movc5 $0,(%r3),%r1,%r0,(%r3) 521.1Suwe jbr 1b 53