m68k: set errno in sin, cos, tan
authorAndreas Schwab <schwab@linux-m68k.org>
Fri, 24 Feb 2012 11:22:22 +0000 (12:22 +0100)
committerAndreas Schwab <schwab@linux-m68k.org>
Fri, 24 Feb 2012 21:13:57 +0000 (22:13 +0100)
ChangeLog.m68k
sysdeps/m68k/m680x0/fpu/bits/mathinline.h
sysdeps/m68k/m680x0/fpu/s_cos.c
sysdeps/m68k/m680x0/fpu/s_cosf.c
sysdeps/m68k/m680x0/fpu/s_cosl.c
sysdeps/m68k/m680x0/fpu/s_sin.c
sysdeps/m68k/m680x0/fpu/s_sinf.c
sysdeps/m68k/m680x0/fpu/s_sinl.c
sysdeps/m68k/m680x0/fpu/s_tan.c
sysdeps/m68k/m680x0/fpu/s_tanf.c
sysdeps/m68k/m680x0/fpu/s_tanl.c

index 7eace92..9724c30 100644 (file)
@@ -1,3 +1,18 @@
+2012-02-24  Andreas Schwab  <schwab@linux-m68k.org>
+
+       * sysdeps/m68k/m680x0/fpu/s_sin.c: Set errno to EDOM if argument
+       is infinite.
+       * sysdeps/m68k/m680x0/fpu/s_cos.c: Include <s_sin.c>.
+       * sysdeps/m68k/m680x0/fpu/s_tan.c: Likewise.
+       * sysdeps/m68k/m680x0/fpu/s_cosf.c: Include <s_sinf.c>.
+       * sysdeps/m68k/m680x0/fpu/s_cosl.c: Include <s_sinl.c>.
+       * sysdeps/m68k/m680x0/fpu/s_sinf.c: Include <s_sin.c>.
+       (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  <schwab@linux-m68k.org>
 
        * sysdeps/m68k/crti.S: New file.
index 00ae076..d79f6bd 100644 (file)
@@ -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
index 9c96076..2f1adf7 100644 (file)
@@ -1,2 +1,2 @@
 #define        FUNC    cos
-#include <s_atan.c>
+#include <s_sin.c>
index db965b8..b6d6acc 100644 (file)
@@ -1,2 +1,2 @@
-#define        FUNC    cosf
-#include <s_atanf.c>
+#define FUNC cosf
+#include <s_sinf.c>
index 4198fee..eb61521 100644 (file)
@@ -1,2 +1,2 @@
 #define FUNC cosl
-#include <s_atanl.c>
+#include <s_sinl.c>
index 0d4abdb..e088b58 100644 (file)
@@ -1,2 +1,41 @@
-#define        FUNC    sin
-#include <s_atan.c>
+/* 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 <math.h>
+#include <errno.h>
+#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)
index 9b23d48..304f4f7 100644 (file)
@@ -1,2 +1,5 @@
-#define        FUNC    sinf
-#include <s_atanf.c>
+#ifndef FUNC
+# define FUNC sinf
+#endif
+#define float_type float
+#include <s_sin.c>
index 9ac532c..31dac0b 100644 (file)
@@ -1,2 +1,5 @@
-#define FUNC sinl
-#include <s_atanl.c>
+#ifndef FUNC
+# define FUNC sinl
+#endif
+#define float_type long double
+#include <s_sin.c>
index ca7fb0e..dfbbbb2 100644 (file)
@@ -1,2 +1,2 @@
 #define        FUNC    tan
-#include <s_atan.c>
+#include <s_sin.c>
index 95fe9c7..9ae66dd 100644 (file)
@@ -1,2 +1,2 @@
-#define        FUNC    tanf
-#include <s_atanf.c>
+#define FUNC tanf
+#include <s_sinf.c>
index 64fcb54..27daf8f 100644 (file)
@@ -1,2 +1,2 @@
 #define FUNC tanl
-#include <s_atanl.c>
+#include <s_sinl.c>