add memcmp.S memmove.S

This commit is contained in:
perry 1998-08-04 03:35:59 +00:00
parent c6300798a1
commit a611b37e29
3 changed files with 45 additions and 2 deletions

View File

@ -1,10 +1,10 @@
# $NetBSD: Makefile.inc,v 1.16 1998/02/22 09:08:34 mycroft Exp $
# $NetBSD: Makefile.inc,v 1.17 1998/08/04 03:35:59 perry Exp $
SRCS+= __main.c __assert.c \
imax.c imin.c lmax.c lmin.c max.c min.c ulmax.c ulmin.c \
bswap16.c bswap32.c bswap64.c \
bcmp.S bcopy.S bzero.S ffs.S \
memchr.S memcpy.S memset.S \
memchr.S memcmp.S memcpy.S memmove.S memset.S \
strcat.S strchr.S strcmp.S strcpy.S strlen.S strrchr.S strncasecmp.c strncmp.S strncpy.S \
scanc.c skpc.c \
htonl.S htons.S ntohl.S ntohs.S \

View File

@ -0,0 +1,39 @@
/* $NetBSD: memcmp.S,v 1.1 1998/08/04 03:35:59 perry Exp $ */
/*
* Written by Matthias Pfaller, 1996
* Public domain.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: memcmp.S,v 1.1 1998/08/04 03:35:59 perry Exp $")
#endif
/*
* int
* memcmp (const void *b1, const void *b2, size_t len)
*/
KENTRY(memcmp, 12)
enter [],0
movd B_ARG2,r0
movd B_ARG0,r1
movd B_ARG1,r2
lshd -2,r0
cmpsd
movqd 4,r0
bne 1f
movqd 3,r0
andd B_ARG2,r0
1: cmpsb
bne 3f
2: exit []
ret ARGS
3: movzbd 0(r1),r0
movzbd 0(r2),r1
subd r1,r0
exit []
ret ARGS

View File

@ -0,0 +1,4 @@
/* $NetBSD: memmove.S,v 1.1 1998/08/04 03:35:59 perry Exp $ */
#define MEMMOVE
#include "memcpy.S"