diff options
Diffstat (limited to 'sysdeps/m68k')
-rw-r--r-- | sysdeps/m68k/bsd-_setjmp.S | 28 | ||||
-rw-r--r-- | sysdeps/m68k/bsd-setjmp.S | 28 | ||||
-rw-r--r-- | sysdeps/m68k/elf/start.S | 34 | ||||
-rw-r--r-- | sysdeps/m68k/fpu/bits/mathdef.h | 2 | ||||
-rw-r--r-- | sysdeps/m68k/fpu/bits/mathinline.h | 36 | ||||
-rw-r--r-- | sysdeps/m68k/fpu/s_ilogb.c | 26 | ||||
-rw-r--r-- | sysdeps/m68k/fpu/s_ilogbf.c | 2 | ||||
-rw-r--r-- | sysdeps/m68k/fpu/s_ilogbl.c | 2 |
8 files changed, 75 insertions, 83 deletions
diff --git a/sysdeps/m68k/bsd-_setjmp.S b/sysdeps/m68k/bsd-_setjmp.S index dc1f52c6aa..f1551521d3 100644 --- a/sysdeps/m68k/bsd-_setjmp.S +++ b/sysdeps/m68k/bsd-_setjmp.S @@ -1,21 +1,21 @@ /* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. m68k version. -Copyright (C) 1994 Free Software Foundation, Inc. -This file is part of the GNU C Library. + Copyright (C) 1994, 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 -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 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. + 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. */ + 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. */ /* This just does a tail-call to `__sigsetjmp (ARG, 0)'. We cannot do it in C because it must be a tail-call, so frame-unwinding diff --git a/sysdeps/m68k/bsd-setjmp.S b/sysdeps/m68k/bsd-setjmp.S index 7158907cfe..8074719639 100644 --- a/sysdeps/m68k/bsd-setjmp.S +++ b/sysdeps/m68k/bsd-setjmp.S @@ -1,21 +1,21 @@ /* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. m68k version. -Copyright (C) 1994 Free Software Foundation, Inc. -This file is part of the GNU C Library. + Copyright (C) 1994, 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 -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 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. + 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. */ + 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. */ /* This just does a tail-call to `__sigsetjmp (ARG, 1)'. We cannot do it in C because it must be a tail-call, so frame-unwinding diff --git a/sysdeps/m68k/elf/start.S b/sysdeps/m68k/elf/start.S index 1b622d6e08..6c7cd4b99d 100644 --- a/sysdeps/m68k/elf/start.S +++ b/sysdeps/m68k/elf/start.S @@ -1,33 +1,33 @@ /* Startup code compliant to the ELF m68k ABI. -Copyright (C) 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. + 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 -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 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. + 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. */ + 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. */ /* This is the canonical entry point, usually the first thing in the text segment. The SVR4/m68k ABI says that when the entry point runs, most registers' values are unspecified, except for: %a1 Contains a function pointer to be registered with `atexit'. - This is how the dynamic linker arranges to have DT_FINI + This is how the dynamic linker arranges to have DT_FINI functions called for shared libraries that have been loaded before this code runs. %sp The stack contains the arguments and environment: - 0(%sp) argc + 0(%sp) argc 4(%sp) argv[0] ... (4*argc)(%sp) NULL @@ -36,7 +36,7 @@ Cambridge, MA 02139, USA. */ NULL */ - .text + .text .globl _start _start: /* Clear the frame pointer. The ABI suggests this be done, to mark diff --git a/sysdeps/m68k/fpu/bits/mathdef.h b/sysdeps/m68k/fpu/bits/mathdef.h index 4eaa58a3a9..c2b4eff920 100644 --- a/sysdeps/m68k/fpu/bits/mathdef.h +++ b/sysdeps/m68k/fpu/bits/mathdef.h @@ -36,5 +36,5 @@ typedef long double double_t; /* `double' expressions are evaluated as #define INFINITY HUGE_VALL /* The values returned by `ilogb' for 0 and NaN respectively. */ -#define FP_ILOGB0 0 +#define FP_ILOGB0 0x80000000 #define FP_ILOGBNAN 0x7fffffff diff --git a/sysdeps/m68k/fpu/bits/mathinline.h b/sysdeps/m68k/fpu/bits/mathinline.h index 8899b752ff..79245c07a1 100644 --- a/sysdeps/m68k/fpu/bits/mathinline.h +++ b/sysdeps/m68k/fpu/bits/mathinline.h @@ -44,12 +44,12 @@ is the name of the fpu operation (without leading f). */ #if defined __USE_MISC || defined __USE_ISOC9X -#define __inline_mathop(func, op) \ +# define __inline_mathop(func, op) \ __inline_mathop1(double, func, op) \ __inline_mathop1(float, __CONCAT(func,f), op) \ __inline_mathop1(long double, __CONCAT(func,l), op) #else -#define __inline_mathop(func, op) \ +# define __inline_mathop(func, op) \ __inline_mathop1(double, func, op) #endif @@ -257,17 +257,6 @@ __m81_defun (int, __CONCAT(__signbit,s), (float_type __value)) \ return (__fpsr >> 27) & 1; \ } \ \ -__m81_defun (int, __CONCAT(__ilogb,s), (float_type __x)) \ -{ \ - float_type __result; \ - if (__m81_u(__CONCAT(__isnan,s)) (__x)) \ - /* The stupid standard requires us to return a specific value where \ - it would depend on the bitpattern of the NaN. */ \ - return 0x7fffffff; \ - __asm("fgetexp%.x %1, %0" : "=f" (__result) : "f" (__x)); \ - return (int) __result; \ -} \ - \ __m81_defun (float_type, __CONCAT(__scalbn,s), \ (float_type __x, long int __n)) \ { \ @@ -341,7 +330,6 @@ __inline_forward_c(double,scalbn, (double __x, long int __n), (__x, __n)) #ifndef __USE_ISOC9X /* Conflict with macro of same name. */ __inline_forward_c(int,isnan, (double __value), (__value)) #endif -__inline_forward_c(int,ilogb, (double __value), (__value)) #endif #ifdef __USE_ISOC9X __inline_forward_c(double,nearbyint, (double __value), (__value)) @@ -362,7 +350,6 @@ __inline_forward_c(int,isinff, (float __value), (__value)) __inline_forward_c(int,finitef, (float __value), (__value)) __inline_forward_c(float,scalbnf, (float __x, long int __n), (__x, __n)) __inline_forward_c(int,isnanf, (float __value), (__value)) -__inline_forward_c(int,ilogbf, (float __value), (__value)) #endif #ifdef __USE_ISOC9X __inline_forward_c(float,nearbyintf, (float __value), (__value)) @@ -382,7 +369,6 @@ __inline_forward_c(int,finitel, (long double __value), (__value)) __inline_forward_c(long double,scalbnl, (long double __x, long int __n), (__x, __n)) __inline_forward_c(int,isnanl, (long double __value), (__value)) -__inline_forward_c(int,ilogbl, (long double __value), (__value)) #endif #ifdef __USE_ISOC9X __inline_forward_c(long double,nearbyintl, (long double __value), (__value)) @@ -405,48 +391,42 @@ __inline_forward(void,sincosl, m68k FPU supports this with special opcodes and we should use them. These must not be inline functions since we have to be able to handle all floating-point types. */ -#undef isgreater -#define isgreater(x, y) \ +# define isgreater(x, y) \ __extension__ \ ({ char __result; \ __asm__ ("fcmp%.x %2,%1; fsogt %0" \ : "=dm" (__result) : "f" (x), "f" (y)); \ (int) __result; }) -#undef isgreaterequal -#define isgreaterequal(x, y) \ +# define isgreaterequal(x, y) \ __extension__ \ ({ char __result; \ __asm__ ("fcmp%.x %2,%1; fsoge %0" \ : "=dm" (__result) : "f" (x), "f" (y)); \ (int) __result; }) -#undef isless -#define isless(x, y) \ +# define isless(x, y) \ __extension__ \ ({ char __result; \ __asm__ ("fcmp%.x %2,%1; fsolt %0" \ : "=dm" (__result) : "f" (x), "f" (y)); \ (int) __result; }) -#undef islessequal -#define islessequal(x, y) \ +# define islessequal(x, y) \ __extension__ \ ({ char __result; \ __asm__ ("fcmp%.x %2,%1; fsole %0" \ : "=dm" (__result) : "f" (x), "f" (y)); \ (int) __result; }) -#undef islessgreater -#define islessgreater(x, y) \ +# define islessgreater(x, y) \ __extension__ \ ({ char __result; \ __asm__ ("fcmp%.x %2,%1; fsogl %0" \ : "=dm" (__result) : "f" (x), "f" (y)); \ (int) __result; }) -#undef isunordered -#define isunordered(x, y) \ +# define isunordered(x, y) \ __extension__ \ ({ char __result; \ __asm__ ("fcmp%.x %2,%1; fsun %0" \ diff --git a/sysdeps/m68k/fpu/s_ilogb.c b/sysdeps/m68k/fpu/s_ilogb.c index a081a884d4..2d8f7d5082 100644 --- a/sysdeps/m68k/fpu/s_ilogb.c +++ b/sysdeps/m68k/fpu/s_ilogb.c @@ -19,21 +19,33 @@ #define __LIBC_M81_MATH_INLINES #include <math.h> -#ifndef FUNC -#define FUNC ilogb +#ifndef SUFF +#define SUFF #endif #ifndef float_type #define float_type double #endif -#define __CONCATX(a,b) __CONCAT(a,b) +#define CONCATX(a,b) __CONCAT(a,b) +#define s(name) CONCATX(name,SUFF) +#define m81(func) __m81_u(s(func)) int -__CONCATX(__,FUNC) (x) - float_type x; +s(__ilogb) (float_type x) { - return __m81_u(__CONCATX(__,FUNC))(x); + float_type result; + unsigned long x_cond; + + x_cond = __m81_test (x); + /* We must return consistent values for zero and NaN. */ + if (x_cond & __M81_COND_ZERO) + return FP_ILOGB0; + if (x_cond & (__M81_COND_NAN | __M81_COND_INF)) + return FP_ILOGBNAN; + + __asm ("fgetexp%.x %1, %0" : "=f" (result) : "f" (x)); + return (int) result; } #define weak_aliasx(a,b) weak_alias(a,b) -weak_aliasx (__CONCATX(__,FUNC), FUNC) +weak_aliasx (s(__ilogb), s(ilogb)) diff --git a/sysdeps/m68k/fpu/s_ilogbf.c b/sysdeps/m68k/fpu/s_ilogbf.c index c0c2ffd18d..4031c42ff7 100644 --- a/sysdeps/m68k/fpu/s_ilogbf.c +++ b/sysdeps/m68k/fpu/s_ilogbf.c @@ -1,3 +1,3 @@ -#define FUNC ilogbf +#define SUFF f #define float_type float #include <s_ilogb.c> diff --git a/sysdeps/m68k/fpu/s_ilogbl.c b/sysdeps/m68k/fpu/s_ilogbl.c index c3554d5c58..9c55a115e0 100644 --- a/sysdeps/m68k/fpu/s_ilogbl.c +++ b/sysdeps/m68k/fpu/s_ilogbl.c @@ -1,3 +1,3 @@ -#define FUNC ilogbl +#define SUFF l #define float_type long double #include <s_ilogb.c> |