From patchwork Thu Oct 26 19:06:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 117263 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1126128qgn; Thu, 26 Oct 2017 12:09:44 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RODBQaf0BqszSKV5HpSl+nxISOfuzgSz31R42IyK7g4Sygths6WRpjR2nlbPLvSnflf9H3 X-Received: by 10.99.127.67 with SMTP id p3mr5854697pgn.321.1509044984562; Thu, 26 Oct 2017 12:09:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509044984; cv=none; d=google.com; s=arc-20160816; b=d49HJqVtDDky7v9RlScKPV5AqBgKQ4hmyTgGnnbyoUZj3MXz4x85cZ6/Z+09grHwc5 DBkRtkpjLvud+Q3ShAHuKKCJv6nYaCih9vBT/En68dC9dOy6pXnLHgoyxKrisNkg7yAV 6uSdUh7yqxZ+0T/QUgIK1BtG6aFmonq2SZDMVjpKcPX2rArxzMrpkWs3quoHqT/BgBVZ 0DWp/NWpAmZuIRnWojKQ/ScGfHTN/2DoFKNRtkmY0BTM+0QKN74IUtdsjzdTfpp9Moj4 GxWz6ulTAaFbk1HYm20EfbT+WWti4u5AodENh3ccdKfML7il6wIA9dBiYp1Aa0ypTJ+W RmeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:to:from:delivered-to :sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=s+tKlFI1pxfb87UnZYprNpFDsISMjho5Tp8t0EMPkJI=; b=XK9atznShFIPh07JrsRgHEe0mrLi420IlVWiC7J9j8EtmpBbFpajx8ALWvsPY69oZ9 BtkZ7aL32oMZDBAK6gdeUt99URh07Xe/WKq3FJbKutnmRWeq/kX1ev3x4wzIOQnFdF3k XPtbcpQ4pExRyzCN9kgYqepSn43/qG1bA7+40uqM87QjJ0D4ZsDXVjEgGwTUalzDH1/g x4LP5WzaYrWPsxxYWh42bdqyQaSLY6wazuIKRiK2iJ6fnBMDRQkHd59Qzu2AKKxaIn0L uTBzbrZv/UO4lQJ/thXDp3Ow30g4aAdaaPZicINH3PbBpGakq31RX3/vX5PcrhgeRS9/ zeyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=AXMDU5b/; spf=pass (google.com: domain of libc-alpha-return-86413-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-86413-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id u3si3325343plb.302.2017.10.26.12.09.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Oct 2017 12:09:44 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-86413-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=AXMDU5b/; spf=pass (google.com: domain of libc-alpha-return-86413-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-86413-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=PiYbrX0kfGLFBoFb92Ap/DCQ9S/Iwku 3rckv5kQDRpB5jlcCGTw3DHMagBfuiW0j7736fusHjmkqGzpF0zNl5y0EzQ9Si6E 4M/Yl/OUJobKJox76R99IdUan/751oZFu/l7Wya+dVa3SvN2UXaAfQwOmDgbN+G5 PTNIzCbXzQGI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=rEwEe8E2PMIIj9wDvL0QnvImwLc=; b=AXMDU 5b/eOK2WQM6GbOF8iMfn+pq5vawS+40M0I2bF+eEUVlUmgFTDrulk1UoJYLeisJC UZYrHCm0igAatCqIBmB/9J4cBKRPdWbhegZtFPYBtD3BSjOdjzvcqEfTdIZr7Rsn VNTNlU9waFc7CypMsWc/mwCFb0iItxmA3G91hc= 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-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@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-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 17:06:40 -0200 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> 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 -- 2.7.4 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)