diff --git a/ChangeLog.m68k b/ChangeLog.m68k index 7eace9206d..9724c30685 100644 --- a/ChangeLog.m68k +++ b/ChangeLog.m68k @@ -1,3 +1,18 @@ +2012-02-24 Andreas Schwab + + * sysdeps/m68k/m680x0/fpu/s_sin.c: Set errno to EDOM if argument + is infinite. + * sysdeps/m68k/m680x0/fpu/s_cos.c: Include . + * sysdeps/m68k/m680x0/fpu/s_tan.c: Likewise. + * sysdeps/m68k/m680x0/fpu/s_cosf.c: Include . + * sysdeps/m68k/m680x0/fpu/s_cosl.c: Include . + * sysdeps/m68k/m680x0/fpu/s_sinf.c: Include . + (FUNC): Don't define if already defined. + (float_type): Define. + * sysdeps/m68k/m680x0/fpu/s_sinl.c: Likewise. + * sysdeps/m68k/m680x0/fpu/bits/mathinline.h [__OPTIMIZE__]: Don't + define sin, cos, tan as inlines. + 2012-02-08 Andreas Schwab * sysdeps/m68k/crti.S: New file. diff --git a/sysdeps/m68k/m680x0/fpu/bits/mathinline.h b/sysdeps/m68k/m680x0/fpu/bits/mathinline.h index 00ae076038..d79f6bdcde 100644 --- a/sysdeps/m68k/m680x0/fpu/bits/mathinline.h +++ b/sysdeps/m68k/m680x0/fpu/bits/mathinline.h @@ -1,5 +1,5 @@ /* Definitions of inline math functions implemented by the m68881/2. - Copyright (C) 1991,92,93,94,96,97,98,99,2000,2002, 2003, 2004, 2008, 2010 + Copyright (C) 1991,92,93,94,96,97,98,99,2000,2002, 2003, 2004, 2008, 2010, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -175,9 +175,6 @@ __inline_mathop(__trunc, intrz) #if !defined __NO_MATH_INLINES && defined __OPTIMIZE__ __inline_mathop(atan, atan) -__inline_mathop(cos, cos) -__inline_mathop(sin, sin) -__inline_mathop(tan, tan) __inline_mathop(tanh, tanh) # if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 diff --git a/sysdeps/m68k/m680x0/fpu/s_cos.c b/sysdeps/m68k/m680x0/fpu/s_cos.c index 9c96076316..2f1adf77f5 100644 --- a/sysdeps/m68k/m680x0/fpu/s_cos.c +++ b/sysdeps/m68k/m680x0/fpu/s_cos.c @@ -1,2 +1,2 @@ #define FUNC cos -#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_cosf.c b/sysdeps/m68k/m680x0/fpu/s_cosf.c index db965b8cc1..b6d6accb4a 100644 --- a/sysdeps/m68k/m680x0/fpu/s_cosf.c +++ b/sysdeps/m68k/m680x0/fpu/s_cosf.c @@ -1,2 +1,2 @@ -#define FUNC cosf -#include +#define FUNC cosf +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_cosl.c b/sysdeps/m68k/m680x0/fpu/s_cosl.c index 4198feef18..eb61521fdd 100644 --- a/sysdeps/m68k/m680x0/fpu/s_cosl.c +++ b/sysdeps/m68k/m680x0/fpu/s_cosl.c @@ -1,2 +1,2 @@ #define FUNC cosl -#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_sin.c b/sysdeps/m68k/m680x0/fpu/s_sin.c index 0d4abdbfe4..e088b584b7 100644 --- a/sysdeps/m68k/m680x0/fpu/s_sin.c +++ b/sysdeps/m68k/m680x0/fpu/s_sin.c @@ -1,2 +1,41 @@ -#define FUNC sin -#include +/* Copyright (C) 2012 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 Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include +#include "mathimpl.h" + +#ifndef FUNC +# define FUNC sin +#endif +#ifndef float_type +# define float_type double +#endif + +#define CONCATX(a,b) __CONCAT(a,b) + +float_type +CONCATX(__,FUNC) (float_type x) +{ + if (__m81_test (x) & __M81_COND_INF) + __set_errno (EDOM); + return __m81_u(CONCATX(__, FUNC)) (x); +} + +#define weak_aliasx(a, b) weak_alias(a, b) +weak_aliasx (CONCATX(__, FUNC), FUNC) diff --git a/sysdeps/m68k/m680x0/fpu/s_sinf.c b/sysdeps/m68k/m680x0/fpu/s_sinf.c index 9b23d4823f..304f4f76f6 100644 --- a/sysdeps/m68k/m680x0/fpu/s_sinf.c +++ b/sysdeps/m68k/m680x0/fpu/s_sinf.c @@ -1,2 +1,5 @@ -#define FUNC sinf -#include +#ifndef FUNC +# define FUNC sinf +#endif +#define float_type float +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_sinl.c b/sysdeps/m68k/m680x0/fpu/s_sinl.c index 9ac532cb47..31dac0bee7 100644 --- a/sysdeps/m68k/m680x0/fpu/s_sinl.c +++ b/sysdeps/m68k/m680x0/fpu/s_sinl.c @@ -1,2 +1,5 @@ -#define FUNC sinl -#include +#ifndef FUNC +# define FUNC sinl +#endif +#define float_type long double +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_tan.c b/sysdeps/m68k/m680x0/fpu/s_tan.c index ca7fb0e6dc..dfbbbb2270 100644 --- a/sysdeps/m68k/m680x0/fpu/s_tan.c +++ b/sysdeps/m68k/m680x0/fpu/s_tan.c @@ -1,2 +1,2 @@ #define FUNC tan -#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_tanf.c b/sysdeps/m68k/m680x0/fpu/s_tanf.c index 95fe9c71a5..9ae66ddbf3 100644 --- a/sysdeps/m68k/m680x0/fpu/s_tanf.c +++ b/sysdeps/m68k/m680x0/fpu/s_tanf.c @@ -1,2 +1,2 @@ -#define FUNC tanf -#include +#define FUNC tanf +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_tanl.c b/sysdeps/m68k/m680x0/fpu/s_tanl.c index 64fcb54406..27daf8f29b 100644 --- a/sysdeps/m68k/m680x0/fpu/s_tanl.c +++ b/sysdeps/m68k/m680x0/fpu/s_tanl.c @@ -1,2 +1,2 @@ #define FUNC tanl -#include +#include