Support for type-generic libm function implementations libm

System Internals / glibc - Paul E. Murphy [linux.vnet.ibm.com] - 17 August 2016 14:06 UTC

This defines a new classes of libm objects. The _template.c file which is used in conjunction with the new makefile hooks to derive variants for each type supported by the target machine.

The headers math-type-macros-TYPE.h are used to supply macros to a common implementation of a function in a file named FUNC_template.c and glued togethor via a generated file matching existing naming in the build directory.

This has the properties of preserving the existing override mechanism and not requiring any arcane build system twiddling. Likewise, it enables machines to override these files without any additional work.

I have verified the built objects for ppc64, x86_64, alpha, arm, and m68k do not change in any meaningful way with these changes using the Fedora cross toolchains. I have verified the x86_64 and ppc64 changes still run.

ce6698e Support for type-generic libm function implementations libm
ChangeLog | 50 ++++++++
math/Makefile | 31 ++++-
math/cabs.c | 32 ------
math/cabs_template.c | 33 ++++++
math/cabsf.c | 28 -----
math/cabsl.c | 28 -----
math/carg.c | 32 ------
math/carg_template.c | 33 ++++++
math/cargf.c | 28 -----
math/cargl.c | 28 -----
math/cimag.c | 31 -----
math/cimag_template.c | 32 ++++++
math/cimagf.c | 27 -----
math/cimagl.c | 27 -----
math/conj.c | 31 -----
math/conj_template.c | 32 ++++++
math/conjf.c | 27 -----
math/conjl.c | 27 -----
math/creal.c | 31 -----
math/creal_template.c | 32 ++++++
math/crealf.c | 27 -----
math/creall.c | 27 -----
sysdeps/generic/math-type-macros-double.h | 45 ++++++++
sysdeps/generic/math-type-macros-float.h | 35 ++++++
sysdeps/generic/math-type-macros-ldouble.h | 32 ++++++
sysdeps/generic/math-type-macros.h | 121 ++++++++++++++++++++
sysdeps/ieee754/ldbl-opt/cabs.c | 6 -
sysdeps/ieee754/ldbl-opt/cabsl.c | 6 -
sysdeps/ieee754/ldbl-opt/carg.c | 6 -
sysdeps/ieee754/ldbl-opt/cargl.c | 6 -
sysdeps/ieee754/ldbl-opt/cimag.c | 6 -
sysdeps/ieee754/ldbl-opt/cimagl.c | 6 -
sysdeps/ieee754/ldbl-opt/conj.c | 6 -
sysdeps/ieee754/ldbl-opt/conjl.c | 6 -
sysdeps/ieee754/ldbl-opt/creal.c | 6 -
sysdeps/ieee754/ldbl-opt/creall.c | 6 -
sysdeps/ieee754/ldbl-opt/math-type-macros-double.h | 58 ++++++++++
.../ieee754/ldbl-opt/math-type-macros-ldouble.h | 29 +++++
38 files changed, 561 insertions(+), 493 deletions(-)

Upstream: sourceware.org


  • Share