1*2fe8fb19SBen Gras/* $NetBSD: bcmp.S,v 1.2 2003/10/06 05:30:21 matt Exp $ */ 2*2fe8fb19SBen Gras 3*2fe8fb19SBen Gras/* $OpenBSD: bcmp.S,v 1.3 2001/06/04 23:14:02 mickey Exp $ */ 4*2fe8fb19SBen Gras 5*2fe8fb19SBen Gras/* 6*2fe8fb19SBen Gras * Copyright 1996 1995 by Open Software Foundation, Inc. 7*2fe8fb19SBen Gras * All Rights Reserved 8*2fe8fb19SBen Gras * 9*2fe8fb19SBen Gras * Permission to use, copy, modify, and distribute this software and 10*2fe8fb19SBen Gras * its documentation for any purpose and without fee is hereby granted, 11*2fe8fb19SBen Gras * provided that the above copyright notice appears in all copies and 12*2fe8fb19SBen Gras * that both the copyright notice and this permission notice appear in 13*2fe8fb19SBen Gras * supporting documentation. 14*2fe8fb19SBen Gras * 15*2fe8fb19SBen Gras * OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE 16*2fe8fb19SBen Gras * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 17*2fe8fb19SBen Gras * FOR A PARTICULAR PURPOSE. 18*2fe8fb19SBen Gras * 19*2fe8fb19SBen Gras * IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR 20*2fe8fb19SBen Gras * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 21*2fe8fb19SBen Gras * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT, 22*2fe8fb19SBen Gras * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 23*2fe8fb19SBen Gras * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 24*2fe8fb19SBen Gras */ 25*2fe8fb19SBen Gras/* 26*2fe8fb19SBen Gras * (c) Copyright 1988 HEWLETT-PACKARD COMPANY 27*2fe8fb19SBen Gras * 28*2fe8fb19SBen Gras * To anyone who acknowledges that this file is provided "AS IS" 29*2fe8fb19SBen Gras * without any express or implied warranty: 30*2fe8fb19SBen Gras * permission to use, copy, modify, and distribute this file 31*2fe8fb19SBen Gras * for any purpose is hereby granted without fee, provided that 32*2fe8fb19SBen Gras * the above copyright notice and this notice appears in all 33*2fe8fb19SBen Gras * copies, and that the name of Hewlett-Packard Company not be 34*2fe8fb19SBen Gras * used in advertising or publicity pertaining to distribution 35*2fe8fb19SBen Gras * of the software without specific, written prior permission. 36*2fe8fb19SBen Gras * Hewlett-Packard Company makes no representations about the 37*2fe8fb19SBen Gras * suitability of this software for any purpose. 38*2fe8fb19SBen Gras */ 39*2fe8fb19SBen Gras/* 40*2fe8fb19SBen Gras * Copyright (c) 1990,1991,1994 The University of Utah and 41*2fe8fb19SBen Gras * the Computer Systems Laboratory (CSL). All rights reserved. 42*2fe8fb19SBen Gras * 43*2fe8fb19SBen Gras * THE UNIVERSITY OF UTAH AND CSL PROVIDE THIS SOFTWARE IN ITS "AS IS" 44*2fe8fb19SBen Gras * CONDITION, AND DISCLAIM ANY LIABILITY OF ANY KIND FOR ANY DAMAGES 45*2fe8fb19SBen Gras * WHATSOEVER RESULTING FROM ITS USE. 46*2fe8fb19SBen Gras * 47*2fe8fb19SBen Gras * CSL requests users of this software to return to csl-dist@cs.utah.edu any 48*2fe8fb19SBen Gras * improvements that they make and grant CSL redistribution rights. 49*2fe8fb19SBen Gras * 50*2fe8fb19SBen Gras * Utah Hdr: movc.s 1.26 94/12/14 51*2fe8fb19SBen Gras */ 52*2fe8fb19SBen Gras 53*2fe8fb19SBen Gras#include <machine/asm.h> 54*2fe8fb19SBen Gras 55*2fe8fb19SBen Gras#ifdef SYSLIBC_SCCS 56*2fe8fb19SBen Gras .text 57*2fe8fb19SBen Gras .asciz "$OpenBSD: bcmp.S,v 1.3 2001/06/04 23:14:02 mickey Exp $" 58*2fe8fb19SBen Gras .align 4 59*2fe8fb19SBen Gras#endif 60*2fe8fb19SBen Gras 61*2fe8fb19SBen Gras/* 62*2fe8fb19SBen Gras * int 63*2fe8fb19SBen Gras * bcmp(src, dst, count) 64*2fe8fb19SBen Gras * vaddr_t src; 65*2fe8fb19SBen Gras * vaddr_t dst; 66*2fe8fb19SBen Gras * size_t count; 67*2fe8fb19SBen Gras */ 68*2fe8fb19SBen GrasLEAF_ENTRY(bcmp) 69*2fe8fb19SBen Gras comb,>= %r0,%arg2,$bcmp_exit 70*2fe8fb19SBen Gras copy %t1,%t2 71*2fe8fb19SBen Gras 72*2fe8fb19SBen Gras$bcmp_loop: 73*2fe8fb19SBen Gras ldbs,ma 1(%arg0),%t1 74*2fe8fb19SBen Gras ldbs,ma 1(%arg1),%t2 75*2fe8fb19SBen Gras comb,<>,n %t1,%t2,$bcmp_exit 76*2fe8fb19SBen Gras addib,<> -1,%arg2,$bcmp_loop 77*2fe8fb19SBen Gras nop 78*2fe8fb19SBen Gras 79*2fe8fb19SBen Gras$bcmp_exit: 80*2fe8fb19SBen Gras bv 0(%r2) 81*2fe8fb19SBen Gras sub %t1,%t2,%ret0 82*2fe8fb19SBen Gras 83*2fe8fb19SBen GrasEXIT(bcmp) 84*2fe8fb19SBen Gras 85