2016-11-28 Joseph Myers <joseph@codesourcery.com>
+ * math/w_ilogb_template.c: New file. Based on math/w_ilogb.c.
+ * math/w_ilogb.c: Remove.
+ * math/w_ilogbf.c: Likewise.
+ * math/w_ilogbl.c: Likewise.
+ * sysdeps/ieee754/ldbl-opt/w_ilogb.c: Likewise.
+ * sysdeps/ieee754/ldbl-opt/w_ilogbl.c: Likewise.
+ * math/Makefile (gen-libm-calls): Add w_ilogbF.
+ (libm-calls): Remove w_ilogbF.
+ * sysdeps/ieee754/ldbl-opt/math-type-macros-double.h
+ (LDOUBLE_ilogbl_libm_version): New macro.
+
* sysdeps/unix/sysv/linux/ia64/tst-setcontext2.c: New file.
* sysdeps/ia64/fpu/libm-symbols.h: Make contents conditional on
k_casinhF s_csinhF k_casinhF s_csinhF s_catanhF s_catanF \
s_ctanF s_ctanhF s_cexpF s_clogF s_cprojF s_csqrtF \
s_cpowF s_clog10F s_fdimF s_nextdownF s_fmaxF s_fminF \
- s_nanF s_iseqsigF s_canonicalizeF
+ s_nanF s_iseqsigF s_canonicalizeF w_ilogbF
libm-calls = \
e_acosF e_acoshF e_asinF e_atan2F e_atanhF e_coshF e_expF e_fmodF \
w_atan2F w_atanhF w_coshF w_expF w_exp2F w_exp10F w_fmodF \
w_tgammaF w_hypotF w_j0F w_j1F w_jnF w_lgammaF w_lgammaF_r \
w_logF w_log10F w_powF w_remainderF w_scalbF w_sinhF w_sqrtF \
- w_ilogbF \
s_fpclassifyF s_truncF \
s_remquoF e_log2F e_exp2F s_roundF s_nearbyintF s_sincosF \
s_fmaF s_lrintF s_llrintF s_lroundF s_llroundF e_exp10F w_log2F \
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Wrapper to set errno for ilogb.
+ Copyright (C) 2012-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Adhemerval Zanella <azanella@linux.vnet.ibm.com>, 2011.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
/* wrapper ilogb */
int
-__ilogb (double x)
+M_DECL_FUNC (__ilogb) (FLOAT x)
{
- int r = __ieee754_ilogb (x);
+ int r = M_SUF (__ieee754_ilogb) (x);
if (__builtin_expect (r == FP_ILOGB0, 0)
|| __builtin_expect (r == FP_ILOGBNAN, 0)
|| __builtin_expect (r == INT_MAX, 0))
}
return r;
}
-weak_alias (__ilogb, ilogb)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__ilogb, __ilogbl)
-weak_alias (__ilogb, ilogbl)
+declare_mgen_alias (__ilogb, ilogb)
+
+#if M_LIBM_NEED_COMPAT (ilogb)
+declare_mgen_libm_compat (__ilogb, ilogb)
#endif
+++ /dev/null
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Adhemerval Zanella <azanella@linux.vnet.ibm.com>, 2011.
-
- 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, see
- <http://www.gnu.org/licenses/>. */
-
-#include <math.h>
-#include <errno.h>
-#include <limits.h>
-#include <math_private.h>
-
-/* wrapper ilogbf */
-int
-__ilogbf (float x)
-{
- int r = __ieee754_ilogbf (x);
- if (__builtin_expect (r == FP_ILOGB0, 0)
- || __builtin_expect (r == FP_ILOGBNAN, 0)
- || __builtin_expect (r == INT_MAX, 0))
- {
- __set_errno (EDOM);
- feraiseexcept (FE_INVALID);
- }
- return r;
-}
-weak_alias (__ilogbf, ilogbf)
+++ /dev/null
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Adhemerval Zanella <azanella@linux.vnet.ibm.com>, 2011.
-
- 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, see
- <http://www.gnu.org/licenses/>. */
-
-#include <math.h>
-#include <errno.h>
-#include <limits.h>
-#include <math_private.h>
-
-/* wrapper ilogbl */
-int
-__ilogbl (long double x)
-{
- int r = __ieee754_ilogbl (x);
- if (__builtin_expect (r == FP_ILOGB0, 0)
- || __builtin_expect (r == FP_ILOGBNAN, 0)
- || __builtin_expect (r == INT_MAX, 0))
- {
- __set_errno (EDOM);
- feraiseexcept (FE_INVALID);
- }
- return r;
-}
-weak_alias (__ilogbl, ilogbl)
#define LDOUBLE_fdiml_libm_version GLIBC_2_1
#define LDOUBLE_fmaxl_libm_version GLIBC_2_1
#define LDOUBLE_fminl_libm_version GLIBC_2_1
+#define LDOUBLE_ilogbl_libm_version GLIBC_2_0
#define LDOUBLE_nanl_libm_version GLIBC_2_1
/* Define compat symbols for long double on platforms
+++ /dev/null
-#include <math_ldbl_opt.h>
-#include <math/w_ilogb.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __ilogb, ilogbl, GLIBC_2_0);
-#endif
+++ /dev/null
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_ilogbl.c>
-long_double_symbol (libm, __ilogbl, ilogbl);