From patchwork Thu Oct 26 19:06:50 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: 117274 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1128011qgn; Thu, 26 Oct 2017 12:11:41 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TsxQY9L3oaljPJB021PC5O42P1lv7UFeqzeiEigkBFIt32dP4H10sqZsn3Lm9tJCoeBE7D X-Received: by 10.98.20.197 with SMTP id 188mr6470264pfu.94.1509045101290; Thu, 26 Oct 2017 12:11:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509045101; cv=none; d=google.com; s=arc-20160816; b=lswK9SibY75DYYrXsweSm/vWgm7ncvhlRbXaVQOHJbI9yqqXjo/0RsJ/fZs4uyaFPb Tmcs+pmSyVVh6eZhLtQLephvRw9XfN8V9EEoV9TX4AKUYCjKk3zOqK1EFcEOjEdY4dOj 8rkqe2qQQJFb3ZnUz/CXHXZGVu17u1Mdo8TXg/cYDRAo3KF9jaQaraYsjq+713sk2rMn JUxfIq9Xmi+qcRM88nwF8vxgapwxXgfRfoFz6k8YB8Hjts4iy9xO4atrMcEf/ysU5OY1 PlDwWwpZ1xFHXgJh5Fqhy8F9BLROga0k80S/8wzur0BjwcPe+OGe8MIpP5Z1xrfGS5yw CEjA== 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=tBEuY85vJCrYetcJfUcJ+W5YaP7D6ygRgXb58XBLM8E=; b=Pj9HeV7/jiGoMnVYb8AJAAVBPXAwAvtIolzBh2TI+klSkRbyjCsNJx6tqyjsn9AMUL ziorZlZ/15IonbFYWTWIrxF/oEc/t3Qf6eWwCs99y51pjWrAh1wuYB3Ygi4hkNpJuiKK USuDcwGSiFpG2jSNb7zeI6CelgZSZ8MjOTJpKq/0oPM4sPbxQrhu4VAWzwz0tGKGOAYW Rq4TEzdaa4mZk5ca8owMN45sRgphy9vqWblryhYImc2qCw5TNEAgTqvm/jVeyIzdXZRo HJdHxuJVsJDX7kAEPxwwqc1XtPkpsnWHiHpTS4K0eDfJdE2/iXlcYJF+Zz0jBiB9uW83 x7QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=PS0i2s/7; spf=pass (google.com: domain of libc-alpha-return-86424-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-86424-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 t73si3738046pgb.377.2017.10.26.12.11.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Oct 2017 12:11:41 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-86424-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=PS0i2s/7; spf=pass (google.com: domain of libc-alpha-return-86424-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-86424-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=jyt3XAOO6T9hDiKigqmMIWT2y+lTsEO +vbwrETbJnjMts7IJlwBbbibl/nS5W7VzCZXDD/rAtvt9RH3IAbY5hpP8fuJICUb VKov4l+kORnZNnPAmZtIA/M+HfpdlnYiNqnR0N2s1BuUTs5dGLi4esIKdwUR5Iiq bpay/GjteLUw= 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=T2DL59/deKtks5c29fnd+xACTDo=; b=PS0i2 s/7lIECYnLLkbxh+6DMMjWkRKmhl7fA2IwPuZplZ1Eiz+vvTnPO0rXc9DpoXsOMd /XcKxD7deMFx0Xhc8+2Opc0w5I+GQA6gjw9ysy2HsIdtpMvrptq1PVf3rPVQMmUm k/6KXjRvSMs/8LUSPdbg3MQHZjQdQ06JlscG9Y= Received: (qmail 101183 invoked by alias); 26 Oct 2017 19:07:43 -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 100423 invoked by uid 89); 26 Oct 2017 19:07:36 -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-f196.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=tBEuY85vJCrYetcJfUcJ+W5YaP7D6ygRgXb58XBLM8E=; b=M1oQfY56xd56qRqGM00DnuzUxbE6ppzA7FYIgYJ0Zg/kXTnG7yrT8QckbA+LCimpdr naVgl9WfKCda2WgDW9Em1FuzoMGjD8lV6WtMfl/AnH5iqy7fKtI4BZ/7KzhONyekjCi2 8rY+fRGwxYXSaoKl9AkhhyrC3SD0w9tlzMt7pxf3RRIcIMsPPzDE3D1hnVXgmJF4KB9r P/EMZ9YlrUB70tTYuXd3IOilZ4PxG0n8bcdDFv/JMFwRQ2o+nLfb5W96w5fGgJeCyhD6 lZ2VOw+6TGuTbEivbzFMQp2bMyQxYsUQAo+D0HFNH0CaJ94eEauewuvVuaTgKTbhGMto IWRg== X-Gm-Message-State: AMCzsaWVYIdxKKRziTE5EZ8YT/ipvCfrd1LWI7VGOpC4azXG3ZFOhCoo KRYdPmQdmR1ka0DpcKrXt7TZkkInUsA= X-Received: by 10.55.125.66 with SMTP id y63mr10355488qkc.101.1509044851787; Thu, 26 Oct 2017 12:07:31 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 22/25] sparc: refactor sparc32 nearbyint{f} selector to C Date: Thu, 26 Oct 2017 17:06:50 -0200 Message-Id: <1509044813-9951-23-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 sparc32 ifunc selector to a C implementation. Also, the generic symbol is moved to its own implementation file s_nearbyint{f}-generic.S). Checked on sparc64-linux-gnu and sparcv9-linux-gnu. * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile (libm-sysdep_routines): Add s_nearbyintf-generic and s_nearbyint-generic. * sysdeps/sparc/sparcv9/fpu/multiarch/s_nearbyint-generic.S: New file. * sysdeps/sparc32/sparcv9/fpu/multiarch/s_nearbyint.c: Likewise. * sysdeps/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-generic.S: Likewise. * sysdeps/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.c: Likewise. * sysdeps/sparc32/sparcv9/fpu/multiarch/s_nearbyint.S: Remove file. * sysdeps/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.S: Likewise. Signed-off-by: Adhemerval Zanella --- ChangeLog | 12 ++++++++ .../sparc/sparc32/sparcv9/fpu/multiarch/Makefile | 6 ++-- .../sparcv9/fpu/multiarch/s_nearbyint-generic.S | 9 ++++++ .../sparc32/sparcv9/fpu/multiarch/s_nearbyint.S | 19 ------------ .../sparc32/sparcv9/fpu/multiarch/s_nearbyint.c | 35 ++++++++++++++++++++++ .../sparcv9/fpu/multiarch/s_nearbyintf-generic.S | 4 +++ .../sparc32/sparcv9/fpu/multiarch/s_nearbyintf.S | 12 -------- .../sparc32/sparcv9/fpu/multiarch/s_nearbyintf.c | 29 ++++++++++++++++++ 8 files changed, 92 insertions(+), 34 deletions(-) create mode 100644 sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-generic.S delete mode 100644 sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.S create mode 100644 sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.c create mode 100644 sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-generic.S delete mode 100644 sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.S create mode 100644 sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.c -- 2.7.4 diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile index 459c0e5..1a26ee1 100644 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile +++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile @@ -11,9 +11,9 @@ libm-sysdep_routines += s_fabs-vis3 s_fabsf-vis3 s_fabs-generic \ s_fabsf-generic s_llrintf-vis3 s_llrint-vis3 \ s_llrintf-generic s_llrint-generic \ s_rintf-vis3 s_rint-vis3 s_rintf-generic \ - s_rint-generic \ - s_fmaf-vis3 s_fma-vis3 s_fma-generic s_fmaf-generic \ - s_nearbyint-vis3 s_nearbyintf-vis3 \ + s_rint-generic s_fmaf-vis3 s_fma-vis3 s_fma-generic \ + s_fmaf-generic s_nearbyint-vis3 s_nearbyintf-vis3 \ + s_nearbyint-generic s_nearbyintf-generic \ s_fdimf-vis3 s_fdim-vis3 s_fdim-generic \ s_fdimf-generic \ $(sysdep_calls:s_%=m_%) diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-generic.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-generic.S new file mode 100644 index 0000000..fd4112e --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-generic.S @@ -0,0 +1,9 @@ +#include + +#define __nearbyint __nearbyint_generic +#undef weak_alias +#define weak_alias(a, b) +#undef compat_symbol +#define compat_symbol(a, b, c, d) + +#include diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.S deleted file mode 100644 index 47da9ea..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.S +++ /dev/null @@ -1,19 +0,0 @@ -#include -#include - -SPARC_ASM_VIS3_IFUNC(nearbyint) - -weak_alias (__nearbyint, nearbyint) - -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1) -compat_symbol (libm, __nearbyint, nearbyintl, GLIBC_2_1) -#endif - -# undef weak_alias -# define weak_alias(a, b) -# undef compat_symbol -# define compat_symbol(a, b, c, d) - -#define __nearbyint __nearbyint_generic - -#include "../s_nearbyint.S" diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.c new file mode 100644 index 0000000..5a2b6e4 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.c @@ -0,0 +1,35 @@ +/* nearbyint 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 + . */ + +#define __nearbyint __redirect_nearbyint +#include +#undef __nearbyint +#include +#include + +extern __typeof (__redirect_nearbyint) __nearbyint_vis3 attribute_hidden; +extern __typeof (__redirect_nearbyint) __nearbyint_generic attribute_hidden; + +sparc_libm_ifunc_redirected (__redirect_nearbyint, __nearbyint, + hwcap & HWCAP_SPARC_VIS3 + ? __nearbyint_vis3 + : __nearbyint_generic); +weak_alias (__nearbyint, nearbyint) +#if LONG_DOUBLE_COMPAT (libm, GLIBC_2_1) +compat_symbol (libm, __nearbyint, nearbyintl, GLIBC_2_1); +#endif diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-generic.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-generic.S new file mode 100644 index 0000000..8f9088e --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-generic.S @@ -0,0 +1,4 @@ +#define __nearbyintf __nearbyintf_generic +#undef weak_alias +#define weak_alias(a, b) +#include diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.S deleted file mode 100644 index 95100c1..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.S +++ /dev/null @@ -1,12 +0,0 @@ -#include - -SPARC_ASM_VIS3_IFUNC(nearbyintf) - -weak_alias (__nearbyintf, nearbyintf) - -# undef weak_alias -# define weak_alias(a, b) - -#define __nearbyintf __nearbyintf_generic - -#include "../s_nearbyintf.S" diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.c new file mode 100644 index 0000000..a513fa7 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.c @@ -0,0 +1,29 @@ +/* nearbyintf 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 + . */ + +#include +#include + +extern __typeof (nearbyintf) __nearbyintf_vis3 attribute_hidden; +extern __typeof (nearbyintf) __nearbyintf_generic attribute_hidden; + +sparc_libm_ifunc (__nearbyintf, + hwcap & HWCAP_SPARC_VIS3 + ? __nearbyintf_vis3 + : __nearbyintf_generic); +weak_alias (__nearbyintf, nearbyintf)