about summary refs log tree commit diff
path: root/math/s_cacosh_template.c
diff options
context:
space:
mode:
authorPaul E. Murphy <murphyp@linux.vnet.ibm.com>2016-06-27 17:11:46 -0500
committerPaul E. Murphy <murphyp@linux.vnet.ibm.com>2016-08-19 11:28:55 -0500
commit01ee387015a2075c45a4e1ad45d39e50b5a6d40b (patch)
treec8d2a88b0900c294d5e82fe869908d46b3ca838f /math/s_cacosh_template.c
parent281f5073e5a6d2cd3733acd9c773c8c6340468c4 (diff)
downloadglibc-01ee387015a2075c45a4e1ad45d39e50b5a6d40b.tar.gz
glibc-01ee387015a2075c45a4e1ad45d39e50b5a6d40b.tar.xz
glibc-01ee387015a2075c45a4e1ad45d39e50b5a6d40b.zip
Convert _Complex cosine functions to generated code
This is fairly straight fowards.  m68k overrides are
updated to use the framework, and thus are simplified
a bit.
Diffstat (limited to 'math/s_cacosh_template.c')
-rw-r--r--math/s_cacosh_template.c50
1 files changed, 26 insertions, 24 deletions
diff --git a/math/s_cacosh_template.c b/math/s_cacosh_template.c
index 20bf2158b8..e44da39a10 100644
--- a/math/s_cacosh_template.c
+++ b/math/s_cacosh_template.c
@@ -1,4 +1,4 @@
-/* Return arc hyperbole cosine for double value.
+/* Return arc hyperbolic cosine for a complex type.
    Copyright (C) 1997-2016 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,10 +22,10 @@
 #include <math_private.h>
 
 
-__complex__ double
-__cacosh (__complex__ double x)
+CFLOAT
+M_DECL_FUNC (__cacosh) (CFLOAT x)
 {
-  __complex__ double res;
+  CFLOAT res;
   int rcls = fpclassify (__real__ x);
   int icls = fpclassify (__imag__ x);
 
@@ -33,45 +33,46 @@ __cacosh (__complex__ double x)
     {
       if (icls == FP_INFINITE)
 	{
-	  __real__ res = HUGE_VAL;
+	  __real__ res = M_HUGE_VAL;
 
 	  if (rcls == FP_NAN)
-	    __imag__ res = __nan ("");
+	    __imag__ res = M_NAN;
 	  else
-	    __imag__ res = __copysign ((rcls == FP_INFINITE
-					? (__real__ x < 0.0
-					   ? M_PI - M_PI_4 : M_PI_4)
-					: M_PI_2), __imag__ x);
+	    __imag__ res = M_COPYSIGN ((rcls == FP_INFINITE
+					? (__real__ x < 0
+					   ? M_MLIT (M_PI) - M_MLIT (M_PI_4)
+					   : M_MLIT (M_PI_4))
+					: M_MLIT (M_PI_2)), __imag__ x);
 	}
       else if (rcls == FP_INFINITE)
 	{
-	  __real__ res = HUGE_VAL;
+	  __real__ res = M_HUGE_VAL;
 
 	  if (icls >= FP_ZERO)
-	    __imag__ res = __copysign (signbit (__real__ x) ? M_PI : 0.0,
-				       __imag__ x);
+	    __imag__ res = M_COPYSIGN (signbit (__real__ x)
+				       ? M_MLIT (M_PI) : 0, __imag__ x);
 	  else
-	    __imag__ res = __nan ("");
+	    __imag__ res = M_NAN;
 	}
       else
 	{
-	  __real__ res = __nan ("");
-	  __imag__ res = __nan ("");
+	  __real__ res = M_NAN;
+	  __imag__ res = M_NAN;
 	}
     }
   else if (rcls == FP_ZERO && icls == FP_ZERO)
     {
-      __real__ res = 0.0;
-      __imag__ res = __copysign (M_PI_2, __imag__ x);
+      __real__ res = 0;
+      __imag__ res = M_COPYSIGN (M_MLIT (M_PI_2), __imag__ x);
     }
   else
     {
-      __complex__ double y;
+      CFLOAT y;
 
       __real__ y = -__imag__ x;
       __imag__ y = __real__ x;
 
-      y = __kernel_casinh (y, 1);
+      y = M_SUF (__kernel_casinh) (y, 1);
 
       if (signbit (__imag__ x))
 	{
@@ -87,8 +88,9 @@ __cacosh (__complex__ double x)
 
   return res;
 }
-weak_alias (__cacosh, cacosh)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__cacosh, __cacoshl)
-weak_alias (__cacosh, cacoshl)
+
+declare_mgen_alias (__cacosh, cacosh)
+
+#if M_LIBM_NEED_COMPAT (cacosh)
+declare_mgen_libm_compat (__cacosh, cacosh)
 #endif