diff options
author | 2004-08-11 17:34:32 +0000 | |
---|---|---|
committer | 2004-08-11 17:34:32 +0000 | |
commit | c75442f78bf8b56fb38404a78475ec68a1f1003e (patch) | |
tree | 6d980fbac2596947a72da46a3b33904f2f662cc0 /lib/libc/arch/mips/gen | |
parent | Move mips to mips64 (diff) | |
download | wireguard-openbsd-c75442f78bf8b56fb38404a78475ec68a1f1003e.tar.xz wireguard-openbsd-c75442f78bf8b56fb38404a78475ec68a1f1003e.zip |
bye
Diffstat (limited to 'lib/libc/arch/mips/gen')
-rw-r--r-- | lib/libc/arch/mips/gen/Makefile.inc | 7 | ||||
-rw-r--r-- | lib/libc/arch/mips/gen/_setjmp.S | 128 | ||||
-rw-r--r-- | lib/libc/arch/mips/gen/fabs.S | 50 | ||||
-rw-r--r-- | lib/libc/arch/mips/gen/flt_rounds.c | 28 | ||||
-rw-r--r-- | lib/libc/arch/mips/gen/fpgetmask.c | 19 | ||||
-rw-r--r-- | lib/libc/arch/mips/gen/fpgetround.c | 19 | ||||
-rw-r--r-- | lib/libc/arch/mips/gen/fpgetsticky.c | 19 | ||||
-rw-r--r-- | lib/libc/arch/mips/gen/fpsetmask.c | 28 | ||||
-rw-r--r-- | lib/libc/arch/mips/gen/fpsetround.c | 28 | ||||
-rw-r--r-- | lib/libc/arch/mips/gen/fpsetsticky.c | 28 | ||||
-rw-r--r-- | lib/libc/arch/mips/gen/frexp.c | 74 | ||||
-rw-r--r-- | lib/libc/arch/mips/gen/infinity.c | 15 | ||||
-rw-r--r-- | lib/libc/arch/mips/gen/isinf.S | 91 | ||||
-rw-r--r-- | lib/libc/arch/mips/gen/ldexp.S | 213 | ||||
-rw-r--r-- | lib/libc/arch/mips/gen/modf.S | 71 | ||||
-rw-r--r-- | lib/libc/arch/mips/gen/setjmp.S | 128 | ||||
-rw-r--r-- | lib/libc/arch/mips/gen/sigsetjmp.S | 74 |
17 files changed, 0 insertions, 1020 deletions
diff --git a/lib/libc/arch/mips/gen/Makefile.inc b/lib/libc/arch/mips/gen/Makefile.inc deleted file mode 100644 index 27d23fc3e9b..00000000000 --- a/lib/libc/arch/mips/gen/Makefile.inc +++ /dev/null @@ -1,7 +0,0 @@ -# $OpenBSD: Makefile.inc,v 1.4 2003/05/02 19:20:26 millert Exp $ - -SRCS+= _setjmp.S fabs.S frexp.c infinity.c isinf.S ldexp.S modf.S -SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \ - fpsetround.c fpsetsticky.c -SRCS+= setjmp.S sigsetjmp.S -SRCS+= alloca.c diff --git a/lib/libc/arch/mips/gen/_setjmp.S b/lib/libc/arch/mips/gen/_setjmp.S deleted file mode 100644 index 2e427de9d1b..00000000000 --- a/lib/libc/arch/mips/gen/_setjmp.S +++ /dev/null @@ -1,128 +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/regnum.h> -#include <machine/asm.h> - -#if defined(LIBC_SCCS) - .text - .asciz "$OpenBSD: _setjmp.S,v 1.7 2003/06/02 20:18:31 millert Exp $" -#endif /* LIBC_SCCS */ - -/* - * C library -- _setjmp, _longjmp - * - * _longjmp(a,v) - * will generate a "return(v)" from - * the last call to - * _setjmp(a) - * by restoring registers from the stack, - * The previous signal state is NOT restored. - */ - -LEAF(_setjmp) - .set noreorder - li v0, 0xACEDBADE # sigcontext magic number - sw ra, (2 * 4)(a0) # sc_pc = return address - sw v0, (3 * 4)(a0) # saved in sc_regs[0] - sw s0, ((S0 + 3) * 4)(a0) - sw s1, ((S1 + 3) * 4)(a0) - sw s2, ((S2 + 3) * 4)(a0) - sw s3, ((S3 + 3) * 4)(a0) - sw s4, ((S4 + 3) * 4)(a0) - sw s5, ((S5 + 3) * 4)(a0) - sw s6, ((S6 + 3) * 4)(a0) - sw s7, ((S7 + 3) * 4)(a0) - sw sp, ((SP + 3) * 4)(a0) - sw s8, ((S8 + 3) * 4)(a0) - cfc1 v0, $31 # too bad cant check if FP used - swc1 $f20, ((20 + 38) * 4)(a0) - swc1 $f21, ((21 + 38) * 4)(a0) - swc1 $f22, ((22 + 38) * 4)(a0) - swc1 $f23, ((23 + 38) * 4)(a0) - swc1 $f24, ((24 + 38) * 4)(a0) - swc1 $f25, ((25 + 38) * 4)(a0) - swc1 $f26, ((26 + 38) * 4)(a0) - swc1 $f27, ((27 + 38) * 4)(a0) - swc1 $f28, ((28 + 38) * 4)(a0) - swc1 $f29, ((29 + 38) * 4)(a0) - swc1 $f30, ((30 + 38) * 4)(a0) - swc1 $f31, ((31 + 38) * 4)(a0) - sw v0, ((32 + 38) * 4)(a0) - j ra - move v0, zero -END(_setjmp) - -LEAF(_longjmp) -#ifdef ABICALLS - subu sp, sp, 32 - .cprestore 16 -#endif - .set noreorder - lw v0, (3 * 4)(a0) # get magic number - lw ra, (2 * 4)(a0) - bne v0, 0xACEDBADE, botch # jump if error - - addu sp, sp, 32 # does not matter, sanity - lw s0, ((S0 + 3) * 4)(a0) - lw s1, ((S1 + 3) * 4)(a0) - lw s2, ((S2 + 3) * 4)(a0) - lw s3, ((S3 + 3) * 4)(a0) - lw s4, ((S4 + 3) * 4)(a0) - lw s5, ((S5 + 3) * 4)(a0) - lw s6, ((S6 + 3) * 4)(a0) - lw s7, ((S7 + 3) * 4)(a0) - lw v0, ((32 + 38) * 4)(a0) # get fpu status - lw sp, ((SP + 3) * 4)(a0) - lw s8, ((S8 + 3) * 4)(a0) - ctc1 v0, $31 - lwc1 $f20, ((20 + 38) * 4)(a0) - lwc1 $f21, ((21 + 38) * 4)(a0) - lwc1 $f22, ((22 + 38) * 4)(a0) - lwc1 $f23, ((23 + 38) * 4)(a0) - lwc1 $f24, ((24 + 38) * 4)(a0) - lwc1 $f25, ((25 + 38) * 4)(a0) - lwc1 $f26, ((26 + 38) * 4)(a0) - lwc1 $f27, ((27 + 38) * 4)(a0) - lwc1 $f28, ((28 + 38) * 4)(a0) - lwc1 $f29, ((29 + 38) * 4)(a0) - lwc1 $f30, ((30 + 38) * 4)(a0) - lwc1 $f31, ((31 + 38) * 4)(a0) - - j ra - move v0, a1 -botch: - jal _C_LABEL(longjmperror) - nop - jal _C_LABEL(abort) - nop -END(_longjmp) diff --git a/lib/libc/arch/mips/gen/fabs.S b/lib/libc/arch/mips/gen/fabs.S deleted file mode 100644 index f32c29b68ea..00000000000 --- a/lib/libc/arch/mips/gen/fabs.S +++ /dev/null @@ -1,50 +0,0 @@ -/*- - * Copyright (c) 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: fabs.S,v 1.5 2003/06/02 20:18:31 millert Exp $" -#endif /* LIBC_SCCS */ - -/* - * fabs(x) - * double x; - * - * Return absolute value of x. - */ -LEAF(fabs) - .set noreorder - j ra - abs.d $f0, $f12 # compute absolute value of x -END(fabs) diff --git a/lib/libc/arch/mips/gen/flt_rounds.c b/lib/libc/arch/mips/gen/flt_rounds.c deleted file mode 100644 index d5acebdcf6c..00000000000 --- a/lib/libc/arch/mips/gen/flt_rounds.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Written by J.T. Conklin, Apr 11, 1995 - * Public domain. - */ - -#include <sys/types.h> -#include <machine/float.h> - -#if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: flt_rounds.c,v 1.4 1999/02/01 16:57:33 pefo Exp $"; -#endif /* LIBC_SCCS and not lint */ - -static const int map[] = { - 1, /* round to nearest */ - 0, /* round to zero */ - 2, /* round to positive infinity */ - 3 /* round to negative infinity */ -}; - -int -__flt_rounds() -{ - int x; - - __asm__("cfc1 %0,$31" : "=r" (x)); - __asm__("nop"); - return map[x & 0x03]; -} diff --git a/lib/libc/arch/mips/gen/fpgetmask.c b/lib/libc/arch/mips/gen/fpgetmask.c deleted file mode 100644 index c9c0cbd0770..00000000000 --- a/lib/libc/arch/mips/gen/fpgetmask.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Written by J.T. Conklin, Apr 11, 1995 - * Public domain. - */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: fpgetmask.c,v 1.2 1996/08/19 08:15:54 tholo Exp $"; -#endif /* LIBC_SCCS and not lint */ - -#include <ieeefp.h> - -fp_except -fpgetmask() -{ - int x; - - __asm__("cfc1 %0,$31" : "=r" (x)); - return (x >> 7) & 0x1f; -} diff --git a/lib/libc/arch/mips/gen/fpgetround.c b/lib/libc/arch/mips/gen/fpgetround.c deleted file mode 100644 index cd42342c2ac..00000000000 --- a/lib/libc/arch/mips/gen/fpgetround.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Written by J.T. Conklin, Apr 11, 1995 - * Public domain. - */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: fpgetround.c,v 1.2 1996/08/19 08:15:55 tholo Exp $"; -#endif /* LIBC_SCCS and not lint */ - -#include <ieeefp.h> - -fp_rnd -fpgetround() -{ - int x; - - __asm__("cfc1 %0,$31" : "=r" (x)); - return x & 0x03; -} diff --git a/lib/libc/arch/mips/gen/fpgetsticky.c b/lib/libc/arch/mips/gen/fpgetsticky.c deleted file mode 100644 index f801e7e6ac0..00000000000 --- a/lib/libc/arch/mips/gen/fpgetsticky.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Written by J.T. Conklin, Apr 11, 1995 - * Public domain. - */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: fpgetsticky.c,v 1.2 1996/08/19 08:15:56 tholo Exp $"; -#endif /* LIBC_SCCS and not lint */ - -#include <ieeefp.h> - -fp_except -fpgetsticky() -{ - int x; - - __asm__("cfc1 %0,$31" : "=r" (x)); - return (x >> 2) & 0x1f; -} diff --git a/lib/libc/arch/mips/gen/fpsetmask.c b/lib/libc/arch/mips/gen/fpsetmask.c deleted file mode 100644 index f665ef98e60..00000000000 --- a/lib/libc/arch/mips/gen/fpsetmask.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Written by J.T. Conklin, Apr 11, 1995 - * Public domain. - */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: fpsetmask.c,v 1.2 1996/08/19 08:15:57 tholo Exp $"; -#endif /* LIBC_SCCS and not lint */ - -#include <ieeefp.h> - -fp_except -fpsetmask(mask) - fp_except mask; -{ - fp_except old; - fp_except new; - - __asm__("cfc1 %0,$31" : "=r" (old)); - - new = old; - new &= ~(0x1f << 7); - new |= ((mask & 0x1f) << 7); - - __asm__("ctc1 %0,$31" : : "r" (new)); - - return (old >> 7) & 0x1f; -} diff --git a/lib/libc/arch/mips/gen/fpsetround.c b/lib/libc/arch/mips/gen/fpsetround.c deleted file mode 100644 index 264659fe7ca..00000000000 --- a/lib/libc/arch/mips/gen/fpsetround.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Written by J.T. Conklin, Apr 11, 1995 - * Public domain. - */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: fpsetround.c,v 1.2 1996/08/19 08:15:58 tholo Exp $"; -#endif /* LIBC_SCCS and not lint */ - -#include <ieeefp.h> - -fp_rnd -fpsetround(rnd_dir) - fp_rnd rnd_dir; -{ - fp_rnd old; - fp_rnd new; - - __asm__("cfc1 %0,$31" : "=r" (old)); - - new = old; - new &= ~0x03; - new |= (rnd_dir & 0x03); - - __asm__("ctc1 %0,$31" : : "r" (new)); - - return old & 0x03; -} diff --git a/lib/libc/arch/mips/gen/fpsetsticky.c b/lib/libc/arch/mips/gen/fpsetsticky.c deleted file mode 100644 index 84e40403203..00000000000 --- a/lib/libc/arch/mips/gen/fpsetsticky.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Written by J.T. Conklin, Apr 11, 1995 - * Public domain. - */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: fpsetsticky.c,v 1.2 1996/08/19 08:15:59 tholo Exp $"; -#endif /* LIBC_SCCS and not lint */ - -#include <ieeefp.h> - -fp_except -fpsetsticky(sticky) - fp_except sticky; -{ - fp_except old; - fp_except new; - - __asm__("cfc1 %0,$31" : "=r" (old)); - - new = old; - new &= ~(0x1f << 2); - new |= ((sticky & 0x1f) << 2); - - __asm__("ctc1 %0,$31" : : "r" (new)); - - return (old >> 2) & 0x1f; -} diff --git a/lib/libc/arch/mips/gen/frexp.c b/lib/libc/arch/mips/gen/frexp.c deleted file mode 100644 index fda0547c46e..00000000000 --- a/lib/libc/arch/mips/gen/frexp.c +++ /dev/null @@ -1,74 +0,0 @@ -/* $OpenBSD: frexp.c,v 1.5 2003/06/02 20:18:31 millert Exp $ */ - -/* - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This software was developed by the Computer Systems Engineering group - * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and - * contributed to Berkeley. - * - * 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. - */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: frexp.c,v 1.5 2003/06/02 20:18:31 millert Exp $"; -#endif /* LIBC_SCCS and not lint */ - -#include <sys/types.h> -#include <machine/ieee.h> - -/* - * Split the given value into a fraction in the range [0.5, 1.0) and - * an exponent, such that frac * (2^exp) == value. If value is 0, - * return 0. - */ -double -frexp(value, eptr) - double value; - int *eptr; -{ - union { - double v; - struct ieee_double s; - } u; - - if (value) { - /* - * Fractions in [0.5..1.0) have an exponent of 2^-1. - * Leave Inf and NaN alone, however. - * WHAT ABOUT DENORMS? - */ - u.v = value; - if (u.s.dbl_exp != DBL_EXP_INFNAN) { - *eptr = u.s.dbl_exp - (DBL_EXP_BIAS - 1); - u.s.dbl_exp = DBL_EXP_BIAS - 1; - } - return (u.v); - } else { - *eptr = 0; - return ((double)0); - } -} diff --git a/lib/libc/arch/mips/gen/infinity.c b/lib/libc/arch/mips/gen/infinity.c deleted file mode 100644 index 3831a29aae2..00000000000 --- a/lib/libc/arch/mips/gen/infinity.c +++ /dev/null @@ -1,15 +0,0 @@ -/* infinity.c */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: infinity.c,v 1.3 1996/11/29 16:51:02 imp Exp $"; -#endif /* LIBC_SCCS and not lint */ - -#include <math.h> -#include <sys/types.h> - -/* bytes for +Infinity on a MIPS */ -#if BYTE_ORDER == BIG_ENDIAN -char __infinity[] = { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 }; -#else -char __infinity[] = { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }; -#endif diff --git a/lib/libc/arch/mips/gen/isinf.S b/lib/libc/arch/mips/gen/isinf.S deleted file mode 100644 index c097598bf79..00000000000 --- a/lib/libc/arch/mips/gen/isinf.S +++ /dev/null @@ -1,91 +0,0 @@ -/*- - * Copyright (c) 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: isinf.S,v 1.5 2003/06/02 20:18:31 millert Exp $" -#endif /* LIBC_SCCS */ - -#define DEXP_INF 0x7ff - -/* - * isnan(x) - * double x; - * - * Return true if x is a NAN. - */ -LEAF(isnan) - .set noreorder - mfc1 v1, $f13 # get MSW of x - mfc1 t3, $f12 # get LSW of x - sll t1, v1, 1 # get x exponent - srl t1, t1, 32 - 11 - bne t1, DEXP_INF, 2f # is it a finite number? - sll t2, v1, 32 - 20 # get x fraction - bne t3, zero, 1f # is it a NAN? - nop - beq t2, zero, 2f # its infinity - nop -1: - j ra - li v0, 1 # x is a NAN -2: - j ra - move v0, zero # x is NOT a NAN -END(isnan) - -/* - * isinf(x) - * double x; - * - * Return true if x is infinity. - */ -LEAF(isinf) - .set noreorder - mfc1 v1, $f13 # get MSW of x - mfc1 t3, $f12 # get LSW of x - sll t1, v1, 1 # get x exponent - srl t1, t1, 32 - 11 - bne t1, DEXP_INF, 1f # is it a finite number? - sll t2, v1, 32 - 20 # get x fraction - bne t3, zero, 1f # is it a NAN? - nop - bne t2, zero, 1f # is it a NAN? - nop - j ra - li v0, 1 # x is infinity -1: - j ra - move v0, zero # x is NOT infinity -END(isinf) diff --git a/lib/libc/arch/mips/gen/ldexp.S b/lib/libc/arch/mips/gen/ldexp.S deleted file mode 100644 index e1fe32842e7..00000000000 --- a/lib/libc/arch/mips/gen/ldexp.S +++ /dev/null @@ -1,213 +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: ldexp.S,v 1.5 2003/06/02 20:18:31 millert Exp $" -#endif /* LIBC_SCCS */ - -#define DEXP_INF 0x7ff -#define DEXP_BIAS 1023 -#define DEXP_MIN -1022 -#define DEXP_MAX 1023 -#define DFRAC_BITS 52 -#define DIMPL_ONE 0x00100000 -#define DLEAD_ZEROS 31 - 20 -#define STICKYBIT 1 -#define GUARDBIT 0x80000000 -#define DSIGNAL_NAN 0x00040000 -#define DQUIET_NAN0 0x0007ffff -#define DQUIET_NAN1 0xffffffff - -/* - * double ldexp(x, N) - * double x; int N; - * - * Return x * (2**N), for integer values N. - */ -LEAF(ldexp) - .set reorder - mfc1 v1, $f13 # get MSW of x - mfc1 t3, $f12 # get LSW of x - sll t1, v1, 1 # get x exponent - srl t1, t1, 32 - 11 - beq t1, DEXP_INF, 9f # is it a NAN or infinity? - beq t1, zero, 1f # zero or denormalized number? - addu t1, t1, a2 # scale exponent - sll v0, a2, 20 # position N for addition - bge t1, DEXP_INF, 8f # overflow? - addu v0, v0, v1 # multiply by (2**N) - ble t1, zero, 4f # underflow? - mtc1 v0, $f1 # save MSW of result - mtc1 t3, $f0 # save LSW of result - j ra -1: - sll t2, v1, 32 - 20 # get x fraction - srl t2, t2, 32 - 20 - srl t0, v1, 31 # get x sign - bne t2, zero, 1f - beq t3, zero, 9f # result is zero -1: -/* - * Find out how many leading zero bits are in t2,t3 and put in t9. - */ - move v0, t2 - move t9, zero - bne t2, zero, 1f - move v0, t3 - addu t9, 32 -1: - srl t4, v0, 16 - bne t4, zero, 1f - addu t9, 16 - sll v0, 16 -1: - srl t4, v0, 24 - bne t4, zero, 1f - addu t9, 8 - sll v0, 8 -1: - srl t4, v0, 28 - bne t4, zero, 1f - addu t9, 4 - sll v0, 4 -1: - srl t4, v0, 30 - bne t4, zero, 1f - addu t9, 2 - sll v0, 2 -1: - srl t4, v0, 31 - bne t4, zero, 1f - addu t9, 1 -/* - * Now shift t2,t3 the correct number of bits. - */ -1: - subu t9, t9, DLEAD_ZEROS # dont count normal leading zeros - li t1, DEXP_MIN + DEXP_BIAS - subu t1, t1, t9 # adjust exponent - addu t1, t1, a2 # scale exponent - li v0, 32 - blt t9, v0, 1f - subu t9, t9, v0 # shift fraction left >= 32 bits - sll t2, t3, t9 - move t3, zero - b 2f -1: - subu v0, v0, t9 # shift fraction left < 32 bits - sll t2, t2, t9 - srl t4, t3, v0 - or t2, t2, t4 - sll t3, t3, t9 -2: - bge t1, DEXP_INF, 8f # overflow? - ble t1, zero, 4f # underflow? - sll t2, t2, 32 - 20 # clear implied one bit - srl t2, t2, 32 - 20 -3: - sll t1, t1, 31 - 11 # reposition exponent - sll t0, t0, 31 # reposition sign - or t0, t0, t1 # put result back together - or t0, t0, t2 - mtc1 t0, $f1 # save MSW of result - mtc1 t3, $f0 # save LSW of result - j ra -4: - li v0, 0x80000000 - ble t1, -52, 7f # is result too small for denorm? - sll t2, v1, 31 - 20 # clear exponent, extract fraction - or t2, t2, v0 # set implied one bit - blt t1, -30, 2f # will all bits in t3 be shifted out? - srl t2, t2, 31 - 20 # shift fraction back to normal position - subu t1, t1, 1 - sll t4, t2, t1 # shift right t2,t3 based on exponent - srl t8, t3, t1 # save bits shifted out - negu t1 - srl t3, t3, t1 - or t3, t3, t4 - srl t2, t2, t1 - bge t8, zero, 1f # does result need to be rounded? - addu t3, t3, 1 # round result - sltu t4, t3, 1 - sll t8, t8, 1 - addu t2, t2, t4 - bne t8, zero, 1f # round result to nearest - and t3, t3, ~1 -1: - mtc1 t3, $f0 # save denormalized result (LSW) - mtc1 t2, $f1 # save denormalized result (MSW) - bge v1, zero, 1f # should result be negative? - neg.d $f0, $f0 # negate result -1: - j ra -2: - mtc1 zero, $f1 # exponent and upper fraction - addu t1, t1, 20 # compute amount to shift right by - sll t8, t2, t1 # save bits shifted out - negu t1 - srl t3, t2, t1 - bge t8, zero, 1f # does result need to be rounded? - addu t3, t3, 1 # round result - sltu t4, t3, 1 - sll t8, t8, 1 - mtc1 t4, $f1 # exponent and upper fraction - bne t8, zero, 1f # round result to nearest - and t3, t3, ~1 -1: - mtc1 t3, $f0 - bge v1, zero, 1f # is result negative? - neg.d $f0, $f0 # negate result -1: - j ra -7: - mtc1 zero, $f0 # result is zero - mtc1 zero, $f1 - beq t0, zero, 1f # is result positive? - neg.d $f0, $f0 # negate result -1: - j ra -8: - li t1, 0x7ff00000 # result is infinity (MSW) - mtc1 t1, $f1 - mtc1 zero, $f0 # result is infinity (LSW) - bge v1, zero, 1f # should result be negative infinity? - neg.d $f0, $f0 # result is negative infinity -1: - add.d $f0, $f0 # cause overflow faults if enabled - j ra -9: - mov.d $f0, $f12 # yes, result is just x - j ra -END(ldexp) diff --git a/lib/libc/arch/mips/gen/modf.S b/lib/libc/arch/mips/gen/modf.S deleted file mode 100644 index 6eba37fcc17..00000000000 --- a/lib/libc/arch/mips/gen/modf.S +++ /dev/null @@ -1,71 +0,0 @@ -/*- - * Copyright (c) 1991, 1993, 1995 - * 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: modf.S,v 1.6 2003/06/02 20:18:31 millert Exp $" -#endif /* LIBC_SCCS */ - -/* - * double modf(val, iptr) - * double val, *iptr; - * returns: xxx and n (in *iptr) where val == n.xxx - */ -LEAF(modf) - .set reorder - cfc1 t0, $31 # get the control register - li.d $f2, 4503599627370496e0 # f2 <- 2^52 - - or t1, t0, 0x3 # set rounding mode to round to zero - xor t1, t1, 0x2 # (i.e., 01) - ctc1 t1, $31 - - mov.d $f0, $f12 # f0 <- f12 - abs.d $f4, $f12 # f4 <- |f12| - c.olt.d $f4, $f2 # f4 ? < f2 - bc1f 1f # leave f0 alone if Nan, infinity - # or >=2^52 - c.eq.d $f12,$f4 # was f12 positive ? - add.d $f4,$f2,$f4 # round off to integer - bc1f 2f # No -> will have to negate result - sub.d $f0,$f4,$f2 # Remove fudge factor - j 1f # integer fraction got -2: - sub.d $f0,$f2,$f4 # Remove fudge factor and negate -1: - ctc1 t0, $31 # restore old rounding mode - s.d $f0, 0(a2) # save the integer part - sub.d $f0, $f12, $f0 # subtract val - integer part - j ra -END(modf) diff --git a/lib/libc/arch/mips/gen/setjmp.S b/lib/libc/arch/mips/gen/setjmp.S deleted file mode 100644 index 36f6206e337..00000000000 --- a/lib/libc/arch/mips/gen/setjmp.S +++ /dev/null @@ -1,128 +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 <sys/syscall.h> -#include <machine/asm.h> -#include <machine/regnum.h> - -#if defined(LIBC_SCCS) - .text - .asciz "$OpenBSD: setjmp.S,v 1.8 2003/06/02 20:18:31 millert Exp $" -#endif /* LIBC_SCCS */ - -/* - * C library -- setjmp, longjmp - * - * longjmp(a,v) - * will generate a "return(v)" from - * the last call to - * setjmp(a) - * by restoring registers from the stack, - * and a struct sigcontext, see <signal.h> - */ - -#define SETJMP_FRAME_SIZE (STAND_FRAME_SIZE + 12) - -NON_LEAF(setjmp, SETJMP_FRAME_SIZE, ra) - .mask 0x80000000, (STAND_RA_OFFSET - STAND_FRAME_SIZE) - subu sp, sp, SETJMP_FRAME_SIZE # allocate stack frame -#ifdef ABICALLS - .cprestore 16 -#endif - .set reorder - sw ra, STAND_RA_OFFSET(sp) # save state - sw a0, SETJMP_FRAME_SIZE(sp) - move a0, zero # get current signal mask - jal _C_LABEL(sigblock) - lw v1, SETJMP_FRAME_SIZE(sp) # v1 = jmpbuf - sw v0, (1 * 4)(v1) # save sc_mask = sigblock(0) - move a0, zero - addu a1, sp, STAND_FRAME_SIZE # pointer to struct sigaltstack -#ifndef _THREAD_SAFE - jal _C_LABEL(sigaltstack) -#else - jal _C_LABEL(_thread_sys_sigaltstack) -#endif - lw a0, SETJMP_FRAME_SIZE(sp) # restore jmpbuf - lw v1, STAND_FRAME_SIZE+8(sp) # get old ss_onstack - and v1, v1, 1 # extract onstack flag - sw v1, 0(a0) # save it in sc_onstack - lw ra, STAND_RA_OFFSET(sp) - addu sp, sp, SETJMP_FRAME_SIZE - blt v0, zero, botch # check for sigstack() error - sw ra, (2 * 4)(a0) # sc_pc = return address - li v0, 0xACEDBADE # sigcontext magic number - sw v0, ((ZERO + 3) * 4)(a0) # saved in sc_regs[0] - sw s0, ((S0 + 3) * 4)(a0) - sw s1, ((S1 + 3) * 4)(a0) - sw s2, ((S2 + 3) * 4)(a0) - sw s3, ((S3 + 3) * 4)(a0) - sw s4, ((S4 + 3) * 4)(a0) - sw s5, ((S5 + 3) * 4)(a0) - sw s6, ((S6 + 3) * 4)(a0) - sw s7, ((S7 + 3) * 4)(a0) - sw gp, ((GP + 3) * 4)(a0) - sw sp, ((SP + 3) * 4)(a0) - sw s8, ((S8 + 3) * 4)(a0) - li v0, 1 # be nice if we could tell - sw v0, (37 * 4)(a0) # sc_fpused = 1 - cfc1 v0, $31 - swc1 $f20, ((20 + 38) * 4)(a0) - swc1 $f21, ((21 + 38) * 4)(a0) - swc1 $f22, ((22 + 38) * 4)(a0) - swc1 $f23, ((23 + 38) * 4)(a0) - swc1 $f24, ((24 + 38) * 4)(a0) - swc1 $f25, ((25 + 38) * 4)(a0) - swc1 $f26, ((26 + 38) * 4)(a0) - swc1 $f27, ((27 + 38) * 4)(a0) - swc1 $f28, ((28 + 38) * 4)(a0) - swc1 $f29, ((29 + 38) * 4)(a0) - swc1 $f30, ((30 + 38) * 4)(a0) - swc1 $f31, ((31 + 38) * 4)(a0) - sw v0, ((32 + 38) * 4)(a0) - move v0, zero - j ra -END(setjmp) - -LEAF(longjmp) -#ifdef ABICALLS - subu sp, sp, 32 - .cprestore 16 -#endif - .set reorder - sw a1, ((V0 + 3) * 4)(a0) # save return value in sc_regs[V0] - li v0, SYS_sigreturn - syscall -botch: - jal _C_LABEL(longjmperror) - jal _C_LABEL(abort) -END(longjmp) diff --git a/lib/libc/arch/mips/gen/sigsetjmp.S b/lib/libc/arch/mips/gen/sigsetjmp.S deleted file mode 100644 index f49ad65f4a7..00000000000 --- a/lib/libc/arch/mips/gen/sigsetjmp.S +++ /dev/null @@ -1,74 +0,0 @@ -/*- - * Copyright (c) 1991, 1993, 1995, - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Havard Eidnes. - * - * 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 <sys/syscall.h> -#include <machine/regnum.h> -#include <machine/asm.h> -#include <machine/setjmp.h> - -#if defined(LIBC_SCCS) - .text - .asciz "$OpenBSD: sigsetjmp.S,v 1.6 2003/06/02 20:18:31 millert Exp $" -#endif /* LIBC_SCCS */ - -/* - * C library -- sigsetjmp, siglongjmp - * - * siglongjmp(a,v) - * will generate a "return(v)" from - * the last call to - * sigsetjmp(a, savemask) - * by restoring registers from the stack, - * and dependent on savemask restores the - * signal mask. - */ - -LEAF(sigsetjmp) - .set reorder - sw a1, (_JBLEN*4)(a0) # save "savemask" - bne a1, 0x0, 1f # do saving of signal mask? - la t9, _setjmp - jr t9 - -1: la t9, setjmp - jr t9 -END(sigsetjmp) - -LEAF(siglongjmp) - .set reorder - lw t0, (_JBLEN * 4)(a0) # get "savemask" - bne t0, 0x0, 1f # restore signal mask? - la t9, _longjmp - jr t9 -1: la t9, longjmp - jr t9 -END(siglongjmp) |