From patchwork Fri Mar 29 13:35:18 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: 161440 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp2052965jan; Fri, 29 Mar 2019 06:39:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxXgviQTznlWZjYufRn4jrRBBS+G/OMGTxOXdhoP9Py4eGCiGAGNmyo8czzUAE09sgFHE6H X-Received: by 2002:a65:50c2:: with SMTP id s2mr37922929pgp.112.1553866782895; Fri, 29 Mar 2019 06:39:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553866782; cv=none; d=google.com; s=arc-20160816; b=X+GoLqixPB6xEh/ct2wznaCRDWRA3S+iTEJpMuaHlNVNmH4KYFj8R3RhfcTwlymMc5 kS2hMtmc9R2Uzup1D+dv5kxlyZk6avH63UtSI2ZsdKbNAGEb5q6AajTny79nRV1aAmIY E50w/VX934A4hfQHzppL2nFqZimryBIimceZQv5q/zTtyWPf1tDuIePMtD/vIRJK4hvU /pxEX8vrn1P7RcU5L8ktyszwSfP9Y2uK+IueIl0/0DJecRo5pkcCiRfNWAyIomiMV/2a N2q2mLzMYzFM7GmB9jzggKxORqd+nBU7Vtydmp5lwH3OC2KQzSNb4D7zNMAN+0bQPBUM Ooww== 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=ZmnnJ5xRrt5DZunnyYGSFZmYMqA/Dwgtce2mFNL1lZI=; b=G7YbX0o5cizAFJIhA+aZee/fyVxmFBDHKsqquCe0+VerAtRclkDrsuvr6RiK8TLpGf LNbingqiQHkFeqlAeCQ4o8SuEunUbl1zaCbtXe+/YUVgzMDtVbBI1sQGF8oFWQyzkzT2 yYt2NShjsMPZrwOiGFAomn4RGRaPnA0rrzdVwUZIhMoi3Sw+RiA/+AiYZlzse7CpdqUI 8fSdlhfGiRiGlwtl4fdfYkuzqHMDDmIGcnycGT4ad24oG5PGkR22L50oAlnUYJNwzYGX DHga9jc6qbAkz0/vdC/uL66y6rcMfru0gKsNdtginO4ILb+/B71kOApmKT+oVdH/yzxA +znQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=CuAT8Gho; dkim=pass header.i=@linaro.org header.s=google header.b=yBDolsbL; spf=pass (google.com: domain of libc-alpha-return-101009-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-101009-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 v21si1823103pfe.119.2019.03.29.06.39.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Mar 2019 06:39:42 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-101009-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=CuAT8Gho; dkim=pass header.i=@linaro.org header.s=google header.b=yBDolsbL; spf=pass (google.com: domain of libc-alpha-return-101009-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-101009-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=Eog8X1eg5YQzf0v5R8w2HXoyZ9GAvq2 qchU0t3T3skUAeJ4i2xE11nCjapgGC5lDsAFKjt+s5w4gUEi1m8h6gyRsJlQ7/bs ibXdqv9rr0nKe5P62GqP60IR32cuA6VvBCjkcZOTiyjM5Brhhxo0Z4GZ4hf/V9UQ Fc5+9o4qtz0o= 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=9QLlfj0qeMTI94qXl5Ar4LifBJM=; b=CuAT8 GhoDkLZ2rwCiZ04cvlneH2OAMA/E+lylkVfXhAtz2EEDCSs4yhygbfG7KDbnpguy CxS9aYUONgLuAbyxqMIyKCdxXlqfLhcv6/9NQVw0lniFyZQaD8+OlJZwE4ic+95/ JZekyF2DiO9nzY6tH11fLzjhCSaT83mCnQmomk= Received: (qmail 121976 invoked by alias); 29 Mar 2019 13:36:21 -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 120598 invoked by uid 89); 29 Mar 2019 13:36:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.3 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-f67.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=ZmnnJ5xRrt5DZunnyYGSFZmYMqA/Dwgtce2mFNL1lZI=; b=yBDolsbLZ5OEvIy/U+UIOB3/7l3jZVTK4hLQ7hjJJ34km8drM/HSNpZaeHe9lP2dSB fk9IU//nKpCfA5ctlD6xDRBI3cE0rL3mIAPCZ4UeVNHBG3OhC+HgIQiGrk88Ic2EpGV+ jt4XyiX39m3cwQPb+QzpJhYFdUSmQnjpzU5rNzeYoxqBpgZNLtIkLIZQld1s48+1XhTM V5rd789crMcJNkYO4GMJe0BobggdsiF4fuE821lY4ePY/dfVieDONWPJhOjNzZmJIe4A TR3H6DsPMF/4upiXB08EpUhzs0f4KGGoiYbB3Jxt+swTM6BBc2TYMpcV9vU62E8QSe3u WMkg== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 17/28] powerpc: Remove optimized finite Date: Fri, 29 Mar 2019 10:35:18 -0300 Message-Id: <20190329133529.22523-18-adhemerval.zanella@linaro.org> In-Reply-To: <20190329133529.22523-1-adhemerval.zanella@linaro.org> References: <20190329133529.22523-1-adhemerval.zanella@linaro.org> The powerpc finite optimization do not show much gain: - 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 patterns, but at cost of others. Comparing against generic C implementation built for powerpc64-linux-gnu-power7 (--with-cpu=power7): - Generic sysdeps/ieee754 implementation: "isfinite": { "": { "duration": 5.0082e+09, "iterations": 2.45299e+09, "max": 43.824, "min": 2.008, "mean": 2.04167 }, "INF": { "duration": 4.66554e+09, "iterations": 2.28288e+09, "max": 35.73, "min": 2.008, "mean": 2.04371 }, "NAN": { "duration": 4.66274e+09, "iterations": 2.28716e+09, "max": 34.161, "min": 2.009, "mean": 2.03866 } } - power7 optimized one: "isfinite": { "": { "duration": 4.99111e+09, "iterations": 2.65566e+09, "max": 25.015, "min": 1.716, "mean": 1.87942 }, "INF": { "duration": 4.6783e+09, "iterations": 2.0999e+09, "max": 35.264, "min": 1.868, "mean": 2.22787 }, "NAN": { "duration": 4.67915e+09, "iterations": 2.08678e+09, "max": 38.099, "min": 1.869, "mean": 2.24228 } } So it basically optimizes marginally for normal numbers while increasing the latency for other kind of FP. - The power8 implementation is just the generic implementation using ISA 2.07 mfvsrd instruction (which GCC uses for generic implementation). So generic implementation is 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_finite* objects. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite-power7.S: Remove file. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite-ppc32.c: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite.c: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finitef-ppc32.c: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finitef.c: Likewise. * sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S: Likewise. * sysdeps/powerpc/powerpc32/power7/fpu/s_finitef.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile usysdep_call): Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power7.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power8.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-ppc64.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef-ppc64.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c: Likewise. * sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S: Likewise. * sysdeps/powerpc/powerpc64/power7/fpu/s_finitef.S: Likewise. * sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S: Likewise. * sysdeps/powerpc/powerpc64/power8/fpu/s_finitef.S: Likewise. --- .../powerpc32/power4/fpu/multiarch/Makefile | 7 +- .../power4/fpu/multiarch/s_finite-power7.S | 33 ------- .../power4/fpu/multiarch/s_finite-ppc32.c | 33 ------- .../powerpc32/power4/fpu/multiarch/s_finite.c | 57 ------------ .../power4/fpu/multiarch/s_finitef-ppc32.c | 31 ------- .../power4/fpu/multiarch/s_finitef.c | 34 ------- .../powerpc/powerpc32/power7/fpu/s_finite.S | 93 ------------------- .../powerpc/powerpc32/power7/fpu/s_finitef.S | 1 - .../powerpc/powerpc64/fpu/multiarch/Makefile | 4 +- .../powerpc64/fpu/multiarch/s_finite-power7.S | 32 ------- .../powerpc64/fpu/multiarch/s_finite-power8.S | 32 ------- .../powerpc64/fpu/multiarch/s_finite-ppc64.c | 34 ------- .../powerpc64/fpu/multiarch/s_finite.c | 69 -------------- .../powerpc64/fpu/multiarch/s_finitef-ppc64.c | 32 ------- .../powerpc64/fpu/multiarch/s_finitef.c | 37 -------- .../powerpc/powerpc64/power7/fpu/s_finite.S | 70 -------------- .../powerpc/powerpc64/power7/fpu/s_finitef.S | 1 - .../powerpc/powerpc64/power8/fpu/s_finite.S | 56 ----------- .../powerpc/powerpc64/power8/fpu/s_finitef.S | 1 - 19 files changed, 3 insertions(+), 654 deletions(-) delete mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite-power7.S delete mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite-ppc32.c delete mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite.c delete mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finitef-ppc32.c delete mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finitef.c delete mode 100644 sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S delete mode 100644 sysdeps/powerpc/powerpc32/power7/fpu/s_finitef.S delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power7.S delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power8.S delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-ppc64.c delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef-ppc64.c delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c delete mode 100644 sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S delete mode 100644 sysdeps/powerpc/powerpc64/power7/fpu/s_finitef.S delete mode 100644 sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S delete mode 100644 sysdeps/powerpc/powerpc64/power8/fpu/s_finitef.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 c7b9d48094..51b13fe33a 100644 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile +++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile @@ -1,13 +1,10 @@ ifeq ($(subdir),math) -sysdep_routines += s_finite-power7 \ - s_finite-ppc32 s_finitef-ppc32 \ - s_modf-power5+ s_modf-ppc32 \ +sysdep_routines += 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_finite-power7 \ - s_finite-ppc32 s_finitef-ppc32 s_ceil-power5+ \ + s_llround-ppc32 s_ceil-power5+ \ s_ceil-ppc32 s_ceilf-power5+ s_ceilf-ppc32 \ s_floor-power5+ s_floor-ppc32 s_floorf-power5+ \ s_floorf-ppc32 s_round-power5+ s_round-ppc32 \ diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite-power7.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite-power7.S deleted file mode 100644 index 0cde9f1cd1..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite-power7.S +++ /dev/null @@ -1,33 +0,0 @@ -/* finite(). 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 __finite __finite_power7 - -#include diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite-ppc32.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite-ppc32.c deleted file mode 100644 index c03a26e00f..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite-ppc32.c +++ /dev/null @@ -1,33 +0,0 @@ -/* finite(). 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 FINITE __finite_ppc32 -#ifdef SHARED -# undef hidden_def -# define hidden_def(a) \ - __hidden_ver1 (__finite_ppc32, __GI___finite, __finite_ppc32); -#endif - -#include diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite.c deleted file mode 100644 index 677b71baf3..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite.c +++ /dev/null @@ -1,57 +0,0 @@ -/* Multiple versions of finite. - 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 __finite __redirect___finite -#define __finitef __redirect___finitef -#define __finitel __redirect___finitel -#include -#include -#include -#include "init-arch.h" - -extern __typeof (__finite) __finite_ppc32 attribute_hidden; -extern __typeof (__finite) __finite_power7 attribute_hidden; -#undef __finite -#undef __finitef -#undef __finitel - -libc_ifunc_redirected (__redirect___finite, __finite, - (hwcap & PPC_FEATURE_ARCH_2_06) - ? __finite_power7 - : __finite_ppc32); - -weak_alias (__finite, finite) - -#ifdef NO_LONG_DOUBLE -strong_alias (__finite, __finitel) -weak_alias (__finite, finitel) -#endif - -#if IS_IN (libm) -# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0) -compat_symbol (libm, finite, finitel, GLIBC_2_0); -# endif -# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_1) -compat_symbol (libm, __finite, __finitel, GLIBC_2_1); -# endif -#else -# if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0) -compat_symbol (libc, __finite, __finitel, GLIBC_2_0); -compat_symbol (libc, finite, finitel, GLIBC_2_0); -# endif -#endif diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finitef-ppc32.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finitef-ppc32.c deleted file mode 100644 index e43c7a54bc..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finitef-ppc32.c +++ /dev/null @@ -1,31 +0,0 @@ -/* finitef(). 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 FINITEF __finitef_ppc32 -#ifdef SHARED -# undef hidden_def -# define hidden_def(a) \ - __hidden_ver1 (__finitef_ppc32, __GI___finitef, __finitef_ppc32); -#endif - -#include diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finitef.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finitef.c deleted file mode 100644 index da4780551e..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finitef.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Multiple versions of finitef. - 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 __finitef __redirect___finitef -#include -#include -#include "init-arch.h" - -extern __typeof (__finitef) __finitef_ppc32 attribute_hidden; -/* The power7 finite(double) works for float. */ -extern __typeof (__finitef) __finite_power7 attribute_hidden; -#undef __finitef - -libc_ifunc_redirected (__redirect___finitef, __finitef, - (hwcap & PPC_FEATURE_ARCH_2_06) - ? __finite_power7 - : __finitef_ppc32); - -weak_alias (__finitef, finitef) diff --git a/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S b/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S deleted file mode 100644 index 07fa8ae7b7..0000000000 --- a/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S +++ /dev/null @@ -1,93 +0,0 @@ -/* finite(). 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 __finite(x) */ - .section .rodata.cst8,"aM",@progbits,8 - .align 3 -.LC0: /* 1.0 */ - .quad 0x3ff0000000000000 - - .section ".text" - .type __finite, @function - .machine power7 -ENTRY (__finite) -#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,1 - bflr 30 - - /* We have -INF/+INF/NaN or a denormal. */ - - 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 r0,8+HISHORT(r1) /* Fetch the upper 16 bits of the FP value - (biased exponent and sign bit). */ - clrlwi r0,r0,17 /* r0 = abs(r0). */ - addi r1,r1,16 /* Reset the stack pointer. */ - cmpwi cr7,r0,0x7ff0 /* r4 == 0x7ff0?. */ - bltlr cr7 /* LT means we have a denormal. */ - li r3,0 - blr - END (__finite) - -hidden_def (__finite) -weak_alias (__finite, finite) - -/* It turns out that the 'double' version will also always work for - single-precision. */ -strong_alias (__finite, __finitef) -hidden_def (__finitef) -weak_alias (__finitef, finitef) - -#ifdef NO_LONG_DOUBLE -strong_alias (__finite, __finitel) -weak_alias (__finite, finitel) -#endif - -#if IS_IN (libm) -# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0) -compat_symbol (libm, finite, finitel, GLIBC_2_0) -# endif -# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_1) -compat_symbol (libm, __finite, __finitel, GLIBC_2_1) -# endif -#else -# if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0) -compat_symbol (libc, __finite, __finitel, GLIBC_2_0); -compat_symbol (libc, finite, finitel, GLIBC_2_0); -# endif -#endif diff --git a/sysdeps/powerpc/powerpc32/power7/fpu/s_finitef.S b/sysdeps/powerpc/powerpc32/power7/fpu/s_finitef.S deleted file mode 100644 index 54bd94176d..0000000000 --- a/sysdeps/powerpc/powerpc32/power7/fpu/s_finitef.S +++ /dev/null @@ -1 +0,0 @@ -/* This function uses the same code as s_finite.S. */ diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile index 3a2051d97b..4aa7fd6295 100644 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile @@ -2,9 +2,7 @@ ifeq ($(subdir),math) # These functions are built both for libc and libm because they're required # by printf. While the libc objects have the prefix s_, the libm ones are # prefixed with m_. -sysdep_calls := s_finite-power8 s_finite-power7 s_finite-ppc64 \ - s_finitef-ppc64 \ - s_modf-power5+ s_modf-ppc64 \ +sysdep_calls := s_modf-power5+ s_modf-ppc64 \ s_modff-power5+ s_modff-ppc64 sysdep_routines += $(sysdep_calls) diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power7.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power7.S deleted file mode 100644 index c360c3a8db..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power7.S +++ /dev/null @@ -1,32 +0,0 @@ -/* isnan(). 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, symbol, ver) - -#define __finite __finite_power7 - -#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power8.S deleted file mode 100644 index 8fa57e222e..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power8.S +++ /dev/null @@ -1,32 +0,0 @@ -/* isnan(). PowerPC64/POWER7 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, symbol, ver) - -#define __finite __finite_power8 - -#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-ppc64.c deleted file mode 100644 index 59cc8ba168..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-ppc64.c +++ /dev/null @@ -1,34 +0,0 @@ -/* finite(). PowerPC64 default version. - Copyright (C) 2013-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 - -#undef weak_alias -#define weak_alias(a, b) -#undef strong_alias -#define strong_alias(a, b) - -#define FINITE __finite_ppc64 -#ifdef SHARED -# undef hidden_def -# define hidden_def(a) \ - __hidden_ver1 (__finite_ppc64, __GI___finite, __finite_ppc64); -#endif - -#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c deleted file mode 100644 index 4f88a221cc..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c +++ /dev/null @@ -1,69 +0,0 @@ -/* Multiple versions of finite. - 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 __finite __redirect___finite - -/* The following definitions, although not related to the 'double' - version of 'finite', are required to guarantee macro expansions - (e.g.: from __finitef to __redirect_finitef) in include/math.h, thus - compensating for the unintended macro expansions in - math/bits/mathcalls-helper-functions.h. */ -#define __finitef __redirect___finitef -#define __finitel __redirect___finitel -#define __finitef128 __redirect___finitef128 - -#include -#include -#include -#include "init-arch.h" - -extern __typeof (__finite) __finite_ppc64 attribute_hidden; -extern __typeof (__finite) __finite_power7 attribute_hidden; -extern __typeof (__finite) __finite_power8 attribute_hidden; -#undef __finite -#undef __finitef -#undef __finitel -#undef __finitef128 - -libc_ifunc_redirected (__redirect___finite, __finite, - (hwcap2 & PPC_FEATURE2_ARCH_2_07) - ? __finite_power8 - : (hwcap & PPC_FEATURE_ARCH_2_06) - ? __finite_power7 - : __finite_ppc64); - -weak_alias (__finite, finite) - -#ifdef NO_LONG_DOUBLE -strong_alias (__finite, __finitel) -weak_alias (__finite, finitel) -#endif - -#if IS_IN (libm) -# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0) -compat_symbol (libm, finite, finitel, GLIBC_2_0); -# endif -# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_1) -compat_symbol (libm, __finite, __finitel, GLIBC_2_1); -# endif -#else -# if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0) -compat_symbol (libc, __finite, __finitel, GLIBC_2_0); -compat_symbol (libc, finite, finitel, GLIBC_2_0); -# endif -#endif diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef-ppc64.c deleted file mode 100644 index 77af76d3ef..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef-ppc64.c +++ /dev/null @@ -1,32 +0,0 @@ -/* finitef(). PowerPC64 default version. - Copyright (C) 2013-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 - -#undef weak_alias -#define weak_alias(a, b) - -#define FINITEF __finitef_ppc64 -#ifdef SHARED -# undef hidden_def -# define hidden_def(a) \ - __hidden_ver1 (__finitef_ppc64, __GI___finitef, __finitef_ppc64); -#endif - -#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c deleted file mode 100644 index cde669e5e3..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Multiple versions of finitef. - 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 __finitef __redirect___finitef -#include -#include -#include "init-arch.h" - -extern __typeof (__finitef) __finitef_ppc64 attribute_hidden; -/* The double-precision version also works for single-precision. */ -extern __typeof (__finitef) __finite_power7 attribute_hidden; -extern __typeof (__finitef) __finite_power8 attribute_hidden; -#undef __finitef - -libc_ifunc_redirected (__redirect___finitef, __finitef, - (hwcap2 & PPC_FEATURE2_ARCH_2_07) - ? __finite_power8 - : (hwcap & PPC_FEATURE_ARCH_2_06) - ? __finite_power7 - : __finitef_ppc64); - -weak_alias (__finitef, finitef) diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S b/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S deleted file mode 100644 index 5b5746c9a5..0000000000 --- a/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S +++ /dev/null @@ -1,70 +0,0 @@ -/* finite(). 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 __finite(x) */ - .section ".toc","aw" -.LC0: /* 1.0 */ - .tc FD_ONE[TC],0x3ff0000000000000 - .section ".text" - .type __finite, @function - .machine power7 -ENTRY (__finite, 4) - CALL_MCOUNT 0 - lfd fp0,.LC0@toc(r2) - ftdiv cr7,fp1,fp0 - li r3,1 - bflr 30 - - /* If we are here, we either have +/-INF, - NaN or 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). */ - clrlwi r4,r4,17 /* r4 = abs(r4). */ - cmpwi cr7,r4,0x7ff0 /* r4 == 0x7ff0? */ - bltlr cr7 /* LT means finite, other non-finite. */ - li r3,0 - blr - END (__finite) - -hidden_def (__finite) -weak_alias (__finite, finite) - -/* It turns out that the 'double' version will also always work for - single-precision. */ -strong_alias (__finite, __finitef) -hidden_def (__finitef) -weak_alias (__finitef, finitef) - -#if IS_IN (libm) -# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0) -compat_symbol (libm, __finite, __finitel, GLIBC_2_0) -compat_symbol (libm, finite, finitel, GLIBC_2_0) -# endif -#else -# if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0) -compat_symbol (libc, __finite, __finitel, GLIBC_2_0); -compat_symbol (libc, finite, finitel, GLIBC_2_0); -# endif -#endif diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/s_finitef.S b/sysdeps/powerpc/powerpc64/power7/fpu/s_finitef.S deleted file mode 100644 index 54bd94176d..0000000000 --- a/sysdeps/powerpc/powerpc64/power7/fpu/s_finitef.S +++ /dev/null @@ -1 +0,0 @@ -/* This function uses the same code as s_finite.S. */ diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S deleted file mode 100644 index f5316e898f..0000000000 --- a/sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S +++ /dev/null @@ -1,56 +0,0 @@ -/* isfinite(). 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] __finite ([fp1] x) */ - -ENTRY_TOCLESS (__finite, 4) - CALL_MCOUNT 0 - MFVSRD_R3_V1 - lis r9,0x8010 - clrldi r3,r3,1 /* r3 = r3 & 0x8000000000000000 */ - rldicr r9,r9,32,31 /* r9 = (r9 << 32) & 0xffffffff */ - add r3,r3,r9 - rldicl r3,r3,1,63 - blr -END (__finite) - -hidden_def (__finite) -weak_alias (__finite, finite) - -/* It turns out that the 'double' version will also always work for - single-precision. */ -strong_alias (__finite, __finitef) -hidden_def (__finitef) -weak_alias (__finitef, finitef) - -#if IS_IN (libm) -# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0) -compat_symbol (libm, __finite, __finitel, GLIBC_2_0) -compat_symbol (libm, finite, finitel, GLIBC_2_0) -# endif -#else -# if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0) -compat_symbol (libc, __finite, __finitel, GLIBC_2_0); -compat_symbol (libc, finite, finitel, GLIBC_2_0); -# endif -#endif diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_finitef.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_finitef.S deleted file mode 100644 index 54bd94176d..0000000000 --- a/sysdeps/powerpc/powerpc64/power8/fpu/s_finitef.S +++ /dev/null @@ -1 +0,0 @@ -/* This function uses the same code as s_finite.S. */