From patchwork Thu Oct 26 19:06:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 117264 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1126321qgn; Thu, 26 Oct 2017 12:09:58 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RvTudY3hpwJO11yXqCbcWa5IOXv1jgKBv164c3IAvxCyIseNsJZdtbS0h6GQw7hOrt3ygq X-Received: by 10.98.194.86 with SMTP id l83mr6218240pfg.314.1509044998360; Thu, 26 Oct 2017 12:09:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509044998; cv=none; d=google.com; s=arc-20160816; b=V0TLpBXye/U9JdoPDJyJpMJbUpr1dil+R285nuFad5kDhfKpTEjOTFCvBQ05vZ29ZX gbjyMcTIuvmY+IcvXXMic54KR4lXt0Pj04LXR7PJ7vPf05GCBlxG1vK/7A7rmFXO7Uj2 GrgmTJcQF0aP5jJzk7e63lQ8vRppRJxjQmRsRqHJIna42zBMMqmRzyveq+lLeOvzm0+m LXslt7Bjas3W2dRfUf8um7y/VrTvzP+W7oT3Jg9lg4yYq8oxQh716wo3VPK2kQPnRiO8 hyB0gJMrQk/YBxSI5R023dTbRm69EpFbCobFltPtqW0BomYcrb4jL0V2rwnbmb5BJlNk 8Xrg== 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=HujDBBlv4WDWlW+Uji+LnS5K3fmWX+dJNMse+Q0zXsc=; b=c2LpiVzZFh3Dchf4UBtacXZr/5DU5Kg3hmcnIabZ8Rlhl0Wh3yqthZpucngQa8k/Jt Bj6GQLwbWJUN8XwQC/SOHDj0mdl1ycTiu33lcdd4/zzHWNEJ6hoegz8JBVKaFBMy1GPV RMJwVMoMpevRLZw/xAd7u3kX0bdgBdaurSWluXkqLCG0zlFJmG1/YHadrNPHUJGvGDkQ K+YBVz0WJzOLQX1zd5OUO+6uKHq6FPMjY6M9WILwOBN4pwmdm3Zxhd1FknEtQv9jjql6 oxnMz1oIGHvV0yzDDxDdVX8ELzJTnK/aHbWidiuLbZMv+8kZOISgBiQmb86C+HoNd2FL LWvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=VRxjCFou; spf=pass (google.com: domain of libc-alpha-return-86414-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-86414-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 t68si4079883pfe.228.2017.10.26.12.09.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Oct 2017 12:09:58 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-86414-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=VRxjCFou; spf=pass (google.com: domain of libc-alpha-return-86414-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-86414-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=kq0/WxTKKkgwCxX9wnxvWX/AYl/V778 3K6Gvsqo8EjlnMNOwZnZ/JN1lOpXTNn6mn/DhHXX3QqgfPdIIi1ZDV+xg0S1G+9o 5HHtSSVH9QUzNPZjh1T8ftvGYYCSBLcrNAsF3tAdLGFgZdEW/ny+PHrAWzOR3vj9 0nqOaGBFJvn8= 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=9pW5xmKzO4cpzrEa4Ee/v0OW3UA=; b=VRxjC FoumeTi2q51i9DDJ31ajy678A0lzJy6Nn8Ir1Dho2JcuvuIAf+pfmTYFpCJ5uAFg Y/F05CICrDRKyG2DPiP/CCAKEXIuJUcLDgtGjdBuQilbArQIphXAmGq/5Dn7rTFn sThwAHpW3qGWq1Tw6vbW/6S5a74SataJKuCMvc= Received: (qmail 98953 invoked by alias); 26 Oct 2017 19:07:23 -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 98826 invoked by uid 89); 26 Oct 2017 19:07:22 -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=HujDBBlv4WDWlW+Uji+LnS5K3fmWX+dJNMse+Q0zXsc=; b=F/oZBRppmKb9AYGP+wdCuEaUt01MnzJ/7mCb2IivfNR7jdnVfBAOEhZRNf5Z70bCR5 uAx+7pKgNiq34TR9Ap+6/CT9qkC83FRlir7C5702hlPqOd05fVhqNPUfZMgn56SdcoD5 vB7f6s3xkUV+p9s6Hmv/xvRCXd09bY1rDwDcCKr4Zuhs+IuWiakux4t1fQi1Yr4ICLfo 6oDHyxwuUtKbFOCT/NGK/GVnP/SDHfdIgDR67Eb6DFI4eH+oj9v76ECEtRQ8erEQZGKH n9hrPycg1lZyCjIlFp6EA0QdKlrSBOz/IwE0KV2RAs76l1L/YRCqrk2g8Xsmt9Wf56So 8O8w== X-Gm-Message-State: AMCzsaWE+0IqVa8hBRFNn82sWfBj3eC7efrMZTISD1HA5V+w1nMQwo86 OIo2mNgAbjEPxFm8bbJTvugXciSKL5k= X-Received: by 10.55.15.139 with SMTP id 11mr9588997qkp.141.1509044833329; Thu, 26 Oct 2017 12:07:13 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 09/25] sparc: refactor sparc64 finite{f} selector to C Date: Thu, 26 Oct 2017 17:06:37 -0200 Message-Id: <1509044813-9951-10-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_finite{f}-generic.S). Checked on sparc64-linux-gnu and sparcv9-linux-gnu. * sysdeps/sparc/sparc64/fpu/multiarch/Makefile (sysdeps_calls): Add s_finitef-generic and s_finite-generic objects. * sysdeps/sparc/sparc64/fpu/multiarch/s_finite-generic.S: New file. * sysdeps/sparc/sparc64/fpu/multiarch/s_finite.c: Likewise. * sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-generic.S: Likewise. * sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.c: Likewise. * sysdeps/sparc/sparc64/fpu/multiarch/s_finite.S: Remove file. * sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.S: Remove file. Signed-off-by: Adhemerval Zanella --- ChangeLog | 9 ++++++ sysdeps/sparc/sparc64/fpu/multiarch/Makefile | 1 + .../sparc/sparc64/fpu/multiarch/s_finite-generic.S | 6 ++++ sysdeps/sparc/sparc64/fpu/multiarch/s_finite.S | 15 --------- sysdeps/sparc/sparc64/fpu/multiarch/s_finite.c | 37 ++++++++++++++++++++++ .../sparc64/fpu/multiarch/s_finitef-generic.S | 6 ++++ sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.S | 15 --------- sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.c | 33 +++++++++++++++++++ 8 files changed, 92 insertions(+), 30 deletions(-) create mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_finite-generic.S delete mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_finite.S create mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_finite.c create mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-generic.S delete mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.S create mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.c -- 2.7.4 diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/Makefile b/sysdeps/sparc/sparc64/fpu/multiarch/Makefile index f0c8fa3..d19a446 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/Makefile +++ b/sysdeps/sparc/sparc64/fpu/multiarch/Makefile @@ -4,6 +4,7 @@ ifeq ($(subdir),math) # prefixed with m_. sysdep_calls := s_signbitf-vis3 s_signbit-vis3 s_signbitf-generic \ s_signbit-generic s_finitef-vis3 s_finite-vis3 \ + s_finitef-generic s_finite-generic \ s_isinff-vis3 s_isinf-vis3 s_isinff-generic s_isinf-generic \ s_isnanf-vis3 s_isnan-vis3 s_isnanf-generic s_isnan-generic diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-generic.S new file mode 100644 index 0000000..dfbf32f --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-generic.S @@ -0,0 +1,6 @@ +#define __finite __finite_generic +#undef hidden_def +#define hidden_def(a) +#undef weak_alias +#define weak_alias(a,b) +#include diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.S deleted file mode 100644 index 78406a6..0000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.S +++ /dev/null @@ -1,15 +0,0 @@ -#include - -SPARC_ASM_VIS3_IFUNC(finite) - -hidden_def (__finite) -weak_alias (__finite, finite) - -# undef weak_alias -# define weak_alias(a, b) -# undef hidden_def -# define hidden_def(a) - -#define __finite __finite_generic - -#include "../s_finite.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.c new file mode 100644 index 0000000..22e46c4 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.c @@ -0,0 +1,37 @@ +/* finite 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 + . */ + +#define __finite __redirect___finite +#define __finitef __redirect___finitef +#define __finitel __redirect___finitel +#include +#undef __finite +#undef __finitef +#undef __finitel +#include + +extern __typeof (finite) __finite_vis3 attribute_hidden; +extern __typeof (finite) __finite_generic attribute_hidden; + +sparc_libm_ifunc_redirected (__redirect___finite, __finite, + hwcap & HWCAP_SPARC_VIS3 + ? __finite_vis3 + : __finite_generic); + +sparc_ifunc_redirected_hidden_def (__redirect___finite, __finite) +weak_alias (__finite, finite) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-generic.S new file mode 100644 index 0000000..3888076 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-generic.S @@ -0,0 +1,6 @@ +#define __finitef __finitef_generic +#undef hidden_def +#define hidden_def(a) +#undef weak_alias +#define weak_alias(a,b) +#include diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.S deleted file mode 100644 index cafd41f..0000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.S +++ /dev/null @@ -1,15 +0,0 @@ -#include - -SPARC_ASM_VIS3_IFUNC(finitef) - -hidden_def (__finitef) -weak_alias (__finitef, finitef) - -# undef weak_alias -# define weak_alias(a, b) -# undef hidden_def -# define hidden_def(a) - -#define __finitef __finitef_generic - -#include "../s_finitef.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.c new file mode 100644 index 0000000..695e8a0 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.c @@ -0,0 +1,33 @@ +/* finitef 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 + . */ + +#define __finitef __redirect___finitef +#include +#undef __finitef +#include + +extern __typeof (finitef) __finitef_vis3 attribute_hidden; +extern __typeof (finitef) __finitef_generic attribute_hidden; + +sparc_libm_ifunc_redirected (__redirect___finitef, __finitef, + hwcap & HWCAP_SPARC_VIS3 + ? __finitef_vis3 + : __finitef_generic); + +sparc_ifunc_redirected_hidden_def (__redirect___finitef, __finitef) +weak_alias (__finitef, finitef)