summaryrefslogtreecommitdiffstats
path: root/lib/libc/arch/mips/string
diff options
context:
space:
mode:
authorpefo <pefo@openbsd.org>2004-08-11 17:34:32 +0000
committerpefo <pefo@openbsd.org>2004-08-11 17:34:32 +0000
commitc75442f78bf8b56fb38404a78475ec68a1f1003e (patch)
tree6d980fbac2596947a72da46a3b33904f2f662cc0 /lib/libc/arch/mips/string
parentMove mips to mips64 (diff)
downloadwireguard-openbsd-c75442f78bf8b56fb38404a78475ec68a1f1003e.tar.xz
wireguard-openbsd-c75442f78bf8b56fb38404a78475ec68a1f1003e.zip
bye
Diffstat (limited to 'lib/libc/arch/mips/string')
-rw-r--r--lib/libc/arch/mips/string/Makefile.inc7
-rw-r--r--lib/libc/arch/mips/string/bcmp.S116
-rw-r--r--lib/libc/arch/mips/string/bcopy.S123
-rw-r--r--lib/libc/arch/mips/string/bzero.S70
-rw-r--r--lib/libc/arch/mips/string/ffs.S53
-rw-r--r--lib/libc/arch/mips/string/index.S52
-rw-r--r--lib/libc/arch/mips/string/rindex.S51
-rw-r--r--lib/libc/arch/mips/string/strcmp.S62
-rw-r--r--lib/libc/arch/mips/string/strlen.S49
9 files changed, 0 insertions, 583 deletions
diff --git a/lib/libc/arch/mips/string/Makefile.inc b/lib/libc/arch/mips/string/Makefile.inc
deleted file mode 100644
index da5a8e48a5b..00000000000
--- a/lib/libc/arch/mips/string/Makefile.inc
+++ /dev/null
@@ -1,7 +0,0 @@
-# $OpenBSD: Makefile.inc,v 1.4 1999/04/25 00:23:58 millert Exp $
-
-SRCS+= bcmp.S bcopy.S bzero.S ffs.S index.S memchr.c memcmp.c memset.c \
- rindex.S strcat.c strcmp.S strcpy.c strcspn.c strlcpy.c strlen.S \
- strncat.c strncmp.c strncpy.c strpbrk.c strsep.c \
- strspn.c strstr.c swab.c
-LSRCS+= bcmp.c bcopy.c bzero.c ffs.c index.c rindex.c strcmp.c strlen.c
diff --git a/lib/libc/arch/mips/string/bcmp.S b/lib/libc/arch/mips/string/bcmp.S
deleted file mode 100644
index 22c29177f82..00000000000
--- a/lib/libc/arch/mips/string/bcmp.S
+++ /dev/null
@@ -1,116 +0,0 @@
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * 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. 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)
- .text
- .asciz "$OpenBSD: bcmp.S,v 1.5 2003/06/02 20:18:31 millert Exp $"
-#endif /* LIBC_SCCS */
-
-/* bcmp(s1, s2, n) */
-
-LEAF(bcmp)
- .set noreorder
- blt a2, 16, small # is it worth any trouble?
- xor v0, a0, a1 # compare low two bits of addresses
- and v0, v0, 3
- subu a3, zero, a1 # compute # bytes to word align address
- bne v0, zero, unaligned # not possible to align addresses
- and a3, a3, 3
-
- beq a3, zero, 1f
- subu a2, a2, a3 # subtract from remaining count
- move v0, v1 # init v0,v1 so unmodified bytes match
- LWHI v0, 0(a0) # read 1, 2, or 3 bytes
- LWHI v1, 0(a1)
- addu a1, a1, a3
- bne v0, v1, nomatch
- addu a0, a0, a3
-1:
- and a3, a2, ~3 # compute number of whole words left
- subu a2, a2, a3 # which has to be >= (16-3) & ~3
- addu a3, a3, a0 # compute ending address
-2:
- lw v0, 0(a0) # compare words
- lw v1, 0(a1)
- addu a0, a0, 4
- bne v0, v1, nomatch
- addu a1, a1, 4
- bne a0, a3, 2b
- nop
- b small # finish remainder
- nop
-unaligned:
- beq a3, zero, 2f
- subu a2, a2, a3 # subtract from remaining count
- addu a3, a3, a0 # compute ending address
-1:
- lbu v0, 0(a0) # compare bytes until a1 word aligned
- lbu v1, 0(a1)
- addu a0, a0, 1
- bne v0, v1, nomatch
- addu a1, a1, 1
- bne a0, a3, 1b
- nop
-2:
- and a3, a2, ~3 # compute number of whole words left
- subu a2, a2, a3 # which has to be >= (16-3) & ~3
- addu a3, a3, a0 # compute ending address
-3:
- LWHI v0, 0(a0) # compare words a0 unaligned, a1 aligned
- LWLO v0, 3(a0)
- lw v1, 0(a1)
- addu a0, a0, 4
- bne v0, v1, nomatch
- addu a1, a1, 4
- bne a0, a3, 3b
- nop
-small:
- ble a2, zero, match
- addu a3, a2, a0 # compute ending address
-1:
- lbu v0, 0(a0)
- lbu v1, 0(a1)
- addu a0, a0, 1
- bne v0, v1, nomatch
- addu a1, a1, 1
- bne a0, a3, 1b
- nop
-match:
- j ra
- move v0, zero
-nomatch:
- j ra
- li v0, 1
- .set reorder
-END(bcmp)
diff --git a/lib/libc/arch/mips/string/bcopy.S b/lib/libc/arch/mips/string/bcopy.S
deleted file mode 100644
index 2ebcd686bda..00000000000
--- a/lib/libc/arch/mips/string/bcopy.S
+++ /dev/null
@@ -1,123 +0,0 @@
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * 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. 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)
- .text
- .asciz "$OpenBSD: bcopy.S,v 1.6 2003/06/02 20:18:32 millert Exp $"
-#endif /* LIBC_SCCS */
-
-/* bcopy(s1, s2, n) */
-
-
-LEAF(bcopy)
- .set noreorder
- addu t0, a0, a2 # t0 = end of s1 region
- sltu t1, a1, t0
- sltu t2, a0, a1
- and t1, t1, t2 # t1 = true if from < to < (from+len)
- beq t1, zero, forward # non overlapping, do forward copy
- slt t2, a2, 12 # check for small copy
-
- ble a2, zero, 2f
- addu t1, a1, a2 # t1 = end of to region
-1:
- lb v0, -1(t0) # copy bytes backwards,
- subu t0, t0, 1 # doesn't happen often so do slow way
- subu t1, t1, 1
- bne t0, a0, 1b
- sb v0, 0(t1)
-2:
- j ra
- nop
-forward:
- bne t2, zero, smallcpy # do a small bcopy
- xor v0, a0, a1 # compare low two bits of addresses
- and v0, v0, 3
- subu a3, zero, a1 # compute # bytes to word align address
- beq v0, zero, aligned # addresses can be word aligned
- and a3, a3, 3
-
- beq a3, zero, 1f
- subu a2, a2, a3 # subtract from remaining count
- LWHI v0, 0(a0) # get next 4 bytes (unaligned)
- LWLO v0, 3(a0)
- addu a0, a0, a3
- SWHI v0, 0(a1) # store 1, 2, or 3 bytes to align a1
- addu a1, a1, a3
-1:
- and v0, a2, 3 # compute number of words left
- subu a3, a2, v0
- move a2, v0
- addu a3, a3, a0 # compute ending address
-2:
- LWHI v0, 0(a0) # copy words a0 unaligned, a1 aligned
- LWLO v0, 3(a0)
- addu a0, a0, 4
- addu a1, a1, 4
- bne a0, a3, 2b
- sw v0, -4(a1)
- b smallcpy
- nop
-aligned:
- beq a3, zero, 1f
- subu a2, a2, a3 # subtract from remaining count
- LWHI v0, 0(a0) # copy 1, 2, or 3 bytes to align
- addu a0, a0, a3
- SWHI v0, 0(a1)
- addu a1, a1, a3
-1:
- and v0, a2, 3 # compute number of whole words left
- subu a3, a2, v0
- move a2, v0
- addu a3, a3, a0 # compute ending address
-2:
- lw v0, 0(a0) # copy words
- addu a0, a0, 4
- addu a1, a1, 4
- bne a0, a3, 2b
- sw v0, -4(a1)
-smallcpy:
- ble a2, zero, 2f
- addu a3, a2, a0 # compute ending address
-1:
- lbu v0, 0(a0) # copy bytes
- addu a0, a0, 1
- addu a1, a1, 1
- bne a0, a3, 1b
- sb v0, -1(a1)
-2:
- j ra
- nop
- .set reorder
-END(bcopy)
diff --git a/lib/libc/arch/mips/string/bzero.S b/lib/libc/arch/mips/string/bzero.S
deleted file mode 100644
index 3ad63cbffd6..00000000000
--- a/lib/libc/arch/mips/string/bzero.S
+++ /dev/null
@@ -1,70 +0,0 @@
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * 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. 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)
- .text
- .asciz "$OpenBSD: bzero.S,v 1.6 2003/06/02 20:18:32 millert Exp $"
-#endif /* LIBC_SCCS */
-
-/* bzero(s1, n) */
-
-LEAF(bzero)
- .set noreorder
- blt a1, 12, smallclr # small amount to clear?
- subu a3, zero, a0 # compute # bytes to word align address
- and a3, a3, 3
- beq a3, zero, 1f # skip if word aligned
- subu a1, a1, a3 # subtract from remaining count
- SWHI zero, 0(a0) # clear 1, 2, or 3 bytes to align
- addu a0, a0, a3
-1:
- and v0, a1, 3 # compute number of words left
- subu a3, a1, v0
- move a1, v0
- addu a3, a3, a0 # compute ending address
-2:
- addu a0, a0, 4 # clear words
- bne a0, a3, 2b # unrolling loop doesn't help
- sw zero, -4(a0) # since we are limited by memory speed
-smallclr:
- ble a1, zero, 2f
- addu a3, a1, a0 # compute ending address
-1:
- addu a0, a0, 1 # clear bytes
- bne a0, a3, 1b
- sb zero, -1(a0)
-2:
- j ra
- nop
-END(bzero)
diff --git a/lib/libc/arch/mips/string/ffs.S b/lib/libc/arch/mips/string/ffs.S
deleted file mode 100644
index 486f3d1d675..00000000000
--- a/lib/libc/arch/mips/string/ffs.S
+++ /dev/null
@@ -1,53 +0,0 @@
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * 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. 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)
- .text
- .asciz "$OpenBSD: ffs.S,v 1.5 2003/06/02 20:18:32 millert Exp $"
-#endif /* LIBC_SCCS */
-
-/* bit = ffs(value) */
-
-LEAF(ffs)
- .set reorder
- move v0, zero
- beq a0, zero, done
-1:
- and v1, a0, 1 # bit set?
- addu v0, v0, 1
- srl a0, a0, 1
- beq v1, zero, 1b # no, continue
-done:
- j ra
-END(ffs)
diff --git a/lib/libc/arch/mips/string/index.S b/lib/libc/arch/mips/string/index.S
deleted file mode 100644
index 73cf27e9d88..00000000000
--- a/lib/libc/arch/mips/string/index.S
+++ /dev/null
@@ -1,52 +0,0 @@
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * 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. 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)
- .text
- .asciz "$OpenBSD: index.S,v 1.5 2003/06/02 20:18:32 millert Exp $"
-#endif /* LIBC_SCCS */
-
-LEAF(index)
- .set reorder
- lbu a2, 0(a0) # get a byte
- addu a0, a0, 1
- beq a2, a1, fnd
- bne a2, zero, _C_LABEL(index)
-notfnd:
- move v0, zero
- j ra
-fnd:
- subu v0, a0, 1
- j ra
-END(index)
diff --git a/lib/libc/arch/mips/string/rindex.S b/lib/libc/arch/mips/string/rindex.S
deleted file mode 100644
index 511457f2d6d..00000000000
--- a/lib/libc/arch/mips/string/rindex.S
+++ /dev/null
@@ -1,51 +0,0 @@
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * 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. 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)
- .text
- .asciz "$OpenBSD: rindex.S,v 1.5 2003/06/02 20:18:32 millert Exp $"
-#endif /* LIBC_SCCS */
-
-LEAF(rindex)
- .set reorder
- move v0, zero # default if not found
-1:
- lbu a3, 0(a0) # get a byte
- addu a0, a0, 1
- bne a3, a1, 2f
- subu v0, a0, 1 # save address of last match
-2:
- bne a3, zero, 1b # continue if not end
- j ra
-END(rindex)
diff --git a/lib/libc/arch/mips/string/strcmp.S b/lib/libc/arch/mips/string/strcmp.S
deleted file mode 100644
index 35b900b6726..00000000000
--- a/lib/libc/arch/mips/string/strcmp.S
+++ /dev/null
@@ -1,62 +0,0 @@
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * 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. 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)
- .text
- .asciz "$OpenBSD: strcmp.S,v 1.5 2003/06/02 20:18:32 millert Exp $"
-#endif /* LIBC_SCCS */
-
-/*
- * NOTE: this version assumes unsigned chars in order to be "8 bit clean".
- */
-LEAF(strcmp)
- .set reorder
-1:
- lbu t0, 0(a0) # get two bytes and compare them
- lbu t1, 0(a1)
- beq t0, zero, LessOrEq # end of first string?
- bne t0, t1, NotEq
- lbu t0, 1(a0) # unroll loop
- lbu t1, 1(a1)
- add a0, a0, 2
- beq t0, zero, LessOrEq # end of first string?
- add a1, a1, 2
- beq t0, t1, 1b
-NotEq:
- subu v0, t0, t1
- j ra
-LessOrEq:
- subu v0, zero, t1
- j ra
-END(strcmp)
diff --git a/lib/libc/arch/mips/string/strlen.S b/lib/libc/arch/mips/string/strlen.S
deleted file mode 100644
index 426d08d188e..00000000000
--- a/lib/libc/arch/mips/string/strlen.S
+++ /dev/null
@@ -1,49 +0,0 @@
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * 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. 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)
- .text
- .asciz "$OpenBSD: strlen.S,v 1.5 2003/06/02 20:18:32 millert Exp $"
-#endif /* LIBC_SCCS */
-
-LEAF(strlen)
- .set reorder
- addu v1, a0, 1
-1:
- lb v0, 0(a0) # get byte from string
- addu a0, a0, 1 # increment pointer
- bne v0, zero, 1b # continue if not end
- subu v0, a0, v1 # compute length - 1 for '\0' char
- j ra
-END(strlen)