xref: /freebsd/lib/libc/arm/string/strcmp.S (revision 31489a9a2653e123121e8ca39b4be802013d2b50)
12357939bSOlivier Houchard/*      $NetBSD: strcmp.S,v 1.3 2003/04/05 23:08:52 bjh21 Exp $ */
22357939bSOlivier Houchard
32357939bSOlivier Houchard/*
42357939bSOlivier Houchard * Copyright (c) 2002 ARM Ltd
52357939bSOlivier Houchard * All rights reserved.
62357939bSOlivier Houchard *
72357939bSOlivier Houchard * Redistribution and use in source and binary forms, with or without
82357939bSOlivier Houchard * modification, are permitted provided that the following conditions
92357939bSOlivier Houchard * are met:
102357939bSOlivier Houchard * 1. Redistributions of source code must retain the above copyright
112357939bSOlivier Houchard *    notice, this list of conditions and the following disclaimer.
122357939bSOlivier Houchard * 2. Redistributions in binary form must reproduce the above copyright
132357939bSOlivier Houchard *    notice, this list of conditions and the following disclaimer in the
142357939bSOlivier Houchard *    documentation and/or other materials provided with the distribution.
152357939bSOlivier Houchard * 3. The name of the company may not be used to endorse or promote
162357939bSOlivier Houchard *    products derived from this software without specific prior written
172357939bSOlivier Houchard *    permission.
182357939bSOlivier Houchard *
192357939bSOlivier Houchard * THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
202357939bSOlivier Houchard * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
212357939bSOlivier Houchard * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
222357939bSOlivier Houchard * IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
232357939bSOlivier Houchard * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
242357939bSOlivier Houchard * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
252357939bSOlivier Houchard * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
262357939bSOlivier Houchard * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
272357939bSOlivier Houchard * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
282357939bSOlivier Houchard * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
292357939bSOlivier Houchard */
302357939bSOlivier Houchard
312357939bSOlivier Houchard#include <machine/asm.h>
322357939bSOlivier Houchard
332357939bSOlivier Houchard__FBSDID("$FreeBSD$");
342357939bSOlivier Houchard
352357939bSOlivier HouchardENTRY(strcmp)
362357939bSOlivier Houchard1:
372357939bSOlivier Houchard	ldrb	r2, [r0], #1
382357939bSOlivier Houchard	ldrb	r3, [r1], #1
392357939bSOlivier Houchard	cmp	r2, #1
402357939bSOlivier Houchard	cmpcs	r2, r3
412357939bSOlivier Houchard	beq	1b
422357939bSOlivier Houchard	sub	r0, r2, r3
4331489a9aSOlivier Houchard	RET
44