From patchwork Fri Mar 29 13:35:11 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: 161437 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp2052226jan; Fri, 29 Mar 2019 06:39:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqzd7tj9CzAViFEYlNzvGPiWIiWhWhmD4EGelBM3ahgMMMHOFQ9mQnwMewX+7Z/qfcg8o7nS X-Received: by 2002:a63:4616:: with SMTP id t22mr44818904pga.217.1553866742108; Fri, 29 Mar 2019 06:39:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553866742; cv=none; d=google.com; s=arc-20160816; b=jdzc6zDSB4/nOUWdl0Pw1xymKC6tpHB8AIwV44daLYlYqkkuHK9Vm0vI6NwS+p1s9W CK2RUSm8lfgtzt0Tlx5if0HpWhVHPA7GH5qVj4uVDct1BbmDgylu7VfwZRL3dOeWKvuz 9Y+ML7g5bftzxsp5hsw2adjNiVI4Y15ooq565e/dSRRm4yaCCKG8rftztaUck1wawcmB gBrd+0Y9VWx+oyHAbQAP1P/sjL2AiUt7BiTaA5yAnICCT+7mPCb9Sn0XjCDiAEyK4dkS Bnf4zSCwOTZV2/YzWfjUahbftWQ5BqOUNTDlIJto9SXk/njCBv8wCXVv3QmwvmW2lgQ7 lCAQ== 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=vidfdPFx8RpQ5jeRzFfNblR6BSHPgUIExvVZVWInFI4=; b=fsh6t2cHiWZom+Xbbjs+l8KVaL9g5KAAgtoZoSiw9Htbu9MlMRIRPIjNtZ+fn5+25e 3oOxMAymeGUsmEstPz7Roma2oWiCJ4/4qOpsOAHXIY3Gi3bBV/H1BpOLC4cgyvsOw9Wz n2Ox9bsgWNTxyVIFsQ7J39u5/oJs3bQx1VQorc5VCYGUKlgUPksvvHXuES5ZxOx2c+0b J/FroMZ6tK9ATV64O3UUQW3o3FvQ4JJLarlhXhNAo43Zudohgw5t4bpLB1c83JrBHQT6 LJdr94FoREdzWPOZvSKMTUXl3J3tCTjtnfAFDSxMJGl8yOa0J4wOEODOu/C1G+o4D+mI dl+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=clVxDCRi; dkim=pass header.i=@linaro.org header.s=google header.b=QvIChj61; spf=pass (google.com: domain of libc-alpha-return-101006-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-101006-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 z10si1919965pgu.172.2019.03.29.06.39.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Mar 2019 06:39:02 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-101006-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=clVxDCRi; dkim=pass header.i=@linaro.org header.s=google header.b=QvIChj61; spf=pass (google.com: domain of libc-alpha-return-101006-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-101006-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=v9dLIGcUXQiYw1Yl2LbFypAFn97qtku 5SbQ9RcX9qBqsophsJTDtrvb1ePkELyuKno/kFV6XA8K84TTqVUrVGbu+uKYZjoS DxjMeC0np7y5hy2HDOgCz4JBC4BHCXJ3R94+zwB5USOJ0CDHeRKyYkr4OSkx9lh8 zclevtnBWM2w= 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=x2JC/sbbUIpM/9Mw16uvZ/Efklw=; b=clVxD CRi3nHQ+asqVedmjmFk38vk7AhplCNW+Ejq8/Vl3kna1Dam5/I8ZBuvejkDryrw1 1Uo59/zTu8HTHxdlV8bce4Czav1qn5qLr2zr7S77FdgBymJ7Z2uz3JOCxqemFJmv W66pbOVYPN0DlLuckeeW8McuAE1CV4O9hev6s0= Received: (qmail 120840 invoked by alias); 29 Mar 2019 13:36:09 -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 120067 invoked by uid 89); 29 Mar 2019 13:36:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.0 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-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=vidfdPFx8RpQ5jeRzFfNblR6BSHPgUIExvVZVWInFI4=; b=QvIChj61zwB5shgFTfuRYatSSYbAEirJGhoY5grX5WT21uKlOmiu9KZFBPbM3lheat PBjK1MaCGJTDXGXjAu2ZgT0Ycv1xNdVA4UOtp7DbA4y3tlZPYPwDEEG790PzVl4seZ72 BZAznxdYIBizpc8EGywdTNF+Uh4ddrAY7uqNwM3CXXMiv2xmDVZicXj3obSD29IHW0EZ VyyLwYJtCsFnecnncavAYUp3n5SG8oE0xG9ZA6O1xD/b09cx4syaJOOs2d4suOihXdvf DnKQKwHBaMbjHD1BNXCFT2oHjpCNvC2DOqUSo/kHyfqIprdqDpzhKe/35tUIqdsEn9VZ fzKg== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 10/28] powerpc: copysign cleanup Date: Fri, 29 Mar 2019 10:35:11 -0300 Message-Id: <20190329133529.22523-11-adhemerval.zanella@linaro.org> In-Reply-To: <20190329133529.22523-1-adhemerval.zanella@linaro.org> References: <20190329133529.22523-1-adhemerval.zanella@linaro.org> GCC always expand copysign{f} for all possible cpus, so calling the libm is only done if user explicitly states to disable the builtin (which is usually done not for performance reason). So to provide ifunc variant for copysign only adds complexity for powerpc and powerpc64 and it not required for powerpc64le. This patch removes both powerpc32 and powerpc64 ifunc variants and consolidates the powerpc implementation on sysdeps/powerpc/fpu/s_copysign{f}.c using compiler builtins. 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_copysign.c: New file. * sysdeps/powerpc/fpu/s_copysignf.c: Likewise. * sysdeps/powerpc/powerpc32/fpu/s_copysign.S: Remove file. * sysdeps/powerpc/powerpc32/fpu/s_copysignf.S: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile (sysdep_routines, libm-sysdep_routines): Remove s_copysign-power6 and s_copysign-ppc32. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign-power6.S: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign-ppc32.S: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign.c: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysignf.c: Likewise. * sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S: Likewise. * sysdeps/powerpc/powerpc32/power6/fpu/s_copysignf.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile (sysdeps_calls): Remove s_copysign-power6 s_copysign-ppc64. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-power6.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysignf.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/s_copysign.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/s_copysignf.S: Likewise. * sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S: Likewise. * sysdeps/powerpc/powerpc64/power6/fpu/s_copysignf.S: Likewise. --- sysdeps/powerpc/fpu/s_copysign.c | 32 +++++++++++ sysdeps/powerpc/fpu/s_copysignf.c | 28 ++++++++++ sysdeps/powerpc/powerpc32/fpu/s_copysign.S | 53 ------------------- sysdeps/powerpc/powerpc32/fpu/s_copysignf.S | 1 - .../powerpc32/power4/fpu/multiarch/Makefile | 6 +-- .../power4/fpu/multiarch/s_copysign-power6.S | 33 ------------ .../power4/fpu/multiarch/s_copysign-ppc32.S | 34 ------------ .../power4/fpu/multiarch/s_copysign.c | 45 ---------------- .../power4/fpu/multiarch/s_copysignf.c | 34 ------------ .../powerpc/powerpc32/power6/fpu/s_copysign.S | 49 ----------------- .../powerpc32/power6/fpu/s_copysignf.S | 1 - .../powerpc/powerpc64/fpu/multiarch/Makefile | 3 +- .../fpu/multiarch/s_copysign-power6.S | 32 ----------- .../fpu/multiarch/s_copysign-ppc64.S | 34 ------------ .../powerpc64/fpu/multiarch/s_copysign.c | 45 ---------------- .../powerpc64/fpu/multiarch/s_copysignf.c | 34 ------------ sysdeps/powerpc/powerpc64/fpu/s_copysign.S | 53 ------------------- sysdeps/powerpc/powerpc64/fpu/s_copysignf.S | 1 - .../powerpc/powerpc64/power6/fpu/s_copysign.S | 49 ----------------- .../powerpc64/power6/fpu/s_copysignf.S | 1 - 20 files changed, 64 insertions(+), 504 deletions(-) create mode 100644 sysdeps/powerpc/fpu/s_copysign.c create mode 100644 sysdeps/powerpc/fpu/s_copysignf.c delete mode 100644 sysdeps/powerpc/powerpc32/fpu/s_copysign.S delete mode 100644 sysdeps/powerpc/powerpc32/fpu/s_copysignf.S delete mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign-power6.S delete mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign-ppc32.S delete mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign.c delete mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysignf.c delete mode 100644 sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S delete mode 100644 sysdeps/powerpc/powerpc32/power6/fpu/s_copysignf.S delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-power6.S delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-ppc64.S delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign.c delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysignf.c delete mode 100644 sysdeps/powerpc/powerpc64/fpu/s_copysign.S delete mode 100644 sysdeps/powerpc/powerpc64/fpu/s_copysignf.S delete mode 100644 sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S delete mode 100644 sysdeps/powerpc/powerpc64/power6/fpu/s_copysignf.S -- 2.17.1 Reviewed-by: Gabriel F. T. Gomes diff --git a/sysdeps/powerpc/fpu/s_copysign.c b/sysdeps/powerpc/fpu/s_copysign.c new file mode 100644 index 0000000000..364242e5d9 --- /dev/null +++ b/sysdeps/powerpc/fpu/s_copysign.c @@ -0,0 +1,32 @@ +/* Copy sign of a number. PowerPC version. + Copyright (C) 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 Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If + not, see . */ + +#define NO_MATH_REDIRECT +#include +#include +#include + +double +__copysign (double x, double y) +{ + return __builtin_copysign (x, y); +} +libm_alias_double (__copysign, copysign) +#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0) +compat_symbol (libc, __copysign, copysignl, GLIBC_2_0); +#endif diff --git a/sysdeps/powerpc/fpu/s_copysignf.c b/sysdeps/powerpc/fpu/s_copysignf.c new file mode 100644 index 0000000000..d423bfa793 --- /dev/null +++ b/sysdeps/powerpc/fpu/s_copysignf.c @@ -0,0 +1,28 @@ +/* Smallest integral value not less than argument. PowerPC version. + Copyright (C) 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 Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If + not, see . */ + +#define NO_MATH_REDIRECT +#include +#include + +float +__copysignf (float x, float y) +{ + return __builtin_copysignf (x, y); +} +libm_alias_float (__copysign, copysign) diff --git a/sysdeps/powerpc/powerpc32/fpu/s_copysign.S b/sysdeps/powerpc/powerpc32/fpu/s_copysign.S deleted file mode 100644 index fa9e5a2a1a..0000000000 --- a/sysdeps/powerpc/powerpc32/fpu/s_copysign.S +++ /dev/null @@ -1,53 +0,0 @@ -/* Copy a sign bit between floating-point values. - 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 - . */ - -/* This has been coded in assembler because GCC makes such a mess of it - when it's coded in C. */ - -#include -#include -#include -#include - -ENTRY(__copysign) -/* double [f1] copysign (double [f1] x, double [f2] y); - copysign(x,y) returns a value with the magnitude of x and - with the sign bit of y. */ - stwu r1,-16(r1) - cfi_adjust_cfa_offset (16) - stfd fp2,8(r1) - lwz r3,8+HIWORD(r1) - cmpwi r3,0 - addi r1,r1,16 - cfi_adjust_cfa_offset (-16) - blt L(0) - fabs fp1,fp1 - blr -L(0): fnabs fp1,fp1 - blr - END (__copysign) - -libm_alias_double (__copysign, copysign) - -/* It turns out that it's safe to use this code even for single-precision. */ -strong_alias(__copysign,__copysignf) -libm_alias_float (__copysign, copysign) - -#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0) -compat_symbol (libc, __copysign, copysignl, GLIBC_2_0) -#endif diff --git a/sysdeps/powerpc/powerpc32/fpu/s_copysignf.S b/sysdeps/powerpc/powerpc32/fpu/s_copysignf.S deleted file mode 100644 index e05438ae7d..0000000000 --- a/sysdeps/powerpc/powerpc32/fpu/s_copysignf.S +++ /dev/null @@ -1 +0,0 @@ -/* __copysignf is in s_copysign.S */ diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile index cf38e347f2..7008e775b7 100644 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile +++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile @@ -2,8 +2,8 @@ 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 \ s_isinf-ppc32 s_isinff-ppc32 s_finite-power7 \ - s_finite-ppc32 s_finitef-ppc32 s_copysign-power6 \ - s_copysign-ppc32 s_modf-power5+ s_modf-ppc32 \ + s_finite-ppc32 s_finitef-ppc32 \ + s_modf-power5+ s_modf-ppc32 \ s_modff-power5+ s_modff-ppc32 libm-sysdep_routines += s_llrintf-power6 s_llrintf-ppc32 s_llrint-power6 \ @@ -18,7 +18,7 @@ libm-sysdep_routines += s_llrintf-power6 s_llrintf-ppc32 s_llrint-power6 \ s_floorf-ppc32 s_round-power5+ s_round-ppc32 \ s_roundf-power5+ s_roundf-ppc32 s_trunc-power5+ \ s_trunc-ppc32 s_truncf-power5+ s_truncf-ppc32 \ - s_copysign-power6 s_copysign-ppc32 s_lround-power6x \ + s_lround-power6x \ s_lround-power5+ s_lround-ppc32 s_lrint-power6x \ s_lrint-ppc32 s_modf-power5+ s_modf-ppc32 \ s_modff-power5+ s_modff-ppc32 s_logbl-power7 \ diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign-power6.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign-power6.S deleted file mode 100644 index 24ab12e41e..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign-power6.S +++ /dev/null @@ -1,33 +0,0 @@ -/* copysign(). 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, alias, ver) - -#define __copysign __copysign_power6 - -#include diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign-ppc32.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign-ppc32.S deleted file mode 100644 index 0c283c65b0..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign-ppc32.S +++ /dev/null @@ -1,34 +0,0 @@ -/* copysign(). 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 strong_alias -#define strong_alias(a,b) -#undef compat_symbol -#define compat_symbol(a, b, c, d) - -#define __copysign __copysign_ppc32 -#undef hidden_def -#define hidden_def(name) - strong_alias (__copysign_ppc32, __GI___copysign) - -#include diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign.c deleted file mode 100644 index f9d1795732..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign.c +++ /dev/null @@ -1,45 +0,0 @@ -/* Multiple versions of copysign. - 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 NO_MATH_REDIRECT -/* Redefine copysign so that the compiler won't complain about the type - mismatch with the IFUNC selector in strong_alias below. */ -#undef __copysign -#define __copysign __redirect_copysign -#include -#include -#undef __copysign -#include -#include "init-arch.h" -#include - -extern __typeof (__redirect_copysign) __copysign_ppc32 attribute_hidden; -extern __typeof (__redirect_copysign) __copysign_power6 attribute_hidden; - -extern __typeof (__redirect_copysign) __libm_copysign; -libc_ifunc (__libm_copysign, - (hwcap & PPC_FEATURE_ARCH_2_05) - ? __copysign_power6 - : __copysign_ppc32); - -strong_alias (__libm_copysign, __copysign) -libm_alias_double (__copysign, copysign) - -#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0) -compat_symbol (libc, __copysign, copysignl, GLIBC_2_0); -#endif diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysignf.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysignf.c deleted file mode 100644 index 12354d0872..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysignf.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Multiple versions of copysignf. - 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 NO_MATH_REDIRECT -#include -#include -#include "init-arch.h" -#include - -/* It's safe to use double-precision implementation for single-precision. */ -extern __typeof (__copysignf) __copysign_ppc32 attribute_hidden; -extern __typeof (__copysignf) __copysign_power6 attribute_hidden; - -libc_ifunc (__copysignf, - (hwcap & PPC_FEATURE_ARCH_2_05) - ? __copysign_power6 - : __copysign_ppc32); - -libm_alias_float (__copysign, copysign) diff --git a/sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S b/sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S deleted file mode 100644 index abf84ca191..0000000000 --- a/sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S +++ /dev/null @@ -1,49 +0,0 @@ -/* copysign(). PowerPC32/POWER6 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 -#include -#include - -/* double [f1] copysign (double [f1] x, double [f2] y); - copysign(x,y) returns a value with the magnitude of x and - with the sign bit of y. */ - - .section ".text" - .type __copysign, @function - .machine power6 -EALIGN (__copysign, 4, 0) - CALL_MCOUNT - fcpsgn fp1,fp2,fp1 - blr -END (__copysign) - -hidden_def (__copysign) -libm_alias_double (__copysign, copysign) - -/* It turns out that the 'double' version will also always work for - single-precision. */ -strong_alias (__copysign, __copysignf) -hidden_def (__copysignf) -libm_alias_float (__copysign, copysign) - -#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0) -compat_symbol (libc, copysign, copysignl, GLIBC_2_0); -#endif diff --git a/sysdeps/powerpc/powerpc32/power6/fpu/s_copysignf.S b/sysdeps/powerpc/powerpc32/power6/fpu/s_copysignf.S deleted file mode 100644 index d4aa702d07..0000000000 --- a/sysdeps/powerpc/powerpc32/power6/fpu/s_copysignf.S +++ /dev/null @@ -1 +0,0 @@ -/* This function uses the same code as s_copysign.S. */ diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile index 7d469d79af..36d5e65ee1 100644 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile @@ -2,8 +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_copysign-power6 s_copysign-ppc64 \ - s_finite-power8 s_finite-power7 s_finite-ppc64 \ +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 \ diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-power6.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-power6.S deleted file mode 100644 index e901cea480..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-power6.S +++ /dev/null @@ -1,32 +0,0 @@ -/* copysign(). PowerPC64 default version. - Copyright (C) 2013-2019 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include - -#undef weak_alias -#define weak_alias(a,b) -#undef strong_alias -#define strong_alias(a,b) -#undef compat_symbol -#define compat_symbol(a, b, c, d) -#undef hidden_def -#define hidden_def(name) - -#define __copysign __copysign_power6 - -#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-ppc64.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-ppc64.S deleted file mode 100644 index a4a783f3f6..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-ppc64.S +++ /dev/null @@ -1,34 +0,0 @@ -/* copysign(). PowerPC64 default 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 - -#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 __copysign __copysign_ppc64 -#undef hidden_def -#define hidden_def(name) \ - strong_alias (__copysign_ppc64, __GI___copysign) - -#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign.c deleted file mode 100644 index 3d7f7f051d..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign.c +++ /dev/null @@ -1,45 +0,0 @@ -/* Multiple versions of copysign. - 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 NO_MATH_REDIRECT -/* Redefine copysign so that the compiler won't complain about the type - mismatch with the IFUNC selector in strong_alias below. */ -#undef __copysign -#define __copysign __redirect_copysign -#include -#include -#undef __copysign -#include -#include "init-arch.h" -#include - -extern __typeof (__redirect_copysign) __copysign_ppc64 attribute_hidden; -extern __typeof (__redirect_copysign) __copysign_power6 attribute_hidden; - -extern __typeof (__redirect_copysign) __libm_copysign; -libc_ifunc (__libm_copysign, - (hwcap & PPC_FEATURE_ARCH_2_05) - ? __copysign_power6 - : __copysign_ppc64); - -strong_alias (__libm_copysign, __copysign) -libm_alias_double (__copysign, copysign) - -#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0) -compat_symbol (libc, __copysign, copysignl, GLIBC_2_0); -#endif diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysignf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysignf.c deleted file mode 100644 index d20984b01a..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysignf.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Multiple versions of copysignf. - 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 NO_MATH_REDIRECT -#include -#include -#include "init-arch.h" -#include - -/* It's safe to use double-precision implementation for single-precision. */ -extern __typeof (__copysignf) __copysign_ppc64 attribute_hidden; -extern __typeof (__copysignf) __copysign_power6 attribute_hidden; - -libc_ifunc (__copysignf, - (hwcap & PPC_FEATURE_ARCH_2_05) - ? __copysign_power6 - : __copysign_ppc64); - -libm_alias_float (__copysign, copysign) diff --git a/sysdeps/powerpc/powerpc64/fpu/s_copysign.S b/sysdeps/powerpc/powerpc64/fpu/s_copysign.S deleted file mode 100644 index bf6283361c..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/s_copysign.S +++ /dev/null @@ -1,53 +0,0 @@ -/* Copy a sign bit between floating-point values. PowerPC64 version. - 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 - . */ - -/* This has been coded in assembler because GCC makes such a mess of it - when it's coded in C. */ - -#include -#include -#include -#include - -ENTRY_TOCLESS (__copysign) - CALL_MCOUNT 0 -/* double [f1] copysign (double [f1] x, double [f2] y); - copysign(x,y) returns a value with the magnitude of x and - with the sign bit of y. */ - stfd fp2,-8(r1) - nop - nop - nop - ld r3,-8(r1) - cmpdi r3,0 - blt L(0) - fabs fp1,fp1 - blr -L(0): fnabs fp1,fp1 - blr - END (__copysign) - -libm_alias_double (__copysign, copysign) - -/* It turns out that it's safe to use this code even for single-precision. */ -strong_alias(__copysign,__copysignf) -libm_alias_float (__copysign, copysign) - -#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0) -compat_symbol (libc, __copysign, copysignl, GLIBC_2_0) -#endif diff --git a/sysdeps/powerpc/powerpc64/fpu/s_copysignf.S b/sysdeps/powerpc/powerpc64/fpu/s_copysignf.S deleted file mode 100644 index e05438ae7d..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/s_copysignf.S +++ /dev/null @@ -1 +0,0 @@ -/* __copysignf is in s_copysign.S */ diff --git a/sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S b/sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S deleted file mode 100644 index feba531e5b..0000000000 --- a/sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S +++ /dev/null @@ -1,49 +0,0 @@ -/* copysign(). PowerPC64/POWER6 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 -#include -#include - -/* double [f1] copysign (double [f1] x, double [f2] y); - copysign(x,y) returns a value with the magnitude of x and - with the sign bit of y. */ - - .section ".text" - .type __copysign, @function - .machine power6 -ENTRY_TOCLESS (__copysign, 4) - CALL_MCOUNT 0 - fcpsgn fp1,fp2,fp1 - blr -END (__copysign) - -hidden_def (__copysign) -libm_alias_double (__copysign, copysign) - -/* It turns out that the 'double' version will also always work for - single-precision. */ -strong_alias (__copysign, __copysignf) -hidden_def (__copysignf) -libm_alias_float (__copysign, copysign) - -#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0) -compat_symbol (libc, copysign, copysignl, GLIBC_2_0); -#endif diff --git a/sysdeps/powerpc/powerpc64/power6/fpu/s_copysignf.S b/sysdeps/powerpc/powerpc64/power6/fpu/s_copysignf.S deleted file mode 100644 index d4aa702d07..0000000000 --- a/sysdeps/powerpc/powerpc64/power6/fpu/s_copysignf.S +++ /dev/null @@ -1 +0,0 @@ -/* This function uses the same code as s_copysign.S. */