From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 98819 invoked by alias); 26 Oct 2017 19:07:22 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 98679 invoked by uid 89); 26 Oct 2017 19:07:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-qk0-f194.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=s+tKlFI1pxfb87UnZYprNpFDsISMjho5Tp8t0EMPkJI=; b=mHXOkhDs6Pp+hNTgnlje0guVpWG/uwjbhNpDWl7yV1oHYFaH7gegLQFewSRFjezLfT DH5gO4TR/vaiYgdLIUrL9NTy28hXeN1SB/+w6TqQRH5FhNJ2gsArLK4RSN0GzuSfNLWg iZte9E8yaLzVFeupIEeKeXAy3MxC700wLWxAr0ZFeVvQxVqi8k7FufUnFbpMlLknyRMP YT1nT5OZqgUhx1FRwlJfrOjZYEwrgbToN54cT7Jpp4OUI16rGLRNOl8WZkYg7+Ux9Mrg eg+Kuql+1iW0JwY61b11gMHmOD7atwBp8WM4QjIEfzxmfeT7YUquWr6fm9CZ9i8zQuxY +ubQ== X-Gm-Message-State: AMCzsaVREeNZgITDaVDKiDh0TtXYZVPNt/gMfnFJXnynV4MGhEcCEUuu KBBQ+WeXDWMFZfc4v19P6ukApkzcPuo= X-Google-Smtp-Source: ABhQp+R7Bybaoy43JrBa+YCvRg3d4mKE2U61AjU12ehmT9J1aXTqrW4Nb1hJvp8hiStPYpRvzdkO5w== X-Received: by 10.55.6.22 with SMTP id 22mr9385756qkg.340.1509044837549; Thu, 26 Oct 2017 12:07:17 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 12/25] sparc: refactor sparc64 rint{f} selector to C Date: Thu, 26 Oct 2017 19:07:00 -0000 Message-Id: <1509044813-9951-13-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1509044813-9951-1-git-send-email-adhemerval.zanella@linaro.org> References: <1509044813-9951-1-git-send-email-adhemerval.zanella@linaro.org> X-SW-Source: 2017-10/txt/msg01235.txt.bz2 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 --- ChangeLog | 10 ++++++++ sysdeps/sparc/sparc64/fpu/multiarch/Makefile | 1 + .../sparc/sparc64/fpu/multiarch/s_rint-generic.S | 4 +++ sysdeps/sparc/sparc64/fpu/multiarch/s_rint.S | 12 --------- sysdeps/sparc/sparc64/fpu/multiarch/s_rint.c | 29 ++++++++++++++++++++++ .../sparc/sparc64/fpu/multiarch/s_rintf-generic.S | 4 +++ sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.S | 12 --------- sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.c | 29 ++++++++++++++++++++++ 8 files changed, 77 insertions(+), 24 deletions(-) create mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_rint-generic.S delete mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_rint.S create mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_rint.c create mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-generic.S delete mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.S create mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.c diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/Makefile b/sysdeps/sparc/sparc64/fpu/multiarch/Makefile index d0a87d1..3321e1d 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/Makefile +++ b/sysdeps/sparc/sparc64/fpu/multiarch/Makefile @@ -11,6 +11,7 @@ sysdep_calls := s_signbitf-vis3 s_signbit-vis3 s_signbitf-generic \ sysdep_routines += $(sysdep_calls) libm-sysdep_routines += s_lrintf-vis3 s_lrint-vis3 s_lrintf-generic \ s_lrint-generic s_rintf-vis3 s_rint-vis3 \ + s_rintf-generic s_rint-generic \ s_fmaf-vis3 s_fma-vis3 s_fmaf-generic s_fma-generic \ s_nearbyint-vis3 s_nearbyintf-vis3 \ s_nearbyint-generic s_nearbyintf-generic \ diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-generic.S new file mode 100644 index 0000000..d927434 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-generic.S @@ -0,0 +1,4 @@ +#define __rint __rint_generic +#undef weak_alias +#define weak_alias(a, b) +#include diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.S deleted file mode 100644 index cc980eb..0000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.S +++ /dev/null @@ -1,12 +0,0 @@ -#include - -SPARC_ASM_VIS3_IFUNC(rint) - -weak_alias (__rint, rint) - -# undef weak_alias -# define weak_alias(a, b) - -#define __rint __rint_generic - -#include "../s_rint.S" 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 0000000..ca566c2 --- /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) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-generic.S new file mode 100644 index 0000000..30da5f0 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-generic.S @@ -0,0 +1,4 @@ +#define __rintf __rintf_generic +#undef weak_alias +#define weak_alias(a, b) +#include diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.S deleted file mode 100644 index 38fd936..0000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.S +++ /dev/null @@ -1,12 +0,0 @@ -#include - -SPARC_ASM_VIS3_IFUNC(rintf) - -weak_alias (__rintf, rintf) - -# undef weak_alias -# define weak_alias(a, b) - -#define __rintf __rintf_generic - -#include "../s_rintf.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.c new file mode 100644 index 0000000..67f166c --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.c @@ -0,0 +1,29 @@ +/* rintf 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 (rintf) __rintf_vis3 attribute_hidden; +extern __typeof (rintf) __rintf_generic attribute_hidden; + +sparc_libm_ifunc (__rintf, + hwcap & HWCAP_SPARC_VIS3 + ? __rintf_vis3 + : __rintf_generic); +weak_alias (__rintf, rintf) -- 2.7.4