From patchwork Wed Jun 3 20:07:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. Murphy" X-Patchwork-Id: 39470 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DCD39388C02E; Wed, 3 Jun 2020 20:08:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DCD39388C02E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1591214882; bh=zINNQpTUA2ZUaGog2W+Nxj4uCIjnAU/zaWaVNgHnsOg=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=foWNzkg03RZwaeOVLhoqdH/QNtr1fcj5WDtFa1QY1kGbRPi9lLsU29dD45OxiSweX +9BTG/TYGVqDPX7VunI2uGjHBLdO6c/Escax+oQfJr5AWGpa7XrrfjsItM4/Osyajo /Ky4vRrhS4BKmOwKYcWN3rBgLErbrcOr578c2m1A= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id D7F71388F05A for ; Wed, 3 Jun 2020 20:07:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D7F71388F05A Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 053K2cnl080073 for ; Wed, 3 Jun 2020 16:07:59 -0400 Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0b-001b2d01.pphosted.com with ESMTP id 31dp43gq1s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 03 Jun 2020 16:07:58 -0400 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 053K6Cuu005501 for ; Wed, 3 Jun 2020 20:07:58 GMT Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by ppma01wdc.us.ibm.com with ESMTP id 31bf4999ve-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 03 Jun 2020 20:07:58 +0000 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 053K7tva24838638 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 3 Jun 2020 20:07:55 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 32BBA78067 for ; Wed, 3 Jun 2020 20:07:57 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0D92C78064 for ; Wed, 3 Jun 2020 20:07:56 +0000 (GMT) Received: from brokenarrow.ibmuc.com (unknown [9.211.92.153]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP for ; Wed, 3 Jun 2020 20:07:56 +0000 (GMT) To: libc-alpha@sourceware.org Subject: [PATCH] powerpc: define USE_FMAF128_BUILTIN in math-use-builtins.h Date: Wed, 3 Jun 2020 15:07:56 -0500 Message-Id: <20200603200756.1495911-1-murphyp@linux.vnet.ibm.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.687 definitions=2020-06-03_13:2020-06-02, 2020-06-03 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 phishscore=0 clxscore=1015 cotscore=-2147483648 adultscore=0 suspectscore=4 spamscore=0 bulkscore=0 impostorscore=0 mlxscore=0 mlxlogscore=999 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006030152 X-Spam-Status: No, score=-14.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "Paul E. Murphy via Libc-alpha" From: "Paul E. Murphy" Reply-To: "Paul E. Murphy" Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Commit a7a3435c9a0769744c7748f9d95510d0a99be7d1 caused an undefined macro evaluation error when building powerpc64le. This defines the macro such that it should behave correctly on all supported powerpc64le targets. Likewise, this allows us to remove the ppc64le specific s_fmaf128.c for power9. powerpc{,64} will not support FMA using the ibm128 long double, so it can be left undefined for now to avoid ambiguity with ppc64le. I have verified powerpc64le multiarch and powerpc64le power9 no-multiarch builds continue to generate optimize fmaf128. --- sysdeps/powerpc/fpu/math-use-builtins.h | 4 +++ .../le/fpu/multiarch/s_fmaf128-power9.c | 4 ++- .../powerpc64/le/power9/fpu/s_fmaf128.c | 36 ------------------- 3 files changed, 7 insertions(+), 37 deletions(-) delete mode 100644 sysdeps/powerpc/powerpc64/le/power9/fpu/s_fmaf128.c diff --git a/sysdeps/powerpc/fpu/math-use-builtins.h b/sysdeps/powerpc/fpu/math-use-builtins.h index 4780934379..e4b9b18659 100644 --- a/sysdeps/powerpc/fpu/math-use-builtins.h +++ b/sysdeps/powerpc/fpu/math-use-builtins.h @@ -66,4 +66,8 @@ #define USE_FMA_BUILTIN 1 #define USE_FMAF_BUILTIN 1 +/* This is not available for P8 or BE targets. */ +#define USE_FMAF128_BUILTIN (defined(__FP_FAST_FMAF128) \ + && __FP_FAST_FMAF128 == 1) + #endif diff --git a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/s_fmaf128-power9.c b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/s_fmaf128-power9.c index 8df77ceade..49aeb3a8f4 100644 --- a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/s_fmaf128-power9.c +++ b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/s_fmaf128-power9.c @@ -20,7 +20,9 @@ #undef libm_alias_float128 #define libm_alias_float128(a, b) +#undef strong_alias +#define strong_alias(a, b) #define __fmaf128 __fmaf128_power9 -#include +#include diff --git a/sysdeps/powerpc/powerpc64/le/power9/fpu/s_fmaf128.c b/sysdeps/powerpc/powerpc64/le/power9/fpu/s_fmaf128.c deleted file mode 100644 index f02e810fb9..0000000000 --- a/sysdeps/powerpc/powerpc64/le/power9/fpu/s_fmaf128.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Compute x * y + z as a ternary operation for _Float128. POWER9 version. - Copyright (C) 2020 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. - - In addition to the permissions in the GNU Lesser General Public - License, the Free Software Foundation gives you unlimited - permission to link the compiled version of this file into - combinations with other programs, and to distribute those - combinations without any restriction coming from the use of this - file. (The Lesser General Public License restrictions do apply in - other respects; for example, they cover modification of the file, - and distribution when not linked into a combine executable.) - - 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 - -__float128 -__fmaf128 (__float128 x, __float128 y, __float128 z) -{ - return x * y + z; -} - -libm_alias_float128 (__fma, fma)