]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
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 7eace9206d3c8c96116f38ef82d8f33cb7dbdccc..9724c306854e7e9cd5cb0c759f18370749be660b 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 00ae07603821f19f2231e583d9951f5a649fd61f..d79f6bdcde00a70e5a65161e1de64034dead76cc 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 9c96076316af4e4e99255de959ec347b1ab223d2..2f1adf77f57fab45242a9e5f18a92511a468eab9 100644 (file)
@@ -1,2 +1,2 @@
 #define        FUNC    cos
-#include <s_atan.c>
+#include <s_sin.c>
index db965b8cc1c312843501002cd7d03dcaaa543dbf..b6d6accb4ac5504a524c1c9cae634084d15ff77c 100644 (file)
@@ -1,2 +1,2 @@
-#define        FUNC    cosf
-#include <s_atanf.c>
+#define FUNC cosf
+#include <s_sinf.c>
index 4198feef18fa6adba993a91406e1ea50f1ecad3d..eb61521fdda75871ec6342dcd4d19f64cfc5413a 100644 (file)
@@ -1,2 +1,2 @@
 #define FUNC cosl
-#include <s_atanl.c>
+#include <s_sinl.c>
index 0d4abdbfe4576e45282637141a31b8c7b84ef984..e088b584b7904771e912cffc84e1af4609217d4e 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 9b23d4823f4095fd3d525b72eacb17f43b9d1921..304f4f76f64afed50f55331410cd5c565ad1029c 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 9ac532cb4770b32d05e28c0021957e961d2ca0fb..31dac0bee70ded95f168a3aad824cdb89f87f3c5 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 ca7fb0e6dc8c2554606f3ab27b0f95d9cc484c37..dfbbbb22704edeba10d30aa4c7af5b22d6b8a2f6 100644 (file)
@@ -1,2 +1,2 @@
 #define        FUNC    tan
-#include <s_atan.c>
+#include <s_sin.c>
index 95fe9c71a59baa9f1de135f9071e23d07fadd66c..9ae66ddbf3371424439fe7f4d9f79209b71c504d 100644 (file)
@@ -1,2 +1,2 @@
-#define        FUNC    tanf
-#include <s_atanf.c>
+#define FUNC tanf
+#include <s_sinf.c>
index 64fcb5440685de938e0e8da49ae0f7520a075a8f..27daf8f29b199ca8b719615776c331af481f9eab 100644 (file)
@@ -1,2 +1,2 @@
 #define FUNC tanl
-#include <s_atanl.c>
+#include <s_sinl.c>