From patchwork Thu Jun 4 13:56: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: 39475 X-Patchwork-Delegate: azanella@linux.vnet.ibm.com 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 E02253890429; Thu, 4 Jun 2020 13:58:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E02253890429 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1591279080; bh=BP07wOzDtdgAZr+o88KtxoCrHgvnHK/LJg8B3xgBnok=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=bwt4FrER4krjfQ6+SNbwN3Zx+o4rraxQn+emBGvGlM9G9ZJTELl76jPVIUlCvZUzS 3rlJgobiXMAJUm4njY5qvC8aDkYcoWyl12iFMMSwAvMlsz/E30VI16o+nWpCWUOk0U gDQl7tZ+cI4Ytbp3hlPA98IiWS5Pp/HsnqBottR0= 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 26B193840C24 for ; Thu, 4 Jun 2020 13:57:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 26B193840C24 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 054DWsvF051649 for ; Thu, 4 Jun 2020 09:57:58 -0400 Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0b-001b2d01.pphosted.com with ESMTP id 31ec65s7k6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 04 Jun 2020 09:57:58 -0400 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 054DYTH4021372 for ; Thu, 4 Jun 2020 13:57:58 GMT Received: from b03cxnp07028.gho.boulder.ibm.com (b03cxnp07028.gho.boulder.ibm.com [9.17.130.15]) by ppma03dal.us.ibm.com with ESMTP id 31bf4adj2e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 04 Jun 2020 13:57:58 +0000 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 054DuuMA39846270 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 4 Jun 2020 13:56:56 GMT Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D6F4E6A04F for ; Thu, 4 Jun 2020 13:56:56 +0000 (GMT) Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AFCAC6A04D for ; Thu, 4 Jun 2020 13:56:56 +0000 (GMT) Received: from brokenarrow.ibmuc.com (unknown [9.163.83.236]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP for ; Thu, 4 Jun 2020 13:56:56 +0000 (GMT) To: libc-alpha@sourceware.org Subject: [PATCHv2] powerpc: define USE_FMAF128_BUILTIN in math-use-builtins.h Date: Thu, 4 Jun 2020 08:56:56 -0500 Message-Id: <20200604135656.2121535-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-04_10:2020-06-02, 2020-06-04 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 mlxscore=0 priorityscore=1501 impostorscore=0 phishscore=0 clxscore=1015 suspectscore=4 adultscore=0 malwarescore=0 cotscore=-2147483648 spamscore=0 mlxlogscore=999 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006040090 X-Spam-Status: No, score=-14.0 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" Removed defined in macro expansion. Verified again. Thank you for pointing out the macro expansion nuance of defined Andreas. ---8<--- 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 | 7 ++++ .../le/fpu/multiarch/s_fmaf128-power9.c | 4 ++- .../powerpc64/le/power9/fpu/s_fmaf128.c | 36 ------------------- 3 files changed, 10 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..9b1cdfc4c8 100644 --- a/sysdeps/powerpc/fpu/math-use-builtins.h +++ b/sysdeps/powerpc/fpu/math-use-builtins.h @@ -66,4 +66,11 @@ #define USE_FMA_BUILTIN 1 #define USE_FMAF_BUILTIN 1 +/* This is not available for P8 or BE targets. */ +#if defined (__FP_FAST_FMAF128) && __FP_FAST_FMAF128 == 1 +# define USE_FMAF128_BUILTIN 1 +#else +# define USE_FMAF128_BUILTIN 0 +#endif + #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)