Use libm_alias_float for alpha.

Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes alpha libm function implementations use
libm_alias_float macros to define function aliases.  In the case of
the ABI compatibility for complex functions, libm_alias_float_other is
used, with the cfloat_versions macro adjusted to take a function name
argument without the trailing 'f' to facilitate this, and
cfloat_versions dealing with calling libm_alias_float_other (except
for clog10f, which doesn't use that macro because of the complexity
associated with __clog10f also being exported).

Tested with build-many-glibcs.py for alpha-linux-gnu that installed
stripped shared libraries are unchanged by the patch.

	* sysdeps/alpha/fpu/cfloat-compat.h: Include <libm-alias-float.h>.
	(cfloat_versions): Take function argument without trailing 'f'.
	Call libm_alias_float_other.
	* sysdeps/alpha/fpu/cabsf.c: Update call to cfloat_versions.
	* sysdeps/alpha/fpu/cargf.c: Likewise.
	* sysdeps/alpha/fpu/cimagf.c: Likewise.
	* sysdeps/alpha/fpu/conjf.c: Likewise.
	* sysdeps/alpha/fpu/crealf.c: Likewise.
	* sysdeps/alpha/fpu/s_cacosf.c: Likewise.
	* sysdeps/alpha/fpu/s_cacoshf.c: Likewise.
	* sysdeps/alpha/fpu/s_casinf.c: Likewise.
	* sysdeps/alpha/fpu/s_casinhf.c: Likewise.
	* sysdeps/alpha/fpu/s_catanf.c: Likewise.
	* sysdeps/alpha/fpu/s_catanhf.c: Likewise.
	* sysdeps/alpha/fpu/s_ccosf.c: Likewise.
	* sysdeps/alpha/fpu/s_ccoshf.c: Likewise.
	* sysdeps/alpha/fpu/s_cexpf.c: Likewise.
	* sysdeps/alpha/fpu/s_clogf.c: Likewise.
	* sysdeps/alpha/fpu/s_cpowf.c: Likewise.
	* sysdeps/alpha/fpu/s_cprojf.c: Likewise.
	* sysdeps/alpha/fpu/s_csinf.c: Likewise.
	* sysdeps/alpha/fpu/s_csinhf.c: Likewise.
	* sysdeps/alpha/fpu/s_csqrtf.c: Likewise.
	* sysdeps/alpha/fpu/s_ctanf.c: Likewise.
	* sysdeps/alpha/fpu/s_ctanhf.c: Likewise.
	* sysdeps/alpha/fpu/s_clog10f.c: Include <libm-alias-float.h>.
	(clog10f): Use libm_alias_float_other.
	* sysdeps/alpha/fpu/s_ceilf.c: Include <libm-alias-float.h>.
	(ceilf): Define using libm_alias_float.
	* sysdeps/alpha/fpu/s_copysignf.c: Include <libm-alias-float.h>.
	(copysignf): Define using libm_alias_float.
	* sysdeps/alpha/fpu/s_fabsf.c: Include <libm-alias-float.h>.
	(fabsf): Define using libm_alias_float.
	* sysdeps/alpha/fpu/s_floorf.c: Include <libm-alias-float.h>.
	(floorf): Define using libm_alias_float.
	* sysdeps/alpha/fpu/s_fmax.S: Include <libm-alias-float.h>.
	(fmaxf): Define using libm_alias_float.
	* sysdeps/alpha/fpu/s_fmin.S: Include <libm-alias-float.h>.
	(fminf): Define using libm_alias_float.
	* sysdeps/alpha/fpu/s_lrintf.c: Include <libm-alias-float.h>.
	(lrintf): Define using libm_alias_float.
	(llrintf): Likewise.
	* sysdeps/alpha/fpu/s_lroundf.c: Include <libm-alias-float.h>.
	(lroundf): Define using libm_alias_float.
	(llroundf): Likewise.
	* sysdeps/alpha/fpu/s_rintf.c: Include <libm-alias-float.h>.
	(rintf): Define using libm_alias_float.
	* sysdeps/alpha/fpu/s_truncf.c: Include <libm-alias-float.h>.
	(truncf): Define using libm_alias_float.
