From patchwork Sun Jul 9 18:24:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juvenal Silva X-Patchwork-Id: 107241 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2532910qge; Sun, 9 Jul 2017 11:25:15 -0700 (PDT) X-Received: by 10.99.119.194 with SMTP id s185mr10858007pgc.256.1499624714944; Sun, 09 Jul 2017 11:25:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499624714; cv=none; d=google.com; s=arc-20160816; b=l593olEkdW6hy7J657M+CbT8+IDfQmD3SaIoDvtRAA7j2hnIewL7O1yC/3KWz4dZXb 4qO+7uaGKehC6sJxfhFIRM+ua9Wxj+N9yMruJDcUQAEXN2OU8D/lQpGty7CAN1xFXn/J tCDy1Bl4wIC7os0c9sm2avmuagdY2v6YlPy3jDGojpHlTEOwa5aLepZtn2jFR0or2Woi GEXlvNo5cyvVl8dckPsPsdVm3RFWgtSFDFI7k68QgC7e/LtoXAkjwB/qMcvDn155Cr2i VQQySzfKAPxVU5f6uDUdfpp6V+fyqBdK8bM4HBdLlXZYk5Dmgm1BEfOVvDPXVSWgWbt4 yA4A== 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:cc:to:from :delivered-to:sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=7rkrtB4ggmORIrPviK4QYo/H1x75GoebhH5w/W3JnCs=; b=IRFXqcjXx8jodl5Fl7zmN8mXqQg7KTpCsEZJdMmxOb5vj0wcMZtXTINIQKsDaYOrkx HeZtnQim0dEBHWLU7ZfiHPbKOGrpENRE6eFthr0sQZ6Mk5sECQYl/C2JpTV1iSvppjrC l1Xk/mL991z/GrJbUa8X+SNU3yq7668qqCYZPer8YpYCVP2Jg9HRtiESc9xEUnyCygEO eoOl4B7kRtLtnPc8yeJl8LY4upC5pPX8Wh1X5P/naj5rs+M8D3Wf5VBaKLCrqvSNLgsN gP9yUUBGrmDW4AJuiVV5Aw8PZDNpYfNalWOF+y6oqR7VbSlkPR3CQmL7PIWbJ4Mag2tB rwMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.b=BXC7UBgX; spf=pass (google.com: domain of libc-alpha-return-81910-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-81910-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 64si7273883plb.59.2017.07.09.11.25.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Jul 2017 11:25:14 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-81910-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.b=BXC7UBgX; spf=pass (google.com: domain of libc-alpha-return-81910-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-81910-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com 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:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=Gy+hsRBcglfwJryIXp+FhyhqPVCo49S I5V3nHJzRkwywTVX1JHj9QlaqH+0LD46riVNiwfqXOlS1amPzulEt1ZTt5ab1//V Rt/6wckog4w7pTHgrnwD0ut0VTL9XON7ehfmA/jx6+/UX7RpwJ4HWkUDQ1yyzILP b5c+oxiDkbj4= 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:cc:subject:date:message-id:in-reply-to :references; s=default; bh=Ws/C6Wdv09qSf/Jn1HvES05CTLY=; b=BXC7U BgXB8sH/s8UGe3U6ARtPluuQIq1+BXsZ+01qHStsGKUUY236BXmNkWnJ+UhVXCBk EZbaRo2D2a+kjUPxhsSfnhKnXhH1XHdTKOssyPVZ7trLjXulEbNf6T4YDdYZHXC7 DQ791vdJ758WohhHjYYyeK6VuC3mQ/z8TM0Xe8= Received: (qmail 66590 invoked by alias); 9 Jul 2017 18:25:04 -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 66573 invoked by uid 89); 9 Jul 2017 18:25:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.9 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Multiple, Todo X-HELO: mail-qt0-f174.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7rkrtB4ggmORIrPviK4QYo/H1x75GoebhH5w/W3JnCs=; b=E8UM5Eo9xYbLjSwjerI2A1yck+O8pmGlGKi+AmO5oTy0lq6kxjlJh4xZduw11ZdMlO 9Q7+jEE/6pvvzFdTsGxbXb82aZsSgu8bPCTkCA1BOSnb4/tm7jK5v5r2F7A8nKxMD1p4 1o6Bh1GHdbkL/Zc6jZA672RrE9Ds7H9FRbUaMZ6x2kWiqkv2rT1n2rJlIWSzG0gFdhZD LxyKRzCx3CHruPixGybWmp51n+ea9fXEVmviFPUpIsqwAZC6xZga4z3osjf+ZrrRk6aU JEAtyK2spRYEEN/Lmu3E/yX+xGo62t7kfI5IzgflwgCMl5S1awDcFu0UfYT9bthGs2OV dofw== X-Gm-Message-State: AIVw113ja9ILWvrtoFo+oFKl9zta45aI0FewhxAReXDPZSKSkNhQngEo 7lUBFZt+Ti4yklWKfNM= X-Received: by 10.200.53.78 with SMTP id z14mr186256qtb.184.1499624695239; Sun, 09 Jul 2017 11:24:55 -0700 (PDT) From: "Juvenal A. Silva Jr" To: libc-alpha@sourceware.org Cc: "Juvenal A. Silva Jr" , tuliom@linux.vnet.ibm.com Subject: [PATCH 1/1] Add IFUNC POWER optimization for e_pow and e_exp Date: Sun, 9 Jul 2017 15:24:30 -0300 Message-Id: <20170709182430.91459-2-juvenal.silva.jr@gmail.com> In-Reply-To: <20170709182430.91459-1-juvenal.silva.jr@gmail.com> References: <20170709182430.91459-1-juvenal.silva.jr@gmail.com> This patch proposes a change to provide at least crude optimizations for some POWER architecture versions, based on IFUNC and a custom -mcpu gcc directive. This patch covers two of the POWER GLIBC Master Todo List items, 'Optimize math functions for P7: __ieee754_exp, __ieee754_pow, __dubsin'. This is also a proof of concept for a base performance gain strategy. 2017-01-31 Juvenal A. Silva Jr. * sysdeps/ieee754/dbl-64/e-pow.c: Fix a comment aligment problem. * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile: Add entries for custom build of CPU specific versions of e_pow and e_exp. * sysdeps/powerpc/powerpc64/fpu/multiarch/e_pow.c: New file * sysdeps/powerpc/powerpc64/fpu/multiarch/e_pow-ppc64.c: New file. * sysdeps/powerpc/powerpc64/fpu/multiarch/e_pow-power7.c: New file. * sysdeps/powerpc/powerpc64/fpu/multiarch/e_pow-power8.c: New file. * sysdeps/powerpc/powerpc64/fpu/multiarch/e_pow-power9.c: New file. * sysdeps/powerpc/powerpc64/fpu/multiarch/slowpow-ppc64.c: New file. * sysdeps/powerpc/powerpc64/fpu/multiarch/slowpow-power7.c: New file. * sysdeps/powerpc/powerpc64/fpu/multiarch/slowpow-power8.c: New file. * sysdeps/powerpc/powerpc64/fpu/multiarch/slowpow-power9.c: New file. * sysdeps/powerpc/powerpc64/fpu/multiarch/e_exp.c: New file * sysdeps/powerpc/powerpc64/fpu/multiarch/e_exp-ppc64.c: New file. * sysdeps/powerpc/powerpc64/fpu/multiarch/e_exp-power7.c: New file. * sysdeps/powerpc/powerpc64/fpu/multiarch/e_exp-power8.c: New file. * sysdeps/powerpc/powerpc64/fpu/multiarch/e_exp-power9.c: New file. * sysdeps/powerpc/powerpc64/fpu/multiarch/slowexp-ppc64.c: New file. * sysdeps/powerpc/powerpc64/fpu/multiarch/slowexp-power7.c: New file. * sysdeps/powerpc/powerpc64/fpu/multiarch/slowexp-power8.c: New file. * sysdeps/powerpc/powerpc64/fpu/multiarch/slowexp-power9.c: New file. --- sysdeps/ieee754/dbl-64/e_pow.c | 2 +- sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile | 18 ++++++++++- .../powerpc/powerpc64/fpu/multiarch/e_exp-power7.c | 28 ++++++++++++++++ .../powerpc/powerpc64/fpu/multiarch/e_exp-power8.c | 28 ++++++++++++++++ .../powerpc/powerpc64/fpu/multiarch/e_exp-power9.c | 28 ++++++++++++++++ .../powerpc/powerpc64/fpu/multiarch/e_exp-ppc64.c | 26 +++++++++++++++ sysdeps/powerpc/powerpc64/fpu/multiarch/e_exp.c | 37 ++++++++++++++++++++++ .../powerpc/powerpc64/fpu/multiarch/e_pow-power7.c | 28 ++++++++++++++++ .../powerpc/powerpc64/fpu/multiarch/e_pow-power8.c | 28 ++++++++++++++++ .../powerpc/powerpc64/fpu/multiarch/e_pow-power9.c | 28 ++++++++++++++++ .../powerpc/powerpc64/fpu/multiarch/e_pow-ppc64.c | 26 +++++++++++++++ sysdeps/powerpc/powerpc64/fpu/multiarch/e_pow.c | 37 ++++++++++++++++++++++ .../powerpc64/fpu/multiarch/slowexp-power7.c | 26 +++++++++++++++ .../powerpc64/fpu/multiarch/slowexp-power8.c | 26 +++++++++++++++ .../powerpc64/fpu/multiarch/slowexp-power9.c | 26 +++++++++++++++ .../powerpc64/fpu/multiarch/slowexp-ppc64.c | 24 ++++++++++++++ .../powerpc64/fpu/multiarch/slowpow-power7.c | 26 +++++++++++++++ .../powerpc64/fpu/multiarch/slowpow-power8.c | 26 +++++++++++++++ .../powerpc64/fpu/multiarch/slowpow-power9.c | 26 +++++++++++++++ .../powerpc64/fpu/multiarch/slowpow-ppc64.c | 24 ++++++++++++++ 20 files changed, 516 insertions(+), 2 deletions(-) create mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/e_exp-power7.c create mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/e_exp-power8.c create mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/e_exp-power9.c create mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/e_exp-ppc64.c create mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/e_exp.c create mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/e_pow-power7.c create mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/e_pow-power8.c create mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/e_pow-power9.c create mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/e_pow-ppc64.c create mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/e_pow.c create mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/slowexp-power7.c create mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/slowexp-power8.c create mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/slowexp-power9.c create mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/slowexp-ppc64.c create mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/slowpow-power7.c create mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/slowpow-power8.c create mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/slowpow-power9.c create mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/slowpow-ppc64.c -- 2.13.2 diff --git a/sysdeps/ieee754/dbl-64/e_pow.c b/sysdeps/ieee754/dbl-64/e_pow.c index 9f6439ee42..45a485c52a 100644 --- a/sysdeps/ieee754/dbl-64/e_pow.c +++ b/sysdeps/ieee754/dbl-64/e_pow.c @@ -26,7 +26,7 @@ /* checkint */ /* FILES NEEDED: dla.h endian.h mpa.h mydefs.h */ /* halfulp.c mpexp.c mplog.c slowexp.c slowpow.c mpa.c */ -/* uexp.c upow.c */ +/* uexp.c upow.c */ /* root.tbl uexp.tbl upow.tbl */ /* An ultimate power routine. Given two IEEE double machine numbers y,x */ /* it computes the correctly rounded (to nearest) value of x^y. */ diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile index d6f14f360a..8bd508747b 100644 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile @@ -27,7 +27,11 @@ libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \ s_llrint-power8 s_llround-power8 s_llroundf-ppc64 \ e_expf-power8 e_expf-ppc64 \ s_sinf-ppc64 s_sinf-power8 \ - s_cosf-ppc64 s_cosf-power8 + s_cosf-ppc64 s_cosf-power8 \ + slowpow-power7 slowpow-power8 slowpow-power9 slowpow-ppc64 \ + e_pow-power7 e_pow-power8 e_pow-power9 e_pow-ppc64 \ + slowexp-power7 slowexp-power8 slowexp-power9 slowexp-ppc64 \ + e_exp-power7 e_exp-power8 e_exp-power9 e_exp-ppc64 CFLAGS-s_logbf-power7.c = -mcpu=power7 CFLAGS-s_logbl-power7.c = -mcpu=power7 @@ -36,6 +40,18 @@ CFLAGS-s_modf-power5+.c = -mcpu=power5+ CFLAGS-s_modff-power5+.c = -mcpu=power5+ CFLAGS-e_hypot-power7.c = -mcpu=power7 CFLAGS-e_hypotf-power7.c = -mcpu=power7 +CFLAGS-slowpow-power7.c = -mcpu=power7 +CFLAGS-slowpow-power8.c = -mcpu=power8 +CFLAGS-slowpow-power9.c = -mcpu=power9 +CFLAGS-e_pow-power7.c = -mcpu=power7 +CFLAGS-e_pow-power8.c = -mcpu=power8 +CFLAGS-e_pow-power9.c = -mcpu=power9 +CFLAGS-slowexp-power7.c = -mcpu=power7 +CFLAGS-slowexp-power8.c = -mcpu=power8 +CFLAGS-slowexp-power9.c = -mcpu=power9 +CFLAGS-e_exp-power7.c = -mcpu=power7 +CFLAGS-e_exp-power8.c = -mcpu=power8 +CFLAGS-e_exp-power9.c = -mcpu=power9 # These files quiet sNaNs in a way that is optimized away without # -fsignaling-nans. diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_exp-power7.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_exp-power7.c new file mode 100644 index 0000000000..652b2ec862 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_exp-power7.c @@ -0,0 +1,28 @@ +/* __ieee_exp() POWER7 version. + Copyright (C) 2017 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 strong_alias +#define strong_alias(a, b) + +#define __ieee754_exp __ieee754_exp_power7 +#define __exp1 __exp1_power7 +#define __slowexp __slowexp_power7 +#define SECTION __attribute__ ((section (".text.power7"))) + +#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_exp-power8.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_exp-power8.c new file mode 100644 index 0000000000..c9561e462b --- /dev/null +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_exp-power8.c @@ -0,0 +1,28 @@ +/* __ieee_exp() POWER8 version. + Copyright (C) 2017 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 strong_alias +#define strong_alias(a, b) + +#define __ieee754_exp __ieee754_exp_power8 +#define __exp1 __exp1_power8 +#define __slowexp __slowexp_power8 +#define SECTION __attribute__ ((section (".text.power8"))) + +#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_exp-power9.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_exp-power9.c new file mode 100644 index 0000000000..a4f2a8890c --- /dev/null +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_exp-power9.c @@ -0,0 +1,28 @@ +/* __ieee_exp() POWER9 version. + Copyright (C) 2017 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 strong_alias +#define strong_alias(a, b) + +#define __ieee754_exp __ieee754_exp_power9 +#define __exp1 __exp1_power9 +#define __slowexp __slowexp_power9 +#define SECTION __attribute__ ((section (".text.power9"))) + +#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_exp-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_exp-ppc64.c new file mode 100644 index 0000000000..8d65aaa895 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_exp-ppc64.c @@ -0,0 +1,26 @@ +/* __ieee_pow() PowerPC64 version. + Copyright (C) 2017 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 strong_alias +#define strong_alias(a, b) + +#define __ieee754_exp __ieee754_exp_ppc64 +#define __exp1 __exp1_ppc64 +#define __slowexp __slowexp_ppc64 + +#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_exp.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_exp.c new file mode 100644 index 0000000000..10bfa09e71 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_exp.c @@ -0,0 +1,37 @@ +/* Multiple versions of ieee754_exp. + Copyright (C) 2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include "init-arch.h" + +extern __typeof (__ieee754_exp) __ieee754_exp_ppc64 attribute_hidden; +extern __typeof (__ieee754_exp) __ieee754_exp_power7 attribute_hidden; +extern __typeof (__ieee754_exp) __ieee754_exp_power8 attribute_hidden; +extern __typeof (__ieee754_exp) __ieee754_exp_power9 attribute_hidden; + +libc_ifunc (__ieee754_exp, + (hwcap2 & PPC_FEATURE2_ARCH_3_00) + ? __ieee754_exp_power9 + : (hwcap2 & PPC_FEATURE2_ARCH_2_07) + ? __ieee754_exp_power8 + : (hwcap & PPC_FEATURE_ARCH_2_06) + ? __ieee754_exp_power7 + : __ieee754_exp_ppc64); + +strong_alias (__ieee754_exp, __exp_finite) diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_pow-power7.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_pow-power7.c new file mode 100644 index 0000000000..e0a69396c6 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_pow-power7.c @@ -0,0 +1,28 @@ +/* __ieee_pow() POWER7 version. + Copyright (C) 2017 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 strong_alias +#define strong_alias(a, b) + +#define __ieee754_pow __ieee754_pow_power7 +#define __exp1 __exp1_power7 +#define __slowpow __slowpow_power7 +#define SECTION __attribute__ ((section (".text.power7"))) + +#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_pow-power8.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_pow-power8.c new file mode 100644 index 0000000000..4ecff81505 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_pow-power8.c @@ -0,0 +1,28 @@ +/* __ieee_pow() POWER8 version. + Copyright (C) 2017 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 strong_alias +#define strong_alias(a, b) + +#define __ieee754_pow __ieee754_pow_power8 +#define __exp1 __exp1_power8 +#define __slowpow __slowpow_power8 +#define SECTION __attribute__ ((section (".text.power8"))) + +#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_pow-power9.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_pow-power9.c new file mode 100644 index 0000000000..a674a26759 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_pow-power9.c @@ -0,0 +1,28 @@ +/* __ieee_pow() POWER9 version. + Copyright (C) 2017 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 strong_alias +#define strong_alias(a, b) + +#define __ieee754_pow __ieee754_pow_power9 +#define __exp1 __exp1_power9 +#define __slowpow __slowpow_power9 +#define SECTION __attribute__ ((section (".text.power9"))) + +#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_pow-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_pow-ppc64.c new file mode 100644 index 0000000000..1efcde2780 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_pow-ppc64.c @@ -0,0 +1,26 @@ +/* __ieee_pow() PowerPC64 version. + Copyright (C) 2017 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 strong_alias +#define strong_alias(a, b) + +#define __ieee754_pow __ieee754_pow_ppc64 +#define __exp1 __exp1_ppc64 +#define __slowpow __slowpow_ppc64 + +#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_pow.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_pow.c new file mode 100644 index 0000000000..c46c21ccf4 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_pow.c @@ -0,0 +1,37 @@ +/* Multiple versions of ieee754_pow. + Copyright (C) 2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include "init-arch.h" + +extern __typeof (__ieee754_pow) __ieee754_pow_ppc64 attribute_hidden; +extern __typeof (__ieee754_pow) __ieee754_pow_power7 attribute_hidden; +extern __typeof (__ieee754_pow) __ieee754_pow_power8 attribute_hidden; +extern __typeof (__ieee754_pow) __ieee754_pow_power9 attribute_hidden; + +libc_ifunc (__ieee754_pow, + (hwcap2 & PPC_FEATURE2_ARCH_3_00) + ? __ieee754_pow_power9 + : (hwcap2 & PPC_FEATURE2_ARCH_2_07) + ? __ieee754_pow_power8 + : (hwcap & PPC_FEATURE_ARCH_2_06) + ? __ieee754_pow_power7 + : __ieee754_pow_ppc64); + +strong_alias (__ieee754_pow, __pow_finite) diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/slowexp-power7.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/slowexp-power7.c new file mode 100644 index 0000000000..ae874d0ce9 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/slowexp-power7.c @@ -0,0 +1,26 @@ +/* __slowexp() POWER7 version. + Copyright (C) 2017 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 strong_alias +#define strong_alias(a, b) + +#define __slowexp __slowexp_power7 +#define SECTION __attribute__ ((section (".text.power7"))) + +#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/slowexp-power8.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/slowexp-power8.c new file mode 100644 index 0000000000..d53d60e9e6 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/slowexp-power8.c @@ -0,0 +1,26 @@ +/* __slowexp() POWER8 version. + Copyright (C) 2017 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 strong_alias +#define strong_alias(a, b) + +#define __slowexp __slowexp_power8 +#define SECTION __attribute__ ((section (".text.power8"))) + +#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/slowexp-power9.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/slowexp-power9.c new file mode 100644 index 0000000000..5bdc26539a --- /dev/null +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/slowexp-power9.c @@ -0,0 +1,26 @@ +/* __slowexp() POWER9 version. + Copyright (C) 2017 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 strong_alias +#define strong_alias(a, b) + +#define __slowexp __slowexp_power9 +#define SECTION __attribute__ ((section (".text.power9"))) + +#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/slowexp-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/slowexp-ppc64.c new file mode 100644 index 0000000000..6479eff5ea --- /dev/null +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/slowexp-ppc64.c @@ -0,0 +1,24 @@ +/* __slowexp() PowerPC64 version. + Copyright (C) 2017 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 strong_alias +#define strong_alias(a, b) + +#define __slowexp __slowexp_ppc64 + +#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/slowpow-power7.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/slowpow-power7.c new file mode 100644 index 0000000000..de6baaaf14 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/slowpow-power7.c @@ -0,0 +1,26 @@ +/* __slowpow() POWER7 version. + Copyright (C) 2017 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 strong_alias +#define strong_alias(a, b) + +#define __slowpow __slowpow_power7 +#define SECTION __attribute__ ((section (".text.power7"))) + +#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/slowpow-power8.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/slowpow-power8.c new file mode 100644 index 0000000000..8c42bd93ff --- /dev/null +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/slowpow-power8.c @@ -0,0 +1,26 @@ +/* __slowpow() POWER8 version. + Copyright (C) 2017 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 strong_alias +#define strong_alias(a, b) + +#define __slowpow __slowpow_power8 +#define SECTION __attribute__ ((section (".text.power8"))) + +#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/slowpow-power9.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/slowpow-power9.c new file mode 100644 index 0000000000..05baef3939 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/slowpow-power9.c @@ -0,0 +1,26 @@ +/* __slowpow() POWER9 version. + Copyright (C) 2017 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 strong_alias +#define strong_alias(a, b) + +#define __slowpow __slowpow_power9 +#define SECTION __attribute__ ((section (".text.power9"))) + +#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/slowpow-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/slowpow-ppc64.c new file mode 100644 index 0000000000..3fdac58455 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/slowpow-ppc64.c @@ -0,0 +1,24 @@ +/* __slowpow() PowerPC64 version. + Copyright (C) 2017 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 strong_alias +#define strong_alias(a, b) + +#define __slowpow __slowpow_ppc64 + +#include