diff options
Diffstat (limited to 'sysdeps')
47 files changed, 46 insertions, 1394 deletions
diff --git a/sysdeps/alpha/copysign.S b/sysdeps/alpha/s_copysign.S index 95eb608666..95eb608666 100644 --- a/sysdeps/alpha/copysign.S +++ b/sysdeps/alpha/s_copysign.S diff --git a/sysdeps/alpha/fabs.S b/sysdeps/alpha/s_fabs.S index dff8390b5a..12c0abdf75 100644 --- a/sysdeps/alpha/fabs.S +++ b/sysdeps/alpha/s_fabs.S @@ -19,9 +19,10 @@ Cambridge, MA 02139, USA. */ #include <sysdep.h> -ENTRY(fabs) +ENTRY(__fabs) .prologue 0 cpys $f31,$f16,$f0 ret - END(fabs) + END(__fabs) +weak_alias (__fabs, fabs) diff --git a/sysdeps/generic/get_str.c b/sysdeps/generic/get_str.c deleted file mode 100644 index 182815ee18..0000000000 --- a/sysdeps/generic/get_str.c +++ /dev/null @@ -1,213 +0,0 @@ -/* __mpn_get_str -- Convert a MSIZE long limb vector pointed to by MPTR - to a printable string in STR in base BASE. - -Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. - - -This file is part of the GNU C Library. Its master source is NOT part of -the C library, however. This file is in fact copied from the GNU MP -Library and its source lives there. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#include "gmp.h" -#include "gmp-impl.h" - -/* Convert the limb vector pointed to by MPTR and MSIZE long to a - char array, using base BASE for the result array. Store the - result in the character array STR. STR must point to an array with - space for the largest possible number represented by a MSIZE long - limb vector + 1 extra character. - - The result is NOT in Ascii, to convert it to printable format, add - '0' or 'A' depending on the base and range. - - Return the number of digits in the result string. - This may include some leading zeros. - - The limb vector pointed to by MPTR is clobbered. */ - -size_t -__mpn_get_str (str, base, mptr, msize) - unsigned char *str; - int base; - mp_ptr mptr; - mp_size_t msize; -{ - mp_limb big_base; -#if UDIV_NEEDS_NORMALIZATION || UDIV_TIME > 2 * UMUL_TIME - int normalization_steps; -#endif -#if UDIV_TIME > 2 * UMUL_TIME - mp_limb big_base_inverted; -#endif - unsigned int dig_per_u; - mp_size_t out_len; - register unsigned char *s; - - big_base = __mp_bases[base].big_base; - - s = str; - - /* Special case zero, as the code below doesn't handle it. */ - if (msize == 0) - { - s[0] = 0; - return 1; - } - - if ((base & (base - 1)) == 0) - { - /* The base is a power of 2. Make conversion from most - significant side. */ - mp_limb n1, n0; - register int bits_per_digit = big_base; - register int x; - register int bit_pos; - register int i; - - n1 = mptr[msize - 1]; - count_leading_zeros (x, n1); - - /* BIT_POS should be R when input ends in least sign. nibble, - R + bits_per_digit * n when input ends in n:th least significant - nibble. */ - - { - int bits; - - bits = BITS_PER_MP_LIMB * msize - x; - x = bits % bits_per_digit; - if (x != 0) - bits += bits_per_digit - x; - bit_pos = bits - (msize - 1) * BITS_PER_MP_LIMB; - } - - /* Fast loop for bit output. */ - i = msize - 1; - for (;;) - { - bit_pos -= bits_per_digit; - while (bit_pos >= 0) - { - *s++ = (n1 >> bit_pos) & ((1 << bits_per_digit) - 1); - bit_pos -= bits_per_digit; - } - i--; - if (i < 0) - break; - n0 = (n1 << -bit_pos) & ((1 << bits_per_digit) - 1); - n1 = mptr[i]; - bit_pos += BITS_PER_MP_LIMB; - *s++ = n0 | (n1 >> bit_pos); - } - - *s = 0; - - return s - str; - } - else - { - /* General case. The base is not a power of 2. Make conversion - from least significant end. */ - - /* If udiv_qrnnd only handles divisors with the most significant bit - set, prepare BIG_BASE for being a divisor by shifting it to the - left exactly enough to set the most significant bit. */ -#if UDIV_NEEDS_NORMALIZATION || UDIV_TIME > 2 * UMUL_TIME - count_leading_zeros (normalization_steps, big_base); - big_base <<= normalization_steps; -#if UDIV_TIME > 2 * UMUL_TIME - /* Get the fixed-point approximation to 1/(BIG_BASE << NORMALIZATION_STEPS). */ - big_base_inverted = __mp_bases[base].big_base_inverted; -#endif -#endif - - dig_per_u = __mp_bases[base].chars_per_limb; - out_len = ((size_t) msize * BITS_PER_MP_LIMB - * __mp_bases[base].chars_per_bit_exactly) + 1; - s += out_len; - - while (msize != 0) - { - int i; - mp_limb n0, n1; - -#if UDIV_NEEDS_NORMALIZATION || UDIV_TIME > 2 * UMUL_TIME - /* If we shifted BIG_BASE above, shift the dividend too, to get - the right quotient. We need to do this every loop, - since the intermediate quotients are OK, but the quotient from - one turn in the loop is going to be the dividend in the - next turn, and the dividend needs to be up-shifted. */ - if (normalization_steps != 0) - { - n0 = __mpn_lshift (mptr, mptr, msize, normalization_steps); - - /* If the shifting gave a carry out limb, store it and - increase the length. */ - if (n0 != 0) - { - mptr[msize] = n0; - msize++; - } - } -#endif - - /* Divide the number at TP with BIG_BASE to get a quotient and a - remainder. The remainder is our new digit in base BIG_BASE. */ - i = msize - 1; - n1 = mptr[i]; - - if (n1 >= big_base) - n1 = 0; - else - { - msize--; - i--; - } - - for (; i >= 0; i--) - { - n0 = mptr[i]; -#if UDIV_TIME > 2 * UMUL_TIME - udiv_qrnnd_preinv (mptr[i], n1, n1, n0, big_base, big_base_inverted); -#else - udiv_qrnnd (mptr[i], n1, n1, n0, big_base); -#endif - } - -#if UDIV_NEEDS_NORMALIZATION || UDIV_TIME > 2 * UMUL_TIME - /* If we shifted above (at previous UDIV_NEEDS_NORMALIZATION tests) - the remainder will be up-shifted here. Compensate. */ - n1 >>= normalization_steps; -#endif - - /* Convert N1 from BIG_BASE to a string of digits in BASE - using single precision operations. */ - for (i = dig_per_u - 1; i >= 0; i--) - { - *--s = n1 % base; - n1 /= base; - if (n1 == 0 && msize == 0) - break; - } - } - - while (s != str) - *--s = 0; - return out_len; - } -} diff --git a/sysdeps/generic/prof-freq.c b/sysdeps/generic/prof-freq.c index c69b43ec09..4ad42124e8 100644 --- a/sysdeps/generic/prof-freq.c +++ b/sysdeps/generic/prof-freq.c @@ -55,62 +55,3 @@ __profile_frequency () return 0; return (1000000 / tim.it_interval.tv_usec); } -/* Return frequency of ticks reported by profil. Generic version. */ -/*- - * Copyright (c) 1983, 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * 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 <sys/types.h> -#include <sys/time.h> - -int -__profile_frequency () -{ - /* - * Discover the tick frequency of the machine if something goes wrong, - * we return 0, an impossible hertz. - */ - struct itimerval tim; - - tim.it_interval.tv_sec = 0; - tim.it_interval.tv_usec = 1; - tim.it_value.tv_sec = 0; - tim.it_value.tv_usec = 0; - setitimer(ITIMER_REAL, &tim, 0); - setitimer(ITIMER_REAL, 0, &tim); - if (tim.it_interval.tv_usec < 2) - return 0; - return (1000000 / tim.it_interval.tv_usec); -} - - diff --git a/sysdeps/i386/strrchr.S b/sysdeps/i386/strrchr.S index 26d6a22d6b..58058e1195 100644 --- a/sysdeps/i386/strrchr.S +++ b/sysdeps/i386/strrchr.S @@ -1,6 +1,6 @@ -/* strchr (str, ch) -- Return pointer to last occurrence of CH in STR. +/* strrchr (str, ch) -- Return pointer to last occurrence of CH in STR. For Intel 80x86, x>=3. -Copyright (C) 1994, 1995 Free Software Foundation, Inc. +Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu> Some optimisations by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au> This file is part of the GNU C Library. @@ -84,7 +84,7 @@ L12: orb %dl, %dl /* is NUL? */ cmpb %dl, %cl /* compare byte */ jne L13 /* target found => return */ movl %esi, %eax /* remember pointer as result */ -L13: orb %cl, %cl /* is NUL? */ +L13: orb %dl, %dl /* is NUL? */ jz L2 /* yes => return NULL */ incl %esi /* increment pointer */ @@ -134,7 +134,11 @@ L13: orb %cl, %cl /* is NUL? */ /* These fill bytes make the main loop be correctly aligned. We cannot use align because it is not the following instruction which should be aligned. */ - .byte 0, 0, 0, 0, 0, 0, 0, 0 + .byte 0, 0 +#ifndef PROF + /* Profiling adds some code and so changes the alignment. */ + .byte 0 +#endif L4: subl $4, %esi /* adjust pointer */ L41: subl $4, %esi diff --git a/sysdeps/ieee754/cbrt.c b/sysdeps/ieee754/cbrt.c deleted file mode 100644 index fe5fb95511..0000000000 --- a/sysdeps/ieee754/cbrt.c +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 1985, 1993 - * The Regents of the University of California. All rights reserved. - * - * 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. - */ - -#ifndef lint -static char sccsid[] = "@(#)cbrt.c 8.1 (Berkeley) 6/4/93"; -#endif /* not lint */ - -#include <sys/cdefs.h> - -/* kahan's cube root (53 bits IEEE double precision) - * for IEEE machines only - * coded in C by K.C. Ng, 4/30/85 - * - * Accuracy: - * better than 0.667 ulps according to an error analysis. Maximum - * error observed was 0.666 ulps in an 1,000,000 random arguments test. - * - * Warning: this code is semi machine dependent; the ordering of words in - * a floating point number must be known in advance. I assume that the - * long interger at the address of a floating point number will be the - * leading 32 bits of that floating point number (i.e., sign, exponent, - * and the 20 most significant bits). - * On a National machine, it has different ordering; therefore, this code - * must be compiled with flag -DNATIONAL. - */ -#if !defined(vax)&&!defined(tahoe) - -static const unsigned long - B1 = 715094163, /* B1 = (682-0.03306235651)*2**20 */ - B2 = 696219795; /* B2 = (664-0.03306235651)*2**20 */ -static const double - C= 19./35., - D= -864./1225., - E= 99./70., - F= 45./28., - G= 5./14.; - -double cbrt(x) -double x; -{ - double r,s,t=0.0,w; - unsigned long *px = (unsigned long *) &x, - *pt = (unsigned long *) &t, - mexp,sign; - -#ifdef national /* ordering of words in a floating points number */ - const int n0=1,n1=0; -#else /* national */ - const int n0=0,n1=1; -#endif /* national */ - - mexp=px[n0]&0x7ff00000; - if(mexp==0x7ff00000) return(x); /* cbrt(NaN,INF) is itself */ - if(x==0.0) return(x); /* cbrt(0) is itself */ - - sign=px[n0]&0x80000000; /* sign= sign(x) */ - px[n0] ^= sign; /* x=|x| */ - - - /* rough cbrt to 5 bits */ - if(mexp==0) /* subnormal number */ - {pt[n0]=0x43500000; /* set t= 2**54 */ - t*=x; pt[n0]=pt[n0]/3+B2; - } - else - pt[n0]=px[n0]/3+B1; - - - /* new cbrt to 23 bits, may be implemented in single precision */ - r=t*t/x; - s=C+r*t; - t*=G+F/(s+E+D/s); - - /* chopped to 20 bits and make it larger than cbrt(x) */ - pt[n1]=0; pt[n0]+=0x00000001; - - - /* one step newton iteration to 53 bits with error less than 0.667 ulps */ - s=t*t; /* t*t is exact */ - r=x/s; - w=t+t; - r=(r-t)/(w+r); /* r-t is exact */ - t=t+t*r; - - - /* retore the sign bit */ - pt[n0] |= sign; - return(t); -} -#endif diff --git a/sysdeps/ieee754/drem.c b/sysdeps/ieee754/drem.c deleted file mode 100644 index cab3a04535..0000000000 --- a/sysdeps/ieee754/drem.c +++ /dev/null @@ -1,107 +0,0 @@ -/* Copyright (C) 1992, 1995 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -/* - * Copyright (c) 1985 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted provided - * that: (1) source distributions retain this entire copyright notice and - * comment, and (2) distributions including binaries display the following - * acknowledgement: ``This product includes software developed by the - * University of California, Berkeley and its contributors'' in the - * documentation or other materials provided with the distribution and in - * all advertising materials mentioning features or use of this software. - * 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 ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#include <ansidecl.h> -#include <math.h> -#include <float.h> -#include "ieee754.h" - -/* Return the remainder of X/Y. */ -double -DEFUN(__drem, (x, y), - double x AND double y) -{ - union ieee754_double ux, uy; - - ux.d = x; - uy.d = y; -#define x ux.d -#define y uy.d - - uy.ieee.negative = 0; - - if (!__finite (x) || y == 0.0) - return NAN; - else if (__isnan (y)) - return y; - else if (__isinf (y)) - return x; - else if (uy.ieee.exponent <= 1) - { - /* Subnormal (or almost subnormal) Y value. */ - double b = __scalb (1.0, 54); - y *= b; - x = __drem (x, y); - x *= b; - return __drem (x, y) / b; - } - else if (y >= 1.7e308 / 2) - { - y /= 2; - x /= 2; - return __drem (x, y) * 2; - } - else - { - union ieee754_double a; - double b; - unsigned int negative = ux.ieee.negative; - a.d = y + y; - b = y / 2; - ux.ieee.negative = 0; - while (x > a.d) - { - unsigned short int k = ux.ieee.exponent - a.ieee.exponent; - union ieee754_double tmp; - tmp.d = a.d; - tmp.ieee.exponent += k; - if (x < tmp.d) - --tmp.ieee.exponent; - x -= tmp.d; - } - if (x > b) - { - x -= y; - if (x >= b) - x -= y; - } - ux.ieee.negative ^= negative; - return x; - } -} - -weak_alias (__drem, drem) diff --git a/sysdeps/ieee754/logb.c b/sysdeps/ieee754/logb.c deleted file mode 100644 index 918de9ebad..0000000000 --- a/sysdeps/ieee754/logb.c +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (C) 1992, 1995 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#include <ansidecl.h> -#include <math.h> -#include <float.h> -#include "ieee754.h" - -/* Return the base 2 signed integral exponent of X. */ -double -DEFUN(__logb, (x), double x) -{ - union ieee754_double u; - - if (__isnan (x)) - return x; - else if (__isinf (x)) - return HUGE_VAL; - else if (x == 0.0) - return - HUGE_VAL; - - u.d = x; - - if (u.ieee.exponent == 0) - /* A denormalized number. - Multiplying by 2 ** DBL_MANT_DIG normalizes it; - we then subtract the DBL_MANT_DIG we added to the exponent. */ - return (__logb (x * ldexp (1.0, DBL_MANT_DIG)) - DBL_MANT_DIG); - - return (int) u.ieee.exponent - (DBL_MAX_EXP - 1); -} - -weak_alias (__logb, logb) diff --git a/sysdeps/ieee754/sqrt.c b/sysdeps/ieee754/sqrt.c deleted file mode 100644 index 7e350e0d91..0000000000 --- a/sysdeps/ieee754/sqrt.c +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 1985 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted provided - * that: (1) source distributions retain this entire copyright notice and - * comment, and (2) distributions including binaries display the following - * acknowledgement: ``This product includes software developed by the - * University of California, Berkeley and its contributors'' in the - * documentation or other materials provided with the distribution and in - * all advertising materials mentioning features or use of this software. - * 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 ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#include <ansidecl.h> -#include <errno.h> -#include <math.h> - -/* Return the square root of X. */ -double -DEFUN (sqrt, (x), double x) -{ - double q, s, b, r, t; - CONST double zero = 0.0; - int m, n, i; - - /* sqrt (NaN) is NaN; sqrt (+-0) is +-0. */ - if (__isnan (x) || x == zero) - return x; - - if (x < zero) - return zero / zero; - - /* sqrt (Inf) is Inf. */ - if (__isinf (x)) - return x; - - /* Scale X to [1,4). */ - n = __logb (x); - x = __scalb (x, -n); - m = __logb (x); - if (m != 0) - /* Subnormal number. */ - x = __scalb (x, -m); - - m += n; - n = m / 2; - - if ((n + n) != m) - { - x *= 2; - --m; - n = m / 2; - } - - /* Generate sqrt (X) bit by bit (accumulating in Q). */ - q = 1.0; - s = 4.0; - x -= 1.0; - r = 1; - for (i = 1; i <= 51; i++) - { - t = s + 1; - x *= 4; - r /= 2; - if (t <= x) - { - s = t + t + 2, x -= t; - q += r; - } - else - s *= 2; - } - - /* Generate the last bit and determine the final rounding. */ - r /= 2; - x *= 4; - if (x == zero) - goto end; - (void) (100 + r); /* Trigger inexact flag. */ - if (s < x) - { - q += r; - x -= s; - s += 2; - s *= 2; - x *= 4; - t = (x - s) - 5; - b = 1.0 + 3 * r / 4; - if (b == 1.0) - goto end; /* B == 1: Round to zero. */ - b = 1.0 + r / 4; - if (b > 1.0) - t = 1; /* B > 1: Round to +Inf. */ - if (t >= 0) - q += r; - } /* Else round to nearest. */ - else - { - s *= 2; - x *= 4; - t = (x - s) - 1; - b = 1.0 + 3 * r / 4; - if (b == 1.0) - goto end; - b = 1.0 + r / 4; - if (b > 1.0) - t = 1; - if (t >= 0) - q += r; - } - -end: - return __scalb (q, n); -} diff --git a/sysdeps/m68k/fpu/__math.h b/sysdeps/m68k/fpu/__math.h index 2cbb4ca388..4992aea561 100644 --- a/sysdeps/m68k/fpu/__math.h +++ b/sysdeps/m68k/fpu/__math.h @@ -20,7 +20,7 @@ Cambridge, MA 02139, USA. */ #include <sys/cdefs.h> -#ifdef __NO_MATH_INLINES +#ifdef __NO_M81_MATH_INLINES /* This is used when defining the functions themselves. Define them with __ names, and with `static inline' instead of `extern inline' so the bodies will always be used, never an external function call. */ @@ -29,7 +29,7 @@ Cambridge, MA 02139, USA. */ #else #define __m81_u(x) x #define __m81_inline extern __inline -#define __MATH_INLINES 1 +#define __M81_MATH_INLINES 1 #endif /* Define a const math function. */ diff --git a/sysdeps/m68k/fpu/e_acos.c b/sysdeps/m68k/fpu/e_acos.c index ae77dabf98..61c374d917 100644 --- a/sysdeps/m68k/fpu/e_acos.c +++ b/sysdeps/m68k/fpu/e_acos.c @@ -16,8 +16,9 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> +#define __NO_M81_MATH_INLINES #include <math.h> +#include "math_private.h" #ifndef FUNC #define FUNC __ieee754_acos @@ -27,7 +28,8 @@ Cambridge, MA 02139, USA. */ #endif float_type -DEFUN(FUNC, (x), float_type x) +FUNC (x) + float_type x; { return __m81_u(FUNC)(x); } diff --git a/sysdeps/m68k/fpu/e_fmod.c b/sysdeps/m68k/fpu/e_fmod.c index 0b2468c06d..bf2f7ed1bb 100644 --- a/sysdeps/m68k/fpu/e_fmod.c +++ b/sysdeps/m68k/fpu/e_fmod.c @@ -16,8 +16,9 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> +#define __NO_M81_MATH_INLINES #include <math.h> +#include "math_private.h" #ifndef FUNC #define FUNC __ieee754_fmod @@ -27,7 +28,9 @@ Cambridge, MA 02139, USA. */ #endif float_type -DEFUN(FUNC, (x, y), float_type x AND float_type y) +FUNC (x, y) + float_type x; + float_type y; { return __m81_u(FUNC)(x, y); } diff --git a/sysdeps/m68k/fpu/k_cos.c b/sysdeps/m68k/fpu/k_cos.c index 61f566f6a1..6bb9090568 100644 --- a/sysdeps/m68k/fpu/k_cos.c +++ b/sysdeps/m68k/fpu/k_cos.c @@ -16,7 +16,9 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#define __NO_M81_MATH_INLINES #include <math.h> +#include "math_private.h" #ifndef FUNC #define FUNC cos diff --git a/sysdeps/m68k/fpu/k_sin.c b/sysdeps/m68k/fpu/k_sin.c index 3eed1d466c..f10c7f9801 100644 --- a/sysdeps/m68k/fpu/k_sin.c +++ b/sysdeps/m68k/fpu/k_sin.c @@ -16,7 +16,9 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#define __NO_M81_MATH_INLINES #include <math.h> +#include "math_private.h" #ifndef FUNC #define FUNC sin @@ -35,7 +37,7 @@ __CONCATX(__kernel_,FUNC) (x, y, iy) { float_type sin_x, cos_x, sin_y, cos_y; if (iy == 0) - return __m81_u_(__CONCATX(__,FUNC)) (x); + return __m81_u(__CONCATX(__,FUNC)) (x); __asm__ __volatile__ ("fsincosx %2,%0:%1" : "=f" (cos_x), "=f" (sin_x) : "f" (x)); __asm__ __volatile__ ("fsincosx %2,%0:%1" : "=f" (cos_y), "=f" (sin_y) diff --git a/sysdeps/m68k/fpu/k_tan.c b/sysdeps/m68k/fpu/k_tan.c index 7f1b729b96..9c222cd6e1 100644 --- a/sysdeps/m68k/fpu/k_tan.c +++ b/sysdeps/m68k/fpu/k_tan.c @@ -16,7 +16,9 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#define __NO_M81_MATH_INLINES #include <math.h> +#include "math_private.h" #ifndef FUNC #define FUNC tan @@ -34,8 +36,8 @@ __CONCATX(__kernel_,FUNC) (x, y, iy) int iy; { float_type tan_x, tan_y; - tan_x = __m81_u_(__CONCATX(__,FUNC)) (x); - tan_y = __m81_u_(__CONCATX(__,FUNC)) (y); + tan_x = __m81_u(__CONCATX(__,FUNC)) (x); + tan_y = __m81_u(__CONCATX(__,FUNC)) (y); if (iy > 0) return (tan_x + tan_y) / (1 - tan_x * tan_y); else diff --git a/sysdeps/m68k/fpu/s_atan.c b/sysdeps/m68k/fpu/s_atan.c index 29717d4395..99b3024326 100644 --- a/sysdeps/m68k/fpu/s_atan.c +++ b/sysdeps/m68k/fpu/s_atan.c @@ -17,6 +17,7 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <ansidecl.h> +#define __NO_M81_MATH_INLINES #include <math.h> #ifndef FUNC diff --git a/sysdeps/m68k/fpu/s_frexp.c b/sysdeps/m68k/fpu/s_frexp.c index 16f30394b2..8b38086e27 100644 --- a/sysdeps/m68k/fpu/s_frexp.c +++ b/sysdeps/m68k/fpu/s_frexp.c @@ -17,6 +17,7 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <ansidecl.h> +#define __NO_M81_MATH_INLINES #include <math.h> #ifndef FUNC diff --git a/sysdeps/m68k/fpu/s_ilogb.c b/sysdeps/m68k/fpu/s_ilogb.c index c80a288949..39c871481d 100644 --- a/sysdeps/m68k/fpu/s_ilogb.c +++ b/sysdeps/m68k/fpu/s_ilogb.c @@ -17,6 +17,7 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <ansidecl.h> +#define __NO_M81_MATH_INLINES #include <math.h> #ifndef FUNC diff --git a/sysdeps/m68k/fpu/s_isinf.c b/sysdeps/m68k/fpu/s_isinf.c index 570a7ba7bb..7d4b1c44a5 100644 --- a/sysdeps/m68k/fpu/s_isinf.c +++ b/sysdeps/m68k/fpu/s_isinf.c @@ -17,6 +17,7 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <ansidecl.h> +#define __NO_M81_MATH_INLINES #include <math.h> #ifndef FUNC diff --git a/sysdeps/m68k/fpu/s_ldexp.c b/sysdeps/m68k/fpu/s_ldexp.c index ea8bfbab88..18f4d43c37 100644 --- a/sysdeps/m68k/fpu/s_ldexp.c +++ b/sysdeps/m68k/fpu/s_ldexp.c @@ -17,6 +17,7 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <ansidecl.h> +#define __NO_M81_MATH_INLINES #include <math.h> #ifndef FUNC diff --git a/sysdeps/m68k/fpu/s_modf.c b/sysdeps/m68k/fpu/s_modf.c index f704260e21..426d847ebd 100644 --- a/sysdeps/m68k/fpu/s_modf.c +++ b/sysdeps/m68k/fpu/s_modf.c @@ -17,6 +17,7 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <ansidecl.h> +#define __NO_M81_MATH_INLINES #include <math.h> #ifndef FUNC diff --git a/sysdeps/m68k/isinfl.c b/sysdeps/m68k/s_isinfl.c index 1b06d47d52..1b06d47d52 100644 --- a/sysdeps/m68k/isinfl.c +++ b/sysdeps/m68k/s_isinfl.c diff --git a/sysdeps/m68k/isnanl.c b/sysdeps/m68k/s_isnanl.c index 38a9616593..38a9616593 100644 --- a/sysdeps/m68k/isnanl.c +++ b/sysdeps/m68k/s_isnanl.c diff --git a/sysdeps/mach/hurd/prof-freq.c b/sysdeps/mach/hurd/prof-freq.c index 5c0d307bdb..a3707033a6 100644 --- a/sysdeps/mach/hurd/prof-freq.c +++ b/sysdeps/mach/hurd/prof-freq.c @@ -1,4 +1,2 @@ /* __profile_frequency is in sysdeps/mach/hurd/profil.c. This file is here as a place-holder to prevent the use of sysdeps/generic/prof-freq.c. */ -/* __profile_frequency is in sysdeps/mach/hurd/profil.c. This file -is here as a place-holder to prevent the use of sysdeps/generic/prof-freq.c. */ diff --git a/sysdeps/sparc/sqrt.c b/sysdeps/sparc/e_sqrt.c index bff46e1644..614965d047 100644 --- a/sysdeps/sparc/sqrt.c +++ b/sysdeps/sparc/e_sqrt.c @@ -26,7 +26,7 @@ Cambridge, MA 02139, USA. */ /* Return the square root of X. */ double -DEFUN(sqrt, (x), double x) +DEFUN(__ieee754_sqrt, (x), double x) { register double result; asm("fsqrtd %1, %0" : "=f" (result) : "f" (x)); diff --git a/sysdeps/stub/cbrt.c b/sysdeps/stub/cbrt.c deleted file mode 100644 index a330b051e5..0000000000 --- a/sysdeps/stub/cbrt.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 1992, 1995 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#include <ansidecl.h> -#include <errno.h> -#include <math.h> - -/* Return the cube root of X. */ -double -DEFUN(cbrt, (x), double x) -{ - errno = ENOSYS; - return 0.0; -} - - -stub_warning (cbrt) diff --git a/sysdeps/stub/cos.c b/sysdeps/stub/cos.c deleted file mode 100644 index 81cf1b603f..0000000000 --- a/sysdeps/stub/cos.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#include <ansidecl.h> -#include <errno.h> -#include <math.h> - -/* Return the cosine of X. */ -double -DEFUN(cos, (x), double x) -{ - errno = ENOSYS; - return(0.0); -} - - -stub_warning (cos) diff --git a/sysdeps/stub/drem.c b/sysdeps/stub/drem.c deleted file mode 100644 index e4c7ceaa73..0000000000 --- a/sysdeps/stub/drem.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (C) 1992, 1995 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#include <ansidecl.h> -#include <errno.h> -#include <math.h> - -/* Return the remainder of X/Y. */ -double -DEFUN(__drem, (x, y), - double x AND double y) -{ - errno = ENOSYS; - return 0.0; -} - -stub_warning (drem) -weak_alias (__drem, drem) diff --git a/sysdeps/stub/isinf.c b/sysdeps/stub/isinf.c deleted file mode 100644 index aa02eb19e3..0000000000 --- a/sysdeps/stub/isinf.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#include <ansidecl.h> -#include <math.h> - -/* Return 0 if VALUE is finite or NaN, +1 if it - is +Infinity, -1 if it is -Infinity. */ -int -DEFUN(__isinf, (value), double value) -{ - return 0; -} -weak_alias (__isinf, isinf) - -stub_warning (__isinf) diff --git a/sysdeps/stub/isinfl.c b/sysdeps/stub/isinfl.c deleted file mode 100644 index 71065c77fa..0000000000 --- a/sysdeps/stub/isinfl.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (C) 1995 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#include <math.h> - -#undef __isinfl -#undef isinfl - - -/* Return 0 if VALUE is finite or NaN, +1 if it - is +Infinity, -1 if it is -Infinity. */ -int -__isinfl (long double value) -{ - return 0; -} - -weak_alias (__isinfl, isinfl); diff --git a/sysdeps/stub/isnanl.c b/sysdeps/stub/isnanl.c deleted file mode 100644 index c785b351b8..0000000000 --- a/sysdeps/stub/isnanl.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (C) 1995 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#include <math.h> - -#undef __isnanl -#undef isnanl - - -/* Return nonzero if VALUE is not a number. */ - -int -__isnanl (long double value) -{ - return 0; -} - -weak_alias (__isnanl, isnanl); diff --git a/sysdeps/stub/logb.c b/sysdeps/stub/logb.c deleted file mode 100644 index f5af6bfa05..0000000000 --- a/sysdeps/stub/logb.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright (C) 1992, 1995 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#include <ansidecl.h> -#include <math.h> -#include <errno.h> - -/* Return the base 2 signed integral exponent of X. */ -double -DEFUN(__logb, (x), double x) -{ - errno = ENOSYS; - return 0.0; -} -stub_warning (logb) -weak_alias (__logb, logb) diff --git a/sysdeps/stub/sin.c b/sysdeps/stub/sin.c deleted file mode 100644 index 7100661dbb..0000000000 --- a/sysdeps/stub/sin.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#include <ansidecl.h> -#include <errno.h> -#include <math.h> - -/* Return the sine of X. */ -double -DEFUN(sin, (x), double x) -{ - errno = ENOSYS; - return(0.0); -} - - -stub_warning (sin) diff --git a/sysdeps/stub/sqrt.c b/sysdeps/stub/sqrt.c deleted file mode 100644 index 8ca345972e..0000000000 --- a/sysdeps/stub/sqrt.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#include <ansidecl.h> -#include <errno.h> -#include <math.h> - -/* Return the square root of X. */ -double -DEFUN(sqrt, (x), double x) -{ - errno = ENOSYS; - return(0.0); -} - - -stub_warning (sqrt) diff --git a/sysdeps/tahoe/log10.c b/sysdeps/tahoe/log10.c deleted file mode 100644 index 2cf2cee58b..0000000000 --- a/sysdeps/tahoe/log10.c +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright (C) 1991 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#define FPCONST(hi0, lo0, hi1, lo1) { (hi0), (lo0), (hi1), (lo1) } - -#include <../sysdeps/vax/log10.c> - diff --git a/sysdeps/unix/sysv/linux/alpha/Dist b/sysdeps/unix/sysv/linux/alpha/Dist index d898d041a2..d79f1f2970 100644 --- a/sysdeps/unix/sysv/linux/alpha/Dist +++ b/sysdeps/unix/sysv/linux/alpha/Dist @@ -4,3 +4,4 @@ ioperm.c init-first.h clone.S sys/io.h +llseek.S diff --git a/sysdeps/unix/sysv/linux/i386/init-first.h b/sysdeps/unix/sysv/linux/i386/init-first.h deleted file mode 100644 index 4c61f1b41e..0000000000 --- a/sysdeps/unix/sysv/linux/i386/init-first.h +++ /dev/null @@ -1,27 +0,0 @@ -/* The job of this fragment it to find argc and friends for INIT. - This is done in one of two ways: either in the stack context - of program start, or having dlopen pass them in. */ - -#define SYSDEP_CALL_INIT(NAME, INIT) \ -void NAME (void *arg) \ -{ \ - int argc; \ - char **argv, **envp; \ - \ - __libc_multiple_libcs = &_dl_starting_up && !_dl_starting_up; \ - \ - if (!__libc_multiple_libcs) \ - { \ - argc = (int) arg; \ - argv = (char **) &arg + 1; \ - envp = &argv[argc+1]; \ - } \ - else \ - { \ - argc = (int) arg; \ - argv = ((char ***) &arg)[1]; \ - envp = ((char ***) &arg)[2]; \ - } \ - \ - INIT (argc, argv, envp); \ -} diff --git a/sysdeps/unix/sysv/linux/m68k/init-first.h b/sysdeps/unix/sysv/linux/m68k/init-first.h deleted file mode 100644 index 7d8c320b0a..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/init-first.h +++ /dev/null @@ -1,12 +0,0 @@ -/* This fragment is invoked in the stack context of program start. - Its job is to set up a pointer to argc as an argument, pass - control to `INIT', and, if necessary, clean up after the call - to leave the stack in the same condition it was found in. */ - -#define SYSDEP_CALL_INIT(NAME, INIT) \ - asm(".globl " #NAME "\n\t" \ - #NAME ":\n\t" \ - "pea %sp@(4)\n\t" \ - "jbsr " #INIT "\n\t" \ - "addq #4,%sp\n\t" \ - "rts"); diff --git a/sysdeps/vax/Dist b/sysdeps/vax/Dist index 9830be29a4..22a693094a 100644 --- a/sysdeps/vax/Dist +++ b/sysdeps/vax/Dist @@ -1 +1,2 @@ DEFS.h +fl.h diff --git a/sysdeps/vax/bcmp.s b/sysdeps/vax/bcmp.s deleted file mode 100644 index d980feb8e4..0000000000 --- a/sysdeps/vax/bcmp.s +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 1983 Regents of the University of California. - * All rights reserved. - * - * 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. - */ - -#if defined(LIBC_SCCS) && !defined(lint) - .asciz "@(#)bcmp.s 5.6 (Berkeley) 6/1/90" -#endif /* LIBC_SCCS and not lint */ - -/* bcmp(s1, s2, n) */ - -#include "DEFS.h" - -ENTRY(bcmp, 0) - movl 4(ap),r1 - movl 8(ap),r3 - movl 12(ap),r4 -1: - movzwl $65535,r0 - cmpl r4,r0 - jleq 2f - subl2 r0,r4 - cmpc3 r0,(r1),(r3) - jeql 1b - addl2 r4,r0 - ret -2: - cmpc3 r4,(r1),(r3) - ret diff --git a/sysdeps/vax/index.s b/sysdeps/vax/index.s deleted file mode 100644 index e599b276f0..0000000000 --- a/sysdeps/vax/index.s +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 1980 Regents of the University of California. - * All rights reserved. - * - * 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. - */ - -#if defined(LIBC_SCCS) && !defined(lint) - .asciz "@(#)index.s 5.6 (Berkeley) 6/1/90" -#endif /* LIBC_SCCS and not lint */ - -/* - * Find the first occurence of c in the string cp. - * Return pointer to match or null pointer. - * - * char * - * index(cp, c) - * char *cp, c; - */ -#include "DEFS.h" - -ENTRY(index, 0) - movq 4(ap),r1 # r1 = cp; r2 = c - tstl r2 # check for special case c == '\0' - bneq 2f -1: - locc $0,$65535,(r1) # just find end of string - beql 1b # still looking - movl r1,r0 # found it - ret -2: - moval tbl,r3 # r3 = address of table - bbss $0,(r3),5f # insure not reentering - movab (r3)[r2],r5 # table entry for c - incb (r5) - movzwl $65535,r4 # fast access -3: - scanc r4,(r1),(r3),$1 # look for c or '\0' - beql 3b # still looking - movl r1,r0 # return pointer to char - tstb (r0) # if have found '\0' - bneq 4f - clrl r0 # else return 0 -4: - clrb (r5) # clean up table - clrb (r3) - ret - - .data -tbl: .space 256 - .text - -/* - * Reentrant, but slower version of index - */ -5: - movl r1,r3 -6: - locc $0,$65535,(r3) # look for '\0' - bneq 7f - locc r2,$65535,(r3) # look for c - bneq 8f - movl r1,r3 # reset pointer and ... - jbr 6b # ... try again -7: - subl3 r3,r1,r4 # length of short block - incl r4 # +1 for '\0' - locc r2,r4,(r3) # look for c - bneq 8f - ret -8: - movl r1,r0 # return pointer to char - ret diff --git a/sysdeps/vax/infnan.c b/sysdeps/vax/infnan.c deleted file mode 100644 index 62ec9dca0f..0000000000 --- a/sysdeps/vax/infnan.c +++ /dev/null @@ -1,62 +0,0 @@ -/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#ifndef __GNUC__ - #error This file uses GNU C extensions; you must compile with GCC. -#else - -#include <ansidecl.h> -#include <errno.h> -#include <math.h> - -/* Deal with an infinite or NaN result. - If ERROR is ERANGE, result is +Inf; - if ERROR is - ERANGE, result is -Inf; - otherwise result is NaN. - This will set `errno' to either ERANGE or EDOM, - and may return an infinity or NaN, or may do something else. */ -double -DEFUN(__infnan, (error), int error) -{ - switch (error) - { - case ERANGE: - errno = ERANGE; - break; - - case - ERANGE: - errno = ERANGE; - break; - - default: - errno = EDOM; - break; - } - - /* Trigger a reserved operand fault. */ - { - double result; - asm volatile("emodd %1, %1, %2, %0, %0" : "=r" (result) : - "i" (0), "i" (0x8000)); - return result; - } -} - -#endif - -weak_alias (__infnan, infnan) diff --git a/sysdeps/vax/log10.c b/sysdeps/vax/log10.c deleted file mode 100644 index 08741779eb..0000000000 --- a/sysdeps/vax/log10.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright (C) 1991 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#include <ansidecl.h> - -#ifndef FPCONST -#define FPCONST(hi0, lo0, hi1, lo1) { (lo0), (hi0), (lo1), (hi1) } -#endif - -static CONST short int ln10[] = FPCONST(0x4113, 0x5d8d, 0xddaa, 0xa8ac); -#define LN10 (*(CONST double *) ln10) - -#include <../sysdeps/generic/log10.c> diff --git a/sysdeps/vax/memcmp.s b/sysdeps/vax/memcmp.s index 3854fd8e4a..f7e47ded46 100644 --- a/sysdeps/vax/memcmp.s +++ b/sysdeps/vax/memcmp.s @@ -59,3 +59,5 @@ ENTRY(memcmp, 0) cmpc3 r5,(r1),(r3) jeql 0b /* loop if same */ jbr 1b + +weak_alias (memcmp, bcmp) diff --git a/sysdeps/vax/rindex.s b/sysdeps/vax/rindex.s deleted file mode 100644 index 76d7e29597..0000000000 --- a/sysdeps/vax/rindex.s +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 1983 Regents of the University of California. - * All rights reserved. - * - * 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. - */ - -#if defined(LIBC_SCCS) && !defined(lint) - .asciz "@(#)rindex.s 5.6 (Berkeley) 6/1/90" -#endif /* LIBC_SCCS and not lint */ - -/* - * Find the last occurence of c in the string cp. - * Return pointer to match or null pointer. - * - * char * - * rindex(cp, c) - * char *cp, c; - */ -#include "DEFS.h" - -ENTRY(rindex, 0) - movq 4(ap),r1 # r1 = cp; r2 = c - tstl r2 # check for special case c == '\0' - bneq 2f -1: - locc $0,$65535,(r1) # just find end of string - beql 1b # still looking - movl r1,r0 # found it - ret -2: - moval tbl,r3 # r3 = address of table - bbss $0,(r3),5f # insure not reentering - movab (r3)[r2],r5 # table entry for c - incb (r5) - clrl r4 # last found -3: - scanc $65535,(r1),(r3),$1 # look for c or '\0' - beql 3b # keep looking - tstb (r1) # if have found '\0' - beql 4f # we are done - movl r1,r4 # save most recently found - incl r1 # skip over character - jbr 3b # keep looking -4: - movl r4,r0 # return last found (if any) - clrb (r5) # clean up table - clrb (r3) - ret - - .data -tbl: .space 256 - .text - -/* - * Reentrant, but slower version of rindex - */ -5: - movl r1,r3 - clrl r4 # r4 = pointer to last match -6: - locc $0,$65535,(r3) # look for '\0' - bneq 8f - decw r0 # r0 = 65535 -1: - locc r2,r0,(r3) # look for c - bneq 7f - movl r1,r3 # reset pointer and ... - jbr 6b # ... try again -7: - movl r1,r4 # stash pointer ... - addl3 $1,r1,r3 # ... skip over match and ... - decl r0 # ... decrement count - jbr 6b # ... try again -8: - subl3 r3,r1,r0 # length of short block - incl r0 # +1 for '\0' -9: - locc r2,r0,(r3) # look for c - beql 0f - movl r1,r4 # stash pointer ... - addl3 $1,r1,r3 # ... skip over match ... - decl r0 # ... adjust count and ... - jbr 9b # ... try again -0: - movl r4,r0 # return stashed pointer - ret diff --git a/sysdeps/vax/strchr.s b/sysdeps/vax/strchr.s index 18b53838ec..1683f564e2 100644 --- a/sysdeps/vax/strchr.s +++ b/sysdeps/vax/strchr.s @@ -103,3 +103,5 @@ Lreent: beql 2f /* not found: return NULL */ movl r1,r0 2: ret + +weak_alias (strchr, index) diff --git a/sysdeps/vax/strrchr.s b/sysdeps/vax/strrchr.s index f292eaceab..dffcddaef0 100644 --- a/sysdeps/vax/strrchr.s +++ b/sysdeps/vax/strrchr.s @@ -112,3 +112,5 @@ Lreent: 3: movl r5,r0 /* return stashed pointer */ ret + +weak_alias (strrchr, rindex) |