xref: /openbsd-src/lib/libc/arch/arm/string/strcmp.S (revision 3884871817cb6c13555e7e8b09d51aa7e2b64045)
1*38848718Sguenther/*	$OpenBSD: strcmp.S,v 1.5 2016/08/06 19:16:09 guenther Exp $	*/
2d987040fSdrahn/*      $NetBSD: strcmp.S,v 1.3 2003/04/05 23:08:52 bjh21 Exp $ */
3d987040fSdrahn
4d987040fSdrahn/*
5d987040fSdrahn * Copyright (c) 2002 ARM Ltd
6d987040fSdrahn * All rights reserved.
7d987040fSdrahn *
8d987040fSdrahn * Redistribution and use in source and binary forms, with or without
9d987040fSdrahn * modification, are permitted provided that the following conditions
10d987040fSdrahn * are met:
11d987040fSdrahn * 1. Redistributions of source code must retain the above copyright
12d987040fSdrahn *    notice, this list of conditions and the following disclaimer.
13d987040fSdrahn * 2. Redistributions in binary form must reproduce the above copyright
14d987040fSdrahn *    notice, this list of conditions and the following disclaimer in the
15d987040fSdrahn *    documentation and/or other materials provided with the distribution.
16d987040fSdrahn * 3. The name of the company may not be used to endorse or promote
17d987040fSdrahn *    products derived from this software without specific prior written
18d987040fSdrahn *    permission.
19d987040fSdrahn *
20d987040fSdrahn * THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
21d987040fSdrahn * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22d987040fSdrahn * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23d987040fSdrahn * IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24d987040fSdrahn * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
25d987040fSdrahn * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26d987040fSdrahn * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27d987040fSdrahn * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28d987040fSdrahn * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29d987040fSdrahn * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30d987040fSdrahn */
31d987040fSdrahn
32*38848718Sguenther#include "DEFS.h"
33d987040fSdrahn
34d987040fSdrahnENTRY(strcmp)
35d987040fSdrahn1:
36d987040fSdrahn	ldrb	r2, [r0], #1
37d987040fSdrahn	ldrb	r3, [r1], #1
38d987040fSdrahn	cmp	r2, #1
39d987040fSdrahn	cmpcs	r2, r3
40d987040fSdrahn	beq	1b
41d987040fSdrahn	sub	r0, r2, r3
42d987040fSdrahn	mov	pc, lr
439b9d2a55SguentherEND_STRONG(strcmp)
44