parent
7f4cb8b53c
commit
c2f76ff004
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: bswap16.S,v 1.2 2008/04/28 20:22:52 martin Exp $ */
|
||||
/* $NetBSD: bswap16.S,v 1.3 2011/01/25 04:45:28 matt Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999 The NetBSD Foundation, Inc.
|
||||
|
@ -31,14 +31,17 @@
|
|||
|
||||
#include <machine/asm.h>
|
||||
|
||||
RCSID("$NetBSD: bswap16.S,v 1.3 2011/01/25 04:45:28 matt Exp $")
|
||||
|
||||
#if defined(_KERNEL) || defined(_STANDALONE)
|
||||
ENTRY(_C_LABEL(bswap16), 0)
|
||||
ALTENTRY(_C_LABEL(bswap16))
|
||||
#else
|
||||
ALTENTRY(_C_LABEL(ntohs))
|
||||
ALTENTRY(_C_LABEL(htons))
|
||||
ENTRY(_C_LABEL(__bswap16), 0)
|
||||
#endif
|
||||
ENTRY(_C_LABEL(__bswap16), 0)
|
||||
movl 4(%ap), %r1
|
||||
extzv $8, $8, %r1, %r0
|
||||
insv %r1, $8, $8, %r0
|
||||
ret
|
||||
END(_C_LABEL(__bswap16))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: bswap32.S,v 1.2 2008/04/28 20:22:52 martin Exp $ */
|
||||
/* $NetBSD: bswap32.S,v 1.3 2011/01/25 04:45:28 matt Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997 The NetBSD Foundation, Inc.
|
||||
|
@ -31,18 +31,18 @@
|
|||
|
||||
#include <machine/asm.h>
|
||||
|
||||
RCSID("$NetBSD: bswap32.S,v 1.3 2011/01/25 04:45:28 matt Exp $")
|
||||
|
||||
#if defined(_KERNEL) || defined(_STANDALONE)
|
||||
ENTRY(_C_LABEL(bswap32), 0)
|
||||
ALTENTRY(_C_LABEL(bswap32))
|
||||
#else
|
||||
#if BYTE_ORDER == LITTLE_ENDIAN
|
||||
ALTENTRY(_C_LABEL(ntohl))
|
||||
ALTENTRY(_C_LABEL(htonl))
|
||||
#endif
|
||||
ENTRY(_C_LABEL(__bswap32), 0)
|
||||
#endif
|
||||
rotl $-8, 4(%ap), %r0
|
||||
insv %r0, $16, $8, %r0
|
||||
rotl $8, 4(%ap), %r1
|
||||
movb %r1, %r0
|
||||
ret
|
||||
|
||||
END(_C_LABEL(__bswap32))
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
/* Written by Anders Magnusson. Public Domain */
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.asciz "$NetBSD: bswap64.S,v 1.2 2005/12/24 08:33:32 matt Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <machine/asm.h>
|
||||
|
||||
RCSID("$NetBSD: bswap64.S,v 1.3 2011/01/25 04:45:28 matt Exp $")
|
||||
|
||||
ENTRY(bswap64, 0)
|
||||
movq 4(%ap),%r3
|
||||
rotl $-8,%r3,%r1
|
||||
|
@ -17,3 +15,4 @@ ENTRY(bswap64, 0)
|
|||
rotl $8,%r4,%r2
|
||||
movb %r2,%r0
|
||||
ret
|
||||
END(bswap64)
|
||||
|
|
|
@ -30,10 +30,10 @@
|
|||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
#include <machine/asm.h>
|
||||
|
||||
/* .asciz "@(#)udiv.s 8.1 (Berkeley) 6/4/93" */
|
||||
.asciz "$NetBSD: udiv.S,v 1.2 2005/12/24 08:33:32 matt Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
RCSID("$NetBSD: udiv.S,v 1.3 2011/01/25 04:45:28 matt Exp $")
|
||||
|
||||
/*
|
||||
* Unsigned division, PCC flavor.
|
||||
|
@ -41,16 +41,10 @@
|
|||
* audiv() takes a pointer to a dividend and an ordinary divisor.
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
|
||||
#define DIVIDEND 4(%ap)
|
||||
#define DIVISOR 8(%ap)
|
||||
|
||||
#ifdef __ELF__
|
||||
ASENTRY(__udiv,0)
|
||||
#else
|
||||
ASENTRY(udiv,0)
|
||||
#endif
|
||||
movl DIVISOR,%r2
|
||||
jlss Leasy # big divisor: settle by comparison
|
||||
movl DIVIDEND,%r0
|
||||
|
@ -69,12 +63,9 @@ Leasy:
|
|||
Lone:
|
||||
movl $1,%r0
|
||||
ret
|
||||
END(__udiv)
|
||||
|
||||
#ifdef __ELF__
|
||||
ASENTRY(__audiv,0)
|
||||
#else
|
||||
ASENTRY(audiv,0)
|
||||
#endif
|
||||
movl DIVIDEND,%r3
|
||||
movl DIVISOR,%r2
|
||||
jlss La_easy # big divisor: settle by comparison
|
||||
|
@ -98,3 +89,4 @@ La_one:
|
|||
movl $1,%r0
|
||||
movl %r0,(%r3)
|
||||
ret
|
||||
END(__audiv)
|
||||
|
|
|
@ -30,13 +30,11 @@
|
|||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
/* .asciz "@(#)urem.s 8.1 (Berkeley) 6/4/93" */
|
||||
.asciz "$NetBSD: urem.S,v 1.2 2005/12/24 08:33:32 matt Exp $"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <machine/asm.h>
|
||||
|
||||
/* .asciz "@(#)urem.s 8.1 (Berkeley) 6/4/93" */
|
||||
RCSID("$NetBSD: urem.S,v 1.3 2011/01/25 04:45:28 matt Exp $")
|
||||
|
||||
/*
|
||||
* Unsigned modulus, PCC flavor.
|
||||
* urem() takes an ordinary dividend/divisor pair;
|
||||
|
@ -46,11 +44,7 @@
|
|||
#define DIVIDEND 4(%ap)
|
||||
#define DIVISOR 8(%ap)
|
||||
|
||||
#ifdef __ELF__
|
||||
ASENTRY(__urem,0)
|
||||
#else
|
||||
ASENTRY(urem,0)
|
||||
#endif
|
||||
movl DIVISOR,%r2
|
||||
jlss Leasy # big divisor: settle by comparison
|
||||
movl DIVIDEND,%r0
|
||||
|
@ -69,12 +63,9 @@ Leasy:
|
|||
movl DIVIDEND,%r0 # if divisor is bigger, return dividend
|
||||
Ldifference:
|
||||
ret
|
||||
END(__urem)
|
||||
|
||||
#ifdef __ELF__
|
||||
ASENTRY(__aurem,0)
|
||||
#else
|
||||
ASENTRY(aurem,0)
|
||||
#endif
|
||||
movl DIVIDEND,%r3
|
||||
movl DIVISOR,%r2
|
||||
jlss La_easy # big divisor: settle by comparison
|
||||
|
@ -98,3 +89,4 @@ La_easy:
|
|||
La_dividend:
|
||||
movl (%r3),%r0
|
||||
ret
|
||||
END(__aurem)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: memcpy.S,v 1.2 2005/12/24 08:33:32 matt Exp $ */
|
||||
/* $NetBSD: memcpy.S,v 1.3 2011/01/25 04:45:28 matt Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
|
@ -28,9 +28,10 @@
|
|||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.asciz "@(#)memcpy.s 8.1 (Berkeley) 6/4/93"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
#include <machine/asm.h>
|
||||
|
||||
/* .asciz "@(#)memcpy.s 8.1 (Berkeley) 6/4/93" */
|
||||
RCSID("$NetBSD: memcpy.S,v 1.3 2011/01/25 04:45:28 matt Exp $")
|
||||
|
||||
/*
|
||||
* void *memcpy(dst, src, size)
|
||||
|
@ -40,8 +41,6 @@
|
|||
* of some extra memory references and branches when count >= 65536.
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
|
||||
ENTRY(memcpy, 0)
|
||||
movzwl $65535,%r0 /* %r0 = 64K (needed below) */
|
||||
movq 8(%ap),%r1 /* %r1 = src, %r2 = length */
|
||||
|
@ -88,3 +87,4 @@ ENTRY(memcpy, 0)
|
|||
subl2 %r0,%r1
|
||||
subl2 %r0,%r3
|
||||
brb 5b
|
||||
END(memcpy)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: memmove.S,v 1.2 2005/12/24 08:33:32 matt Exp $ */
|
||||
/* $NetBSD: memmove.S,v 1.3 2011/01/25 04:45:28 matt Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
|
@ -28,9 +28,10 @@
|
|||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.asciz "@(#)memmove.s 8.1 (Berkeley) 6/4/93"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
#include <machine/asm.h>
|
||||
|
||||
/* .asciz "@(#)memmove.s 8.1 (Berkeley) 6/4/93" */
|
||||
RCSID("$NetBSD: memmove.S,v 1.3 2011/01/25 04:45:28 matt Exp $")
|
||||
|
||||
/*
|
||||
* void *memmove(dst, src, size)
|
||||
|
@ -40,8 +41,6 @@
|
|||
* of some extra memory references and branches when count >= 65536.
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
|
||||
ENTRY(memmove, 0)
|
||||
movzwl $65535,%r0 /* %r0 = 64K (needed below) */
|
||||
movq 8(%ap),%r1 /* %r1 = src, %r2 = length */
|
||||
|
@ -88,3 +87,4 @@ ENTRY(memmove, 0)
|
|||
subl2 %r0,%r1
|
||||
subl2 %r0,%r3
|
||||
brb 5b
|
||||
END(memmove)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: memset.S,v 1.1 2010/03/12 09:12:34 uwe Exp $ */
|
||||
/* $NetBSD: memset.S,v 1.2 2011/01/25 04:45:28 matt Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
|
@ -28,14 +28,13 @@
|
|||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
.asciz "@(#)memset.s 8.1 (Berkeley) 6/4/93"
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
#include <machine/asm.h>
|
||||
|
||||
/* .asciz "@(#)memset.s 8.1 (Berkeley) 6/4/93" */
|
||||
RCSID("$NetBSD: memset.S,v 1.2 2011/01/25 04:45:28 matt Exp $")
|
||||
|
||||
/* void *memset(base, c, length) */
|
||||
|
||||
#include <machine/asm.h>
|
||||
|
||||
ENTRY(memset, 0)
|
||||
movl 4(%ap),%r3
|
||||
1:
|
||||
|
@ -50,3 +49,4 @@ ENTRY(memset, 0)
|
|||
subl2 %r0,12(%ap)
|
||||
movc5 $0,(%r3),%r1,%r0,(%r3)
|
||||
jbr 1b
|
||||
END(memset)
|
||||
|
|
Loading…
Reference in New Issue