From 21bfcc3d245734618f4fcb710b91c41b1483975b Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Fri, 13 Oct 2017 13:42:07 -0300 Subject: sparc: refactor sparc64 rint{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_rint{f}-generic.S). Checked on sparc64-linux-gnu and sparcv9-linux-gnu. * sysdeps/sparc/sparc64/fpu/multiarch/Makefile (libm-sysdep_routines): Add s_rintf-generic and s_rint-generic objects. * sysdeps/sparc/sparc64/fpu/multiarch/s_rint-generic.S: New file. * sysdeps/sparc/sparc64/fpu/multiarch/s_rint.c: Likewise. * sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-generic.S: Likewise. * sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.c: Likewise. * sysdeps/sparc/sparc64/fpu/multiarch/s_rint.S: Remove file. * sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.S: Likewise. Signed-off-by: Adhemerval Zanella --- sysdeps/sparc/sparc64/fpu/multiarch/s_rint.c | 29 ++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_rint.c (limited to 'sysdeps/sparc/sparc64/fpu/multiarch/s_rint.c') diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.c new file mode 100644 index 0000000000..c53a7fe697 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.c @@ -0,0 +1,29 @@ +/* rint 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 + . */ + +#include +#include + +extern __typeof (rint) __rint_vis3 attribute_hidden; +extern __typeof (rint) __rint_generic attribute_hidden; + +sparc_libm_ifunc (__rint, + hwcap & HWCAP_SPARC_VIS3 + ? __rint_vis3 + : __rint_generic); +weak_alias (__rint, rint) -- cgit 1.4.1