From patchwork Fri Mar 29 13:35:05 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: 161428 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp2049968jan; Fri, 29 Mar 2019 06:37:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqy86Y16i5Plltr3Gv1faT4VAV9PBir0JJgbatymsZ6/5Gwo42qiCdYi+iPj8ldNM8q4zqxv X-Received: by 2002:a17:902:ab95:: with SMTP id f21mr49237918plr.188.1553866623841; Fri, 29 Mar 2019 06:37:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553866623; cv=none; d=google.com; s=arc-20160816; b=IOJHt14gSFFco0F3pLvgbG4dXpBdyVZVOufTVTDNyzX2GOP9EnfNhxqqIz3A7yIBn2 pPW25TOjAhBsJYLRKCtLNkey4+rAtDV+0sKpCT/uttH6vpi135y2uyvkrxGS0hziNXW4 jE5tuNB4fR/A4QON1nRfklBxP7Dqh5VF4Hsz/XMAWIFilVDlX4cXPhh5Yyu/BZSC1eOY ZQc3ql7qe1OTXs/ZoxqnRf+85rxqJEiSmPH4cSRuUq2Q7k0v0T0FzpZ2sxCKYqNAL6YT PP5P1qm3t+3zBOlk2iM/cYPNCbZpB+U3pLbe9x4PQnVLekzFWqp8Pw1xd434DDAhfWPX a6ww== 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=C3rDPXaQRXHIhh1L3ozP8UUc311TRaaGSlC6lC3WGoA=; b=SnjVLyfCaG+Ind3qlPFahYArmBbDJ2t5qjckOmYLy/zMqkfqsL8hfcvFohLsG2NJOj /xtZOXaEKsYSXWREQdIi8+pkMyk0b7b+KN8SY/xmOYkkMhGp5uR3zH3FkT0owZBgAoZ5 M9SWakL5u2yiS1tAXP2jmCHxhMXKUUrPGbpEdjYuXyKF9BMcGNy8U0yGlzIXV+pcR8xb Ge6NiyoChwU64nV7YTHUHUguWklOmwze7YYyAj9q5bdgoKGN0ntz4HYUacNZJ4m7qMzJ 6eA46tfpzr79avBQFc0RpaGpOrljmm/MmdXU6knQ/bV4QxPGvJJNxJJOUoGf1Jt74+uJ 1szg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=KQCTFi1t; dkim=pass header.i=@linaro.org header.s=google header.b=gGLSptA7; spf=pass (google.com: domain of libc-alpha-return-100997-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-100997-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 x8si1914008pll.207.2019.03.29.06.37.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Mar 2019 06:37:03 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-100997-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=KQCTFi1t; dkim=pass header.i=@linaro.org header.s=google header.b=gGLSptA7; spf=pass (google.com: domain of libc-alpha-return-100997-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-100997-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=JodRkXpbXWV3N5Tx79jGDsipJGHKL9w 2sR9Brr7UkCQwdIn+eUYIQ4QOeJinK/NoeyTFNy9eYaxUnri13PYnRJC3bKH5YdI Lte91z9ihih+v4cAMOnAA0XlSFk7GG95xZbWgLFMGbN/I8G9qlyxLdAm/Ixw3G8h pG58nQ/tttpY= 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=R8c8gT5hNJWGu+pUy+l+uuzPynk=; b=KQCTF i1tXcITmdRnIwqmzmNkpx8kQT9GPUyRncecnkGyN6T5+KrRCYua1TZ4tU9A6G9cO K77RI44znHogWCAh/ojiBwE7aS15+FdpoS+qNDygmrpYUMF3MCgHHc57TnLbXuc9 trBCHumsLD/wdY5jr9sx9YxJkTC23V90khljM4= Received: (qmail 119218 invoked by alias); 29 Mar 2019 13:35:52 -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 119073 invoked by uid 89); 29 Mar 2019 13:35:51 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.7 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=lc0, a, b, ab, ble X-HELO: mail-ua1-f67.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=C3rDPXaQRXHIhh1L3ozP8UUc311TRaaGSlC6lC3WGoA=; b=gGLSptA7PAIwUt9GfaZXTBtSfjYlSRlLTVG+u9M0C5v50JPzsHccVaooorahT7pB82 YzYTn8Nc4r70TpJxyQSbTU334hFowWyZJorGIwms0iLNlCPYn+kUzrzv8GwNK1YyKrnD kbKyo2Kwq0SqE0Ss8BQDWnK5dACswwpkZCBfURVsOWPAuI/wK/wnmJDS2k8rIQafo/tK mQ5NQimk6nQlSv3A9VhNoZxgDBKz1IblsDaYfg5kGB8DG2yZ1sRZ8FcpOcO6QnfT9ODu koydBqyxUjXRpurtxYN5OhTiDPFug+LF441i6Neq/fhPzG5yrkdLVOLvdlm6SmaXNeT8 EUKQ== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 04/28] powerpc: ceil/ceilf refactor Date: Fri, 29 Mar 2019 10:35:05 -0300 Message-Id: <20190329133529.22523-5-adhemerval.zanella@linaro.org> In-Reply-To: <20190329133529.22523-1-adhemerval.zanella@linaro.org> References: <20190329133529.22523-1-adhemerval.zanella@linaro.org> This patches consolidates all the powerpc ceil{f} implementations on the generic sysdeps/powerpc/fpu/s_ceil{f}. The generic implementation uses either the compiler builts for ISA 2.03+ (which generates the frip instruction) or a generic implementation which uses FP only operations. It adds a generic implementation (round_to_integer.h) which is shared with other rounding to integer routines. The resulting code should be similar performance-wise to previous assembly one. The IFUNC organization for powerpc64 is also change to be enabled only for powerpc64 and not 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/fenv_libc.h (__fesetround_inline_nocheck): New macro. * sysdeps/powerpc/fpu/round_to_integer.h: New file. * sysdeps/powerpc/fpu/s_ceil.c: Likewise. * sysdeps/powerpc/fpu/s_ceilf.c: Likewise. * sysdeps/powerpc/powerpc32/fpu/s_ceil.S: Remove file. * sysdeps/powerpc/powerpc32/fpu/s_ceilf.S: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile (CFLAGS-s_ceil-power5+.c, CFLAGS-s_ceilf-power5+.c): New rule. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-power5+.S: Remove file. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-ppc32.S: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-power5+.S: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-ppc32.S: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-power5+.c: New file. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-ppc32.c: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-power5+.c: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-ppc32.c: Likewise. * sysdeps/powerpc/powerpc32/power5+/fpu/s_ceil.S: Remove file. * sysdeps/powerpc/powerpc32/power5+/fpu/s_ceilf.S: Likewise. * sysdeps/powerpc/powerpc64/be/fpu/multiarch/Makefile: New file. * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceil-power5+.c: Likewise. * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceil-ppc64.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil.c: Move to ... * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceil.c: ... here. * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceilf-power5+.c: New file. * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceilf-ppc64.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf.c: Move to ... * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceilf.c: ... * here. * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile (libm-sysdep_routines): Remove s_ceil-power5+, s_ceil-ppc64, s_ceilf-power5+, and s_ceilf-ppc64. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-power5+.S: Remove file. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-power5+.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/s_ceil.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/s_ceilf.S: Likewise. * sysdeps/powerpc/powerpc64/power5+/fpu/s_ceil.S: Likewise. * sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S: Likewise. --- sysdeps/powerpc/fpu/fenv_libc.h | 8 ++ sysdeps/powerpc/fpu/round_to_integer.h | 109 ++++++++++++++++++ sysdeps/powerpc/fpu/s_ceil.c | 35 ++++++ sysdeps/powerpc/fpu/s_ceilf.c | 35 ++++++ sysdeps/powerpc/powerpc32/fpu/s_ceil.S | 76 ------------ sysdeps/powerpc/powerpc32/fpu/s_ceilf.S | 76 ------------ .../powerpc32/power4/fpu/multiarch/Makefile | 2 + .../power4/fpu/multiarch/s_ceil-power5+.S | 33 ------ .../power4/fpu/multiarch/s_ceil-power5+.c | 3 + .../power4/fpu/multiarch/s_ceil-ppc32.S | 31 ----- .../power4/fpu/multiarch/s_ceil-ppc32.c | 3 + .../power4/fpu/multiarch/s_ceilf-power5+.S | 26 ----- .../power4/fpu/multiarch/s_ceilf-power5+.c | 3 + .../power4/fpu/multiarch/s_ceilf-ppc32.S | 27 ----- .../power4/fpu/multiarch/s_ceilf-ppc32.c | 3 + .../powerpc/powerpc32/power5+/fpu/s_ceil.S | 29 ----- .../powerpc/powerpc32/power5+/fpu/s_ceilf.S | 30 ----- .../powerpc64/be/fpu/multiarch/Makefile | 9 ++ .../be/fpu/multiarch/s_ceil-power5+.c | 3 + .../powerpc64/be/fpu/multiarch/s_ceil-ppc64.c | 3 + .../powerpc64/{ => be}/fpu/multiarch/s_ceil.c | 4 +- .../be/fpu/multiarch/s_ceilf-power5+.c | 3 + .../be/fpu/multiarch/s_ceilf-ppc64.c | 3 + .../{ => be}/fpu/multiarch/s_ceilf.c | 4 +- .../powerpc/powerpc64/fpu/multiarch/Makefile | 3 +- .../powerpc64/fpu/multiarch/s_ceil-power5+.S | 30 ----- .../powerpc64/fpu/multiarch/s_ceil-ppc64.S | 30 ----- .../powerpc64/fpu/multiarch/s_ceilf-power5+.S | 24 ---- .../powerpc64/fpu/multiarch/s_ceilf-ppc64.S | 24 ---- sysdeps/powerpc/powerpc64/fpu/s_ceil.S | 65 ----------- sysdeps/powerpc/powerpc64/fpu/s_ceilf.S | 67 ----------- .../powerpc/powerpc64/power5+/fpu/s_ceil.S | 30 ----- .../powerpc/powerpc64/power5+/fpu/s_ceilf.S | 31 ----- 33 files changed, 225 insertions(+), 637 deletions(-) create mode 100644 sysdeps/powerpc/fpu/round_to_integer.h create mode 100644 sysdeps/powerpc/fpu/s_ceil.c create mode 100644 sysdeps/powerpc/fpu/s_ceilf.c delete mode 100644 sysdeps/powerpc/powerpc32/fpu/s_ceil.S delete mode 100644 sysdeps/powerpc/powerpc32/fpu/s_ceilf.S delete mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-power5+.S create mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-power5+.c delete mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-ppc32.S create mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-ppc32.c delete mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-power5+.S create mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-power5+.c delete mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-ppc32.S create mode 100644 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-ppc32.c delete mode 100644 sysdeps/powerpc/powerpc32/power5+/fpu/s_ceil.S delete mode 100644 sysdeps/powerpc/powerpc32/power5+/fpu/s_ceilf.S create mode 100644 sysdeps/powerpc/powerpc64/be/fpu/multiarch/Makefile create mode 100644 sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceil-power5+.c create mode 100644 sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceil-ppc64.c rename sysdeps/powerpc/powerpc64/{ => be}/fpu/multiarch/s_ceil.c (95%) create mode 100644 sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceilf-power5+.c create mode 100644 sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceilf-ppc64.c rename sysdeps/powerpc/powerpc64/{ => be}/fpu/multiarch/s_ceilf.c (95%) delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-power5+.S delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-ppc64.S delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-power5+.S delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-ppc64.S delete mode 100644 sysdeps/powerpc/powerpc64/fpu/s_ceil.S delete mode 100644 sysdeps/powerpc/powerpc64/fpu/s_ceilf.S delete mode 100644 sysdeps/powerpc/powerpc64/power5+/fpu/s_ceil.S delete mode 100644 sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S -- 2.17.1 Reviewed-by: Gabriel F. T. Gomes diff --git a/sysdeps/powerpc/fpu/fenv_libc.h b/sysdeps/powerpc/fpu/fenv_libc.h index 67a9c9a51a..01dccb15a8 100644 --- a/sysdeps/powerpc/fpu/fenv_libc.h +++ b/sysdeps/powerpc/fpu/fenv_libc.h @@ -98,6 +98,14 @@ __fesetround_inline (int round) return 0; } +/* Same as __fesetround_inline, however without runtime check to use DFP + mtfsfi syntax or if round is valid. */ +static inline void +__fesetround_inline_nocheck (const int round) +{ + asm volatile ("mtfsfi 7,%0" : : "i" (round)); +} + /* Definitions of all the FPSCR bit numbers */ enum { FPSCR_FX = 0, /* exception summary */ diff --git a/sysdeps/powerpc/fpu/round_to_integer.h b/sysdeps/powerpc/fpu/round_to_integer.h new file mode 100644 index 0000000000..417aae6242 --- /dev/null +++ b/sysdeps/powerpc/fpu/round_to_integer.h @@ -0,0 +1,109 @@ +/* Round to integer generic implementation. + 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 . */ + +#ifndef _ROUND_TO_INTEGER_H +#define _ROUND_TO_INTEGER_H + +#include + +enum round_mode +{ + CEIL, + FLOOR, + ROUND, + TRUNC, + NEARBYINT, +}; + +static inline void +set_fenv_mode (enum round_mode mode) +{ + int rmode; + switch (mode) + { + case CEIL: rmode = FE_UPWARD; break; + default: rmode = FE_TONEAREST; break; + } + __fesetround_inline_nocheck (rmode); +} + +static inline float +round_to_integer_float (enum round_mode mode, float x) +{ + /* Ensure sNaN input is converted to qNaN. */ + if (__glibc_unlikely (isnan (x))) + return x + x; + + if (fabs (x) > 0x1p+23) + return x; + + float r = x; + + /* Save current FPU rounding mode and inexact state. */ + fenv_t fe = fegetenv_register (); + set_fenv_mode (mode); + if (x > 0.0) + { + r += 0x1p+23; + r -= 0x1p+23; + r = fabs (r); + } + else if (x < 0.0) + { + r -= 0x1p+23; + r += 0x1p+23; + r = -fabs (r); + } + __builtin_mtfsf (0xff, fe); + + return r; +} + +static inline double +round_to_integer_double (enum round_mode mode, double x) +{ + /* Ensure sNaN input is converted to qNaN. */ + if (__glibc_unlikely (isnan (x))) + return x + x; + + if (fabs (x) > 0x1p+52) + return x; + + double r = x; + + /* Save current FPU rounding mode and inexact state. */ + fenv_t fe = fegetenv_register (); + set_fenv_mode (mode); + if (x > 0.0) + { + r += 0x1p+52; + r -= 0x1p+52; + r = fabs (r); + } + else if (x < 0.0) + { + r -= 0x1p+52; + r += 0x1p+52; + r = -fabs (r); + } + __builtin_mtfsf (0xff, fe); + + return r; +} + +#endif diff --git a/sysdeps/powerpc/fpu/s_ceil.c b/sysdeps/powerpc/fpu/s_ceil.c new file mode 100644 index 0000000000..49008c7af8 --- /dev/null +++ b/sysdeps/powerpc/fpu/s_ceil.c @@ -0,0 +1,35 @@ +/* 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 +#include + +double +__ceil (double x) +{ +#ifdef _ARCH_PWR5X + return __builtin_ceil (x); +#else + return round_to_integer_double (CEIL, x); +#endif +} +#ifndef __ceil +libm_alias_double (__ceil, ceil) +#endif diff --git a/sysdeps/powerpc/fpu/s_ceilf.c b/sysdeps/powerpc/fpu/s_ceilf.c new file mode 100644 index 0000000000..8c86bf30a3 --- /dev/null +++ b/sysdeps/powerpc/fpu/s_ceilf.c @@ -0,0 +1,35 @@ +/* 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 +#include + +float +__ceilf (float x) +{ +#ifdef _ARCH_PWR5X + return __builtin_ceilf (x); +#else + return round_to_integer_float (CEIL, x); +#endif +} +#ifndef __ceilf +libm_alias_float (__ceil, ceil) +#endif diff --git a/sysdeps/powerpc/powerpc32/fpu/s_ceil.S b/sysdeps/powerpc/powerpc32/fpu/s_ceil.S deleted file mode 100644 index 4d0fdad2c1..0000000000 --- a/sysdeps/powerpc/powerpc32/fpu/s_ceil.S +++ /dev/null @@ -1,76 +0,0 @@ -/* ceil function. PowerPC32 version. - Copyright (C) 2004-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 - - .section .rodata.cst4,"aM",@progbits,4 - .align 2 -.LC0: /* 2**52 */ - .long 0x59800000 - - .section ".text" -ENTRY (__ceil) -#ifdef SHARED - mflr r11 - cfi_register(lr,r11) - SETUP_GOT_ACCESS(r9,got_label) - addis r9,r9,.LC0-got_label@ha - lfs fp13,.LC0-got_label@l(r9) - mtlr r11 - cfi_same_value (lr) -#else - lis r9,.LC0@ha - lfs fp13,.LC0@l(r9) -#endif - fabs fp0,fp1 - fsub fp12,fp13,fp13 /* generate 0.0 */ - fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO52) */ - mffs fp11 /* Save current FPU rounding mode and - "inexact" state. */ - fcmpu cr6,fp1,fp12 /* if (x > 0.0) */ - bnl- cr7,.L10 - mtfsfi 7,2 /* Set rounding mode toward +inf. */ - ble- cr6,.L4 - fadd fp1,fp1,fp13 /* x+= TWO52; */ - fsub fp1,fp1,fp13 /* x-= TWO52; */ - fabs fp1,fp1 /* if (x == 0.0) */ - /* x = 0.0; */ - mtfsf 0xff,fp11 /* Restore previous rounding mode and - "inexact" state. */ - blr -.L4: - bge- cr6,.L9 /* if (x < 0.0) */ - fsub fp1,fp1,fp13 /* x-= TWO52; */ - fadd fp1,fp1,fp13 /* x+= TWO52; */ - fnabs fp1,fp1 /* if (x == 0.0) */ - /* x = -0.0; */ -.L9: - mtfsf 0xff,fp11 /* Restore previous rounding mode and - "inexact" state. */ - blr -.L10: - /* Ensure sNaN input is converted to qNaN. */ - fcmpu cr7,fp1,fp1 - beqlr cr7 - fadd fp1,fp1,fp1 - blr - END (__ceil) - -libm_alias_double (__ceil, ceil) diff --git a/sysdeps/powerpc/powerpc32/fpu/s_ceilf.S b/sysdeps/powerpc/powerpc32/fpu/s_ceilf.S deleted file mode 100644 index c32044afa6..0000000000 --- a/sysdeps/powerpc/powerpc32/fpu/s_ceilf.S +++ /dev/null @@ -1,76 +0,0 @@ -/* float ceil function. PowerPC32 version. - Copyright (C) 2004-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 - - .section .rodata.cst4,"aM",@progbits,4 - .align 2 -.LC0: /* 2**23 */ - .long 0x4b000000 - - .section ".text" -ENTRY (__ceilf) -#ifdef SHARED - mflr r11 - cfi_register(lr,r11) - SETUP_GOT_ACCESS(r9,got_label) - addis r9,r9,.LC0-got_label@ha - lfs fp13,.LC0-got_label@l(r9) - mtlr r11 - cfi_same_value (lr) -#else - lis r9,.LC0@ha - lfs fp13,.LC0@l(r9) -#endif - fabs fp0,fp1 - fsubs fp12,fp13,fp13 /* generate 0.0 */ - fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO23) */ - mffs fp11 /* Save current FPU rounding mode and - "inexact" state. */ - fcmpu cr6,fp1,fp12 /* if (x > 0.0) */ - bnl- cr7,.L10 - mtfsfi 7,2 /* Set rounding mode toward +inf. */ - ble- cr6,.L4 - fadds fp1,fp1,fp13 /* x+= TWO23; */ - fsubs fp1,fp1,fp13 /* x-= TWO23; */ - fabs fp1,fp1 /* if (x == 0.0) */ - /* x = 0.0; */ - mtfsf 0xff,fp11 /* Restore previous rounding mode and - "inexact" state. */ - blr -.L4: - bge- cr6,.L9 /* if (x < 0.0) */ - fsubs fp1,fp1,fp13 /* x-= TWO23; */ - fadds fp1,fp1,fp13 /* x+= TWO23; */ - fnabs fp1,fp1 /* if (x == 0.0) */ - /* x = -0.0; */ -.L9: - mtfsf 0xff,fp11 /* Restore previous rounding mode and - "inexact" state. */ - blr -.L10: - /* Ensure sNaN input is converted to qNaN. */ - fcmpu cr7,fp1,fp1 - beqlr cr7 - fadds fp1,fp1,fp1 - blr - END (__ceilf) - -libm_alias_float (__ceil, ceil) - diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile index 4e85021d50..cf38e347f2 100644 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile +++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile @@ -26,6 +26,8 @@ libm-sysdep_routines += s_llrintf-power6 s_llrintf-ppc32 s_llrint-power6 \ s_logbf-power7 s_logbf-ppc32 e_hypot-power7 \ e_hypot-ppc32 e_hypotf-power7 e_hypotf-ppc32 +CFLAGS-s_ceil-power5+.c = -mcpu=power5+ +CFLAGS-s_ceilf-power5+.c = -mcpu=power5+ CFLAGS-s_modf-power5+.c = -mcpu=power5+ CFLAGS-s_modff-power5+.c = -mcpu=power5+ CFLAGS-s_logbl-power7.c = -mcpu=power7 diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-power5+.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-power5+.S deleted file mode 100644 index b13a56667e..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-power5+.S +++ /dev/null @@ -1,33 +0,0 @@ -/* ceil function. 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, alias, ver) - -#define __ceil __ceil_power5plus - -#include diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-power5+.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-power5+.c new file mode 100644 index 0000000000..87bc66cdb0 --- /dev/null +++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-power5+.c @@ -0,0 +1,3 @@ +#include +#define __ceil __ceil_power5plus +#include diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-ppc32.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-ppc32.S deleted file mode 100644 index 899dc140c6..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-ppc32.S +++ /dev/null @@ -1,31 +0,0 @@ -/* ceil function. 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 __ceil __ceil_ppc32 - -#include diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-ppc32.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-ppc32.c new file mode 100644 index 0000000000..93c098476b --- /dev/null +++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-ppc32.c @@ -0,0 +1,3 @@ +#include +#define __ceil __ceil_ppc32 +#include diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-power5+.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-power5+.S deleted file mode 100644 index 6279638031..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-power5+.S +++ /dev/null @@ -1,26 +0,0 @@ -/* ceilf function. 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 weak_alias -#define weak_alias(name, alias) - -#define __ceilf __ceilf_power5plus - -#include diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-power5+.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-power5+.c new file mode 100644 index 0000000000..a5bfa98535 --- /dev/null +++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-power5+.c @@ -0,0 +1,3 @@ +#include +#define __ceilf __ceilf_power5plus +#include diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-ppc32.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-ppc32.S deleted file mode 100644 index a84edf7a5b..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-ppc32.S +++ /dev/null @@ -1,27 +0,0 @@ -/* ceilf function. 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) - -#define __ceilf __ceilf_ppc32 - -#include diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-ppc32.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-ppc32.c new file mode 100644 index 0000000000..a4dcdcb406 --- /dev/null +++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-ppc32.c @@ -0,0 +1,3 @@ +#include +#define __ceilf __ceilf_ppc32 +#include diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_ceil.S b/sysdeps/powerpc/powerpc32/power5+/fpu/s_ceil.S deleted file mode 100644 index 7dab4023f7..0000000000 --- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_ceil.S +++ /dev/null @@ -1,29 +0,0 @@ -/* ceil function. PowerPC32/power5+ version. - Copyright (C) 2006-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 - - .machine "power5" -EALIGN (__ceil, 4, 0) - frip fp1, fp1 - blr - END (__ceil) - -libm_alias_double (__ceil, ceil) diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_ceilf.S b/sysdeps/powerpc/powerpc32/power5+/fpu/s_ceilf.S deleted file mode 100644 index 15a6f27d28..0000000000 --- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_ceilf.S +++ /dev/null @@ -1,30 +0,0 @@ -/* ceilf function. PowerPC32/power5+ version. - Copyright (C) 2006-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 - - .machine "power5" -EALIGN (__ceilf, 4, 0) - frip fp1, fp1 /* The rounding instructions are double. */ - frsp fp1, fp1 /* But we need to set ooverflow for float. */ - blr - END (__ceilf) - -libm_alias_float (__ceil, ceil) - diff --git a/sysdeps/powerpc/powerpc64/be/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/Makefile new file mode 100644 index 0000000000..932c3c7e6c --- /dev/null +++ b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/Makefile @@ -0,0 +1,9 @@ +ifeq ($(subdir),math) +libm-sysdep_routines += s_ceil-power5+ \ + s_ceil-ppc64 \ + s_ceilf-power5+ \ + s_ceilf-ppc64 + +CFLAGS-s_ceil-power5+.c = -mcpu=power5+ +CFLAGS-s_ceilf-power5+.c = -mcpu=power5+ +endif diff --git a/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceil-power5+.c b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceil-power5+.c new file mode 100644 index 0000000000..87bc66cdb0 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceil-power5+.c @@ -0,0 +1,3 @@ +#include +#define __ceil __ceil_power5plus +#include diff --git a/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceil-ppc64.c b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceil-ppc64.c new file mode 100644 index 0000000000..8711ff3229 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceil-ppc64.c @@ -0,0 +1,3 @@ +#include +#define __ceil __ceil_ppc64 +#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil.c b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceil.c similarity index 95% rename from sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil.c rename to sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceil.c index b72f4b1cc0..36976a0404 100644 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil.c +++ b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceil.c @@ -18,10 +18,8 @@ #define NO_MATH_REDIRECT #include -#include -#include -#include "init-arch.h" #include +#include "init-arch.h" extern __typeof (__ceil) __ceil_ppc64 attribute_hidden; extern __typeof (__ceil) __ceil_power5plus attribute_hidden; diff --git a/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceilf-power5+.c b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceilf-power5+.c new file mode 100644 index 0000000000..a5bfa98535 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceilf-power5+.c @@ -0,0 +1,3 @@ +#include +#define __ceilf __ceilf_power5plus +#include diff --git a/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceilf-ppc64.c b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceilf-ppc64.c new file mode 100644 index 0000000000..086251dc09 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceilf-ppc64.c @@ -0,0 +1,3 @@ +#include +#define __ceilf __ceilf_ppc64 +#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf.c b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceilf.c similarity index 95% rename from sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf.c rename to sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceilf.c index 707f07c0bb..34811330d5 100644 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf.c +++ b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceilf.c @@ -18,10 +18,8 @@ #define NO_MATH_REDIRECT #include -#include -#include -#include "init-arch.h" #include +#include "init-arch.h" extern __typeof (__ceilf) __ceilf_ppc64 attribute_hidden; extern __typeof (__ceilf) __ceilf_power5plus attribute_hidden; diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile index 39b557604c..ac6d162f91 100644 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile @@ -14,8 +14,7 @@ sysdep_calls := s_copysign-power6 s_copysign-ppc64 \ sysdep_routines += $(sysdep_calls) libm-sysdep_routines += s_llround-power6x \ - s_llround-power5+ s_llround-ppc64 s_ceil-power5+ \ - s_ceil-ppc64 s_ceilf-power5+ s_ceilf-ppc64 \ + s_llround-power5+ s_llround-ppc64 \ s_floor-power5+ s_floor-ppc64 s_floorf-power5+ \ s_floorf-ppc64 s_round-power5+ s_round-ppc64 \ s_roundf-power5+ s_roundf-ppc64 s_trunc-power5+ \ diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-power5+.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-power5+.S deleted file mode 100644 index 8782e6378e..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-power5+.S +++ /dev/null @@ -1,30 +0,0 @@ -/* ceil function. 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 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 __ceil __ceil_power5plus - -#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-ppc64.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-ppc64.S deleted file mode 100644 index 5d9b30d50d..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-ppc64.S +++ /dev/null @@ -1,30 +0,0 @@ -/* ceil function. 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) - -#define __ceil __ceil_ppc64 - -#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-power5+.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-power5+.S deleted file mode 100644 index 6c9d18880e..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-power5+.S +++ /dev/null @@ -1,24 +0,0 @@ -/* ceilf function. 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 - . */ - -#undef weak_alias -#define weak_alias(a,b) - -#define __ceilf __ceilf_power5plus - -#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-ppc64.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-ppc64.S deleted file mode 100644 index 2aaa8c4e4a..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-ppc64.S +++ /dev/null @@ -1,24 +0,0 @@ -/* ceilf function. 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 - . */ - -#undef weak_alias -#define weak_alias(a,b) - -#define __ceilf __ceilf_ppc64 - -#include diff --git a/sysdeps/powerpc/powerpc64/fpu/s_ceil.S b/sysdeps/powerpc/powerpc64/fpu/s_ceil.S deleted file mode 100644 index 3e0a968abe..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/s_ceil.S +++ /dev/null @@ -1,65 +0,0 @@ -/* ceil function. PowerPC64 version. - Copyright (C) 2004-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 - - .section ".toc","aw" -.LC0: /* 2**52 */ - .tc FD_43300000_0[TC],0x4330000000000000 - .section ".text" - -ENTRY (__ceil, 4) - CALL_MCOUNT 0 - lfd fp13,.LC0@toc(2) - fabs fp0,fp1 - fsub fp12,fp13,fp13 /* generate 0.0 */ - fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO52) */ - mffs fp11 /* Save current FPU rounding mode and - "inexact" state. */ - fcmpu cr6,fp1,fp12 /* if (x > 0.0) */ - bnl- cr7,.L10 - mtfsfi 7,2 /* Set rounding mode toward +inf. */ - ble- cr6,.L4 - fadd fp1,fp1,fp13 /* x+= TWO52; */ - fsub fp1,fp1,fp13 /* x-= TWO52; */ - fabs fp1,fp1 /* if (x == 0.0) */ - /* x = 0.0; */ - mtfsf 0xff,fp11 /* Restore previous rounding mode and - "inexact" state. */ - blr -.L4: - bge- cr6,.L9 /* if (x < 0.0) */ - fsub fp1,fp1,fp13 /* x-= TWO52; */ - fadd fp1,fp1,fp13 /* x+= TWO52; */ - fnabs fp1,fp1 /* if (x == 0.0) */ - /* x = -0.0; */ -.L9: - mtfsf 0xff,fp11 /* Restore previous rounding mode and - "inexact" state. */ - blr -.L10: - /* Ensure sNaN input is converted to qNaN. */ - fcmpu cr7,fp1,fp1 - beqlr cr7 - fadd fp1,fp1,fp1 - blr - END (__ceil) - -libm_alias_double (__ceil, ceil) diff --git a/sysdeps/powerpc/powerpc64/fpu/s_ceilf.S b/sysdeps/powerpc/powerpc64/fpu/s_ceilf.S deleted file mode 100644 index a189f9fd58..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/s_ceilf.S +++ /dev/null @@ -1,67 +0,0 @@ -/* float ceil function. PowerPC64 version. - Copyright (C) 2004-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 - - .section ".toc","aw" - .p2align 3 -.LC0: /* 2**23 */ - .long 0x4b000000 - .long 0x0 - .section ".text" - -ENTRY (__ceilf, 4) - CALL_MCOUNT 0 - lfs fp13,.LC0@toc(2) - fabs fp0,fp1 - fsubs fp12,fp13,fp13 /* generate 0.0 */ - fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO23) */ - mffs fp11 /* Save current FPU rounding mode and - "inexact" state. */ - fcmpu cr6,fp1,fp12 /* if (x > 0.0) */ - bnl- cr7,.L10 - mtfsfi 7,2 /* Set rounding mode toward +inf. */ - ble- cr6,.L4 - fadds fp1,fp1,fp13 /* x+= TWO23; */ - fsubs fp1,fp1,fp13 /* x-= TWO23; */ - fabs fp1,fp1 /* if (x == 0.0) */ - /* x = 0.0; */ - mtfsf 0xff,fp11 /* Restore previous rounding mode and - "inexact" state. */ - blr -.L4: - bge- cr6,.L9 /* if (x < 0.0) */ - fsubs fp1,fp1,fp13 /* x-= TWO23; */ - fadds fp1,fp1,fp13 /* x+= TWO23; */ - fnabs fp1,fp1 /* if (x == 0.0) */ - /* x = -0.0; */ -.L9: - mtfsf 0xff,fp11 /* Restore previous rounding mode and - "inexact" state. */ - blr -.L10: - /* Ensure sNaN input is converted to qNaN. */ - fcmpu cr7,fp1,fp1 - beqlr cr7 - fadds fp1,fp1,fp1 - blr - END (__ceilf) - -libm_alias_float (__ceil, ceil) - diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceil.S b/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceil.S deleted file mode 100644 index 8feb687697..0000000000 --- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceil.S +++ /dev/null @@ -1,30 +0,0 @@ -/* ceil function. PowerPC64/power5+ version. - Copyright (C) 2006-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 - - .machine "power5" -ENTRY_TOCLESS (__ceil, 4) - CALL_MCOUNT 0 - frip fp1, fp1 - blr - END (__ceil) - -libm_alias_double (__ceil, ceil) diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S b/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S deleted file mode 100644 index 11d13abd11..0000000000 --- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S +++ /dev/null @@ -1,31 +0,0 @@ -/* ceilf function. PowerPC64/power5+ version. - Copyright (C) 2006-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 - - .machine "power5" -ENTRY_TOCLESS (__ceilf, 4) - CALL_MCOUNT 0 - frip fp1, fp1 /* The rounding instructions are double. */ - frsp fp1, fp1 /* But we need to set ooverflow for float. */ - blr - END (__ceilf) - -libm_alias_float (__ceil, ceil) -