From patchwork Fri Mar 29 13:35:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 161438 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp2052432jan; Fri, 29 Mar 2019 06:39:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqwANfS0+wnguj8Uvtb3F458xnrVE71c6dbZRjmeO348WkBDOHY4TfekPby2arQJP6aGBIsm X-Received: by 2002:a63:d250:: with SMTP id t16mr12908874pgi.288.1553866754690; Fri, 29 Mar 2019 06:39:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553866754; cv=none; d=google.com; s=arc-20160816; b=XAckOWdLWxSfNDRdxt6Mj+Lbw/N4zIGatCsysNMQLPay8dgpxtRicqFqmy22JcNHft tF9cla2BOAUY7eqPVsOL0AQ4llbBCmy3NicPQUjC8B/TPmikDB0OvaYmO+oTlR76vC/4 zavS6NS9t9MMT7xcHaJ4uD6Q9MtTTEP/MAD0TA78Y+v+ZpAJ7w06dwm9iKMJl2fjM82z QeqcNEntd7jMuIPJGVUnPgrsgccTKksvreuLnNuiR0beYlcoJkdqe8HjYKG68mla/Exx zE3/ukBdvHs+goU0WPpdv5bqigaonguHrHDMspXeATQ9SOIF4ac5cdGU3g31t9jmqn/G /0UQ== 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 :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=Xq15JCzvP8Uq9J3xC29ESgjYKuQCaMEMs3GiRaeU2aA=; b=x4bA86mwHBxHDgFAQubIyfvCnqYwLqjfg/qiaDEZiY8lQKvemUmDpjpmmviaIxRJFT AshW4xk5U9e9T68CuQhIZej32TBLYHOgcZWgfnSpE4KKfkF1CngyUNX2IyTw0tyl1hIQ 1s9vVr8nMloT7IyyRkkLNhsp2f8EnFMM25xzmqBPR+JXHjcdFbhpy5wW/9E176qBToun gftFcGHDUA/5+fQ1JetkmxuEr7ulrKSi7zVps/cTMwJOmMhsxR6kGPbrqpMlhARq2p18 fqO50adkQa9Ka+DWUmQvCzpbNAs7GrhVYXYDXfP04xUMLo7VuBeeAXujjuDSUXmJ1n7V Q5Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=bfz41Sb2; dkim=pass header.i=@linaro.org header.s=google header.b=nFuDpJKd; spf=pass (google.com: domain of libc-alpha-return-101007-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-101007-patch=linaro.org@sourceware.org"; dmarc=pass (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 37si1955642plc.233.2019.03.29.06.39.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Mar 2019 06:39:14 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-101007-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=bfz41Sb2; dkim=pass header.i=@linaro.org header.s=google header.b=nFuDpJKd; spf=pass (google.com: domain of libc-alpha-return-101007-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-101007-patch=linaro.org@sourceware.org"; dmarc=pass (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=rg81iGWk4iulr+VG/S8O3mr7diM7IUO aAYnh6RCbDRl920sbJ+V7IunvfjbWXdRIChbV93tCBZMxqormMZ+5IOTVB0zCOrg 167pi/DDyh8P0hsCeJ+p4JmGIdofa7cBw3pC0trOquucvlsWWOIM6XHCG/4Xe6TP 40QvUG7OQzHw= 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=Az9oG706/cyVRbYPvHA6s1vQJzI=; b=bfz41 Sb2KCP/CAuUZORT6ycEQaufMwd9t6f0/96/CFr8cKuPnU95ho+6iVeRb+4LJWD22 lSOyJJWnvQ2ygpMAZWGg3zZJigPqulygKAFRESM3GMa09gz/LKOi5wdhIb4M6a2l f0GxxBmpN322cWGLhCsbHKFkSsmaL2OLr7BHHQ= Received: (qmail 121693 invoked by alias); 29 Mar 2019 13:36:18 -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 120330 invoked by uid 89); 29 Mar 2019 13:36:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=luis, Luis X-HELO: mail-vs1-f49.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=Xq15JCzvP8Uq9J3xC29ESgjYKuQCaMEMs3GiRaeU2aA=; b=nFuDpJKd94tOmdpWGA7KvFqBO76r8mVi4hAsLcVGwMwbbv+c9mec4436rs4v9YJRHS uyIao7nC3MqMjrV47dQ+rLMFilWlfFVwWE/h6QnVWX1nb/DGX1G68qWtY4PMwYZwyRJW 7CVl3n7IZAKkDp1sAioXbt0Ry0Wz5UUcWKabK6TbWBbtAdqxB1j45AQwHhB9Oz3I2fOb B/VCe0sk6Lds8/XIR/rSWTzETx8tIVvpuRJBjFgO8S20MC1io2aC4x8GOW3dcKoITtDs LRg+RWeOHdD+tOE4q5OK+C/8thB95jzlP0YcVK4L8/Cu37W4CPAlxX5effmA06we1HM8 FPvg== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 15/28] powerpc: Remove optimized isinf Date: Fri, 29 Mar 2019 10:35:16 -0300 Message-Id: <20190329133529.22523-16-adhemerval.zanella@linaro.org> In-Reply-To: <20190329133529.22523-1-adhemerval.zanella@linaro.org> References: <20190329133529.22523-1-adhemerval.zanella@linaro.org> The powerpc isinf optimizations onyl adds complexity: - GCC will call libm iff -fsignaling-nans is used. This usage pattern is usually not performance oriented and for such calls PLT overhead should dominate execution time. - The power7 uses ftdiv to optimize for some input pattern and branch implementation for INF and denormal that does: return (ix & UINT64_C (0x7fffffffffffffff)) == UINT64_C (0x7ff0000000000000) Although it does show slight better latency than generic algorithm, it is only for power7 and requires it to override it for power8. - The power8 implementation is just the generic implementation using ISA 2.07 mfvsrd instruction (which GCC uses for generic implementation). So generic implementation is already the best option for powerpc64le. Checked on powerpc-linux-gnu (built without --with-cpu, with --with-cpu=power4 and with --with-cpu=power5+ and --disable-multi-arch), powerpc64-linux-gnu (built without --with-cp and with --with-cpu=power5+ and --disable-multi-arch). * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile (sysdeps_routines, libm-sysdep_routines): Remove s_isinf* objects. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf-power7.S: Remove file. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf-ppc32.c: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinff-ppc32.c: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinff.c: Likewise. * sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S: Likewise. * sysdeps/powerpc/powerpc32/power7/fpu/s_isinff.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile usysdep_call): Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power7.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-ppc64.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff-ppc64.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c: Likewise. * sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S: Likewise. * sysdeps/powerpc/powerpc64/power7/fpu/s_isinff.S: Likewise. * sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S: Likewise. * sysdeps/powerpc/powerpc64/power8/fpu/s_isinff.S: Likewise. --- .../powerpc32/power4/fpu/multiarch/Makefile | 6 +- .../power4/fpu/multiarch/s_isinf-power7.S | 33 ------- .../power4/fpu/multiarch/s_isinf-ppc32.c | 33 ------- .../powerpc32/power4/fpu/multiarch/s_isinf.c | 50 ----------- .../power4/fpu/multiarch/s_isinff-ppc32.c | 31 ------- .../powerpc32/power4/fpu/multiarch/s_isinff.c | 35 -------- .../powerpc/powerpc32/power7/fpu/s_isinf.S | 85 ------------------- .../powerpc/powerpc32/power7/fpu/s_isinff.S | 1 - .../powerpc/powerpc64/fpu/multiarch/Makefile | 2 - .../powerpc64/fpu/multiarch/s_isinf-power7.S | 32 ------- .../powerpc64/fpu/multiarch/s_isinf-power8.S | 32 ------- .../powerpc64/fpu/multiarch/s_isinf-ppc64.c | 33 ------- .../powerpc/powerpc64/fpu/multiarch/s_isinf.c | 62 -------------- .../powerpc64/fpu/multiarch/s_isinff-ppc64.c | 31 ------- .../powerpc64/fpu/multiarch/s_isinff.c | 38 --------- .../powerpc/powerpc64/power7/fpu/s_isinf.S | 69 --------------- .../powerpc/powerpc64/power7/fpu/s_isinff.S | 1 - .../powerpc/powerpc64/power8/fpu/s_isinf.S | 61 ------------- .../powerpc/powerpc64/power8/fpu/s_isinff.S | 1 - 19 files changed, 2 insertions(+), 634 deletions(-) delete mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf-power7.S delete mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf-ppc32.c delete mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c delete mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinff-ppc32.c delete mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinff.c delete mode 100644 sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S delete mode 100644 sysdeps/powerpc/powerpc32/power7/fpu/s_isinff.S delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power7.S delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-ppc64.c delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff-ppc64.c delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c delete mode 100644 sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S delete mode 100644 sysdeps/powerpc/powerpc64/power7/fpu/s_isinff.S delete mode 100644 sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S delete mode 100644 sysdeps/powerpc/powerpc64/power8/fpu/s_isinff.S -- 2.17.1 Reviewed-by: Gabriel F. T. Gomes diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile index 0b39461a1a..c7b9d48094 100644 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile +++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile @@ -1,14 +1,12 @@ ifeq ($(subdir),math) -sysdep_routines += s_isinf-power7 \ - s_isinf-ppc32 s_isinff-ppc32 s_finite-power7 \ +sysdep_routines += s_finite-power7 \ s_finite-ppc32 s_finitef-ppc32 \ s_modf-power5+ s_modf-ppc32 \ s_modff-power5+ s_modff-ppc32 libm-sysdep_routines += s_llrintf-power6 s_llrintf-ppc32 s_llrint-power6 \ s_llrint-ppc32 s_llround-power6 s_llround-power5+ \ - s_llround-ppc32 s_isinf-power7 \ - s_isinf-ppc32 s_isinff-ppc32 s_finite-power7 \ + s_llround-ppc32 s_finite-power7 \ s_finite-ppc32 s_finitef-ppc32 s_ceil-power5+ \ s_ceil-ppc32 s_ceilf-power5+ s_ceilf-ppc32 \ s_floor-power5+ s_floor-ppc32 s_floorf-power5+ \ diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf-power7.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf-power7.S deleted file mode 100644 index 0e6e61352d..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf-power7.S +++ /dev/null @@ -1,33 +0,0 @@ -/* isinf(). PowerPC32/POWER7 version. - Copyright (C) 2013-2019 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 - -#undef hidden_def -#define hidden_def(name) -#undef weak_alias -#define weak_alias(name, alias) -#undef strong_alias -#define strong_alias(name, alias) -#undef compat_symbol -#define compat_symbol(lib, name, alias, ver) - -#define __isinf __isinf_power7 - -#include diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf-ppc32.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf-ppc32.c deleted file mode 100644 index 09e51c9891..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf-ppc32.c +++ /dev/null @@ -1,33 +0,0 @@ -/* isinf(). PowerPC32 default version. - Copyright (C) 2013-2019 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 - -#undef weak_alias -#define weak_alias(a, b) -#undef strong_alias -#define strong_alias(a, b) - -#define __isinf __isinf_ppc32 -#ifdef SHARED -# undef hidden_def -# define hidden_def(a) \ - __hidden_ver1 (__isinf_ppc32, __GI___isinf, __isinf_ppc32); -#endif - -#include diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c deleted file mode 100644 index c115c7fef1..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c +++ /dev/null @@ -1,50 +0,0 @@ -/* Multiple versions of isinf. - Copyright (C) 2013-2019 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 __isinf __redirect___isinf -#define __isinff __redirect___isinff -#define __isinfl __redirect___isinfl -#include -#include -#include -#include "init-arch.h" - -extern __typeof (__isinf) __isinf_ppc32 attribute_hidden; -extern __typeof (__isinf) __isinf_power7 attribute_hidden; -#undef __isinf -#undef __isinff -#undef __isinfl - -libc_ifunc_redirected (__redirect___isinf, __isinf, - (hwcap & PPC_FEATURE_ARCH_2_06) - ? __isinf_power7 - : __isinf_ppc32); - -weak_alias (__isinf, isinf) - -#ifdef NO_LONG_DOUBLE -strong_alias (__isinf, __isinfl) -weak_alias (__isinf, isinfl) -#endif - -#if !IS_IN (libm) -# if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0) -compat_symbol (libc, __isinf, __isinfl, GLIBC_2_0); -compat_symbol (libc, isinf, isinfl, GLIBC_2_0); -# endif -#endif diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinff-ppc32.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinff-ppc32.c deleted file mode 100644 index 8299fda5fa..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinff-ppc32.c +++ /dev/null @@ -1,31 +0,0 @@ -/* isinff(). PowerPC32 default version. - Copyright (C) 2013-2019 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 - -#undef weak_alias -#define weak_alias(a, b) - -#define __isinff __isinff_ppc32 -#ifdef SHARED -# undef hidden_def -# define hidden_def(a) \ - __hidden_ver1 (__isinff_ppc32, __GI___isinff, __isinff_ppc32); -#endif - -#include diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinff.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinff.c deleted file mode 100644 index 92f078a0db..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinff.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Multiple versions of isinf. - Copyright (C) 2013-2019 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 __isinff __redirect___isinff -#include -#include -#include -#include "init-arch.h" - -extern __typeof (__isinff) __isinff_ppc32 attribute_hidden; -/* The power7 isinf(double) works for float. */ -extern __typeof (__isinff) __isinf_power7 attribute_hidden; -#undef __isinff - -libc_ifunc_redirected (__redirect___isinff, __isinff, - (hwcap & PPC_FEATURE_ARCH_2_06) - ? __isinf_power7 - : __isinff_ppc32); - -weak_alias (__isinff, isinff) diff --git a/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S b/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S deleted file mode 100644 index 9cd45eb428..0000000000 --- a/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S +++ /dev/null @@ -1,85 +0,0 @@ -/* isinf(). PowerPC32/POWER7 version. - Copyright (C) 2010-2019 Free Software Foundation, Inc. - Contributed by Luis Machado . - 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 - -/* int __isinf(x) */ - .section .rodata.cst8,"aM",@progbits,8 - .align 3 -.LC0: /* 1.0 */ - .quad 0x3ff0000000000000 - - .section ".text" - .type __isinf, @function - .machine power7 -ENTRY (__isinf) -#ifdef SHARED - mflr r11 - cfi_register(lr,r11) - - SETUP_GOT_ACCESS(r9,got_label) - addis r9,r9,.LC0-got_label@ha - lfd fp0,.LC0-got_label@l(r9) - - mtlr r11 - cfi_same_value (lr) -#else - lis r9,.LC0@ha - lfd fp0,.LC0@l(r9) -#endif - ftdiv cr7,fp1,fp0 - li r3,0 - bflr 29 /* If not INF, return. */ - - /* Either we have +INF or -INF. */ - - stwu r1,-16(r1) /* Allocate stack space. */ - stfd fp1,8(r1) /* Transfer FP to GPR's. */ - ori 2,2,0 /* Force a new dispatch group. */ - lhz r4,8+HISHORT(r1) /* Fetch the upper 16 bits of the FP value - (biased exponent and sign bit). */ - addi r1,r1,16 /* Reset the stack pointer. */ - cmpwi cr7,r4,0x7ff0 /* r4 == 0x7ff0? */ - li r3,1 - beqlr cr7 /* EQ means INF, otherwise -INF. */ - li r3,-1 - blr - END (__isinf) - -hidden_def (__isinf) -weak_alias (__isinf, isinf) - -/* It turns out that the 'double' version will also always work for - single-precision. */ -strong_alias (__isinf, __isinff) -hidden_def (__isinff) -weak_alias (__isinff, isinff) - -#ifdef NO_LONG_DOUBLE -strong_alias (__isinf, __isinfl) -weak_alias (__isinf, isinfl) -#endif - -#if !IS_IN (libm) -# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) -compat_symbol (libc, __isinf, __isinfl, GLIBC_2_0); -compat_symbol (libc, isinf, isinfl, GLIBC_2_0); -# endif -#endif diff --git a/sysdeps/powerpc/powerpc32/power7/fpu/s_isinff.S b/sysdeps/powerpc/powerpc32/power7/fpu/s_isinff.S deleted file mode 100644 index be759e091e..0000000000 --- a/sysdeps/powerpc/powerpc32/power7/fpu/s_isinff.S +++ /dev/null @@ -1 +0,0 @@ -/* This function uses the same code as s_isinf.S. */ diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile index a0b5939abe..3a2051d97b 100644 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile @@ -4,8 +4,6 @@ ifeq ($(subdir),math) # prefixed with m_. sysdep_calls := s_finite-power8 s_finite-power7 s_finite-ppc64 \ s_finitef-ppc64 \ - s_isinf-power8 s_isinf-ppc64 \ - s_isinff-ppc64 s_isinf-power7 \ s_modf-power5+ s_modf-ppc64 \ s_modff-power5+ s_modff-ppc64 diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power7.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power7.S deleted file mode 100644 index 28aeba9e66..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power7.S +++ /dev/null @@ -1,32 +0,0 @@ -/* isinf(). PowerPC64/POWER7 version. - Copyright (C) 2013-2019 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 - -#undef hidden_def -#define hidden_def(name) -#undef weak_alias -#define weak_alias(name, alias) -#undef strong_alias -#define strong_alias(name, alias) -#undef compat_symbol -#define compat_symbol(lib, name, alias, ver) - -#define __isinf __isinf_power7 - -#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S deleted file mode 100644 index e9ccdabc5b..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S +++ /dev/null @@ -1,32 +0,0 @@ -/* isinf(). PowerPC64/POWER8 version. - Copyright (C) 2014-2019 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 - -#undef hidden_def -#define hidden_def(name) -#undef weak_alias -#define weak_alias(name, alias) -#undef strong_alias -#define strong_alias(name, alias) -#undef compat_symbol -#define compat_symbol(lib, name, alias, ver) - -#define __isinf __isinf_power8 - -#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-ppc64.c deleted file mode 100644 index b919394512..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-ppc64.c +++ /dev/null @@ -1,33 +0,0 @@ -/* isinf(). PowerPC64 default version. - Copyright (C) 2013-2019 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 - -#undef weak_alias -#define weak_alias(a, b) -#undef strong_alias -#define strong_alias(a, b) - -#define __isinf __isinf_ppc64 -#ifdef SHARED -# undef hidden_def -# define hidden_def(a) \ - __hidden_ver1 (__isinf_ppc64, __GI___isinf, __isinf_ppc64); -#endif - -#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c deleted file mode 100644 index f5b9044473..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c +++ /dev/null @@ -1,62 +0,0 @@ -/* Multiple versions of isinf. - Copyright (C) 2013-2019 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 __isinf __redirect___isinf - -/* The following definitions, although not related to the 'double' - version of 'isinf', are required to guarantee macro expansions - (e.g.: from __isinff to __redirect_isinff) in include/math.h, thus - compensating for the unintended macro expansions in - math/bits/mathcalls-helper-functions.h. */ -#define __isinff __redirect___isinff -#define __isinfl __redirect___isinfl -#define __isinff128 __redirect___isinff128 - -#include -#include -#include -#include "init-arch.h" - -extern __typeof (__isinf) __isinf_ppc64 attribute_hidden; -extern __typeof (__isinf) __isinf_power7 attribute_hidden; -extern __typeof (__isinf) __isinf_power8 attribute_hidden; -#undef __isinf -#undef __isinff -#undef __isinfl -#undef __isinff128 - -libc_ifunc_redirected (__redirect___isinf, __isinf, - (hwcap2 & PPC_FEATURE2_ARCH_2_07) - ? __isinf_power8 - : (hwcap & PPC_FEATURE_ARCH_2_06) - ? __isinf_power7 - : __isinf_ppc64); - -weak_alias (__isinf, isinf) - -#ifdef NO_LONG_DOUBLE -strong_alias (__isinf, __isinfl) -weak_alias (__isinf, isinfl) -#endif - -#if !IS_IN (libm) -# if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0) -compat_symbol (libc, __isinf, __isinfl, GLIBC_2_0); -compat_symbol (libc, isinf, isinfl, GLIBC_2_0); -# endif -#endif diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff-ppc64.c deleted file mode 100644 index ac5274b4c1..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff-ppc64.c +++ /dev/null @@ -1,31 +0,0 @@ -/* isinff(). PowerPC64 default version. - Copyright (C) 2013-2019 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 - -#undef weak_alias -#define weak_alias(a, b) - -#define __isinff __isinff_ppc64 -#ifdef SHARED -# undef hidden_def -# define hidden_def(a) \ - __hidden_ver1 (__isinff_ppc64, __GI___isinff, __isinff_ppc64); -#endif - -#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c deleted file mode 100644 index 16feaee3b8..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Multiple versions of isinf. - Copyright (C) 2013-2019 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 __isinff __redirect___isinff -#include -#include -#include -#include "init-arch.h" - -extern __typeof (__isinff) __isinff_ppc64 attribute_hidden; -/* The double-precision version also works for single-precision. */ -extern __typeof (__isinff) __isinf_power7 attribute_hidden; -extern __typeof (__isinff) __isinf_power8 attribute_hidden; -#undef __isinff - -libc_ifunc_redirected (__redirect___isinff, __isinff, - (hwcap2 & PPC_FEATURE2_ARCH_2_07) - ? __isinf_power8 - : (hwcap & PPC_FEATURE_ARCH_2_06) - ? __isinf_power7 - : __isinff_ppc64); - -weak_alias (__isinff, isinff) diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S b/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S deleted file mode 100644 index aed9d74d35..0000000000 --- a/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S +++ /dev/null @@ -1,69 +0,0 @@ -/* isinf(). PowerPC64/POWER7 version. - Copyright (C) 2010-2019 Free Software Foundation, Inc. - Contributed by Luis Machado . - 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 - -/* int __isinf(x) */ - .section ".toc","aw" -.LC0: /* 1.0 */ - .tc FD_ONE[TC],0x3ff0000000000000 - .section ".text" - .type __isinf, @function - .machine power7 -ENTRY (__isinf, 4) - CALL_MCOUNT 0 - lfd fp0,.LC0@toc(r2) - ftdiv cr7,fp1,fp0 - li r3,0 - bflr 29 /* If not INF, return. */ - - /* Either we have -INF/+INF or a denormal. */ - - stfd fp1,-16(r1) /* Transfer FP to GPR's. */ - ori 2,2,0 /* Force a new dispatch group. */ - lhz r4,-16+HISHORT(r1) /* Fetch the upper 16 bits of the FP value - (biased exponent and sign bit). */ - cmpwi cr7,r4,0x7ff0 /* r4 == 0x7ff0? */ - li r3,1 - beqlr cr7 /* EQ means INF, otherwise -INF. */ - li r3,-1 - blr - END (__isinf) - -hidden_def (__isinf) -weak_alias (__isinf, isinf) - -/* It turns out that the 'double' version will also always work for - single-precision. */ -strong_alias (__isinf, __isinff) -hidden_def (__isinff) -weak_alias (__isinff, isinff) - -#ifdef NO_LONG_DOUBLE -strong_alias (__isinf, __isinfl) -weak_alias (__isinf, isinfl) -#endif - -#if !IS_IN (libm) -# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) -compat_symbol (libc, __isinf, __isinfl, GLIBC_2_0); -compat_symbol (libc, isinf, isinfl, GLIBC_2_0); -# endif -#endif diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/s_isinff.S b/sysdeps/powerpc/powerpc64/power7/fpu/s_isinff.S deleted file mode 100644 index be759e091e..0000000000 --- a/sysdeps/powerpc/powerpc64/power7/fpu/s_isinff.S +++ /dev/null @@ -1 +0,0 @@ -/* This function uses the same code as s_isinf.S. */ diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S deleted file mode 100644 index 1fb2851a84..0000000000 --- a/sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S +++ /dev/null @@ -1,61 +0,0 @@ -/* isinf(). PowerPC64/POWER8 version. - Copyright (C) 2014-2019 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 - -#define MFVSRD_R3_V1 .long 0x7c230066 /* mfvsrd r3,vs1 */ - -/* int [r3] __isinf([fp1] x) */ - -ENTRY_TOCLESS (__isinf, 4) - CALL_MCOUNT 0 - MFVSRD_R3_V1 - lis r9,0x7ff0 /* r9 = 0x7ff0 */ - rldicl r10,r3,0,1 /* r10 = r3 & (0x8000000000000000) */ - sldi r9,r9,32 /* r9 = r9 << 52 */ - cmpd cr7,r10,r9 /* fp1 & 0x7ff0000000000000 ? */ - beq cr7,L(inf) - li r3,0 /* Not inf */ - blr -L(inf): - sradi r3,r3,63 /* r3 = r3 >> 63 */ - ori r3,r3,1 /* r3 = r3 | 0x1 */ - blr -END (__isinf) - -hidden_def (__isinf) -weak_alias (__isinf, isinf) - -/* It turns out that the 'double' version will also always work for - single-precision. */ -strong_alias (__isinf, __isinff) -hidden_def (__isinff) -weak_alias (__isinff, isinff) - -#ifdef NO_LONG_DOUBLE -strong_alias (__isinf, __isinfl) -weak_alias (__isinf, isinfl) -#endif - -#if !IS_IN (libm) -# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) -compat_symbol (libc, __isinf, __isinfl, GLIBC_2_0); -compat_symbol (libc, isinf, isinfl, GLIBC_2_0); -# endif -#endif diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_isinff.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_isinff.S deleted file mode 100644 index be759e091e..0000000000 --- a/sysdeps/powerpc/powerpc64/power8/fpu/s_isinff.S +++ /dev/null @@ -1 +0,0 @@ -/* This function uses the same code as s_isinf.S. */