From patchwork Fri Mar 29 13:35:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 161444 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp2054021jan; Fri, 29 Mar 2019 06:40:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqynzsJ3hNmIt/e2VEyeqSgvSgsBa16oZv7sbnsdYW/BVKxXxyjV4qhhOQXQAwFyu0aUFmff X-Received: by 2002:a62:1690:: with SMTP id 138mr8204951pfw.28.1553866836578; Fri, 29 Mar 2019 06:40:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553866836; cv=none; d=google.com; s=arc-20160816; b=Bz/z0vhMF/aZOxQnXSTicyV3/HZhza4jEfnyoDPo0EWMMWvhnNVh3s2y+dWO3GYZqz KSnoDpg3okSTasHdA0nRpuLnH5igNHaHa2hJed+lBX+8+krmZAI+QdQnjan0DT0ff3Iq MNSG2w8yy2SuJ/Hoz0+qDeUjyNtwLOITh+xrkDSWpuBAiohTI1T/gM0zdICi/VKvUmXq F9KZFDsfr70dEOyXvrxSWKPeIPM/xTmOm6f4VsBR09uPgV7lPGSrTWAPldAVazA0dyoW WxY9DOcW/keR9AxqDv7OSuSATfIC2lUqHHHuQmANG2onvKzqI7a+9hh/B6ndM2DHptgW dEkw== 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=166YtZCF0/iVabKtGZHptVgbLcT5DEYE0b9e4gY7rFE=; b=0D4uKN4Jijpygx0bSJ4xSCffiE7xOvGOttGYzwr08FyJZ1ZkjnpZOVlMvq2n3CO/4S RYrd9rPMXhOkvOxi4aOjndnqzBzyqrj3DoZIWXTVfU2VFtYs0UqbzT0LfSB0SxaZzgUv iVv2sdQls7Eqvd41ElPp848FrSPf0gpOvMwIz3it7EngJjeUF4EFpTj1lCiJmAGoAYGE HbzE4DLBu9b/4EHfmqitAGfppZN4Cxo5iiypAneC04ofsFkRWKy5wmaSqqwmegf79UoK 5GoLBX9UIhCpp08RpgKz8SEk099E07qVwNY/cO9O8Y2DFv/BMOPWjZCu/mXJsPXNrgcr pi+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=Rdncohmt; dkim=pass header.i=@linaro.org header.s=google header.b=DPw8ICLM; spf=pass (google.com: domain of libc-alpha-return-101013-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-101013-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 f7si2030295pfa.50.2019.03.29.06.40.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Mar 2019 06:40:36 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-101013-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=Rdncohmt; dkim=pass header.i=@linaro.org header.s=google header.b=DPw8ICLM; spf=pass (google.com: domain of libc-alpha-return-101013-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-101013-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=M9maDTygBOW7dLhfctJoABw53uE9CTZ Nge7iYTD0qsvHNl3fCBebUoR4QTpQox2cwLOeb8XVLY0rZaLPDj2Mx4l8DUe70bz q97PYu7oTA+MPL1a2D2EwFvqsrUN2iowOvYcsnKrQzYGRrfVPk1+zlvUHH7TqIln i8BXGvlQKBwE= 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=IFNOj3iq1IsyFI41jkptj7ijqpE=; b=Rdnco hmtPuwN18A6a8+vBYohDIlcLMiWeTxRXv9LFLWnPydxCIde2UVhT9SRH63ImTDTs 7Hjw+1DdSEexsTvKVrqH4RNyPCBick5msk8YsQtgv0FhEyx1fUZuPsks7v0CI7b1 LpWt+kH5JeZHLi3CQmYyeO0rWNK0MJpZBGNlqM= Received: (qmail 123086 invoked by alias); 29 Mar 2019 13:36:32 -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 120980 invoked by uid 89); 29 Mar 2019 13:36:10 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.5 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=flushing, luis, Luis X-HELO: mail-ua1-f65.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=166YtZCF0/iVabKtGZHptVgbLcT5DEYE0b9e4gY7rFE=; b=DPw8ICLMOFyufyZUObzXn+HLlB0fhmHC5l6/FsFrNO3VRVs4dnNJVCHE/pSFu5vWN1 nWIb7UJj32uZFahLibXmKdHaBCBEV8yMtJJjd+XeRMymA9tnwfbvSi7R8NztAQFttjFW B/l4ctEKFSXel8RwmhoXjKEeog/6KfZOAM+xudusnXiBJsW02QIhGQ+xJK9X4mTeV1JD gAzJMCLBy5QZ4T8Nf/taXNKN6jWrdtqYkDnfxcEROBdxYfKHD0klz0U02RbqztfDUuOw mTNPSig4kqX5tKm6QYltveapapSUcyCERObhDr4HaOOJ9y4Dm7fvS0ZwfEuygLtsrI8E cyLg== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 13/28] powerpc: Remove optimized isnan Date: Fri, 29 Mar 2019 10:35:14 -0300 Message-Id: <20190329133529.22523-14-adhemerval.zanella@linaro.org> In-Reply-To: <20190329133529.22523-1-adhemerval.zanella@linaro.org> References: <20190329133529.22523-1-adhemerval.zanella@linaro.org> The powerpc isnan optimizations are not really a 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 power5, power6, and power6x are just micro-optimization to improve the Load-Hit-Store hazards from floating-point to general register transfer, and current GCC already has support to minimize it by inserting either extra nops or group dispatch instructions. - The power7 uses ftdiv to optimize for some input patterns, but at cost of others. Comparing against generic C implementation built for powerpc-linux-gnu-power4 (which uses the hp-timing support on benchtests): - Generic sysdeps/ieee754 implementation: "isnan": { "": { "duration": 4.98415e+09, "iterations": 2.34516e+09, "max": 45.925, "min": 2.052, "mean": 2.12529 }, "INF": { "duration": 4.74057e+09, "iterations": 1.69761e+09, "max": 91.01, "min": 2.052, "mean": 2.79249 }, "NAN": { "duration": 4.74071e+09, "iterations": 1.68768e+09, "max": 282.343, "min": 2.052, "mean": 2.809 } } - power7 optimized one: $ ./testrun.sh benchtests/bench-isnan "isnan": { "": { "duration": 4.96842e+09, "iterations": 2.56297e+09, "max": 50.048, "min": 1.872, "mean": 1.93854 }, "INF": { "duration": 4.76648e+09, "iterations": 1.54213e+09, "max": 373.408, "min": 2.661, "mean": 3.09084 }, "NAN": { "duration": 4.76845e+09, "iterations": 1.54515e+09, "max": 51.016, "min": 2.736, "mean": 3.08607 } } So it basically optimizes marginally for normal numbers while increasing the latency for other kind of FP. - The generic implementation requires getting the floating point status, disable the invalid operation bit, and restore the floating-point status. Each operation is costly and requires flushing the FP pipeline. Using the same scenarion for the previous analysis: "isnan": { "": { "duration": 5.08284e+09, "iterations": 6.2898e+08, "max": 41.844, "min": 8.057, "mean": 8.08108 }, "INF": { "duration": 4.97904e+09, "iterations": 6.16176e+08, "max": 39.661, "min": 8.057, "mean": 8.08055 }, "NAN": { "duration": 4.98695e+09, "iterations": 5.95866e+08, "max": 29.728, "min": 8.345, "mean": 8.36925 } } - The power8 implementation is just the generic implementation using ISA 2.07 mfvsrd instruction (which GCC uses for generic implementation). So generic implementation already generates best code 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/fpu/s_isnan.c: Remove file. * sysdeps/powerpc/fpu/s_isnanf.S: Likewise. * sysdeps/powerpc/powerpc32/fpu/s_isnan.S: Likewise. * sysdeps/powerpc/x/powerpc32/power4/fpu/multiarch/Makefile (sysdeps_routines): Remove s_isnan-* objects. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power5.S: Remove file * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power6.S: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power7.S: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-ppc32.S: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf-power5.S: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf-power6.S: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf.c: Likewise. * sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S: Likewise. * sysdeps/powerpc/powerpc32/power5/fpu/s_isnanf.S: Likewise. * sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S: Likewise. * sysdeps/powerpc/powerpc32/power6/fpu/s_isnanf.S: Likewise. * sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S: Likewise. * sysdeps/powerpc/powerpc32/power7/fpu/s_isnanf.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile (sysdep_calls): Remove s_isnan-* objects. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power5.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6x.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power7.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power8.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/s_isnan.S: Likewise. * sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S: Likewise. * sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S: Likewise. * sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S: Likewise. * sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S: Likewise. * sysdeps/powerpc/powerpc64/power7/fpu/s_isnanf.S: Likewise. * sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S: Likewise. * sysdeps/powerpc/powerpc64/power8/fpu/s_isnanf.S: Likewise. --- sysdeps/powerpc/fpu/s_isnan.c | 62 ------------- sysdeps/powerpc/fpu/s_isnanf.S | 1 - sysdeps/powerpc/powerpc32/fpu/s_isnan.S | 57 ------------ .../powerpc32/power4/fpu/multiarch/Makefile | 7 +- .../power4/fpu/multiarch/s_isnan-power5.S | 33 ------- .../power4/fpu/multiarch/s_isnan-power6.S | 33 ------- .../power4/fpu/multiarch/s_isnan-power7.S | 33 ------- .../power4/fpu/multiarch/s_isnan-ppc32.S | 32 ------- .../powerpc32/power4/fpu/multiarch/s_isnan.c | 56 ------------ .../power4/fpu/multiarch/s_isnanf-power5.S | 28 ------ .../power4/fpu/multiarch/s_isnanf-power6.S | 28 ------ .../powerpc32/power4/fpu/multiarch/s_isnanf.c | 39 -------- .../powerpc/powerpc32/power5/fpu/s_isnan.S | 61 ------------- .../powerpc/powerpc32/power5/fpu/s_isnanf.S | 45 ---------- .../powerpc/powerpc32/power6/fpu/s_isnan.S | 61 ------------- .../powerpc/powerpc32/power6/fpu/s_isnanf.S | 44 --------- .../powerpc/powerpc32/power7/fpu/s_isnan.S | 90 ------------------- .../powerpc/powerpc32/power7/fpu/s_isnanf.S | 1 - .../powerpc/powerpc64/fpu/multiarch/Makefile | 2 - .../powerpc64/fpu/multiarch/s_isnan-power5.S | 32 ------- .../powerpc64/fpu/multiarch/s_isnan-power6.S | 32 ------- .../powerpc64/fpu/multiarch/s_isnan-power6x.S | 32 ------- .../powerpc64/fpu/multiarch/s_isnan-power7.S | 32 ------- .../powerpc64/fpu/multiarch/s_isnan-power8.S | 32 ------- .../powerpc64/fpu/multiarch/s_isnan-ppc64.S | 36 -------- .../powerpc/powerpc64/fpu/multiarch/s_isnan.c | 71 --------------- .../powerpc64/fpu/multiarch/s_isnanf.c | 44 --------- sysdeps/powerpc/powerpc64/fpu/s_isnan.S | 56 ------------ .../powerpc/powerpc64/power5/fpu/s_isnan.S | 60 ------------- .../powerpc/powerpc64/power6/fpu/s_isnan.S | 59 ------------ .../powerpc/powerpc64/power6x/fpu/s_isnan.S | 58 ------------ .../powerpc/powerpc64/power7/fpu/s_isnan.S | 68 -------------- .../powerpc/powerpc64/power7/fpu/s_isnanf.S | 1 - .../powerpc/powerpc64/power8/fpu/s_isnan.S | 56 ------------ .../powerpc/powerpc64/power8/fpu/s_isnanf.S | 1 - 35 files changed, 2 insertions(+), 1381 deletions(-) delete mode 100644 sysdeps/powerpc/fpu/s_isnan.c delete mode 100644 sysdeps/powerpc/fpu/s_isnanf.S delete mode 100644 sysdeps/powerpc/powerpc32/fpu/s_isnan.S delete mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power5.S delete mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power6.S delete mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power7.S delete mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-ppc32.S delete mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c delete mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf-power5.S delete mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf-power6.S delete mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf.c delete mode 100644 sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S delete mode 100644 sysdeps/powerpc/powerpc32/power5/fpu/s_isnanf.S delete mode 100644 sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S delete mode 100644 sysdeps/powerpc/powerpc32/power6/fpu/s_isnanf.S delete mode 100644 sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S delete mode 100644 sysdeps/powerpc/powerpc32/power7/fpu/s_isnanf.S delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power5.S delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6.S delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6x.S delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power7.S delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power8.S delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-ppc64.S delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c delete mode 100644 sysdeps/powerpc/powerpc64/fpu/s_isnan.S delete mode 100644 sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S delete mode 100644 sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S delete mode 100644 sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S delete mode 100644 sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S delete mode 100644 sysdeps/powerpc/powerpc64/power7/fpu/s_isnanf.S delete mode 100644 sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S delete mode 100644 sysdeps/powerpc/powerpc64/power8/fpu/s_isnanf.S -- 2.17.1 Reviewed-by: Gabriel F. T. Gomes diff --git a/sysdeps/powerpc/fpu/s_isnan.c b/sysdeps/powerpc/fpu/s_isnan.c deleted file mode 100644 index b62c4cbd0f..0000000000 --- a/sysdeps/powerpc/fpu/s_isnan.c +++ /dev/null @@ -1,62 +0,0 @@ -/* Return 1 if argument is a NaN, else 0. - Copyright (C) 1997-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 - . */ - -/* Ugly kludge to avoid declarations. */ -#define __isnanf __Xisnanf -#define isnanf Xisnanf -#define __GI___isnanf __GI___Xisnanf - -#include -#include -#include - -#undef __isnanf -#undef isnanf -#undef __GI___isnanf - - -/* The hidden_proto in include/math.h was obscured by the macro hackery. */ -__typeof (__isnan) __isnanf; -hidden_proto (__isnanf) - - -int -__isnan (double x) -{ - fenv_t savedstate; - int result; - savedstate = fegetenv_register (); - reset_fpscr_bit (FPSCR_VE); - result = !(x == x); - fesetenv_register (savedstate); - return result; -} -hidden_def (__isnan) -weak_alias (__isnan, isnan) - - -/* It turns out that the 'double' version will also always work for - single-precision. */ -strong_alias (__isnan, __isnanf) -hidden_def (__isnanf) -weak_alias (__isnanf, isnanf) - -#ifdef NO_LONG_DOUBLE -strong_alias (__isnan, __isnanl) -weak_alias (__isnan, isnanl) -#endif diff --git a/sysdeps/powerpc/fpu/s_isnanf.S b/sysdeps/powerpc/fpu/s_isnanf.S deleted file mode 100644 index fc22f678a1..0000000000 --- a/sysdeps/powerpc/fpu/s_isnanf.S +++ /dev/null @@ -1 +0,0 @@ -/* __isnanf is in s_isnan.c */ diff --git a/sysdeps/powerpc/powerpc32/fpu/s_isnan.S b/sysdeps/powerpc/powerpc32/fpu/s_isnan.S deleted file mode 100644 index f28533d40a..0000000000 --- a/sysdeps/powerpc/powerpc32/fpu/s_isnan.S +++ /dev/null @@ -1,57 +0,0 @@ -/* isnan(). PowerPC32 version. - Copyright (C) 2008-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 - -/* int __isnan(x) */ - .machine power4 -EALIGN (__isnan, 4, 0) - mffs fp0 - mtfsb0 4*cr6+lt /* reset_fpscr_bit (FPSCR_VE) */ - fcmpu cr7,fp1,fp1 - mtfsf 255,fp0 - li r3,0 - beqlr+ cr7 /* (x == x) then not a NAN */ - li r3,1 /* else must be a NAN */ - blr - END (__isnan) - -hidden_def (__isnan) -weak_alias (__isnan, isnan) - -/* It turns out that the 'double' version will also always work for - single-precision. */ -#ifndef __isnan -strong_alias (__isnan, __isnanf) -hidden_def (__isnanf) -weak_alias (__isnanf, isnanf) -#endif - -#ifdef NO_LONG_DOUBLE -strong_alias (__isnan, __isnanl) -weak_alias (__isnan, isnanl) -#endif - -#if !IS_IN (libm) -# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) -compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0); -compat_symbol (libc, isnan, isnanl, GLIBC_2_0); -# endif -#endif - diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile index 7008e775b7..0b39461a1a 100644 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile +++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile @@ -1,6 +1,5 @@ ifeq ($(subdir),math) -sysdep_routines += s_isnan-power7 s_isnan-power6 s_isnan-power5 s_isnan-ppc32 \ - s_isnanf-power6 s_isnanf-power5 s_isinf-power7 \ +sysdep_routines += s_isinf-power7 \ s_isinf-ppc32 s_isinff-ppc32 s_finite-power7 \ s_finite-ppc32 s_finitef-ppc32 \ s_modf-power5+ s_modf-ppc32 \ @@ -8,9 +7,7 @@ sysdep_routines += s_isnan-power7 s_isnan-power6 s_isnan-power5 s_isnan-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_isnan-power7 \ - s_isnan-power6 s_isnan-power5 s_isnan-ppc32 \ - s_isnanf-power6 s_isnanf-power5 s_isinf-power7 \ + s_llround-ppc32 s_isinf-power7 \ s_isinf-ppc32 s_isinff-ppc32 s_finite-power7 \ s_finite-ppc32 s_finitef-ppc32 s_ceil-power5+ \ s_ceil-ppc32 s_ceilf-power5+ s_ceilf-ppc32 \ diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power5.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power5.S deleted file mode 100644 index b4bb2bd4bf..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power5.S +++ /dev/null @@ -1,33 +0,0 @@ -/* isnan(). PowerPC32/POWER5 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, symbol, ver) - -#define __isnan __isnan_power5 - -#include diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power6.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power6.S deleted file mode 100644 index c8a429b1e6..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power6.S +++ /dev/null @@ -1,33 +0,0 @@ -/* isnan(). PowerPC32/POWER6 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, symbol, ver) - -#define __isnan __isnan_power6 - -#include diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power7.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power7.S deleted file mode 100644 index ae3fc0539b..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power7.S +++ /dev/null @@ -1,33 +0,0 @@ -/* isnan(). 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, symbol, ver) - -#define __isnan __isnan_power7 - -#include diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-ppc32.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-ppc32.S deleted file mode 100644 index 4b204ae6cf..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-ppc32.S +++ /dev/null @@ -1,32 +0,0 @@ -/* isnan(). 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 -#include - -#undef weak_alias -#define weak_alias(a, b) -#undef compat_symbol -#define compat_symbol(a, b, c, d) - -#define __isnan __isnan_ppc32 -#undef hidden_def -#define hidden_def(name) - strong_alias (__isnan_ppc32, __GI___isnan) - -#include diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c deleted file mode 100644 index 8a7c31f998..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c +++ /dev/null @@ -1,56 +0,0 @@ -/* Multiple versions of isnan. - 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 __isnan __redirect___isnan -#define __isnanf __redirect___isnanf -#define __isnanl __redirect___isnanl -#include -#include -#include -#include "init-arch.h" - -extern __typeof (__isnan) __isnan_ppc32 attribute_hidden; -extern __typeof (__isnan) __isnan_power5 attribute_hidden; -extern __typeof (__isnan) __isnan_power6 attribute_hidden; -extern __typeof (__isnan) __isnan_power7 attribute_hidden; -#undef __isnan -#undef __isnanf -#undef __isnanl - -libc_ifunc_redirected (__redirect___isnan, __isnan, - (hwcap & PPC_FEATURE_ARCH_2_06) - ? __isnan_power7 - : (hwcap & PPC_FEATURE_ARCH_2_05) - ? __isnan_power6 - : (hwcap & PPC_FEATURE_POWER5) - ? __isnan_power5 - : __isnan_ppc32); - -weak_alias (__isnan, isnan) - -#ifdef NO_LONG_DOUBLE -strong_alias (__isnan, __isnanl) -weak_alias (__isnan, isnanl) -#endif - -#if !IS_IN (libm) -# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) -compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0); -compat_symbol (libc, isnan, isnanl, GLIBC_2_0); -# endif -#endif diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf-power5.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf-power5.S deleted file mode 100644 index c456d82999..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf-power5.S +++ /dev/null @@ -1,28 +0,0 @@ -/* isnanf(). PowerPC32/POWER5 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) - -#define __isnanf __isnanf_power5 - -#include diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf-power6.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf-power6.S deleted file mode 100644 index 0133cf218f..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf-power6.S +++ /dev/null @@ -1,28 +0,0 @@ -/* isnanf(). PowerPC32/POWER6 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) - -#define __isnanf __isnanf_power6 - -#include diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf.c deleted file mode 100644 index acb84dbc61..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Multiple versions of isnanf. - 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 -#include "init-arch.h" - -/* Both ppc32 and power7 isnan(double) work for float. */ -extern __typeof (__isnanf) __isnan_ppc32 attribute_hidden; -extern __typeof (__isnanf) __isnanf_power5 attribute_hidden; -extern __typeof (__isnanf) __isnanf_power6 attribute_hidden; -extern __typeof (__isnanf) __isnan_power7 attribute_hidden; - -libc_ifunc_hidden (__isnanf, __isnanf, - (hwcap & PPC_FEATURE_ARCH_2_06) - ? __isnan_power7 - : (hwcap & PPC_FEATURE_ARCH_2_05) - ? __isnanf_power6 - : (hwcap & PPC_FEATURE_POWER5) - ? __isnanf_power5 - : __isnan_ppc32); - -hidden_def (__isnanf) -weak_alias (__isnanf, isnanf) diff --git a/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S b/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S deleted file mode 100644 index 1326973bfc..0000000000 --- a/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S +++ /dev/null @@ -1,61 +0,0 @@ -/* isnan(). PowerPC32 version. - Copyright (C) 2008-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 - -/* int __isnan(x) */ - .machine power5 -EALIGN (__isnan, 4, 0) - stwu r1,-32(r1) - cfi_adjust_cfa_offset (32) - ori r1,r1,0 - stfd fp1,24(r1) /* copy FPR to GPR */ - ori r1,r1,0 - lwz r4,24+HIWORD(r1) - lwz r5,24+LOWORD(r1) - lis r0,0x7ff0 /* const long r0 0x7ff00000 00000000 */ - clrlwi r4,r4,1 /* x = fabs(x) */ - cmpw cr7,r4,r0 /* if (fabs(x) =< inf) */ - cmpwi cr6,r5,0 - li r3,0 /* then return 0 */ - addi r1,r1,32 - cfi_adjust_cfa_offset (-32) - bltlr+ cr7 - bgt- cr7,L(NaN) - beqlr+ cr6 -L(NaN): - li r3,1 /* else return 1 */ - blr - END (__isnan) - -hidden_def (__isnan) -weak_alias (__isnan, isnan) - -#ifdef NO_LONG_DOUBLE -strong_alias (__isnan, __isnanl) -weak_alias (__isnan, isnanl) -#endif - -#if !IS_IN (libm) -# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) -compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0); -compat_symbol (libc, isnan, isnanl, GLIBC_2_0); -# endif -#endif - diff --git a/sysdeps/powerpc/powerpc32/power5/fpu/s_isnanf.S b/sysdeps/powerpc/powerpc32/power5/fpu/s_isnanf.S deleted file mode 100644 index 1cc495f3a8..0000000000 --- a/sysdeps/powerpc/powerpc32/power5/fpu/s_isnanf.S +++ /dev/null @@ -1,45 +0,0 @@ -/* isnan(). PowerPC32 version. - Copyright (C) 2008-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 - -/* int __isnanf(x) */ - .machine power5 -EALIGN (__isnanf, 4, 0) - stwu r1,-32(r1) - cfi_adjust_cfa_offset (32) - stfs fp1,28(r1) /* copy FPR to GPR */ - nop - nop - lwz r4,28(r1) - lis r0,0x7f80 /* const long r0 0x7f800000 */ - clrlwi r4,r4,1 /* x = fabs(x) */ - cmpw cr7,r4,r0 /* if (fabs(x) =< inf) */ - li r3,0 /* then return 0 */ - addi r1,r1,32 - cfi_adjust_cfa_offset (-32) - blelr+ cr7 -L(NaN): - li r3,1 /* else return 1 */ - blr - END (__isnanf) - -hidden_def (__isnanf) -weak_alias (__isnanf, isnanf) - diff --git a/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S b/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S deleted file mode 100644 index d283682a71..0000000000 --- a/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S +++ /dev/null @@ -1,61 +0,0 @@ -/* isnan(). PowerPC32 version. - Copyright (C) 2008-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 - -/* int __isnan(x) */ - .machine power6 -EALIGN (__isnan, 4, 0) - stwu r1,-32(r1) - cfi_adjust_cfa_offset (32) - ori r1,r1,0 - stfd fp1,24(r1) /* copy FPR to GPR */ - ori r1,r1,0 - lwz r4,24+HIWORD(r1) - lwz r5,24+LOWORD(r1) - lis r0,0x7ff0 /* const long r0 0x7ff00000 00000000 */ - clrlwi r4,r4,1 /* x = fabs(x) */ - cmpw cr7,r4,r0 /* if (fabs(x) =< inf) */ - cmpwi cr6,r5,0 - li r3,0 /* then return 0 */ - addi r1,r1,32 - cfi_adjust_cfa_offset (-32) - bltlr+ cr7 - bgt- cr7,L(NaN) - beqlr+ cr6 -L(NaN): - li r3,1 /* else return 1 */ - blr - END (__isnan) - -hidden_def (__isnan) -weak_alias (__isnan, isnan) - -#ifdef NO_LONG_DOUBLE -strong_alias (__isnan, __isnanl) -weak_alias (__isnan, isnanl) -#endif - -#if !IS_IN (libm) -# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) -compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0); -compat_symbol (libc, isnan, isnanl, GLIBC_2_0); -# endif -#endif - diff --git a/sysdeps/powerpc/powerpc32/power6/fpu/s_isnanf.S b/sysdeps/powerpc/powerpc32/power6/fpu/s_isnanf.S deleted file mode 100644 index 6e61471cf0..0000000000 --- a/sysdeps/powerpc/powerpc32/power6/fpu/s_isnanf.S +++ /dev/null @@ -1,44 +0,0 @@ -/* isnanf(). PowerPC32 version. - Copyright (C) 2008-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 - -/* int __isnanf(x) */ - .machine power6 -EALIGN (__isnanf, 4, 0) - stwu r1,-32(r1) - cfi_adjust_cfa_offset (32) - ori r1,r1,0 - stfs fp1,24(r1) /* copy FPR to GPR */ - ori r1,r1,0 - lwz r4,24(r1) - lis r0,0x7f80 /* const long r0 0x7f800000 */ - clrlwi r4,r4,1 /* x = fabs(x) */ - cmpw cr7,r4,r0 /* if (fabs(x) =< inf) */ - li r3,0 /* then return 0 */ - addi r1,r1,32 - cfi_adjust_cfa_offset (-32) - blelr+ cr7 -L(NaN): - li r3,1 /* else return 1 */ - blr - END (__isnanf) - -hidden_def (__isnanf) -weak_alias (__isnanf, isnanf) diff --git a/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S b/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S deleted file mode 100644 index 524a4a6a32..0000000000 --- a/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S +++ /dev/null @@ -1,90 +0,0 @@ -/* isnan(). 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 __isnan(x) */ - .section .rodata.cst8,"aM",@progbits,8 - .align 3 -.LC0: /* 1.0 */ - .quad 0x3ff0000000000000 - - .section ".text" - .type __isnan, @function - .machine power7 -ENTRY (__isnan) -#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 30 /* If not NaN or Inf, finish. */ - - /* 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. */ - lwz r4,8+HIWORD(r1) /* Load the upper half of the FP value. */ - lwz r5,8+LOWORD(r1) /* Load the lower half of the FP value. */ - addi r1,r1,16 /* Reset the stack pointer. */ - lis r0,0x7ff0 /* Load the upper portion for an INF/NaN. */ - clrlwi r4,r4,1 /* r4 = abs(r4). */ - cmpw cr7,r4,r0 /* if (abs(r4) <= inf). */ - cmpwi cr6,r5,0 /* r5 == 0x00000000? */ - bltlr cr7 /* LT means we have a denormal. */ - bgt cr7,L(NaN) /* GT means we have a NaN. */ - beqlr cr6 /* EQ means we have +/-INF. */ -L(NaN): - li r3,1 /* x == NaN? */ - blr - END (__isnan) - -hidden_def (__isnan) -weak_alias (__isnan, isnan) - -/* It turns out that the 'double' version will also always work for - single-precision. */ -strong_alias (__isnan, __isnanf) -hidden_def (__isnanf) -weak_alias (__isnanf, isnanf) - -#ifdef NO_LONG_DOUBLE -strong_alias (__isnan, __isnanl) -weak_alias (__isnan, isnanl) -#endif - -#if !IS_IN (libm) -# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) -compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0); -compat_symbol (libc, isnan, isnanl, GLIBC_2_0); -# endif -#endif diff --git a/sysdeps/powerpc/powerpc32/power7/fpu/s_isnanf.S b/sysdeps/powerpc/powerpc32/power7/fpu/s_isnanf.S deleted file mode 100644 index b48c85e0d3..0000000000 --- a/sysdeps/powerpc/powerpc32/power7/fpu/s_isnanf.S +++ /dev/null @@ -1 +0,0 @@ -/* This function uses the same code as s_isnan.S. */ diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile index 36d5e65ee1..a0b5939abe 100644 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile @@ -6,8 +6,6 @@ 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_isnan-power8 s_isnan-power7 s_isnan-power6x s_isnan-power6 \ - s_isnan-power5 s_isnan-ppc64 \ s_modf-power5+ s_modf-ppc64 \ s_modff-power5+ s_modff-ppc64 diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power5.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power5.S deleted file mode 100644 index 949c51ed12..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power5.S +++ /dev/null @@ -1,32 +0,0 @@ -/* isnan(). PowerPC64/POWER5 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 __isnan __isnan_power5 - -#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6.S deleted file mode 100644 index e946d78c75..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6.S +++ /dev/null @@ -1,32 +0,0 @@ -/* isnan(). PowerPC64/POWER6 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 __isnan __isnan_power6 - -#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6x.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6x.S deleted file mode 100644 index 00016225eb..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6x.S +++ /dev/null @@ -1,32 +0,0 @@ -/* isnan(). PowerPC64/POWER6X 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 __isnan __isnan_power6x - -#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power7.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power7.S deleted file mode 100644 index f32b1feaca..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-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 __isnan __isnan_power7 - -#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power8.S deleted file mode 100644 index 4f292f146c..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-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 __isnan __isnan_power8 - -#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-ppc64.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-ppc64.S deleted file mode 100644 index 6c508aea16..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-ppc64.S +++ /dev/null @@ -1,36 +0,0 @@ -/* isnan(). 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) -#undef compat_symbol -#define compat_symbol(a,b,c,d) - - -#define __isnan __isnan_ppc64 -#ifdef SHARED - #undef hidden_def - #define hidden_def(name) \ - .globl __GI___isnan ; .set __GI___isnan,__isnan_ppc64 -#endif - -#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c deleted file mode 100644 index 5aa44eab12..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c +++ /dev/null @@ -1,71 +0,0 @@ -/* Multiple versions of isnan. - 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 __isnan __redirect___isnan - -/* The following definitions, although not related to the 'double' - version of 'isnan', are required to guarantee macro expansions - (e.g.: from __isnanf to __redirect_isnanf) in include/math.h, thus - compensating for the unintended macro expansions in - math/bits/mathcalls-helper-functions.h. */ -#define __isnanf __redirect___isnanf -#define __isnanl __redirect___isnanl -#define __isnanf128 __redirect___isnanf128 - -#include -#include -#include -#include "init-arch.h" - -extern __typeof (__isnan) __isnan_ppc64 attribute_hidden; -extern __typeof (__isnan) __isnan_power5 attribute_hidden; -extern __typeof (__isnan) __isnan_power6 attribute_hidden; -extern __typeof (__isnan) __isnan_power6x attribute_hidden; -extern __typeof (__isnan) __isnan_power7 attribute_hidden; -extern __typeof (__isnan) __isnan_power8 attribute_hidden; -#undef __isnan -#undef __isnanf -#undef __isnanl -#undef __isnanf128 - -libc_ifunc_redirected (__redirect___isnan, __isnan, - (hwcap2 & PPC_FEATURE2_ARCH_2_07) - ? __isnan_power8 - : (hwcap & PPC_FEATURE_ARCH_2_06) - ? __isnan_power7 - : (hwcap & PPC_FEATURE_POWER6_EXT) - ? __isnan_power6x - : (hwcap & PPC_FEATURE_ARCH_2_05) - ? __isnan_power6 - : (hwcap & PPC_FEATURE_POWER5) - ? __isnan_power5 - : __isnan_ppc64); - -weak_alias (__isnan, isnan) - -#ifdef NO_LONG_DOUBLE -strong_alias (__isnan, __isnanl) -weak_alias (__isnan, isnanl) -#endif - -#if !IS_IN (libm) -# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) -compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0); -compat_symbol (libc, isnan, isnanl, GLIBC_2_0); -# endif -#endif diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c deleted file mode 100644 index 5d789ce196..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Multiple versions of isnan. - 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 "init-arch.h" - -/* The double-precision implementation also works for the single one. */ -extern __typeof (__isnanf) __isnan_ppc64 attribute_hidden; -extern __typeof (__isnanf) __isnan_power5 attribute_hidden; -extern __typeof (__isnanf) __isnan_power6 attribute_hidden; -extern __typeof (__isnanf) __isnan_power6x attribute_hidden; -extern __typeof (__isnanf) __isnan_power7 attribute_hidden; -extern __typeof (__isnanf) __isnan_power8 attribute_hidden; - -libc_ifunc_hidden (__isnanf, __isnanf, - (hwcap2 & PPC_FEATURE2_ARCH_2_07) - ? __isnan_power8 - : (hwcap & PPC_FEATURE_ARCH_2_06) - ? __isnan_power7 - : (hwcap & PPC_FEATURE_POWER6_EXT) - ? __isnan_power6x - : (hwcap & PPC_FEATURE_ARCH_2_05) - ? __isnan_power6 - : (hwcap & PPC_FEATURE_POWER5) - ? __isnan_power5 - : __isnan_ppc64); - -hidden_def (__isnanf) -weak_alias (__isnanf, isnanf) diff --git a/sysdeps/powerpc/powerpc64/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/fpu/s_isnan.S deleted file mode 100644 index ff52c974f8..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/s_isnan.S +++ /dev/null @@ -1,56 +0,0 @@ -/* isnan(). PowerPC64 version. - Copyright (C) 2008-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 - -/* int __isnan(x) */ - .machine power4 -ENTRY_TOCLESS (__isnan, 4) - CALL_MCOUNT 0 - mffs fp0 - mtfsb0 4*cr6+lt /* reset_fpscr_bit (FPSCR_VE) */ - fcmpu cr7,fp1,fp1 - mtfsf 255,fp0 - li r3,0 - beqlr+ cr7 /* (x == x) then not a NAN */ - li r3,1 /* else must be a NAN */ - blr - END (__isnan) - -hidden_def (__isnan) -weak_alias (__isnan, isnan) - -/* It turns out that the 'double' version will also always work for - single-precision. */ -strong_alias (__isnan, __isnanf) -hidden_def (__isnanf) -weak_alias (__isnanf, isnanf) - -#ifdef NO_LONG_DOUBLE -strong_alias (__isnan, __isnanl) -weak_alias (__isnan, isnanl) -#endif - -#if !IS_IN (libm) -# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) -compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0); -compat_symbol (libc, isnan, isnanl, GLIBC_2_0); -# endif -#endif - diff --git a/sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S deleted file mode 100644 index d0c7d81942..0000000000 --- a/sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S +++ /dev/null @@ -1,60 +0,0 @@ -/* isnan(). PowerPC64 version. - Copyright (C) 2008-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 - -/* int __isnan(x) */ - .machine power5 -ENTRY_TOCLESS (__isnan, 4) - CALL_MCOUNT 0 - stfd fp1,-8(r1) /* copy FPR to GPR */ - lis r0,0x7ff0 - nop /* insure the following is in a different */ - nop /* dispatch group */ - ld r4,-8(r1) - sldi r0,r0,32 /* const long r0 0x7ff00000 00000000 */ - clrldi r4,r4,1 /* x = fabs(x) */ - cmpd cr7,r4,r0 /* if (fabs(x) <= inf) */ - li r3,0 /* then return 0 */ - blelr+ cr7 - li r3,1 /* else return 1 */ - blr - END (__isnan) - -hidden_def (__isnan) -weak_alias (__isnan, isnan) - -/* It turns out that the 'double' version will also always work for - single-precision. */ -strong_alias (__isnan, __isnanf) -hidden_def (__isnanf) -weak_alias (__isnanf, isnanf) - -#ifdef NO_LONG_DOUBLE -strong_alias (__isnan, __isnanl) -weak_alias (__isnan, isnanl) -#endif - -#if !IS_IN (libm) -# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) -compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0); -compat_symbol (libc, isnan, isnanl, GLIBC_2_0); -# endif -#endif - diff --git a/sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S deleted file mode 100644 index be1c2c4d04..0000000000 --- a/sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S +++ /dev/null @@ -1,59 +0,0 @@ -/* isnan(). PowerPC64 version. - Copyright (C) 2008-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 - -/* int __isnan(x) */ - .machine power6 -ENTRY_TOCLESS (__isnan, 4) - CALL_MCOUNT 0 - stfd fp1,-8(r1) /* copy FPR to GPR */ - ori r1,r1,0 - ld r4,-8(r1) - lis r0,0x7ff0 - sldi r0,r0,32 /* const long r0 0x7ff00000 00000000 */ - clrldi r4,r4,1 /* x = fabs(x) */ - cmpd cr7,r4,r0 /* if (fabs(x) <= inf) */ - li r3,0 /* then return 0 */ - blelr+ cr7 - li r3,1 /* else return 1 */ - blr - END (__isnan) - -hidden_def (__isnan) -weak_alias (__isnan, isnan) - -/* It turns out that the 'double' version will also always work for - single-precision. */ -strong_alias (__isnan, __isnanf) -hidden_def (__isnanf) -weak_alias (__isnanf, isnanf) - -#ifdef NO_LONG_DOUBLE -strong_alias (__isnan, __isnanl) -weak_alias (__isnan, isnanl) -#endif - -#if !IS_IN (libm) -# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) -compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0); -compat_symbol (libc, isnan, isnanl, GLIBC_2_0); -# endif -#endif - diff --git a/sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S deleted file mode 100644 index b32a87a025..0000000000 --- a/sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S +++ /dev/null @@ -1,58 +0,0 @@ -/* isnan(). PowerPC64 version. - Copyright (C) 2008-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 - -/* int __isnan(x) */ - .machine power6 -ENTRY_TOCLESS (__isnan, 4) - CALL_MCOUNT 0 - mftgpr r4,fp1 /* copy FPR to GPR */ - lis r0,0x7ff0 - ori r1,r1,0 - clrldi r4,r4,1 /* x = fabs(x) */ - sldi r0,r0,32 /* const long r0 0x7ff00000 00000000 */ - cmpd cr7,r4,r0 /* if (fabs(x) <= inf) */ - li r3,0 /* then return 0 */ - blelr+ cr7 - li r3,1 /* else return 1 */ - blr - END (__isnan) - -hidden_def (__isnan) -weak_alias (__isnan, isnan) - -/* It turns out that the 'double' version will also always work for - single-precision. */ -strong_alias (__isnan, __isnanf) -hidden_def (__isnanf) -weak_alias (__isnanf, isnanf) - -#ifdef NO_LONG_DOUBLE -strong_alias (__isnan, __isnanl) -weak_alias (__isnan, isnanl) -#endif - -#if !IS_IN (libm) -# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) -compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0); -compat_symbol (libc, isnan, isnanl, GLIBC_2_0); -# endif -#endif - diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S deleted file mode 100644 index f7df57fe6a..0000000000 --- a/sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S +++ /dev/null @@ -1,68 +0,0 @@ -/* isnan(). 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 __isnan(x) */ - .section ".toc","aw" -.LC0: /* 1.0 */ - .tc FD_ONE[TC],0x3ff0000000000000 - .section ".text" - .type __isnan, @function - .machine power7 -ENTRY (__isnan, 4) - CALL_MCOUNT 0 - lfd fp0,.LC0@toc(r2) - ftdiv cr7,fp1,fp0 - li r3,0 - bflr 30 /* If not NaN, finish. */ - - stfd fp1,-16(r1) /* Transfer FP to GPR's. */ - ori 2,2,0 /* Force a new dispatch group. */ - ld r4,-16(r1) /* Load FP into GPR. */ - lis r0,0x7ff0 - sldi r0,r0,32 /* const long r0 0x7ff00000 00000000. */ - clrldi r4,r4,1 /* x = fabs(x) */ - cmpd cr7,r4,r0 /* if (fabs(x) <= inf) */ - blelr cr7 /* LE means not NaN. */ - li r3,1 /* else return 1 */ - blr - END (__isnan) - -hidden_def (__isnan) -weak_alias (__isnan, isnan) - -/* It turns out that the 'double' version will also always work for - single-precision. */ -strong_alias (__isnan, __isnanf) -hidden_def (__isnanf) -weak_alias (__isnanf, isnanf) - -#ifdef NO_LONG_DOUBLE -strong_alias (__isnan, __isnanl) -weak_alias (__isnan, isnanl) -#endif - -#if !IS_IN (libm) -# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) -compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0); -compat_symbol (libc, isnan, isnanl, GLIBC_2_0); -# endif -#endif diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/s_isnanf.S b/sysdeps/powerpc/powerpc64/power7/fpu/s_isnanf.S deleted file mode 100644 index b48c85e0d3..0000000000 --- a/sysdeps/powerpc/powerpc64/power7/fpu/s_isnanf.S +++ /dev/null @@ -1 +0,0 @@ -/* This function uses the same code as s_isnan.S. */ diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S deleted file mode 100644 index b8ee9c7db4..0000000000 --- a/sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S +++ /dev/null @@ -1,56 +0,0 @@ -/* isnan(). 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] __isnan([f1] x) */ - -ENTRY_TOCLESS (__isnan, 4) - CALL_MCOUNT 0 - MFVSRD_R3_V1 - lis r9,0x7ff0 - clrldi r3,r3,1 /* r3 = r3 & 0x8000000000000000 */ - rldicr r9,r9,32,31 /* r9 = (r9 << 32) & 0xffffffff */ - subf r3,r3,r9 - rldicl r3,r3,1,63 - blr -END (__isnan) - -hidden_def (__isnan) -weak_alias (__isnan, isnan) - -/* It turns out that the 'double' version will also always work for - single-precision. */ -strong_alias (__isnan, __isnanf) -hidden_def (__isnanf) -weak_alias (__isnanf, isnanf) - -#ifdef NO_LONG_DOUBLE -strong_alias (__isnan, __isnanl) -weak_alias (__isnan, isnanl) -#endif - -#if !IS_IN (libm) -# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) -compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0); -compat_symbol (libc, isnan, isnanl, GLIBC_2_0); -# endif -#endif diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_isnanf.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_isnanf.S deleted file mode 100644 index b48c85e0d3..0000000000 --- a/sysdeps/powerpc/powerpc64/power8/fpu/s_isnanf.S +++ /dev/null @@ -1 +0,0 @@ -/* This function uses the same code as s_isnan.S. */