From 01ee387015a2075c45a4e1ad45d39e50b5a6d40b Mon Sep 17 00:00:00 2001 From: "Paul E. Murphy" Date: Mon, 27 Jun 2016 17:11:46 -0500 Subject: 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. --- math/s_cacos_template.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'math/s_cacos_template.c') diff --git a/math/s_cacos_template.c b/math/s_cacos_template.c index 234b12271b..6494a1f2f6 100644 --- a/math/s_cacos_template.c +++ b/math/s_cacos_template.c @@ -1,4 +1,4 @@ -/* Return cosine of complex double value. +/* Return cosine of a complex type. Copyright (C) 1997-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. @@ -20,22 +20,22 @@ #include #include -__complex__ double -__cacos (__complex__ double x) +CFLOAT +M_DECL_FUNC (__cacos) (CFLOAT x) { - __complex__ double y; - __complex__ double res; + CFLOAT y; + CFLOAT res; int rcls = fpclassify (__real__ x); int icls = fpclassify (__imag__ x); if (rcls <= FP_INFINITE || icls <= FP_INFINITE || (rcls == FP_ZERO && icls == FP_ZERO)) { - y = __casin (x); + y = M_SUF (__casin) (x); - __real__ res = (double) M_PI_2 - __real__ y; - if (__real__ res == 0.0) - __real__ res = 0.0; + __real__ res = (FLOAT) M_MLIT (M_PI_2) - __real__ y; + if (__real__ res == 0) + __real__ res = 0; __imag__ res = -__imag__ y; } else @@ -43,7 +43,7 @@ __cacos (__complex__ double x) __real__ y = -__imag__ x; __imag__ y = __real__ x; - y = __kernel_casinh (y, 1); + y = M_SUF (__kernel_casinh) (y, 1); __real__ res = __imag__ y; __imag__ res = __real__ y; @@ -51,8 +51,9 @@ __cacos (__complex__ double x) return res; } -weak_alias (__cacos, cacos) -#ifdef NO_LONG_DOUBLE -strong_alias (__cacos, __cacosl) -weak_alias (__cacos, cacosl) + +declare_mgen_alias (__cacos, cacos); + +#if M_LIBM_NEED_COMPAT (carg) +declare_mgen_libm_compat (__cacos, cacos) #endif -- cgit 1.4.1