From c96d3335a30c214994bfcb2077518027b52dce07 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Fri, 13 Oct 2017 11:39:43 -0300 Subject: sparc: refactor sparc64 isinf{f} selector to C This patch refactors the sparc64 ifunc selector to a C implementation. Also, the generic symbol is moved to its own implementation file s_isinf{f}-generic.S). Checked on sparc64-linux-gnu and sparcv9-linux-gnu. * sysdeps/sparc/sparc64/fpu/multiarch/Makefile (sysdeps_calls): Add isinff-generic and s_isinf-generic objects. * sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-generic.S: New file. * sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.c: Likewise. * sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-generic.S: Likewise. * sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.c: Likewise. * sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.S: Remove file. * sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.S: Likewise. Signed-off-by: Adhemerval Zanella --- sysdeps/sparc/sparc64/fpu/multiarch/Makefile | 4 +-- .../sparc/sparc64/fpu/multiarch/s_isinf-generic.S | 6 ++++ sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.S | 15 --------- sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.c | 37 ++++++++++++++++++++++ .../sparc/sparc64/fpu/multiarch/s_isinff-generic.S | 6 ++++ sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.S | 15 --------- sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.c | 33 +++++++++++++++++++ 7 files changed, 84 insertions(+), 32 deletions(-) create mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-generic.S delete mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.S create mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.c create mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-generic.S delete mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.S create mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.c (limited to 'sysdeps') diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/Makefile b/sysdeps/sparc/sparc64/fpu/multiarch/Makefile index a46773ba1e..f0c8fa3125 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/Makefile +++ b/sysdeps/sparc/sparc64/fpu/multiarch/Makefile @@ -3,8 +3,8 @@ ifeq ($(subdir),math) # by printf. While the libc objects have the prefix s_, the libm ones are # prefixed with m_. sysdep_calls := s_signbitf-vis3 s_signbit-vis3 s_signbitf-generic \ - s_signbit-generic s_finitef-vis3 \ - s_finite-vis3 s_isinff-vis3 s_isinf-vis3 \ + s_signbit-generic s_finitef-vis3 s_finite-vis3 \ + s_isinff-vis3 s_isinf-vis3 s_isinff-generic s_isinf-generic \ s_isnanf-vis3 s_isnan-vis3 s_isnanf-generic s_isnan-generic sysdep_routines += $(sysdep_calls) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-generic.S new file mode 100644 index 0000000000..ebaf054025 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-generic.S @@ -0,0 +1,6 @@ +#define __isinf __isinf_generic +#undef hidden_def +#define hidden_def(a) +#undef weak_alias +#define weak_alias(a,b) +#include <./sysdeps/sparc/sparc64/fpu/s_isinf.S> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.S deleted file mode 100644 index ed9b62640d..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.S +++ /dev/null @@ -1,15 +0,0 @@ -#include - -SPARC_ASM_VIS3_IFUNC(isinf) - -hidden_def (__isinf) -weak_alias (__isinf, isinf) - -# undef weak_alias -# define weak_alias(a, b) -# undef hidden_def -# define hidden_def(a) - -#define __isinf __isinf_generic - -#include "../s_isinf.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.c new file mode 100644 index 0000000000..d7fec22654 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.c @@ -0,0 +1,37 @@ +/* isinf ifunc resolver, Linux/sparc64 version. + Copyright (C) 2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + 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 + . */ + +#define __isinf __redirect___isinf +#define __isinff __redirect___isinff +#define __isinfl __redirect___isinfl +#include +#undef __isinf +#undef __isinff +#undef __isinfl +#include + +extern __typeof (isinf) __isinf_vis3 attribute_hidden; +extern __typeof (isinf) __isinf_generic attribute_hidden; + +sparc_libm_ifunc_redirected (__redirect___isinf, __isinf, + hwcap & HWCAP_SPARC_VIS3 + ? __isinf_vis3 + : __isinf_generic) + +sparc_ifunc_redirected_hidden_def (__redirect___isinf, __isinf) +weak_alias (__isinf, isinf) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-generic.S new file mode 100644 index 0000000000..d37243f216 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-generic.S @@ -0,0 +1,6 @@ +#define __isinff __isinff_generic +#undef hidden_def +#define hidden_def(a) +#undef weak_alias +#define weak_alias(a,b) +#include diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.S deleted file mode 100644 index 04517398f8..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.S +++ /dev/null @@ -1,15 +0,0 @@ -#include - -SPARC_ASM_VIS3_IFUNC(isinff) - -hidden_def (__isinff) -weak_alias (__isinff, isinff) - -# undef weak_alias -# define weak_alias(a, b) -# undef hidden_def -# define hidden_def(a) - -#define __isinff __isinff_generic - -#include "../s_isinff.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.c new file mode 100644 index 0000000000..31c67f3182 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.c @@ -0,0 +1,33 @@ +/* isinff ifunc resolver, Linux/sparc64 version. + Copyright (C) 2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + 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 + . */ + +#define __isinff __redirect___isinff +#include +#undef __isinff +#include + +extern __typeof (isinff) __isinff_vis3 attribute_hidden; +extern __typeof (isinff) __isinff_generic attribute_hidden; + +sparc_libm_ifunc_redirected (__redirect___isinff, __isinff, + hwcap & HWCAP_SPARC_VIS3 + ? __isinff_vis3 + : __isinff_generic); + +sparc_ifunc_redirected_hidden_def (__redirect___isinff, __isinff) +weak_alias (__isinff, isinff) -- cgit 1.4.1