diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-02-27 17:36:19 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-02-27 17:36:19 +0000 |
commit | bf0a65b8ba35f3b89700a10c7eb23f2c8dc212cb (patch) | |
tree | c14e90f29f6ed57b9358529c8ef66d4b69c29a0f /sys/lib/libkern/arch | |
parent | cadcabe0265db6753eccec3bcc53bdc5b837cc3d (diff) |
change amd64's MACHINE_ARCH from x86_64 to amd64. There are many many
reasons for this, quite a few of them technical, and not all of them
in response to Intel's broken ia32e crud. The gcc toolchain stays at
x86_64 for now.
Diffstat (limited to 'sys/lib/libkern/arch')
23 files changed, 0 insertions, 858 deletions
diff --git a/sys/lib/libkern/arch/x86_64/Makefile.inc b/sys/lib/libkern/arch/x86_64/Makefile.inc deleted file mode 100644 index ed61f7015e9..00000000000 --- a/sys/lib/libkern/arch/x86_64/Makefile.inc +++ /dev/null @@ -1,14 +0,0 @@ -# $NetBSD: Makefile.inc,v 1.2 2002/11/25 00:55:22 fvdl Exp $ - -SRCS+= imax.c imin.c lmax.c lmin.c max.c min.c ulmax.c ulmin.c \ - byte_swap_2.S byte_swap_4.S \ - bcmp.S bcopy.S bzero.S ffs.S \ - memchr.S memcmp.S memcpy.S memmove.S memset.S \ - ovbcopy.S \ - strcat.S strchr.S strcmp.S \ - strcpy.S strlcpy.c strlcat.c strlen.S \ - strncasecmp.c strncmp.c strncpy.c strrchr.S \ - scanc.S skpc.S random.c -# bswap64.c strcasecmp.c strncasecmp.c \ strtoul.c \ - -CFLAGS+=-mcmodel=kernel diff --git a/sys/lib/libkern/arch/x86_64/bcmp.S b/sys/lib/libkern/arch/x86_64/bcmp.S deleted file mode 100644 index 5cee3afe74b..00000000000 --- a/sys/lib/libkern/arch/x86_64/bcmp.S +++ /dev/null @@ -1,24 +0,0 @@ -#include <machine/asm.h> - -#if defined(LIBC_SCCS) - RCSID("$NetBSD: bcmp.S,v 1.1 2001/06/19 00:22:45 fvdl Exp $") -#endif - -ENTRY(bcmp) - xorl %eax,%eax /* clear return value */ - cld /* set compare direction forward */ - - movq %rdx,%rcx /* compare by words */ - shrq $3,%rcx - repe - cmpsq - jne L1 - - movq %rdx,%rcx /* compare remainder by bytes */ - andq $7,%rcx - repe - cmpsb - je L2 - -L1: incl %eax -L2: ret diff --git a/sys/lib/libkern/arch/x86_64/bcopy.S b/sys/lib/libkern/arch/x86_64/bcopy.S deleted file mode 100644 index c741cd66ca1..00000000000 --- a/sys/lib/libkern/arch/x86_64/bcopy.S +++ /dev/null @@ -1,101 +0,0 @@ -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from locore.s. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <machine/asm.h> - -#if defined(LIBC_SCCS) - RCSID("$NetBSD: bcopy.S,v 1.1 2001/06/19 00:22:45 fvdl Exp $") -#endif - - /* - * (ov)bcopy (src,dst,cnt) - * ws@tools.de (Wolfgang Solfrank, TooLs GmbH) +49-228-985800 - */ - -#ifdef MEMCOPY -ENTRY(memcpy) -#else -#ifdef MEMMOVE -ENTRY(memmove) -#else -#ifdef OVBCOPY -ENTRY(ovbcopy) -#else -ENTRY(bcopy) -#endif -#endif -#endif -#if defined(MEMCOPY) || defined(MEMMOVE) - movq %rdi,%r11 /* save dest */ -#else - xchgq %rdi,%rsi -#endif - movq %rdx,%rcx - movq %rdi,%rax - subq %rsi,%rax - cmpq %rcx,%rax /* overlapping? */ - jb 1f - cld /* nope, copy forwards. */ - shrq $3,%rcx /* copy by words */ - rep - movsq - movq %rdx,%rcx - andq $7,%rcx /* any bytes left? */ - rep - movsb -#if defined(MEMCOPY) || defined(MEMMOVE) - movq %r11,%rax -#endif - ret -1: - addq %rcx,%rdi /* copy backwards. */ - addq %rcx,%rsi - std - andq $7,%rcx /* any fractional bytes? */ - decq %rdi - decq %rsi - rep - movsb - movq %rdx,%rcx /* copy remainder by words */ - shrq $3,%rcx - subq $7,%rsi - subq $7,%rdi - rep - movsq -#if defined(MEMCOPY) || defined(MEMMOVE) - movq %r11,%rax -#endif - cld - ret diff --git a/sys/lib/libkern/arch/x86_64/byte_swap_2.S b/sys/lib/libkern/arch/x86_64/byte_swap_2.S deleted file mode 100644 index 19ed5e27812..00000000000 --- a/sys/lib/libkern/arch/x86_64/byte_swap_2.S +++ /dev/null @@ -1,52 +0,0 @@ -/* $NetBSD: byte_swap_2.S,v 1.1 2001/06/19 00:22:45 fvdl Exp $ */ - -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: @(#)htons.s 5.2 (Berkeley) 12/17/90 - */ - -#include <machine/asm.h> -#if defined(LIBC_SCCS) - RCSID("$NetBSD: byte_swap_2.S,v 1.1 2001/06/19 00:22:45 fvdl Exp $") -#endif - -_ENTRY(_C_LABEL(bswap16)) -_ENTRY(_C_LABEL(ntohs)) -_ENTRY(_C_LABEL(htons)) -_PROF_PROLOGUE - movl %edi,%eax - xchgb %ah,%al - ret diff --git a/sys/lib/libkern/arch/x86_64/byte_swap_4.S b/sys/lib/libkern/arch/x86_64/byte_swap_4.S deleted file mode 100644 index f6a961e38f5..00000000000 --- a/sys/lib/libkern/arch/x86_64/byte_swap_4.S +++ /dev/null @@ -1,52 +0,0 @@ -/* $NetBSD: byte_swap_4.S,v 1.1 2001/06/19 00:22:45 fvdl Exp $ */ - -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: @(#)htonl.s 5.3 (Berkeley) 12/17/90 - */ - -#include <machine/asm.h> -#if defined(LIBC_SCCS) - RCSID("$NetBSD: byte_swap_4.S,v 1.1 2001/06/19 00:22:45 fvdl Exp $") -#endif - -_ENTRY(_C_LABEL(bswap32)) -_ENTRY(_C_LABEL(ntohl)) -_ENTRY(_C_LABEL(htonl)) -_PROF_PROLOGUE - movl %edi,%eax - bswap %eax - ret diff --git a/sys/lib/libkern/arch/x86_64/bzero.S b/sys/lib/libkern/arch/x86_64/bzero.S deleted file mode 100644 index 6e4fe834d1a..00000000000 --- a/sys/lib/libkern/arch/x86_64/bzero.S +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * Adapted for NetBSD/x86_64 by Frank van der Linden <fvdl@wasabisystems.com> - */ - -#include <machine/asm.h> - -#if defined(LIBC_SCCS) - RCSID("$NetBSD: bzero.S,v 1.1 2001/06/19 00:22:45 fvdl Exp $") -#endif - -ENTRY(bzero) - movq %rsi,%rdx - - cld /* set fill direction forward */ - xorq %rax,%rax /* set fill data to 0 */ - - /* - * if the string is too short, it's really not worth the overhead - * of aligning to word boundries, etc. So we jump to a plain - * unaligned set. - */ - cmpq $16,%rdx - jb L1 - - movq %rdi,%rcx /* compute misalignment */ - negq %rcx - andq $7,%rcx - subq %rcx,%rdx - rep /* zero until word aligned */ - stosb - - movq %rdx,%rcx /* zero by words */ - shrq $3,%rcx - andq $7,%rdx - rep - stosq - -L1: movq %rdx,%rcx /* zero remainder by bytes */ - rep - stosb - - ret diff --git a/sys/lib/libkern/arch/x86_64/ffs.S b/sys/lib/libkern/arch/x86_64/ffs.S deleted file mode 100644 index c74c7010f54..00000000000 --- a/sys/lib/libkern/arch/x86_64/ffs.S +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * Adapted for NetBSD/x86_64 by Frank van der Linden <fvdl@wasabisystems.com> - */ - -#include <machine/asm.h> - -#if defined(LIBC_SCCS) - RCSID("$NetBSD: ffs.S,v 1.1 2001/06/19 00:22:46 fvdl Exp $") -#endif - -ENTRY(ffs) - bsfl %edi,%eax - jz L1 /* ZF is set if all bits are 0 */ - incl %eax /* bits numbered from 1, not 0 */ - ret - - _ALIGN_TEXT -L1: xorl %eax,%eax /* clear result */ - ret diff --git a/sys/lib/libkern/arch/x86_64/index.S b/sys/lib/libkern/arch/x86_64/index.S deleted file mode 100644 index 60754f266f0..00000000000 --- a/sys/lib/libkern/arch/x86_64/index.S +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * Adapted for NetBSD/x86_64 by Frank van der Linden <fvdl@wasabisystems.com> - */ - -#include <machine/asm.h> - -#if defined(LIBC_SCCS) - RCSID("$NetBSD: index.S,v 1.1 2001/06/19 00:22:46 fvdl Exp $") -#endif - -#ifdef STRCHR -ENTRY(strchr) -#else -ENTRY(index) -#endif - movq %rdi,%rax - movb %sil,%cl -L1: - movb (%rax),%dl - cmpb %dl,%cl /* found char? */ - je L2 - incq %rax - testb %dl,%dl /* null terminator? */ - jnz L1 - xorq %rax,%rax -L2: - ret diff --git a/sys/lib/libkern/arch/x86_64/memchr.S b/sys/lib/libkern/arch/x86_64/memchr.S deleted file mode 100644 index f978e760220..00000000000 --- a/sys/lib/libkern/arch/x86_64/memchr.S +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * Adapted for NetBSD/x86_64 by Frank van der Linden <fvdl@wasabisystems.com> - */ - -#include <machine/asm.h> - -#if defined(LIBC_SCCS) - RCSID("$NetBSD: memchr.S,v 1.1 2001/06/19 00:22:46 fvdl Exp $") -#endif - -ENTRY(memchr) - movb %sil,%al /* set character to search for */ - movq %rdx,%rcx /* set length of search */ - testq %rcx,%rcx /* test for len == 0 */ - jz L1 - cld /* set search forward */ - repne /* search! */ - scasb - jne L1 /* scan failed, return null */ - leaq -1(%rdi),%rax /* adjust result of scan */ - ret -L1: xorq %rax,%rax - ret diff --git a/sys/lib/libkern/arch/x86_64/memcmp.S b/sys/lib/libkern/arch/x86_64/memcmp.S deleted file mode 100644 index 722a2a2c304..00000000000 --- a/sys/lib/libkern/arch/x86_64/memcmp.S +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * Adapted for NetBSD/x86_64 by Frank van der Linden <fvdl@wasabisystems.com> - */ - -#include <machine/asm.h> - -#if defined(LIBC_SCCS) - RCSID("$NetBSD: memcmp.S,v 1.1 2001/06/19 00:22:46 fvdl Exp $") -#endif - -ENTRY(memcmp) - cld /* set compare direction forward */ - movq %rdx,%rcx /* compare by longs */ - shrq $3,%rcx - repe - cmpsq - jne L5 /* do we match so far? */ - - movq %rdx,%rcx /* compare remainder by bytes */ - andq $7,%rcx - repe - cmpsb - jne L6 /* do we match? */ - - xorl %eax,%eax /* we match, return zero */ - ret - -L5: movl $8,%ecx /* We know that one of the next */ - subq %rcx,%rdi /* eight pairs of bytes do not */ - subq %rcx,%rsi /* match. */ - repe - cmpsb -L6: xorl %eax,%eax /* Perform unsigned comparison */ - movb -1(%rdi),%al - xorl %edx,%edx - movb -1(%rsi),%dl - subl %edx,%eax - ret diff --git a/sys/lib/libkern/arch/x86_64/memcpy.S b/sys/lib/libkern/arch/x86_64/memcpy.S deleted file mode 100644 index c39caa328a3..00000000000 --- a/sys/lib/libkern/arch/x86_64/memcpy.S +++ /dev/null @@ -1,4 +0,0 @@ -/* $NetBSD: memcpy.S,v 1.1 2001/06/19 00:22:46 fvdl Exp $ */ - -#define MEMCOPY -#include "bcopy.S" diff --git a/sys/lib/libkern/arch/x86_64/memmove.S b/sys/lib/libkern/arch/x86_64/memmove.S deleted file mode 100644 index f5b81357afa..00000000000 --- a/sys/lib/libkern/arch/x86_64/memmove.S +++ /dev/null @@ -1,4 +0,0 @@ -/* $NetBSD: memmove.S,v 1.1 2001/06/19 00:22:46 fvdl Exp $ */ - -#define MEMMOVE -#include "bcopy.S" diff --git a/sys/lib/libkern/arch/x86_64/memset.S b/sys/lib/libkern/arch/x86_64/memset.S deleted file mode 100644 index 2d92dc66534..00000000000 --- a/sys/lib/libkern/arch/x86_64/memset.S +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * Adapted for NetBSD/x86_64 by Frank van der Linden <fvdl@wasabisystems.com> - */ - -#include <machine/asm.h> - -#if defined(LIBC_SCCS) - RCSID("$NetBSD: memset.S,v 1.1 2001/06/19 00:22:46 fvdl Exp $") -#endif - -ENTRY(memset) - movq %rsi,%rax - movq %rdx,%rcx - movq %rdi,%r11 - - cld /* set fill direction forward */ - - /* - * if the string is too short, it's really not worth the overhead - * of aligning to word boundries, etc. So we jump to a plain - * unaligned set. - */ - cmpq $0x0f,%rcx - jle L1 - - movb %al,%ah /* copy char to all bytes in word */ - movl %eax,%edx - sall $16,%eax - orl %edx,%eax - - movl %eax,%edx - salq $32,%rax - orq %rdx,%rax - - movq %rdi,%rdx /* compute misalignment */ - negq %rdx - andq $7,%rdx - movq %rcx,%r8 - subq %rdx,%r8 - - movq %rdx,%rcx /* set until word aligned */ - rep - stosb - - movq %r8,%rcx - shrq $3,%rcx /* set by words */ - rep - stosq - - movq %r8,%rcx /* set remainder by bytes */ - andq $7,%rcx -L1: rep - stosb - movq %r11,%rax - - ret diff --git a/sys/lib/libkern/arch/x86_64/ovbcopy.S b/sys/lib/libkern/arch/x86_64/ovbcopy.S deleted file mode 100644 index 71f2c9c8ddc..00000000000 --- a/sys/lib/libkern/arch/x86_64/ovbcopy.S +++ /dev/null @@ -1,4 +0,0 @@ -/* $NetBSD: memmove.S,v 1.1 2001/06/19 00:22:46 fvdl Exp $ */ - -#define OVBCOPY -#include "bcopy.S" diff --git a/sys/lib/libkern/arch/x86_64/rindex.S b/sys/lib/libkern/arch/x86_64/rindex.S deleted file mode 100644 index 6ba7c52a11f..00000000000 --- a/sys/lib/libkern/arch/x86_64/rindex.S +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * Adapted for NetBSD/x86_64 by Frank van der Linden <fvdl@wasabisystems.com> - */ - -#include <machine/asm.h> - -#if defined(LIBC_SCCS) - RCSID("$NetBSD: rindex.S,v 1.1 2001/06/19 00:22:47 fvdl Exp $") -#endif - -#ifdef STRRCHR -ENTRY(strrchr) -#else -ENTRY(rindex) -#endif - movb %sil,%cl - xorq %rax,%rax /* init pointer to null */ -L1: - movb (%rdi),%dl - cmpb %dl,%cl - jne L2 - movq %rdi,%rax -L2: - incq %rdi - testb %dl,%dl /* null terminator??? */ - jnz L1 - ret diff --git a/sys/lib/libkern/arch/x86_64/scanc.S b/sys/lib/libkern/arch/x86_64/scanc.S deleted file mode 100644 index fd4fd31e129..00000000000 --- a/sys/lib/libkern/arch/x86_64/scanc.S +++ /dev/null @@ -1,62 +0,0 @@ -/* $NetBSD: scanc.S,v 1.1 2001/06/19 00:22:47 fvdl Exp $ */ - -/*- - * Copyright (c) 1998 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Charles M. Hannum. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Adapted for NetBSD/x86_64 by Frank van der Linden <fvdl@wasabisystems.com> - */ - -#include <machine/asm.h> - -ENTRY(scanc) - movq %rdx,%r11 - movb %cl,%dl - movl %edi,%ecx - testl %ecx,%ecx - jz 2f - movq %r11,%rdi - xorq %rax,%rax - cld -1: - lodsb - testb %dl,(%rax,%rdi) - jnz 2f - decl %ecx - jnz 1b -2: - movl %ecx,%eax - ret diff --git a/sys/lib/libkern/arch/x86_64/skpc.S b/sys/lib/libkern/arch/x86_64/skpc.S deleted file mode 100644 index f037d98b66a..00000000000 --- a/sys/lib/libkern/arch/x86_64/skpc.S +++ /dev/null @@ -1,56 +0,0 @@ -/* $NetBSD: skpc.S,v 1.1 2001/06/19 00:22:47 fvdl Exp $ */ - -/*- - * Copyright (c) 1998 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Charles M. Hannum. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Adapted for NetBSD/x86_64 by Frank van der Linden <fvdl@wasabisystems.com> - */ - -#include <machine/asm.h> - -ENTRY(skpc) - movl %edi,%eax - movq %rsi,%rcx - movq %rdx,%rdi - cld - repe - scasb - je 1f - incq %rcx -1: - movl %ecx,%eax - ret diff --git a/sys/lib/libkern/arch/x86_64/strcat.S b/sys/lib/libkern/arch/x86_64/strcat.S deleted file mode 100644 index 7dc71244312..00000000000 --- a/sys/lib/libkern/arch/x86_64/strcat.S +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * Adapted for NetBSD/x86_64 by Frank van der Linden <fvdl@wasabisystems.com> - */ - -#include <machine/asm.h> - -#if defined(LIBC_SCCS) - RCSID("$NetBSD: strcat.S,v 1.1 2001/06/19 00:22:47 fvdl Exp $") -#endif - -/* - * NOTE: I've unrolled the loop eight times: large enough to make a - * significant difference, and small enough not to totally trash the - * cache. - */ - -ENTRY(strcat) - movq %rdi,%r11 - - cld /* set search forward */ - xorl %eax,%eax /* set search for null terminator */ - movq $-1,%rcx /* set search for lots of characters */ - repne /* search! */ - scasb - - decq %rdi - -L1: movb (%rsi),%al /* unroll loop, but not too much */ - movb %al,(%rdi) - testb %al,%al - jz L2 - movb 1(%rsi),%al - movb %al,1(%rdi) - testb %al,%al - jz L2 - movb 2(%rsi),%al - movb %al,2(%rdi) - testb %al,%al - jz L2 - movb 3(%rsi),%al - movb %al,3(%rdi) - testb %al,%al - jz L2 - movb 4(%rsi),%al - movb %al,4(%rdi) - testb %al,%al - jz L2 - movb 5(%rsi),%al - movb %al,5(%rdi) - testb %al,%al - jz L2 - movb 6(%rsi),%al - movb %al,6(%rdi) - testb %al,%al - jz L2 - movb 7(%rsi),%al - movb %al,7(%rdi) - addq $8,%rsi - addq $8,%rdi - testb %al,%al - jnz L1 -L2: movq %r11,%rax - ret diff --git a/sys/lib/libkern/arch/x86_64/strchr.S b/sys/lib/libkern/arch/x86_64/strchr.S deleted file mode 100644 index 91fd708891f..00000000000 --- a/sys/lib/libkern/arch/x86_64/strchr.S +++ /dev/null @@ -1,4 +0,0 @@ -/* $NetBSD: strchr.S,v 1.1 2001/06/19 00:22:47 fvdl Exp $ */ - -#define STRCHR -#include "index.S" diff --git a/sys/lib/libkern/arch/x86_64/strcmp.S b/sys/lib/libkern/arch/x86_64/strcmp.S deleted file mode 100644 index 559563666d4..00000000000 --- a/sys/lib/libkern/arch/x86_64/strcmp.S +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * Adapted for NetBSD/x86_64 by Frank van der Linden <fvdl@wasabisystems.com> - */ - -#include <machine/asm.h> - -#if defined(LIBC_SCCS) - RCSID("$NetBSD: strcmp.S,v 1.1 2001/06/19 00:22:47 fvdl Exp $") -#endif - -/* - * NOTE: I've unrolled the loop eight times: large enough to make a - * significant difference, and small enough not to totally trash the - * cache. - */ - -ENTRY(strcmp) - jmp L2 /* Jump into the loop. */ - -L1: incq %rdi - incq %rsi -L2: movb (%rdi),%cl - testb %cl,%cl /* null terminator */ - jz L3 - cmpb %cl,(%rsi) /* chars match */ - jne L3 - - incq %rdi - incq %rsi - movb (%rdi),%cl - testb %cl,%cl - jz L3 - cmpb %cl,(%rsi) - jne L3 - - incq %rdi - incq %rsi - movb (%rdi),%cl - testb %cl,%cl - jz L3 - cmpb %cl,(%rsi) - jne L3 - - incq %rdi - incq %rsi - movb (%rdi),%cl - testb %cl,%cl - jz L3 - cmpb %cl,(%rsi) - jne L3 - - incq %rdi - incq %rsi - movb (%rdi),%cl - testb %cl,%cl - jz L3 - cmpb %cl,(%rsi) - jne L3 - - incq %rdi - incq %rsi - movb (%rdi),%cl - testb %cl,%cl - jz L3 - cmpb %cl,(%rsi) - jne L3 - - incq %rdi - incq %rsi - movb (%rdi),%cl - testb %cl,%cl - jz L3 - cmpb %cl,(%rsi) - jne L3 - - incq %rdi - incq %rsi - movb (%rdi),%cl - testb %cl,%cl - jz L3 - cmpb %cl,(%rsi) - je L1 -L3: movzbl (%rdi),%eax /* unsigned comparison */ - movzbl (%rsi),%edx - subl %edx,%eax - ret diff --git a/sys/lib/libkern/arch/x86_64/strcpy.S b/sys/lib/libkern/arch/x86_64/strcpy.S deleted file mode 100644 index 924dfffd5be..00000000000 --- a/sys/lib/libkern/arch/x86_64/strcpy.S +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * Adapted for NetBSD/x86_64 by Frank van der Linden <fvdl@wasabisystems.com> - */ - -#include <machine/asm.h> - -#if defined(LIBC_SCCS) - RCSID("$NetBSD: strcpy.S,v 1.1 2001/06/19 00:22:47 fvdl Exp $") -#endif - -/* - * NOTE: I've unrolled the loop eight times: large enough to make a - * significant difference, and small enough not to totally trash the - * cache. - */ - -ENTRY(strcpy) - movq %rdi,%r11 - -L1: movb (%rsi),%al /* unroll loop, but not too much */ - movb %al,(%rdi) - testb %al,%al - jz L2 - movb 1(%rsi),%al - movb %al,1(%rdi) - testb %al,%al - jz L2 - movb 2(%rsi),%al - movb %al,2(%rdi) - testb %al,%al - jz L2 - movb 3(%rsi),%al - movb %al,3(%rdi) - testb %al,%al - jz L2 - movb 4(%rsi),%al - movb %al,4(%rdi) - testb %al,%al - jz L2 - movb 5(%rsi),%al - movb %al,5(%rdi) - testb %al,%al - jz L2 - movb 6(%rsi),%al - movb %al,6(%rdi) - testb %al,%al - jz L2 - movb 7(%rsi),%al - movb %al,7(%rdi) - addq $8,%rsi - addq $8,%rdi - testb %al,%al - jnz L1 -L2: movq %r11,%rax - ret diff --git a/sys/lib/libkern/arch/x86_64/strlen.S b/sys/lib/libkern/arch/x86_64/strlen.S deleted file mode 100644 index 3c85659391a..00000000000 --- a/sys/lib/libkern/arch/x86_64/strlen.S +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * Adapted for NetBSD/x86_64 by Frank van der Linden <fvdl@wasabisystems.com> - */ - -#include <machine/asm.h> - -#if defined(LIBC_SCCS) - RCSID("$NetBSD: strlen.S,v 1.1 2001/06/19 00:22:47 fvdl Exp $") -#endif - -ENTRY(strlen) - cld /* set search forward */ - xorl %eax,%eax /* set search for null terminator */ - movq $-1,%rcx /* set search for lots of characters */ - repne /* search! */ - scasb - notq %rcx /* get length by taking complement */ - leaq -1(%rcx),%rax /* and subtracting one */ - ret diff --git a/sys/lib/libkern/arch/x86_64/strrchr.S b/sys/lib/libkern/arch/x86_64/strrchr.S deleted file mode 100644 index 9b23edfb435..00000000000 --- a/sys/lib/libkern/arch/x86_64/strrchr.S +++ /dev/null @@ -1,4 +0,0 @@ -/* $NetBSD: strrchr.S,v 1.1 2001/06/19 00:22:47 fvdl Exp $ */ - -#define STRRCHR -#include "rindex.S" |