From 51702635af8445431054291c86aaace7c30b0970 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 7 May 1997 15:31:21 +0000 Subject: Update. * locale/categories.def: Change type of _NL_CTYPE_CLASS_NAMES and _NL_CTYPE_MAP_NAMES field to stringlist. Change name of _NL_CTYPE_CODESET_NAME to "charmap". * locale/localeinfo.h (enum value_type): Add stringlist. * locale/programs/locale.c (show_info): Handle stringlist. * locale/programs/charmap.c (charmap_read): If charmap file is not using the given name try to find it by looking through all available charmap files and compare the code set name. * locale/programs/locale.c (write_charmaps): Also print names of charset in fields in the files. * elf/ldd.bash.in: Correct translatable strings. * posix/TESTS: Add some more tests for character class matching. * posix/regex.c: Merge with GNU awk version. (regex_compile): Use ISO C/amend 1 functions for character class handling. * posix/regex.h: Merge with GNU awk version. * posix/getopt.c: Declare as master copies. * posix/getopt1.c: Likewise. * posix/getopt.h: Likewise. * sysdeps/unix/sysv/linux/sys/mount.h: Add definitions for option value to mount functions. Patch by a sun . * stdio-common/bug4.c (main): Use /tmp/bug4.test for concurrency with other tests. * sunrpc/svc_run.c (svc_exit): New, defined. (svc_run): Test for svc_stop variable. * sysdeps/m68k/s_cexp.c: Rewritten. * sysdeps/m68k/s_cexpf.c: Likewise. * sysdeps/m68k/s_cexpl.c: Likewise. --- sysdeps/libm-ieee754/e_acoshl.c | 2 +- sysdeps/libm-ieee754/e_atan2l.c | 6 +- sysdeps/libm-ieee754/e_atanhl.c | 2 +- sysdeps/libm-ieee754/e_sinhl.c | 2 +- sysdeps/m68k/fpu/__math.h | 21 +++++- sysdeps/m68k/fpu/e_pow.c | 32 +++++---- sysdeps/m68k/fpu/s_ccos.c | 73 +++++++++++++++++++++ sysdeps/m68k/fpu/s_ccosf.c | 3 + sysdeps/m68k/fpu/s_ccosh.c | 85 +++++++----------------- sysdeps/m68k/fpu/s_ccoshf.c | 1 - sysdeps/m68k/fpu/s_ccoshl.c | 1 - sysdeps/m68k/fpu/s_ccosl.c | 3 + sysdeps/m68k/fpu/s_cexp.c | 119 ++++++++++++++++------------------ sysdeps/m68k/fpu/s_cexpf.c | 1 - sysdeps/m68k/fpu/s_cexpl.c | 1 - sysdeps/m68k/fpu/s_csin.c | 69 ++++++++++++++++++++ sysdeps/m68k/fpu/s_csinf.c | 3 + sysdeps/m68k/fpu/s_csinh.c | 91 +++++--------------------- sysdeps/m68k/fpu/s_csinhf.c | 1 - sysdeps/m68k/fpu/s_csinhl.c | 1 - sysdeps/m68k/fpu/s_csinl.c | 3 + sysdeps/unix/sysv/linux/abi-tag.h | 8 ++- sysdeps/unix/sysv/linux/alpha/brk.S | 12 +++- sysdeps/unix/sysv/linux/alpha/clone.S | 13 +++- sysdeps/unix/sysv/linux/sys/mount.h | 70 +++++++++++++++++++- 25 files changed, 386 insertions(+), 237 deletions(-) create mode 100644 sysdeps/m68k/fpu/s_ccos.c create mode 100644 sysdeps/m68k/fpu/s_ccosf.c create mode 100644 sysdeps/m68k/fpu/s_ccosl.c create mode 100644 sysdeps/m68k/fpu/s_csin.c create mode 100644 sysdeps/m68k/fpu/s_csinf.c create mode 100644 sysdeps/m68k/fpu/s_csinl.c (limited to 'sysdeps') diff --git a/sysdeps/libm-ieee754/e_acoshl.c b/sysdeps/libm-ieee754/e_acoshl.c index 7b7bea7..a60704a 100644 --- a/sysdeps/libm-ieee754/e_acoshl.c +++ b/sysdeps/libm-ieee754/e_acoshl.c @@ -53,7 +53,7 @@ ln2 = 6.931471805599453094287e-01L; /* 0x3FFE, 0xB17217F7, 0xD1CF79AC */ long double t; u_int32_t se,i0,i1; GET_LDOUBLE_WORDS(se,i0,i1,x); - if(se<0x3fff) { /* x < 1 */ + if(se<0x3fff || se & 0x8000) { /* x < 1 */ return (x-x)/(x-x); } else if(se >=0x401b) { /* x > 2**28 */ if(se >=0x7fff) { /* x is inf of NaN */ diff --git a/sysdeps/libm-ieee754/e_atan2l.c b/sysdeps/libm-ieee754/e_atan2l.c index e60f2d4..72d3eac 100644 --- a/sysdeps/libm-ieee754/e_atan2l.c +++ b/sysdeps/libm-ieee754/e_atan2l.c @@ -73,10 +73,10 @@ pi_lo = -5.01655761266833202345176e-20L;/* 0xBFBE, 0xECE675D1, 0xFC8F8CBB */ EXTRACT_LDOUBLE_WORDS(sx,hx,lx,x); ix = sx&0x7fff; - lx |= hx ^ 0x80000000; + lx |= hx & 0x7fffffff; EXTRACT_LDOUBLE_WORDS(sy,hy,ly,y); iy = sy&0x7fff; - ly |= hy ^ 0x80000000; + ly |= hy & 0x7fffffff; if(((2*ix|((lx|-lx)>>31))>0xfffe)|| ((2*iy|((ly|-ly)>>31))>0xfffe)) /* x or y is NaN */ return x+y; @@ -114,7 +114,7 @@ pi_lo = -5.01655761266833202345176e-20L;/* 0xBFBE, 0xECE675D1, 0xFC8F8CBB */ } } /* when y is INF */ - if(iy==0x7fff) return (hy>=0x8000)? -pi_o_2-tiny: pi_o_2+tiny; + if(iy==0x7fff) return (sy>=0x8000)? -pi_o_2-tiny: pi_o_2+tiny; /* compute y/x */ k = sy-sx; diff --git a/sysdeps/libm-ieee754/e_atanhl.c b/sysdeps/libm-ieee754/e_atanhl.c index 0e6dadd..fdcd1e9 100644 --- a/sysdeps/libm-ieee754/e_atanhl.c +++ b/sysdeps/libm-ieee754/e_atanhl.c @@ -75,5 +75,5 @@ static double long zero = 0.0; t = 0.5*__log1pl(t+t*x/(one-x)); } else t = 0.5*__log1pl((x+x)/(one-x)); - if(se>0x7fff) return t; else return -t; + if(se<=0x7fff) return t; else return -t; } diff --git a/sysdeps/libm-ieee754/e_sinhl.c b/sysdeps/libm-ieee754/e_sinhl.c index f9ccc6f..4f9cfe2 100644 --- a/sysdeps/libm-ieee754/e_sinhl.c +++ b/sysdeps/libm-ieee754/e_sinhl.c @@ -63,7 +63,7 @@ static long double one = 1.0, shuge = 1.0e4931L; if(ix==0x7fff) return x+x; h = 0.5; - if (jx<0) h = -h; + if (jx & 0x8000) h = -h; /* |x| in [0,25], return sign(x)*0.5*(E+E/(E+1))) */ if (ix < 0x4003 || (ix == 0x4003 && i0 <= 0xc8000000)) { /* |x|<25 */ if (ix<0x3fe3) /* |x|<2**-28 */ diff --git a/sysdeps/m68k/fpu/__math.h b/sysdeps/m68k/fpu/__math.h index 92487f9..5dc4d2e 100644 --- a/sysdeps/m68k/fpu/__math.h +++ b/sysdeps/m68k/fpu/__math.h @@ -153,6 +153,21 @@ __internal_inline_functions (float,f) __internal_inline_functions (long double,l) #undef __internal_inline_functions +/* Get the m68881 condition codes, to quickly check multiple conditions. */ +static __inline__ unsigned long +__m81_test (long double __val) +{ + unsigned long __fpsr; + __asm ("ftst%.x %1; fmove%.l %/fpsr,%0" : "=dm" (__fpsr) : "f" (__val)); + return __fpsr; +} + +/* Bit values returned by __m81_test. */ +#define __M81_COND_NAN (1 << 24) +#define __M81_COND_INF (2 << 24) +#define __M81_COND_ZERO (4 << 24) +#define __M81_COND_NEG (8 << 24) + #endif /* __LIBC_M81_MATH_INLINES */ /* The rest of the functions are available to the user. */ @@ -163,8 +178,12 @@ __m81_u(__CONCAT(__frexp,s))(float_type __value, int *__expptr) \ { \ float_type __mantissa, __exponent; \ int __iexponent; \ - if (__value == 0.0) \ + unsigned long __fpsr; \ + __asm("ftst%.x %1\n" \ + "fmove%.l %/fpsr, %0" : "=dm" (__fpsr) : "f" (__value)); \ + if (__fpsr & (7 << 24)) \ { \ + /* Not finite or zero. */ \ *__expptr = 0; \ return __value; \ } \ diff --git a/sysdeps/m68k/fpu/e_pow.c b/sysdeps/m68k/fpu/e_pow.c index a39b63d..b3d151f 100644 --- a/sysdeps/m68k/fpu/e_pow.c +++ b/sysdeps/m68k/fpu/e_pow.c @@ -36,29 +36,33 @@ s(__ieee754_pow) (float_type x, float_type y) { float_type z; float_type ax; + unsigned long x_cond, y_cond; - if (y == 0.0) + y_cond = __m81_test (y); + if (y_cond & __M81_COND_ZERO) return 1.0; - if (x != x || y != y) + + x_cond = __m81_test (x); + if ((x_cond | y_cond) & __M81_COND_NAN) return x + y; - if (m81(__isinf) (y)) + if (y_cond & __M81_COND_INF) { ax = s(fabs) (x); if (ax == 1) - return 0.0/0.0; + return y - y; if (ax > 1) - return y > 0 ? y : 0; + return y_cond & __M81_COND_NEG ? 0 : y; else - return y < 0 ? -y : 0; + return y_cond & __M81_COND_NEG ? -y : 0; } if (s(fabs) (y) == 1) - return y > 0 ? x : 1 / x; + return y_cond & __M81_COND_NEG ? 1 / x : x; if (y == 2) return x * x; - if (y == 0.5 && x >= 0) + if (y == 0.5 && !(x_cond & __M81_COND_NEG)) return m81(__ieee754_sqrt) (x); if (x == 10.0) @@ -73,17 +77,17 @@ s(__ieee754_pow) (float_type x, float_type y) } ax = s(fabs) (x); - if (m81(__isinf) (x) || x == 0 || ax == 1) + if (x_cond & (__M81_COND_INF | __M81_COND_ZERO) || ax == 1) { z = ax; - if (y < 0) + if (y_cond & __M81_COND_NEG) z = 1 / z; - if (m81(__signbit) (x)) + if (x_cond & __M81_COND_NEG) { if (y != m81(__rint) (y)) { if (x == -1) - z = 0.0/0.0; + z = (z - z) / (z - z); } else goto maybe_negate; @@ -91,7 +95,7 @@ s(__ieee754_pow) (float_type x, float_type y) return z; } - if (x < 0.0) + if (x_cond & __M81_COND_NEG) { if (y == m81(__rint) (y)) { @@ -112,7 +116,7 @@ s(__ieee754_pow) (float_type x, float_type y) } } else - z = 0.0/0.0; + z = (y - y) / (y - y); } else z = m81(__ieee754_exp) (y * m81(__ieee754_log) (x)); diff --git a/sysdeps/m68k/fpu/s_ccos.c b/sysdeps/m68k/fpu/s_ccos.c new file mode 100644 index 0000000..53f8286 --- /dev/null +++ b/sysdeps/m68k/fpu/s_ccos.c @@ -0,0 +1,73 @@ +/* Complex cosine function. m68k fpu version + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Andreas Schwab . + + 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., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#define __LIBC_M81_MATH_INLINES +#include +#include + +#ifndef SUFF +#define SUFF +#endif +#ifndef float_type +#define float_type double +#endif + +#define CONCATX(a,b) __CONCAT(a,b) +#define s(name) CONCATX(name,SUFF) +#define m81(func) __m81_u(s(func)) + +__complex__ float_type +s(__ccos) (__complex__ float_type x) +{ + __complex__ float_type retval; + unsigned long rx_cond = __m81_test (__real__ x); + + if ((rx_cond & (__M81_COND_INF|__M81_COND_NAN)) == 0) + { + /* Real part is finite. */ + float_type sin_rx, cos_rx; + + __asm ("fsincos%.x %2,%1:%0" : "=f" (sin_rx), "=f" (cos_rx) + : "f" (__real__ x)); + __real__ retval = cos_rx * m81(__ieee754_cosh) (__imag__ x); + if (rx_cond & __M81_COND_ZERO) + __imag__ retval = (m81(__signbit) (__imag__ x) + ? __real__ x : -__real__ x); + else + __imag__ retval = -sin_rx * m81(__ieee754_sinh) (__imag__ x); + } + else + { + unsigned long ix_cond = __m81_test (__imag__ x); + + if (ix_cond & __M81_COND_INF) + __real__ retval = s(fabs) (__imag__ x); + else + __real__ retval = __real__ x - __real__ x; + if (ix_cond & __M81_COND_ZERO) + __imag__ retval = __imag__ x; + else + __imag__ retval = __real__ x - __real__ x; + } + + return retval; +} +#define weak_aliasx(a,b) weak_alias(a,b) +weak_aliasx (s(__ccos), s(ccos)) diff --git a/sysdeps/m68k/fpu/s_ccosf.c b/sysdeps/m68k/fpu/s_ccosf.c new file mode 100644 index 0000000..f5e8a41 --- /dev/null +++ b/sysdeps/m68k/fpu/s_ccosf.c @@ -0,0 +1,3 @@ +#define SUFF f +#define float_type float +#include diff --git a/sysdeps/m68k/fpu/s_ccosh.c b/sysdeps/m68k/fpu/s_ccosh.c index 439eae1..85e73b8 100644 --- a/sysdeps/m68k/fpu/s_ccosh.c +++ b/sysdeps/m68k/fpu/s_ccosh.c @@ -25,9 +25,6 @@ #ifndef SUFF #define SUFF #endif -#ifndef huge_val -#define huge_val HUGE_VAL -#endif #ifndef float_type #define float_type double #endif @@ -40,78 +37,40 @@ __complex__ float_type s(__ccosh) (__complex__ float_type x) { __complex__ float_type retval; + unsigned long ix_cond = __m81_test (__imag__ x); - __real__ x = s(fabs) (__real__ x); - - if (m81(__finite) (__real__ x)) + if ((ix_cond & (__M81_COND_INF|__M81_COND_NAN)) == 0) { - if (m81(__finite) (__imag__ x)) - { - float_type cosh_val; - float_type sin_ix, cos_ix; + /* Imaginary part is finite. */ + float_type sin_ix, cos_ix; - __asm ("fsincos%.x %2,%1:%0" : "=f" (sin_ix), "=f" (cos_ix) - : "f" (__imag__ x)); - cosh_val = m81(__ieee754_cosh) (__real__ x); - __real__ retval = cos_ix * cosh_val; - __imag__ retval = sin_ix * cosh_val; - } - else if (__real__ x == 0) - { - __imag__ retval = 0.0; - __real__ retval = huge_val - huge_val; - } + __asm ("fsincos%.x %2,%1:%0" : "=f" (sin_ix), "=f" (cos_ix) + : "f" (__imag__ x)); + __real__ retval = cos_ix * m81(__ieee754_cosh) (__real__ x); + if (ix_cond & __M81_COND_ZERO) + __imag__ retval = (m81(__signbit) (__real__ x) + ? -__imag__ x : __imag__ x); else - __real__ retval = __imag__ retval = huge_val - huge_val; + __imag__ retval = sin_ix * m81(__ieee754_sinh) (__real__ x); } - else if (m81(__isinf) (__real__ x)) + else { - if (__imag__ x == 0) - { - __real__ retval = huge_val; - __imag__ retval = __imag__ x; - } - else if (m81(__finite) (__imag__ x)) - { - float_type remainder, pi_2; - int quadrant; - __real__ retval = __imag__ retval = huge_val; + unsigned long rx_cond = __m81_test (__real__ x); - __asm ("fmovecr %#0,%0\n\tfscale%.w %#-1,%0" : "=f" (pi_2)); - __asm ("fmod%.x %2,%0\n\tfmove%.l %/fpsr,%1" - : "=f" (remainder), "=dm" (quadrant) - : "f" (pi_2), "0" (__imag__ x)); - quadrant = (quadrant >> 16) & 0x83; - if (quadrant & 0x80) - quadrant ^= 0x83; - switch (quadrant) - { - default: - break; - case 1: - __real__ retval = -__real__ retval; - break; - case 2: - __real__ retval = -__real__ retval; - case 3: - __imag__ retval = -__imag__ retval; - break; - } + if (rx_cond & __M81_COND_ZERO) + { + __real__ retval = __imag__ x - __imag__ x; + __imag__ retval = __real__ x; } else { - /* The subtraction raises the invalid exception. */ - __real__ retval = huge_val; - __imag__ retval = huge_val - huge_val; + if (rx_cond & __M81_COND_INF) + __real__ retval = s(fabs) (__real__ x); + else + __real__ retval = 0.0/0.0; + __imag__ retval = __imag__ x - __imag__ x; } } - else if (__imag__ x == 0) - { - __real__ retval = 0.0/0.0; - __imag__ retval = __imag__ x; - } - else - __real__ retval = __imag__ retval = 0.0/0.0; return retval; } diff --git a/sysdeps/m68k/fpu/s_ccoshf.c b/sysdeps/m68k/fpu/s_ccoshf.c index 7d07668..3c8e7c7 100644 --- a/sysdeps/m68k/fpu/s_ccoshf.c +++ b/sysdeps/m68k/fpu/s_ccoshf.c @@ -1,4 +1,3 @@ #define SUFF f #define float_type float -#define huge_val HUGE_VALF #include diff --git a/sysdeps/m68k/fpu/s_ccoshl.c b/sysdeps/m68k/fpu/s_ccoshl.c index 6f1d1e5..772d578 100644 --- a/sysdeps/m68k/fpu/s_ccoshl.c +++ b/sysdeps/m68k/fpu/s_ccoshl.c @@ -1,4 +1,3 @@ #define SUFF l #define float_type long double -#define huge_val HUGE_VALL #include diff --git a/sysdeps/m68k/fpu/s_ccosl.c b/sysdeps/m68k/fpu/s_ccosl.c new file mode 100644 index 0000000..aaff365 --- /dev/null +++ b/sysdeps/m68k/fpu/s_ccosl.c @@ -0,0 +1,3 @@ +#define SUFF l +#define float_type long double +#include diff --git a/sysdeps/m68k/fpu/s_cexp.c b/sysdeps/m68k/fpu/s_cexp.c index 4846ec1..86cc894 100644 --- a/sysdeps/m68k/fpu/s_cexp.c +++ b/sysdeps/m68k/fpu/s_cexp.c @@ -25,9 +25,6 @@ #ifndef SUFF #define SUFF #endif -#ifndef huge_val -#define huge_val HUGE_VAL -#endif #ifndef float_type #define float_type double #endif @@ -40,85 +37,79 @@ __complex__ float_type s(__cexp) (__complex__ float_type x) { __complex__ float_type retval; + unsigned long ix_cond; + + ix_cond = __m81_test (__imag__ x); - if (m81(__finite) (__real__ x)) + if ((ix_cond & (__M81_COND_NAN|__M81_COND_INF)) == 0) { - if (m81(__finite) (__imag__ x)) + /* Imaginary part is finite. */ + float_type exp_val = m81(__ieee754_exp) (__real__ x); + + __real__ retval = __imag__ retval = exp_val; + if (m81(__finite) (exp_val)) { - float_type exp_val = m81(__ieee754_exp) (__real__ x); + float_type sin_ix, cos_ix; + __asm ("fsincos%.x %2,%1:%0" : "=f" (sin_ix), "=f" (cos_ix) + : "f" (__imag__ x)); + __real__ retval *= cos_ix; + if (ix_cond & __M81_COND_ZERO) + __imag__ retval = __imag__ x; + else + __imag__ retval *= sin_ix; + } + else + { + /* Compute the sign of the result. */ + float_type remainder, pi_2; + int quadrant; - __real__ retval = __imag__ retval = exp_val; - if (m81(__finite) (exp_val)) + __asm ("fmovecr %#0,%0\n\tfscale%.w %#-1,%0" : "=f" (pi_2)); + __asm ("fmod%.x %2,%0\n\tfmove%.l %/fpsr,%1" + : "=f" (remainder), "=dm" (quadrant) + : "f" (pi_2), "0" (__imag__ x)); + quadrant = (quadrant >> 16) & 0x83; + if (quadrant & 0x80) + quadrant ^= 0x83; + switch (quadrant) { - float_type sin_ix, cos_ix; - __asm ("fsincos%.x %2,%1:%0" : "=f" (sin_ix), "=f" (cos_ix) - : "f" (__imag__ x)); - __real__ retval *= cos_ix; - __imag__ retval *= sin_ix; + default: + break; + case 1: + __real__ retval = -__real__ retval; + break; + case 2: + __real__ retval = -__real__ retval; + case 3: + __imag__ retval = -__imag__ retval; + break; } - else - goto fix_sign; + if (ix_cond & __M81_COND_ZERO && !m81(__isnan) (exp_val)) + __imag__ retval = __imag__ x; } - else - /* If the imaginary part is +-inf or NaN and the real part is - not +-inf the result is NaN + iNaN. */ - __real__ retval = __imag__ retval = 0.0/0.0; } - else if (m81(__isinf) (__real__ x)) + else { - if (m81(__finite) (__imag__ x)) - { - float_type value = m81(__signbit) (__real__ x) ? 0.0 : huge_val; + unsigned long rx_cond = __m81_test (__real__ x); - if (__imag__ x == 0.0) + if (rx_cond & __M81_COND_INF) + { + /* Real part is infinite. */ + if (rx_cond & __M81_COND_NEG) { - __real__ retval = value; - __imag__ retval = __imag__ x; + __real__ retval = __imag__ retval = 0.0; + if (ix_cond & __M81_COND_NEG) + __imag__ retval = -__imag__ retval; } else { - float_type remainder, pi_2; - int quadrant; - __real__ retval = value; - __imag__ retval = value; - - fix_sign: - __asm ("fmovecr %#0,%0\n\tfscale%.w %#-1,%0" : "=f" (pi_2)); - __asm ("fmod%.x %2,%0\n\tfmove%.l %/fpsr,%1" - : "=f" (remainder), "=dm" (quadrant) - : "f" (pi_2), "0" (__imag__ x)); - quadrant = (quadrant >> 16) & 0x83; - if (quadrant & 0x80) - quadrant ^= 0x83; - switch (quadrant) - { - default: - break; - case 1: - __real__ retval = -__real__ retval; - break; - case 2: - __real__ retval = -__real__ retval; - case 3: - __imag__ retval = -__imag__ retval; - break; - } + __real__ retval = __real__ x; + __imag__ retval = __imag__ x - __imag__ x; } } - else if (m81(__signbit) (__real__ x) == 0) - { - __real__ retval = huge_val; - __imag__ retval = 0.0/0.0; - } else - { - __real__ retval = 0.0; - __imag__ retval = s(__copysign) (0.0, __imag__ x); - } + __real__ retval = __imag__ retval = __imag__ x - __imag__ x; } - else - /* If the real part is NaN the result is NaN + iNaN. */ - __real__ retval = __imag__ retval = 0.0/0.0; return retval; } diff --git a/sysdeps/m68k/fpu/s_cexpf.c b/sysdeps/m68k/fpu/s_cexpf.c index db9f174..177a360 100644 --- a/sysdeps/m68k/fpu/s_cexpf.c +++ b/sysdeps/m68k/fpu/s_cexpf.c @@ -1,4 +1,3 @@ #define SUFF f -#define huge_val HUGE_VALF #define float_type float #include diff --git a/sysdeps/m68k/fpu/s_cexpl.c b/sysdeps/m68k/fpu/s_cexpl.c index 7367070..bbda4ba 100644 --- a/sysdeps/m68k/fpu/s_cexpl.c +++ b/sysdeps/m68k/fpu/s_cexpl.c @@ -1,4 +1,3 @@ #define SUFF l -#define huge_val HUGE_VALL #define float_type long double #include diff --git a/sysdeps/m68k/fpu/s_csin.c b/sysdeps/m68k/fpu/s_csin.c new file mode 100644 index 0000000..8eecd96 --- /dev/null +++ b/sysdeps/m68k/fpu/s_csin.c @@ -0,0 +1,69 @@ +/* Complex sine function. m68k fpu version + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Andreas Schwab . + + 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., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#define __LIBC_M81_MATH_INLINES +#include +#include + +#ifndef SUFF +#define SUFF +#endif +#ifndef float_type +#define float_type double +#endif + +#define CONCATX(a,b) __CONCAT(a,b) +#define s(name) CONCATX(name,SUFF) +#define m81(func) __m81_u(s(func)) + +__complex__ float_type +s(__csin) (__complex__ float_type x) +{ + __complex__ float_type retval; + unsigned long rx_cond = __m81_test (__real__ x); + + if ((rx_cond & (__M81_COND_INF|__M81_COND_NAN)) == 0) + { + /* Real part is finite. */ + float_type sin_rx, cos_rx; + + __asm ("fsincos%.x %2,%1:%0" : "=f" (sin_rx), "=f" (cos_rx) + : "f" (__real__ x)); + if (rx_cond & __M81_COND_ZERO) + __real__ retval = __real__ x; + else + __real__ retval = sin_rx * m81(__ieee754_cosh) (__imag__ x); + __imag__ retval = cos_rx * m81(__ieee754_sinh) (__imag__ x); + } + else + { + unsigned long ix_cond = __m81_test (__imag__ x); + + __real__ retval = __real__ x - __real__ x; + if (ix_cond & (__M81_COND_ZERO|__M81_COND_INF|__M81_COND_NAN)) + __imag__ retval = __imag__ x; + else + __imag__ retval = __real__ retval; + } + + return retval; +} +#define weak_aliasx(a,b) weak_alias(a,b) +weak_aliasx (s(__csin), s(csin)) diff --git a/sysdeps/m68k/fpu/s_csinf.c b/sysdeps/m68k/fpu/s_csinf.c new file mode 100644 index 0000000..b760e19 --- /dev/null +++ b/sysdeps/m68k/fpu/s_csinf.c @@ -0,0 +1,3 @@ +#define SUFF f +#define float_type float +#include diff --git a/sysdeps/m68k/fpu/s_csinh.c b/sysdeps/m68k/fpu/s_csinh.c index c409ed0..643a221 100644 --- a/sysdeps/m68k/fpu/s_csinh.c +++ b/sysdeps/m68k/fpu/s_csinh.c @@ -25,9 +25,6 @@ #ifndef SUFF #define SUFF #endif -#ifndef huge_val -#define huge_val HUGE_VAL -#endif #ifndef float_type #define float_type double #endif @@ -40,87 +37,33 @@ __complex__ float_type s(__csinh) (__complex__ float_type x) { __complex__ float_type retval; - int negate = m81(__signbit) (__real__ x); + unsigned long ix_cond; - __real__ x = s(fabs) (__real__ x); + ix_cond = __m81_test (__imag__ x); - if (m81(__finite) (__real__ x)) + if ((ix_cond & (__M81_COND_INF|__M81_COND_NAN)) == 0) { - if (m81(__finite) (__imag__ x)) - { - float_type sinh_val; - float_type sin_ix, cos_ix; - - __asm ("fsincos%.x %2,%1:%0" : "=f" (sin_ix), "=f" (cos_ix) - : "f" (__imag__ x)); - sinh_val = m81(__ieee754_sinh) (__real__ x); - __real__ retval = cos_ix * sinh_val; - __imag__ retval = sin_ix * sinh_val; + /* Imaginary part is finite. */ + float_type sin_ix, cos_ix; - if (negate) - __real__ retval = -__real__ retval; - } - else if (__real__ x == 0) - { - __real__ retval = 0.0; - __imag__ retval = 0.0/0.0; - - if (negate) - __real__ retval = -__real__ retval; - } + __asm ("fsincos%.x %2,%1:%0" : "=f" (sin_ix), "=f" (cos_ix) + : "f" (__imag__ x)); + __real__ retval = cos_ix * m81(__ieee754_sinh) (__real__ x); + if (ix_cond & __M81_COND_ZERO) + __imag__ retval = __imag__ x; else - __real__ retval = __imag__ retval = 0.0/0.0; + __imag__ retval = sin_ix * m81(__ieee754_cosh) (__real__ x); } - else if (m81(__isinf) (__real__ x)) + else { - if (__imag__ x == 0.0) - { - __real__ retval = negate ? -huge_val : huge_val; - __imag__ retval = __imag__ x; - } - else if (m81(__finite) (__imag__ x)) - { - float_type remainder, pi_2; - int quadrant; - __real__ retval = __imag__ retval = huge_val; + unsigned long rx_cond = __m81_test (__real__ x); - __asm ("fmovecr %#0,%0\n\tfscale%.w %#-1,%0" : "=f" (pi_2)); - __asm ("fmod%.x %2,%0\n\tfmove%.l %/fpsr,%1" - : "=f" (remainder), "=dm" (quadrant) - : "f" (pi_2), "0" (__imag__ x)); - quadrant = (quadrant >> 16) & 0x83; - if (quadrant & 0x80) - quadrant ^= 0x83; - if (negate) - quadrant ^= 1; - switch (quadrant) - { - default: - break; - case 1: - __real__ retval = -__real__ retval; - break; - case 2: - __real__ retval = -__real__ retval; - case 3: - __imag__ retval = -__imag__ retval; - break; - } - } + __imag__ retval = __imag__ x - __imag__ x; + if (rx_cond & (__M81_COND_ZERO|__M81_COND_INF|__M81_COND_NAN)) + __real__ retval = __real__ x; else - { - /* The subtraction raises the invalid exception. */ - __real__ retval = huge_val; - __imag__ retval = huge_val - huge_val; - } + __real__ retval = __imag__ retval; } - else if (__imag__ x == 0.0) - { - __real__ retval = 0.0/0.0; - __imag__ retval = __imag__ x; - } - else - __real__ retval = __imag__ retval = 0.0/0.0; return retval; } diff --git a/sysdeps/m68k/fpu/s_csinhf.c b/sysdeps/m68k/fpu/s_csinhf.c index 42c114b..2f7a43e 100644 --- a/sysdeps/m68k/fpu/s_csinhf.c +++ b/sysdeps/m68k/fpu/s_csinhf.c @@ -1,4 +1,3 @@ #define SUFF f #define float_type float -#define huge_val HUGE_VALF #include diff --git a/sysdeps/m68k/fpu/s_csinhl.c b/sysdeps/m68k/fpu/s_csinhl.c index c8aa5c7..026a20e 100644 --- a/sysdeps/m68k/fpu/s_csinhl.c +++ b/sysdeps/m68k/fpu/s_csinhl.c @@ -1,4 +1,3 @@ #define SUFF l #define float_type long double -#define huge_val HUGE_VALL #include diff --git a/sysdeps/m68k/fpu/s_csinl.c b/sysdeps/m68k/fpu/s_csinl.c new file mode 100644 index 0000000..ea2dad0 --- /dev/null +++ b/sysdeps/m68k/fpu/s_csinl.c @@ -0,0 +1,3 @@ +#define SUFF l +#define float_type long double +#include diff --git a/sysdeps/unix/sysv/linux/abi-tag.h b/sysdeps/unix/sysv/linux/abi-tag.h index 166e6a1..6c71eec 100644 --- a/sysdeps/unix/sysv/linux/abi-tag.h +++ b/sysdeps/unix/sysv/linux/abi-tag.h @@ -10,7 +10,9 @@ #define ABI_LINUX_MINOR 0 #define ABI_LINUX_PATCH 0 -#define ABI_TAG ((ABI_LINUX_TAG << 24) | \ - (ABI_LINUX_MAJOR << 16) | \ - (ABI_LINUX_MINOR << 8) | \ +/* Don't use `|' in this expression, it is a comment character in the + assembler. */ +#define ABI_TAG ((ABI_LINUX_TAG << 24) + \ + (ABI_LINUX_MAJOR << 16) + \ + (ABI_LINUX_MINOR << 8) + \ (ABI_LINUX_PATCH << 0)) diff --git a/sysdeps/unix/sysv/linux/alpha/brk.S b/sysdeps/unix/sysv/linux/alpha/brk.S index f44686b..74fef64 100644 --- a/sysdeps/unix/sysv/linux/alpha/brk.S +++ b/sysdeps/unix/sysv/linux/alpha/brk.S @@ -37,8 +37,9 @@ __curbrk: .skip 8 #endif .text -LEAF(__brk, 0) +LEAF(__brk, 8) ldgp gp, 0(t12) + subq sp, 8, sp #ifdef PROF .set noat lda AT, _mcount @@ -47,9 +48,14 @@ LEAF(__brk, 0) #endif .prologue 1 + /* Save the requested brk across the system call. */ + stq a0, 0(sp) + ldiq v0, __NR_brk call_pal PAL_callsys + ldq a0, 0(sp) + /* Be prepared for an OSF-style brk. */ bne a3, $err1 beq v0, $ok @@ -62,11 +68,13 @@ LEAF(__brk, 0) /* Update __curbrk and return cleanly. */ mov zero, v0 $ok: stq a0, __curbrk + addq sp, 8, sp ret /* What a horrible way to die. */ $err0: ldi v0, ENOMEM -$err1: jmp zero, __syscall_error +$err1: addq sp, 8, sp + jmp zero, __syscall_error END(__brk) diff --git a/sysdeps/unix/sysv/linux/alpha/clone.S b/sysdeps/unix/sysv/linux/alpha/clone.S index 5d36e25..aab4e59 100644 --- a/sysdeps/unix/sysv/linux/alpha/clone.S +++ b/sysdeps/unix/sysv/linux/alpha/clone.S @@ -42,9 +42,12 @@ ENTRY(__clone) beq a0,$error /* no NULL function pointers */ beq a1,$error /* no NULL stack pointers */ + /* Save the fn ptr and arg on the new stack. */ + subq a1,16,a1 + stq a0,0(a1) + stq a3,8(a1) + /* Do the system call */ - mov a0,pv /* get fn ptr out of the way */ - mov a3,t0 /* get fn arg out of the way */ mov a2,a0 ldiq v0,__NR_clone call_pal PAL_callsys @@ -73,8 +76,12 @@ thread_start: mov zero,fp .prologue 0 + /* Load up the arguments. */ + ldq pv,0(sp) + ldq a0,8(sp) + addq sp,16,sp + /* Call the user's function */ - mov t0,a0 jsr ra,(pv) ldgp gp,0(ra) diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h index 59a1aa4..08a2e31 100644 --- a/sysdeps/unix/sysv/linux/sys/mount.h +++ b/sysdeps/unix/sysv/linux/sys/mount.h @@ -1,5 +1,5 @@ /* Header file for mounting/unmount Linux filesystems. - Copyright (C) 1996 Free Software Foundation, Inc. + Copyright (C) 1996, 1997 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 @@ -17,13 +17,81 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* This is taken from /usr/include/linux/fs.h. */ + #ifndef _SYS_MOUNT_H #define _SYS_MOUNT_H 1 #include +#include + __BEGIN_DECLS +#define BLOCK_SIZE 1024 +#define BLOCK_SIZE_BITS 10 + + +/* These are the fs-independent mount-flags: up to 16 flags are + supported */ +#define MS_RDONLY 1 /* Mount read-only. */ +#define MS_NOSUID 2 /* Ignore suid and sgid bits. */ +#define MS_NODEV 4 /* Disallow access to device special files. */ +#define MS_NOEXEC 8 /* Disallow program execution. */ +#define MS_SYNCHRONOUS 16 /* Writes are synced at once. */ +#define MS_REMOUNT 32 /* Alter flags of a mounted FS. */ +#define MS_MANDLOCK 64 /* Allow mandatory locks on an FS. */ +#define S_WRITE 128 /* Write on file/directory/symlink. */ +#define S_APPEND 256 /* Append-only file. */ +#define S_IMMUTABLE 512 /* Immutable file. */ +#define MS_NOATIME 1024 /* Do not update access times. */ + + +/* Flags that can be altered by MS_REMOUNT */ +#define MS_RMT_MASK (MS_RDONLY | MS_MANDLOCK) + + +/* Magic mount flag number. Has to be or-ed to the flag values. */ + +#define MS_MGC_VAL 0xc0ed0000 /* Magic flag number to indicate "new" flags */ +#define MS_MGC_MSK 0xffff0000 /* Magic flag number mask */ + + +/* Note that read-only etc flags are inode-specific: setting some + file-system flags just means all the inodes inherit those flags by + default. It might be possible to override it selectively if you + really wanted to with some ioctl() that is not currently + implemented. + + Exception: MS_RDONLY is always applied to the entire file system. */ +#define IS_RDONLY(inode) \ + (((inode)->i_sb) && ((inode)->i_sb->s_flags & MS_RDONLY)) +#define DO_UPDATE_ATIME(inode) \ + (!((inode)->i_flags & MS_NOATIME) && !IS_RDONLY (inode)) +#define IS_NOSUID(inode) ((inode)->i_flags & MS_NOSUID) +#define IS_NODEV(inode) ((inode)->i_flags & MS_NODEV) +#define IS_NOEXEC(inode) ((inode)->i_flags & MS_NOEXEC) +#define IS_SYNC(inode) ((inode)->i_flags & MS_SYNCHRONOUS) +#define IS_MANDLOCK(inode) ((inode)->i_flags & MS_MANDLOCK) + +#define IS_WRITABLE(inode) ((inode)->i_flags & S_WRITE) +#define IS_APPEND(inode) ((inode)->i_flags & S_APPEND) +#define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE) + + +/* The read-only stuff doesn't really belong here, but any other place + is probably as bad and I don't want to create yet another include + file. */ + +#define BLKROSET _IO(0x12, 93) /* Set device read-only (0 = read-write). */ +#define BLKROGET _IO(0x12, 94) /* Get read-only status (0 = read_write). */ +#define BLKRRPART _IO(0x12, 95) /* Re-read partition table. */ +#define BLKGETSIZE _IO(0x12, 96) /* Return device size. */ +#define BLKFLSBUF _IO(0x12, 97) /* Flush buffer cache. */ +#define BLKRASET _IO(0x12, 98) /* Set read ahead for block device. */ +#define BLKRAGET _IO(0x12, 99) /* Get current read ahead setting. */ + + /* Mount a filesystem. */ extern int mount __P ((__const char *__special_file, __const char *__dir, __const char *__fstype, unsigned long int __rwflag, -- cgit v1.1