diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2017-10-13 16:05:24 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2017-11-20 10:35:04 -0200 |
commit | 323616584e7079650b53eac79c905f36a5e686e5 (patch) | |
tree | 64816afb1d2f0cd727cf8fc6ead46bc91fbc41d3 /sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.c | |
parent | 01d040de539a2dce88b8692462861d6765e1a524 (diff) | |
download | glibc-323616584e7079650b53eac79c905f36a5e686e5.tar.gz |
sparc: refactor sparc32 rint{f} selector to C
This patch refactors the sparc32 ifunc selector to a C implementation.
Also, the generic symbol is moved to its own implementation file
s_rint{f}-generic.S).
Checked on sparc64-linux-gnu and sparcv9-linux-gnu.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile
(libm-sysdep_routines): Add s_rintf-generic and s_rint-generic.
* sysdeps/sparc/sparcv9/fpu/multiarch/s_rint-generic.S: New
file.
* sysdeps/sparc32/sparcv9/fpu/multiarch/s_rint.c: Likewise.
* sysdeps/sparc32/sparcv9/fpu/multiarch/s_rintf-generic.S:
Likewise.
* sysdeps/sparc32/sparcv9/fpu/multiarch/s_rintf.c: Likewise.
* sysdeps/sparc32/sparcv9/fpu/multiarch/s_rint.S: Remove file.
* sysdeps/sparc32/sparcv9/fpu/multiarch/s_rintf.S: Likewise.
Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.c')
-rw-r--r-- | sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.c new file mode 100644 index 0000000000..b6714e6619 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.c @@ -0,0 +1,35 @@ +/* rint ifunc resolver, Linux/sparc32 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 + <http://www.gnu.org/licenses/>. */ + +#define __rint __redirect_rint +#include <math.h> +#undef __rint +#include <math_ldbl_opt.h> +#include <sparc-ifunc.h> + +extern __typeof (__redirect_rint) __rint_vis3 attribute_hidden; +extern __typeof (__redirect_rint) __rint_generic attribute_hidden; + +sparc_libm_ifunc_redirected (__redirect_rint, __rint, + hwcap & HWCAP_SPARC_VIS3 + ? __rint_vis3 + : __rint_generic); +weak_alias (__rint, rint) +#if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0) +compat_symbol (libm, __rint, rintl, GLIBC_2_0); +#endif |