From patchwork Fri Mar 29 13:35:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 161446 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp2054547jan; Fri, 29 Mar 2019 06:41:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqxdrt1q11OZpXo3ySo8lSd5kpA41umezm7oBUE676B+nAyrORm6rv+to9ltTJFGYyFAzVnf X-Received: by 2002:a17:902:8d8b:: with SMTP id v11mr49751642plo.241.1553866869076; Fri, 29 Mar 2019 06:41:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553866869; cv=none; d=google.com; s=arc-20160816; b=Y5I2bhaTj80SsEtdVWflaUXkbWGp1048EGtes6X2LIVcvdwrZE/ALc9HefRlF9GlS6 oEOEbeYPClUvuB+8HuicaxOWaVfV0xTuB5CeD2F4nF/2CeS4YPoYjH/4lNL+Ywx44Lcd 6FO4Y6e6i31fLXSEcYEvASc5IuVmfJQq7QsidenatbjmyzwEy+sGjjaBbBazUzxsATng BGyskE3BfT/nCVxugF/xsfqJZOgNEhB623TWCPtPgxrjd9oh2chcFHO0JVRqUGeOoqp6 6xjpOo6KjEkxO/OBmKFI/tjBypcIoRvoQqi1MWjaJ48p/6sdZIxhMMUnF4+drNXqaGCz tGOQ== 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=L+6PefbU8uGC0zihQ4ocv8xLP5LQu7khzOcyOsRWGHo=; b=y9VRWzMs0ixvjt1j/mpm1rxOQHlNIe0NEohANhCE8XO1Ge1G7V2afmWpKKUrtr9d/C PrYAn4ziK/LIJfKx2gSalte8pnxG1GdQ/XSFY0qTXtOJlq2LL1+tnBqFm9djBgsi3o/7 WLyG8YTfHofvsMAFLxfKvCDRNC0V99SOYWbrad8IZ4oQb0RIB+yfl0xmz9y/+ceR5o3A vSeqruGUPiZOkqAtTRPnQIyBa2K07lpZVPaQxjRm3jNVrtHBKSq1id8ZjZSPGe2HIk1z 2ez61jSNKdIeggST5vuvToozGvNrftbbFi8MpMp2rJYHfXYPwugtjD/cSNChkhIquJp7 nHfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="YqW/GwXn"; dkim=pass header.i=@linaro.org header.s=google header.b=lW2DLdLI; spf=pass (google.com: domain of libc-alpha-return-101015-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-101015-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 33si2006107pls.161.2019.03.29.06.41.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Mar 2019 06:41:09 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-101015-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="YqW/GwXn"; dkim=pass header.i=@linaro.org header.s=google header.b=lW2DLdLI; spf=pass (google.com: domain of libc-alpha-return-101015-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-101015-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=R5V7hxg1dRQN878bSL1IQrZnMS8n70K E61URfx84ELBohZrCwwozWqKjNpwQn3U45WBe1nFWw3sR6ptOgIhk18n6kWvT0wY puJjE5eSqw+uVgHwzIbSNakfFWUNmtkaEhfZED+bwGYwxX7fCanlpYkUTP35gQk5 3lXkPUrm0gMA= 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=cOkKtbyRhwDAH+molisIiITLvmI=; b=YqW/G wXnXm1z+zitWdv4TJph4MFp0N/HgbiMjGe9qkCUEqw+8p95yuc2pvkST2C5ih/Ph /D0MObjY62+KS814cbD5tDAo34hoFuhMBAXED8opeT7EY3LTpwoJpdk2pmw1p6jH ggQ1DawLkUQefmCrk5EVJWrH/OMy9JX1ECN6rk= Received: (qmail 123347 invoked by alias); 29 Mar 2019 13:36:35 -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 121269 invoked by uid 89); 29 Mar 2019 13:36:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.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= X-HELO: mail-vk1-f196.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=L+6PefbU8uGC0zihQ4ocv8xLP5LQu7khzOcyOsRWGHo=; b=lW2DLdLIKgiiaWFHRKXbbs4NLbSok5D/tE6L7aLiCrVMoOGst1oKFTTyX9YPyhxkqi 8dciyDr5B6Y1vlDoUcszwpr4dsRHSX55D5q36hu3yNqz1eoRmKOTwlHEwTJ1Qhe4MGXr Woka1ajfKUxQF13VXYu1K8YY91re60WEed/JWbBCW9IBf80Sp7bK+6KUIcQoaRg7n7US xe9gvOzWPaqjB4eai+wOukmvEX49b5fhEe9YYVRTh+VQQ2TGqpRXkZKfNqTH8xqUYvca 9u/rAKnVS7ISjDly8kVzJd9PrHVSyz5qAG70xNxigX6dK/Vqiy2glxe2/198GKQh+31Q YMSQ== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 20/28] powerpc: Refactor powerpc64 lround/lroundf/llround/llroundf Date: Fri, 29 Mar 2019 10:35:21 -0300 Message-Id: <20190329133529.22523-21-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 {l}lround{f} implementations on the generic sysdeps/powerpc/fpu/s_{l}lround{f}.c. The IFUNC support is also moved only to powerpc64 only, since for powerpc64le generic implementation resulting in optimized code. 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/powerpc64/be/fpu/multiarch/Makefile (libm-sysdep_routines): Add s_llround-power8, s_llround-power6x, s_llround-power5+, s_llround-ppc64, and s_llroundf-ppc64. (CFLAGS-s_llround-power8.c, CFLAGS-s_llround-power6x.c, CFLAGS-s_llround-power5+.c): New rule. * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llround-power5+.c: New file. * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llround-power6x.c: Likewise. * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llround-power8.c: Likewise. * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llround-ppc64.c: Likewise. * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llroundf-ppc64.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c: Move to ... * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llround.c: ... here. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llroundf.c: Move to ... * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llroundf.c: ... here. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_lround.c: Move to ... * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_lround.c: ... here. * sysdeps/powerpc/powerpc64/fpu/Makefile [$(subdir) == math] (CFLAGS-s_llround.c): New rule. * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile (libm-sysdep_routines): Remove s_llround-* objects. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power5+.S: Remove file. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power6x.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llroundf-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/s_llround.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/s_llroundf.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/s_lround.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/s_lroundf.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/s_llround.c: New file. * sysdeps/powerpc/powerpc64/fpu/s_llroundf.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/s_lround.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/s_lroundf.c: Likewise. * sysdeps/powerpc/powerpc64/power5+/fpu/s_llround.S: Likewise. * sysdeps/powerpc/powerpc64/power5+/fpu/s_llroundf.S: Likewise. * sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S: Likewise. * sysdeps/powerpc/powerpc64/power6x/fpu/s_llroundf.S: Likewise. * sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S: Likewise. * sysdeps/powerpc/powerpc64/power8/fpu/s_llroundf.S: Likewise. --- .../powerpc64/be/fpu/multiarch/Makefile | 12 ++- .../be/fpu/multiarch/s_llround-power5+.c | 2 + .../be/fpu/multiarch/s_llround-power6x.c | 2 + .../be/fpu/multiarch/s_llround-power8.c | 2 + .../be/fpu/multiarch/s_llround-ppc64.c | 2 + .../{ => be}/fpu/multiarch/s_llround.c | 0 .../be/fpu/multiarch/s_llroundf-ppc64.c | 2 + .../{ => be}/fpu/multiarch/s_llroundf.c | 0 .../{ => be}/fpu/multiarch/s_lround.c | 0 sysdeps/powerpc/powerpc64/fpu/Makefile | 2 + .../powerpc/powerpc64/fpu/multiarch/Makefile | 5 +- .../fpu/multiarch/s_llround-power5+.S | 31 ------- .../fpu/multiarch/s_llround-power6x.S | 31 ------- .../fpu/multiarch/s_llround-power8.S | 30 ------- .../powerpc64/fpu/multiarch/s_llround-ppc64.S | 27 ------ .../fpu/multiarch/s_llroundf-ppc64.S | 31 ------- sysdeps/powerpc/powerpc64/fpu/s_llround.S | 86 ------------------ sysdeps/powerpc/powerpc64/fpu/s_llround.c | 83 +++++++++++++++++ sysdeps/powerpc/powerpc64/fpu/s_llroundf.S | 89 ------------------- sysdeps/powerpc/powerpc64/fpu/s_llroundf.c | 83 +++++++++++++++++ sysdeps/powerpc/powerpc64/fpu/s_lround.S | 1 - sysdeps/powerpc/powerpc64/fpu/s_lround.c | 1 + sysdeps/powerpc/powerpc64/fpu/s_lroundf.S | 1 - sysdeps/powerpc/powerpc64/fpu/s_lroundf.c | 1 + .../powerpc/powerpc64/power5+/fpu/s_llround.S | 56 ------------ .../powerpc64/power5+/fpu/s_llroundf.S | 1 - .../powerpc/powerpc64/power6x/fpu/s_llround.S | 52 ----------- .../powerpc64/power6x/fpu/s_llroundf.S | 1 - .../powerpc/powerpc64/power8/fpu/s_llround.S | 46 ---------- .../powerpc/powerpc64/power8/fpu/s_llroundf.S | 1 - 30 files changed, 190 insertions(+), 491 deletions(-) create mode 100644 sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llround-power5+.c create mode 100644 sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llround-power6x.c create mode 100644 sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llround-power8.c create mode 100644 sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llround-ppc64.c rename sysdeps/powerpc/powerpc64/{ => be}/fpu/multiarch/s_llround.c (100%) create mode 100644 sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llroundf-ppc64.c rename sysdeps/powerpc/powerpc64/{ => be}/fpu/multiarch/s_llroundf.c (100%) rename sysdeps/powerpc/powerpc64/{ => be}/fpu/multiarch/s_lround.c (100%) delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power5+.S delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power6x.S delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-ppc64.S delete mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/s_llroundf-ppc64.S delete mode 100644 sysdeps/powerpc/powerpc64/fpu/s_llround.S create mode 100644 sysdeps/powerpc/powerpc64/fpu/s_llround.c delete mode 100644 sysdeps/powerpc/powerpc64/fpu/s_llroundf.S create mode 100644 sysdeps/powerpc/powerpc64/fpu/s_llroundf.c delete mode 100644 sysdeps/powerpc/powerpc64/fpu/s_lround.S create mode 100644 sysdeps/powerpc/powerpc64/fpu/s_lround.c delete mode 100644 sysdeps/powerpc/powerpc64/fpu/s_lroundf.S create mode 100644 sysdeps/powerpc/powerpc64/fpu/s_lroundf.c delete mode 100644 sysdeps/powerpc/powerpc64/power5+/fpu/s_llround.S delete mode 100644 sysdeps/powerpc/powerpc64/power5+/fpu/s_llroundf.S delete mode 100644 sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S delete mode 100644 sysdeps/powerpc/powerpc64/power6x/fpu/s_llroundf.S delete mode 100644 sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S delete mode 100644 sysdeps/powerpc/powerpc64/power8/fpu/s_llroundf.S -- 2.17.1 Reviewed-by: Gabriel F. T. Gomes diff --git a/sysdeps/powerpc/powerpc64/be/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/Makefile index febda6dbb3..9917cd15d5 100644 --- a/sysdeps/powerpc/powerpc64/be/fpu/multiarch/Makefile +++ b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/Makefile @@ -17,7 +17,12 @@ libm-sysdep_routines += s_ceil-power5+ \ s_truncf-ppc64 \ s_llrint-power8 \ s_llrint-power6x \ - s_llrint-ppc64 + s_llrint-ppc64 \ + s_llround-power8 \ + s_llround-power6x \ + s_llround-power5+ \ + s_llround-ppc64 \ + s_llroundf-ppc64 CFLAGS-s_ceil-power5+.c = -mcpu=power5+ CFLAGS-s_ceilf-power5+.c = -mcpu=power5+ @@ -27,6 +32,7 @@ CFLAGS-s_round-power5+.c = -mcpu=power5+ CFLAGS-s_roundf-power5+.c = -mcpu=power5+ CFLAGS-s_trunc-power5+.c = -mcpu=power5+ CFLAGS-s_truncf-power5+.c = -mcpu=power5+ -CFLAGS-s_llrint-power8.c += -mcpu=power8 -CFLAGS-s_llrint-power6x.c += -mcpu=power6x +CFLAGS-s_llround-power8.c += -mcpu=power8 +CFLAGS-s_llround-power6x.c += -mcpu=power6x +CFLAGS-s_llround-power5+.c += -mcpu=power5+ endif diff --git a/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llround-power5+.c b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llround-power5+.c new file mode 100644 index 0000000000..182132b825 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llround-power5+.c @@ -0,0 +1,2 @@ +#define __llround __llround_power5plus +#include diff --git a/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llround-power6x.c b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llround-power6x.c new file mode 100644 index 0000000000..542319d56b --- /dev/null +++ b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llround-power6x.c @@ -0,0 +1,2 @@ +#define __llround __llround_power6x +#include diff --git a/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llround-power8.c b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llround-power8.c new file mode 100644 index 0000000000..5d2b3b8d44 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llround-power8.c @@ -0,0 +1,2 @@ +#define __llround __llround_power8 +#include diff --git a/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llround-ppc64.c b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llround-ppc64.c new file mode 100644 index 0000000000..8793bd7814 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llround-ppc64.c @@ -0,0 +1,2 @@ +#define __llround __llround_ppc64 +#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llround.c similarity index 100% rename from sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c rename to sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llround.c diff --git a/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llroundf-ppc64.c b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llroundf-ppc64.c new file mode 100644 index 0000000000..dba4c654db --- /dev/null +++ b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llroundf-ppc64.c @@ -0,0 +1,2 @@ +#define __llroundf __llroundf_ppc64 +#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llroundf.c b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llroundf.c similarity index 100% rename from sysdeps/powerpc/powerpc64/fpu/multiarch/s_llroundf.c rename to sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llroundf.c diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_lround.c b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_lround.c similarity index 100% rename from sysdeps/powerpc/powerpc64/fpu/multiarch/s_lround.c rename to sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_lround.c diff --git a/sysdeps/powerpc/powerpc64/fpu/Makefile b/sysdeps/powerpc/powerpc64/fpu/Makefile index 6988a1d396..05075c2a75 100644 --- a/sysdeps/powerpc/powerpc64/fpu/Makefile +++ b/sysdeps/powerpc/powerpc64/fpu/Makefile @@ -2,4 +2,6 @@ ifeq ($(subdir),math) # lrintf and llrintf are aliased to llrint, so suppress compiler builtins to # avoid mismatched signatures. CFLAGS-s_llrint.c += -fno-builtin-lrintf -fno-builtin-llrintf +# Same as before but for lroundf and llroundf +CFLAGS-s_llround.c += -fno-builtin-lroundf -fno-builtin-llroundf endif diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile index fec878bb9d..48cf8dca3b 100644 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile @@ -6,13 +6,10 @@ sysdep_calls := s_modf-power5+ s_modf-ppc64 \ s_modff-power5+ s_modff-ppc64 sysdep_routines += $(sysdep_calls) -libm-sysdep_routines += s_llround-power6x \ - s_llround-power5+ s_llround-ppc64 \ - s_logb-power7 s_logbf-power7 \ +libm-sysdep_routines += s_logb-power7 s_logbf-power7 \ s_logbl-power7 s_logb-ppc64 s_logbf-ppc64 \ s_logbl-ppc64 e_hypot-ppc64 \ e_hypot-power7 e_hypotf-ppc64 e_hypotf-power7 \ - s_llround-power8 s_llroundf-ppc64 \ e_expf-power8 e_expf-ppc64 \ $(sysdep_calls:s_%=m_%) diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power5+.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power5+.S deleted file mode 100644 index 59ec9d8dec..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power5+.S +++ /dev/null @@ -1,31 +0,0 @@ -/* llround(). 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(name, alias) -#undef strong_alias -#define strong_alias(name, alias) -#undef compat_symbol -#define compat_symbol(a,b,c,d) - -#define __llround __llround_power5plus -#define __lround __lround_power5plus - -#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power6x.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power6x.S deleted file mode 100644 index 127c1e9959..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power6x.S +++ /dev/null @@ -1,31 +0,0 @@ -/* llround(). 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(name, alias) -#undef strong_alias -#define strong_alias(name, alias) -#undef compat_symbol -#define compat_symbol(lib, name, alias, ver) - -#define __llround __llround_power6x -#define __lround __lround_power6x - -#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S deleted file mode 100644 index 4e36482f0a..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S +++ /dev/null @@ -1,30 +0,0 @@ -/* llround(). PowerPC64 default 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 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 __llround __llround_power8 - -#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-ppc64.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-ppc64.S deleted file mode 100644 index fe01c33002..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-ppc64.S +++ /dev/null @@ -1,27 +0,0 @@ -/* llround(). 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 compat_symbol -#define compat_symbol(a,b,c,d) - -#define __llround __llround_ppc64 -#define __lround __lround_ppc64 - -#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llroundf-ppc64.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llroundf-ppc64.S deleted file mode 100644 index c62bb92e13..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llroundf-ppc64.S +++ /dev/null @@ -1,31 +0,0 @@ -/* llroundf(). PowerPC64 default version. - Copyright (C) 2017-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 __llroundf __llroundf_ppc64 -#define __lroundf __lroundf_ppc64 - -#include diff --git a/sysdeps/powerpc/powerpc64/fpu/s_llround.S b/sysdeps/powerpc/powerpc64/fpu/s_llround.S deleted file mode 100644 index 7180779921..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/s_llround.S +++ /dev/null @@ -1,86 +0,0 @@ -/* llround 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 -.LC1: /* 0.5 */ - .tc FD_3fe00000_0[TC],0x3fe0000000000000 - .section ".text" - -/* long long [r3] llround (double x [fp1]) - IEEE 1003.1 llround function. IEEE specifies "round to the nearest - integer value, rounding halfway cases away from zero, regardless of - the current rounding mode." However PowerPC Architecture defines - "round to Nearest" as "Choose the best approximation. In case of a - tie, choose the one that is even (least significant bit o).". - So we can't use the PowerPC "round to Nearest" mode. Instead we set - "round toward Zero" mode and round by adding +-0.5 before rounding - to the integer value. - - It is necessary to detect when x is (+-)0x1.fffffffffffffp-2 - because adding +-0.5 in this case will cause an erroneous shift, - carry and round. We simply return 0 if 0.5 > x > -0.5. Likewise - if x is and odd number between +-(2^52 and 2^53-1) a shift and - carry will erroneously round if biased with +-0.5. Therefore if x - is greater/less than +-2^52 we don't need to bias the number with - +-0.5. */ - -ENTRY (__llround) - CALL_MCOUNT 0 - lfd fp9,.LC0@toc(2) /* Load 2^52 into fpr9. */ - lfd fp10,.LC1@toc(2)/* Load 0.5 into fpr10. */ - fabs fp2,fp1 /* Get the absolute value of x. */ - fsub fp12,fp10,fp10 /* Compute 0.0 into fp12. */ - fcmpu cr6,fp2,fp10 /* if |x| < 0.5 */ - fcmpu cr7,fp2,fp9 /* if |x| >= 2^52 */ - fcmpu cr1,fp1,fp12 /* x is negative? x < 0.0 */ - blt- cr6,.Lretzero /* 0.5 > x < -0.5 so just return 0. */ - bge- cr7,.Lnobias /* 2^52 > x < -2^52 just convert with no bias. */ - /* Test whether an integer to avoid spurious "inexact". */ - fadd fp3,fp2,fp9 - fsub fp3,fp3,fp9 - fcmpu cr5,fp2,fp3 - beq cr5,.Lnobias - fadd fp3,fp2,fp10 /* |x|+=0.5 bias to prepare to round. */ - bge cr1,.Lconvert /* x is positive so don't negate x. */ - fnabs fp3,fp3 /* -(|x|+=0.5) */ -.Lconvert: - fctidz fp4,fp3 /* Convert to Integer double word round toward 0. */ - stfd fp4,-16(r1) - nop - nop - nop - ld r3,-16(r1) /* Load return as integer. */ -.Lout: - blr -.Lretzero: /* 0.5 > x > -0.5 */ - li r3,0 /* return 0. */ - b .Lout -.Lnobias: - fmr fp3,fp1 - b .Lconvert - END (__llround) - -strong_alias (__llround, __lround) -libm_alias_double (__llround, llround) -libm_alias_double (__lround, lround) diff --git a/sysdeps/powerpc/powerpc64/fpu/s_llround.c b/sysdeps/powerpc/powerpc64/fpu/s_llround.c new file mode 100644 index 0000000000..6aa8fea195 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/fpu/s_llround.c @@ -0,0 +1,83 @@ +/* Round to nearest integer. PowerPC64 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 +#define lround __redirect_lround +#define __lround __redirect___lround +#include +#undef lround +#undef __lround +#include +#include + +long long int +__llround (double x) +{ +#ifdef _ARCH_PWR5X + double r = __builtin_round (x); + /* Prevent gcc from calling llround directly when compiled with + -fno-math-errno by inserting a barrier. */ + math_opt_barrier (r); + return r; +#else + /* IEEE 1003.1 llround function. IEEE specifies "round to the nearest + integer value, rounding halfway cases away from zero, regardless of + the current rounding mode." However PowerPC Architecture defines + "round to Nearest" as "Choose the best approximation. In case of a + tie, choose the one that is even (least significant bit o).". + So we can't use the PowerPC "round to Nearest" mode. Instead we set + "round toward Zero" mode and round by adding +-0.5 before rounding + to the integer value. + + It is necessary to detect when x is (+-)0x1.fffffffffffffp-2 + because adding +-0.5 in this case will cause an erroneous shift, + carry and round. We simply return 0 if 0.5 > x > -0.5. Likewise + if x is and odd number between +-(2^52 and 2^53-1) a shift and + carry will erroneously round if biased with +-0.5. Therefore if x + is greater/less than +-2^52 we don't need to bias the number with + +-0.5. */ + + double ax = fabs (x); + + if (ax < 0.5) + return 0; + + if (ax < 0x1p+52) + { + /* Test whether an integer to avoid spurious "inexact". */ + double t = ax + 0x1p+52; + t = t - 0x1p+52; + if (ax != t) + { + ax = ax + 0.5; + if (x < 0.0) + ax = -fabs (ax); + x = ax; + } + } + + long int ret; + __asm__ ("fctidz %0, %1" : "=d" (ret) : "d" (x)); + return ret; +#endif +} +#ifndef __llround +strong_alias (__llround, __lround) +libm_alias_double (__llround, llround) +libm_alias_double (__lround, lround) +#endif diff --git a/sysdeps/powerpc/powerpc64/fpu/s_llroundf.S b/sysdeps/powerpc/powerpc64/fpu/s_llroundf.S deleted file mode 100644 index b8afebc7dc..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/s_llroundf.S +++ /dev/null @@ -1,89 +0,0 @@ -/* llroundf 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" -.LC0: /* 2^23 */ - .tc FD_41600000_0[TC],0x4160000000000000 -.LC1: /* 0.5 */ - .tc FD_3fe00000_0[TC],0x3fe0000000000000 -.LC2: /* 2^52 */ - .tc FD_43300000_0[TC],0x4330000000000000 - .section ".text" - -/* long long [r3] llroundf (float x [fp1]) - IEEE 1003.1 llroundf function. IEEE specifies "roundf to the nearest - integer value, rounding halfway cases away from zero, regardless of - the current rounding mode." However PowerPC Architecture defines - "roundf to Nearest" as "Choose the best approximation. In case of a - tie, choose the one that is even (least significant bit o).". - So we can't use the PowerPC "round to Nearest" mode. Instead we set - "round toward Zero" mode and round by adding +-0.5 before rounding - to the integer value. - - It is necessary to detect when x is (+-)0x1.fffffffffffffp-2 - because adding +-0.5 in this case will cause an erroneous shift, - carry and round. We simply return 0 if 0.5 > x > -0.5. Likewise - if x is and odd number between +-(2^23 and 2^24-1) a shift and - carry will erroneously round if biased with +-0.5. Therefore if x - is greater/less than +-2^23 we don't need to bias the number with - +-0.5. */ - -ENTRY (__llroundf) - CALL_MCOUNT 0 - lfd fp9,.LC0@toc(2) /* Load 2^23 into fpr9. */ - lfd fp10,.LC1@toc(2)/* Load 0.5 into fpr10. */ - lfd fp11,.LC2@toc(2) /* Load 2^52 into fpr11. */ - fabs fp2,fp1 /* Get the absolute value of x. */ - fsub fp12,fp10,fp10 /* Compute 0.0 into fp12. */ - fcmpu cr6,fp2,fp10 /* if |x| < 0.5 */ - fcmpu cr7,fp2,fp9 /* if |x| >= 2^23 */ - fcmpu cr1,fp1,fp12 /* x is negative? x < 0.0 */ - blt- cr6,.Lretzero /* 0.5 > x < -0.5 so just return 0. */ - bge- cr7,.Lnobias /* 2^23 > x < -2^23 just convert with no bias. */ - /* Test whether an integer to avoid spurious "inexact". */ - fadd fp3,fp2,fp11 - fsub fp3,fp3,fp11 - fcmpu cr5,fp2,fp3 - beq cr5,.Lnobias - fadd fp3,fp2,fp10 /* |x|+=0.5 bias to prepare to round. */ - bge cr1,.Lconvert /* x is positive so don't negate x. */ - fnabs fp3,fp3 /* -(|x|+=0.5) */ -.Lconvert: - fctidz fp4,fp3 /* Convert to Integer double word round toward 0. */ - stfd fp4,-16(r1) - nop - nop - nop - ld r3,-16(r1) /* Load return as integer. */ -.Lout: - blr -.Lretzero: /* 0.5 > x > -0.5 */ - li r3,0 /* return 0. */ - b .Lout -.Lnobias: - fmr fp3,fp1 - b .Lconvert - END (__llroundf) - -strong_alias (__llroundf, __lroundf) -libm_alias_float (__llround, llround) -libm_alias_float (__lround, lround) - diff --git a/sysdeps/powerpc/powerpc64/fpu/s_llroundf.c b/sysdeps/powerpc/powerpc64/fpu/s_llroundf.c new file mode 100644 index 0000000000..160c00ed6f --- /dev/null +++ b/sysdeps/powerpc/powerpc64/fpu/s_llroundf.c @@ -0,0 +1,83 @@ +/* Round to nearest integer. PowerPC64 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 +#define lroundf __redirect_llround +#define __lroundf __redirect___lround +#include +#undef lroundf +#undef __lroundf +#include +#include + +long long int +__llroundf (float x) +{ +#ifdef _ARCH_PWR5X + double r = __builtin_round (x); + /* Prevent gcc from calling llround directly when compiled with + -fno-math-errno by inserting a barrier. */ + math_opt_barrier (r); + return r; +#else + /* IEEE 1003.1 llroundf function. IEEE specifies "roundf to the nearest + integer value, rounding halfway cases away from zero, regardless of + the current rounding mode." However PowerPC Architecture defines + "roundf to Nearest" as "Choose the best approximation. In case of a + tie, choose the one that is even (least significant bit o).". + So we can't use the PowerPC "round to Nearest" mode. Instead we set + "round toward Zero" mode and round by adding +-0.5 before rounding + to the integer value. + + It is necessary to detect when x is (+-)0x1.fffffffffffffp-2 + because adding +-0.5 in this case will cause an erroneous shift, + carry and round. We simply return 0 if 0.5 > x > -0.5. Likewise + if x is and odd number between +-(2^23 and 2^24-1) a shift and + carry will erroneously round if biased with +-0.5. Therefore if x + is greater/less than +-2^23 we don't need to bias the number with + +-0.5. */ + + float ax = fabsf (x); + + if (ax < 0.5f) + return 0; + + if (ax < 0x1p+23f) + { + /* Test whether an integer to avoid spurious "inexact". */ + float t = ax + 0x1p+23f; + t = t - 0x1p+23f; + if (ax != t) + { + ax = ax + 0.5f; + if (x < 0.0f) + ax = -fabs (ax); + x = ax; + } + } + + long int ret; + __asm__ ("fctidz %0, %1" : "=d" (ret) : "d" (x)); + return ret; +#endif +} +#ifndef __llroundf +strong_alias (__llroundf, __lroundf) +libm_alias_float (__llround, lround) +libm_alias_float (__llround, llround) +#endif diff --git a/sysdeps/powerpc/powerpc64/fpu/s_lround.S b/sysdeps/powerpc/powerpc64/fpu/s_lround.S deleted file mode 100644 index 4306c405c4..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/s_lround.S +++ /dev/null @@ -1 +0,0 @@ -/* __lround is in s_llround.S */ diff --git a/sysdeps/powerpc/powerpc64/fpu/s_lround.c b/sysdeps/powerpc/powerpc64/fpu/s_lround.c new file mode 100644 index 0000000000..bec5026777 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/fpu/s_lround.c @@ -0,0 +1 @@ +/* lround is implemented at s_llround.c as an alias to lround. */ diff --git a/sysdeps/powerpc/powerpc64/fpu/s_lroundf.S b/sysdeps/powerpc/powerpc64/fpu/s_lroundf.S deleted file mode 100644 index 6b2a4e37a6..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/s_lroundf.S +++ /dev/null @@ -1 +0,0 @@ -/* __lroundf is in s_llroundf.S */ diff --git a/sysdeps/powerpc/powerpc64/fpu/s_lroundf.c b/sysdeps/powerpc/powerpc64/fpu/s_lroundf.c new file mode 100644 index 0000000000..30400277f8 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/fpu/s_lroundf.c @@ -0,0 +1 @@ +/* __lroundf is in s_llroundf.c */ diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_llround.S b/sysdeps/powerpc/powerpc64/power5+/fpu/s_llround.S deleted file mode 100644 index 7a37808bb0..0000000000 --- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_llround.S +++ /dev/null @@ -1,56 +0,0 @@ -/* llround function. POWER5+, PowerPC64 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 -#include - -/* long long [r3] llround (float x [fp1]) - IEEE 1003.1 llround function. IEEE specifies "round to the nearest - integer value, rounding halfway cases away from zero, regardless of - the current rounding mode." However PowerPC Architecture defines - "round to Nearest" as "Choose the best approximation. In case of a - tie, choose the one that is even (least significant bit o).". - So we pre-round using the V2.02 Floating Round to Integer Nearest - instruction before we use Floating Convert to Integer Word with - round to zero instruction. */ - - .machine "power5" -ENTRY_TOCLESS (__llround, 4) - CALL_MCOUNT 0 - frin fp2, fp1 /* Round to nearest +-0.5. */ - fctidz fp3, fp2 /* Convert To Integer DW round toward 0. */ - stfd fp3, -16(r1) - nop /* Insure the following load is in a different dispatch group */ - nop /* to avoid pipe stall on POWER4&5. */ - nop - ld r3, -16(r1) - blr - END (__llround) - -strong_alias (__llround, __lround) -libm_alias_double (__llround, llround) -libm_alias_double (__lround, lround) -/* The double version also works for single-precision as both float and - double parameters are passed in 64bit FPRs and both versions are expected - to return [long] long type. */ -strong_alias (__llround, __llroundf) -libm_alias_float (__llround, llround) -strong_alias (__lround, __lroundf) -libm_alias_float (__lround, lround) diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_llroundf.S b/sysdeps/powerpc/powerpc64/power5+/fpu/s_llroundf.S deleted file mode 100644 index 9ea6bd105b..0000000000 --- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_llroundf.S +++ /dev/null @@ -1 +0,0 @@ -/* __lroundf is in s_llround.S. */ diff --git a/sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S b/sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S deleted file mode 100644 index ad9010ab37..0000000000 --- a/sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S +++ /dev/null @@ -1,52 +0,0 @@ -/* llround function. POWER6x PowerPC64 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 -#include - -/* long long [r3] llround (float x [fp1]) - IEEE 1003.1 llround function. IEEE specifies "round to the nearest - integer value, rounding halfway cases away from zero, regardless of - the current rounding mode." However PowerPC Architecture defines - "round to Nearest" as "Choose the best approximation. In case of a - tie, choose the one that is even (least significant bit o).". - So we pre-round using the V2.02 Floating Round to Integer Nearest - instruction before we use Floating Convert to Integer Word with - round to zero instruction. */ - - .machine "power6" -ENTRY_TOCLESS (__llround) - CALL_MCOUNT 0 - frin fp2,fp1 /* Round to nearest +-0.5. */ - fctidz fp3,fp2 /* Convert To Integer DW round toward 0. */ - mftgpr r3,fp3 /* Transfer integer to R3. */ - blr - END (__llround) - -strong_alias (__llround, __lround) -libm_alias_double (__llround, llround) -libm_alias_double (__lround, lround) -/* The double version also works for single-precision as both float and - double parameters are passed in 64bit FPRs and both versions are expected - to return [long] long type. */ -strong_alias (__llround, __llroundf) -libm_alias_float (__llround, llround) -strong_alias (__lround, __lroundf) -libm_alias_float (__lround, lround) diff --git a/sysdeps/powerpc/powerpc64/power6x/fpu/s_llroundf.S b/sysdeps/powerpc/powerpc64/power6x/fpu/s_llroundf.S deleted file mode 100644 index 9ea6bd105b..0000000000 --- a/sysdeps/powerpc/powerpc64/power6x/fpu/s_llroundf.S +++ /dev/null @@ -1 +0,0 @@ -/* __lroundf is in s_llround.S. */ diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S deleted file mode 100644 index 12081204e2..0000000000 --- a/sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S +++ /dev/null @@ -1,46 +0,0 @@ -/* llround function. POWER8 PowerPC64 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 -#include -#include -#include - -#define MFVSRD_R3_V1 .long 0x7c230066 /* mfvsrd r3,vs1 */ - -/* long long [r3] llround (float x [fp1]) */ - -ENTRY_TOCLESS (__llround) - CALL_MCOUNT 0 - frin fp1,fp1 /* Round to nearest +-0.5. */ - fctidz fp1,fp1 /* Convert To Integer DW round toward 0. */ - MFVSRD_R3_V1 - blr -END (__llround) - -strong_alias (__llround, __lround) -libm_alias_double (__llround, llround) -libm_alias_double (__lround, lround) -/* The double version also works for single-precision as both float and - double parameters are passed in 64bit FPRs and both versions are expected - to return [long] long type. */ -strong_alias (__llround, __llroundf) -libm_alias_float (__llround, llround) -strong_alias (__lround, __lroundf) -libm_alias_float (__lround, lround) diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_llroundf.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_llroundf.S deleted file mode 100644 index 9ea6bd105b..0000000000 --- a/sysdeps/powerpc/powerpc64/power8/fpu/s_llroundf.S +++ /dev/null @@ -1 +0,0 @@ -/* __lroundf is in s_llround.S. */