This commit is contained in:
Joseph Myers 2017-11-28 01:19:03 +00:00
parent 15ff490014
commit f433d0b3bb
35 changed files with 102 additions and 38 deletions

View File

@ -1,5 +1,55 @@
2017-11-28 Joseph Myers <joseph@codesourcery.com>
* sysdeps/alpha/fpu/cfloat-compat.h: Include <libm-alias-float.h>.
(cfloat_versions): Take function argument without trailing 'f'.
Call libm_alias_float_other.
* sysdeps/alpha/fpu/cabsf.c: Update call to cfloat_versions.
* sysdeps/alpha/fpu/cargf.c: Likewise.
* sysdeps/alpha/fpu/cimagf.c: Likewise.
* sysdeps/alpha/fpu/conjf.c: Likewise.
* sysdeps/alpha/fpu/crealf.c: Likewise.
* sysdeps/alpha/fpu/s_cacosf.c: Likewise.
* sysdeps/alpha/fpu/s_cacoshf.c: Likewise.
* sysdeps/alpha/fpu/s_casinf.c: Likewise.
* sysdeps/alpha/fpu/s_casinhf.c: Likewise.
* sysdeps/alpha/fpu/s_catanf.c: Likewise.
* sysdeps/alpha/fpu/s_catanhf.c: Likewise.
* sysdeps/alpha/fpu/s_ccosf.c: Likewise.
* sysdeps/alpha/fpu/s_ccoshf.c: Likewise.
* sysdeps/alpha/fpu/s_cexpf.c: Likewise.
* sysdeps/alpha/fpu/s_clogf.c: Likewise.
* sysdeps/alpha/fpu/s_cpowf.c: Likewise.
* sysdeps/alpha/fpu/s_cprojf.c: Likewise.
* sysdeps/alpha/fpu/s_csinf.c: Likewise.
* sysdeps/alpha/fpu/s_csinhf.c: Likewise.
* sysdeps/alpha/fpu/s_csqrtf.c: Likewise.
* sysdeps/alpha/fpu/s_ctanf.c: Likewise.
* sysdeps/alpha/fpu/s_ctanhf.c: Likewise.
* sysdeps/alpha/fpu/s_clog10f.c: Include <libm-alias-float.h>.
(clog10f): Use libm_alias_float_other.
* sysdeps/alpha/fpu/s_ceilf.c: Include <libm-alias-float.h>.
(ceilf): Define using libm_alias_float.
* sysdeps/alpha/fpu/s_copysignf.c: Include <libm-alias-float.h>.
(copysignf): Define using libm_alias_float.
* sysdeps/alpha/fpu/s_fabsf.c: Include <libm-alias-float.h>.
(fabsf): Define using libm_alias_float.
* sysdeps/alpha/fpu/s_floorf.c: Include <libm-alias-float.h>.
(floorf): Define using libm_alias_float.
* sysdeps/alpha/fpu/s_fmax.S: Include <libm-alias-float.h>.
(fmaxf): Define using libm_alias_float.
* sysdeps/alpha/fpu/s_fmin.S: Include <libm-alias-float.h>.
(fminf): Define using libm_alias_float.
* sysdeps/alpha/fpu/s_lrintf.c: Include <libm-alias-float.h>.
(lrintf): Define using libm_alias_float.
(llrintf): Likewise.
* sysdeps/alpha/fpu/s_lroundf.c: Include <libm-alias-float.h>.
(lroundf): Define using libm_alias_float.
(llroundf): Likewise.
* sysdeps/alpha/fpu/s_rintf.c: Include <libm-alias-float.h>.
(rintf): Define using libm_alias_float.
* sysdeps/alpha/fpu/s_truncf.c: Include <libm-alias-float.h>.
(truncf): Define using libm_alias_float.
* sysdeps/aarch64/fpu/s_ceilf.c: Include <libm-alias-float.h>.
(ceilf): Define using libm_alias_float.
* sysdeps/aarch64/fpu/s_floorf.c: Include <libm-alias-float.h>.

View File

@ -38,4 +38,4 @@ __c2_cabsf (c2_cfloat_decl (z))
return __hypotf (c2_cfloat_real (z), c2_cfloat_imag (z));
}
cfloat_versions (cabsf);
cfloat_versions (cabs);

