NetBSD/lib/libc/arch/ns32k/string/strncmp.S

36 lines
546 B
ArmAsm

/* $NetBSD: strncmp.S,v 1.2 1997/05/08 13:38:59 matthias Exp $ */
/*
* Written by Matthias Pfaller, 1996
* Public domain.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: strncmp.S,v 1.2 1997/05/08 13:38:59 matthias Exp $")
#endif
/*
* int
* strncmp(const char *s1, const char *s2, size_t len)
*/
ENTRY(strncmp)
enter [r4],0
movd B_ARG2,r0
cmpqd 0,r0
beq 1f
movd B_ARG0,r1
movd B_ARG1,r2
movqd 0,r4
cmpsb u
bfc 0f
cmpb 0(r1),0(r2)
0: movqd 0,r0
beq 1f
movqd -1,r0
blo 1f
movqd 1,r0
1: exit [r4]
ret 0