View File

@ -38,4 +38,4 @@ __c2_cargf (c2_cfloat_decl (x))
return __atan2f (c2_cfloat_imag (x), c2_cfloat_real (x));
}
cfloat_versions (cargf);
cfloat_versions (carg);

View File

@ -43,6 +43,7 @@ typedef union { double d; _Complex float cf; } c1_compat;
/* Get the proper symbol versions defined for each function. */
#include <shlib-compat.h>
#include <libm-alias-float.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_3_4)
#define cfloat_versions_compat(func) \
@ -52,7 +53,8 @@ typedef union { double d; _Complex float cf; } c1_compat;
#endif
#define cfloat_versions(func) \
cfloat_versions_compat(func); \
versioned_symbol (libm, __c2_##func, func, GLIBC_2_3_4); \
extern typeof(__c2_##func) __##func attribute_hidden; \
strong_alias (__c2_##func, __##func)
cfloat_versions_compat(func##f); \
versioned_symbol (libm, __c2_##func##f, func##f, GLIBC_2_3_4); \
extern typeof(__c2_##func##f) __##func##f attribute_hidden; \
strong_alias (__c2_##func##f, __##func##f); \
libm_alias_float_other (__##func, func)

View File

@ -37,4 +37,4 @@ __c2_cimagf (c2_cfloat_decl (z))
return c2_cfloat_imag (z);
}
cfloat_versions (cimagf);
cfloat_versions (cimag);

View File

@ -39,4 +39,4 @@ __c2_conjf (c2_cfloat_decl (z))
return c2_cfloat_return (r);
}
cfloat_versions (conjf);
cfloat_versions (conj);

View File

@ -37,4 +37,4 @@ __c2_crealf (c2_cfloat_decl (z))
return c2_cfloat_real (z);
}
cfloat_versions (crealf);
cfloat_versions (creal);

View File

@ -54,4 +54,4 @@ __c2_cacosf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
cfloat_versions (cacosf);
cfloat_versions (cacos);

View File

@ -53,4 +53,4 @@ __c2_cacoshf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
cfloat_versions (cacoshf);
cfloat_versions (cacosh);

View File

@ -51,4 +51,4 @@ __c2_casinf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
cfloat_versions (casinf);
cfloat_versions (casin);

View File

@ -51,4 +51,4 @@ __c2_casinhf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
cfloat_versions (casinhf);
cfloat_versions (casinh);

View File

@ -51,4 +51,4 @@ __c2_catanf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
cfloat_versions (catanf);
cfloat_versions (catan);

View File

@ -51,4 +51,4 @@ __c2_catanhf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
cfloat_versions (catanhf);
cfloat_versions (catanh);

View File

@ -51,4 +51,4 @@ __c2_ccosf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
cfloat_versions (ccosf);
cfloat_versions (ccos);

View File

@ -51,4 +51,4 @@ __c2_ccoshf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
cfloat_versions (ccoshf);
cfloat_versions (ccosh);

View File

@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
#include <libm-alias-float.h>
/* Use the -inf rounding mode conversion instructions to implement
ceil, via something akin to -floor(-x). This is much faster than
@ -50,4 +51,4 @@ __ceilf (float x)
return x;
}
weak_alias (__ceilf, ceilf)
libm_alias_float (__ceil, ceil)

View File

@ -51,4 +51,4 @@ __c2_cexpf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
cfloat_versions (cexpf);
cfloat_versions (cexp);

View File

@ -21,6 +21,7 @@
#include <complex.h>
#include <math.h>
#include <libm-alias-float.h>
#undef __clog10f
#undef clog10f
@ -62,3 +63,4 @@ compat_symbol (libm, __c1_clog10f_2, __clog10f, GLIBC_2_1);
versioned_symbol (libm, __c2_clog10f, clog10f, GLIBC_2_3_4);
extern typeof(__c2_clog10f) __clog10f attribute_hidden;
strong_alias (__c2_clog10f, __clog10f)
libm_alias_float_other (__c2_clog10, clog10)

View File

@ -51,4 +51,4 @@ __c2_clogf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
cfloat_versions (clogf);
cfloat_versions (clog);

View File

@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
#include <libm-alias-float.h>
float
__copysignf (float x, float y)
@ -24,4 +25,4 @@ __copysignf (float x, float y)
return __builtin_copysignf (x, y);
}
weak_alias (__copysignf, copysignf)
libm_alias_float (__copysign, copysign)

View File

@ -51,4 +51,4 @@ __c2_cpowf (c2_cfloat_decl (x), c2_cfloat_decl (c))
return c2_cfloat_return (r);
}
cfloat_versions (cpowf);
cfloat_versions (cpow);

View File

@ -51,4 +51,4 @@ __c2_cprojf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
cfloat_versions (cprojf);
cfloat_versions (cproj);

View File

@ -51,4 +51,4 @@ __c2_csinf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
cfloat_versions (csinf);
cfloat_versions (csin);

View File

@ -51,4 +51,4 @@ __c2_csinhf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
cfloat_versions (csinhf);
cfloat_versions (csinh);

View File

@ -51,4 +51,4 @@ __c2_csqrtf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
cfloat_versions (csqrtf);
cfloat_versions (csqrt);

View File

@ -51,4 +51,4 @@ __c2_ctanf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
cfloat_versions (ctanf);
cfloat_versions (ctan);

View File

@ -51,4 +51,4 @@ __c2_ctanhf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
cfloat_versions (ctanhf);
cfloat_versions (ctanh);

View File

@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
#include <libm-alias-float.h>
float
__fabsf (float x)
@ -24,4 +25,4 @@ __fabsf (float x)
return __builtin_fabsf (x);
}
weak_alias (__fabsf, fabsf)
libm_alias_float (__fabs, fabs)

View File

@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
#include <libm-alias-float.h>
/* Use the -inf rounding mode conversion instructions to implement
@ -51,4 +52,4 @@ __floorf (float x)
return x;
}
weak_alias (__floorf, floorf)
libm_alias_float (__floor, floor)

View File

@ -18,6 +18,7 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
#include <libm-alias-float.h>
#include <libm-alias-double.h>
.set noat
@ -46,6 +47,6 @@ END (__fmax)
/* Given the in-register format of single-precision, this works there too. */
strong_alias (__fmax, __fmaxf)
weak_alias (__fmaxf, fmaxf)
libm_alias_float (__fmax, fmax)
libm_alias_double (__fmax, fmax)

View File

@ -18,6 +18,7 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
#include <libm-alias-float.h>
#include <libm-alias-double.h>
.set noat
@ -46,6 +47,6 @@ END (__fmin)
/* Given the in-register format of single-precision, this works there too. */
strong_alias (__fmin, __fminf)
weak_alias (__fminf, fminf)
libm_alias_float (__fmin, fmin)
libm_alias_double (__fmin, fmin)

View File

@ -18,6 +18,7 @@
#define __llrintf not___llrintf
#define llrintf not_llrintf
#include <math.h>
#include <libm-alias-float.h>
#undef __llrintf
#undef llrintf
@ -34,5 +35,5 @@ __lrintf (float x)
}
strong_alias (__lrintf, __llrintf)
weak_alias (__lrintf, lrintf)
weak_alias (__llrintf, llrintf)
libm_alias_float (__lrint, lrint)
libm_alias_float (__llrint, llrint)

View File

@ -18,6 +18,7 @@
#define __llroundf not___llroundf
#define llroundf not_llroundf
#include <math.h>
#include <libm-alias-float.h>
#undef __llroundf
#undef llroundf
@ -33,5 +34,5 @@ __lroundf (float x)
}
strong_alias (__lroundf, __llroundf)
weak_alias (__lroundf, lroundf)
weak_alias (__llroundf, llroundf)
libm_alias_float (__lround, lround)
libm_alias_float (__llround, llround)

View File

@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
#include <libm-alias-float.h>
float
@ -47,4 +48,4 @@ __rintf (float x)
return x;
}
weak_alias (__rintf, rintf)
libm_alias_float (__rint, rint)

View File

@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
#include <libm-alias-float.h>
/* Use the chopped rounding mode conversion instructions to implement trunc. */
@ -40,4 +41,4 @@ __truncf (float x)
return copysignf (r, x);
}
weak_alias (__truncf, truncf)
libm_alias_float (__trunc, trunc)