From patchwork Mon May 4 22:23:51 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: 38911 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 DE0CE3897836; Mon, 4 May 2020 22:24:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DE0CE3897836 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1588631041; bh=fb0SjZZH4+XgZGtlL8MXN/iDNxbR69CYP+AgY0Mc9ig=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=TKSY/WmlAIDV8BU7khykREurFLzKdQR1KbVunf8SZPUqFfjDmszmsageaohovgY+y y4ufezgYmJLO0n+97s7S42P8ezbFA7ODJSzlU1zFy3rEXCyfo3NYEjB3JpTCwCGObJ PZwCPixIghlMW/Gvon5+CTt8Djt6yBZYyKW1msjA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id C75313893671 for ; Mon, 4 May 2020 22:23:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C75313893671 Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 044M39ur153853 for ; Mon, 4 May 2020 18:23:57 -0400 Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0a-001b2d01.pphosted.com with ESMTP id 30sp8j5khk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 04 May 2020 18:23:57 -0400 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 044MNQxE006050 for ; Mon, 4 May 2020 22:23:56 GMT Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by ppma03wdc.us.ibm.com with ESMTP id 30s0g6m4df-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 04 May 2020 22:23:56 +0000 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 044MNtWf19726746 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 4 May 2020 22:23:55 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 850ED78068 for ; Mon, 4 May 2020 22:23:55 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 213C278063 for ; Mon, 4 May 2020 22:23:55 +0000 (GMT) Received: from brokenarrow.ibmuc.com (unknown [9.85.137.49]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP for ; Mon, 4 May 2020 22:23:54 +0000 (GMT) To: libc-alpha@sourceware.org Subject: [PATCH 2/4] powerpc64le: refactor e_sqrtf128.c Date: Mon, 4 May 2020 17:23:51 -0500 Message-Id: <6a73737db700dca0aea859a34e1df95a42d25b28.1588628261.git.murphyp@linux.vnet.ibm.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: References: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-05-04_11:2020-05-04, 2020-05-04 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 phishscore=0 malwarescore=0 suspectscore=0 priorityscore=1501 spamscore=0 clxscore=1015 mlxscore=0 lowpriorityscore=0 mlxlogscore=999 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005040169 X-Spam-Status: No, score=-20.4 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" Combine both implementations into a single file to allow building twice with appropriate multiarch support when possible. Likewise, this maintains the existing optimal behavior when building with a power9 or newer cpu. --- sysdeps/powerpc/powerpc64/le/fpu/e_sqrtf128.c | 8 +++- .../powerpc64/le/power9/fpu/e_sqrtf128.c | 38 ------------------- 2 files changed, 7 insertions(+), 39 deletions(-) delete mode 100644 sysdeps/powerpc/powerpc64/le/power9/fpu/e_sqrtf128.c diff --git a/sysdeps/powerpc/powerpc64/le/fpu/e_sqrtf128.c b/sysdeps/powerpc/powerpc64/le/fpu/e_sqrtf128.c index 950bdad54a..fac8def02a 100644 --- a/sysdeps/powerpc/powerpc64/le/fpu/e_sqrtf128.c +++ b/sysdeps/powerpc/powerpc64/le/fpu/e_sqrtf128.c @@ -26,6 +26,7 @@ License along with the GNU C Library; if not, see . */ +#include #include #include @@ -42,16 +43,21 @@ __float128 __ieee754_sqrtf128 (__float128 a) { + __float128 r; + /* For multiarch builds, this will be built twice. */ +#ifndef _ARCH_PWR9 FP_DECL_EX; FP_DECL_Q (A); FP_DECL_Q (R); - __float128 r; FP_INIT_ROUNDMODE; FP_UNPACK_Q (A, a); FP_SQRT_Q (R, A); FP_PACK_Q (r, R); FP_HANDLE_EXCEPTIONS; +#else + asm ("xssqrtqp %0,%1" : "=v" (r) : "v" (a)); +#endif return r; } libm_alias_finite (__ieee754_sqrtf128, __sqrtf128) diff --git a/sysdeps/powerpc/powerpc64/le/power9/fpu/e_sqrtf128.c b/sysdeps/powerpc/powerpc64/le/power9/fpu/e_sqrtf128.c deleted file mode 100644 index 232fc773c3..0000000000 --- a/sysdeps/powerpc/powerpc64/le/power9/fpu/e_sqrtf128.c +++ /dev/null @@ -1,38 +0,0 @@ -/* POWER9 sqrt for _Float128 - Return sqrt(a) - Copyright (C) 2017-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 -__ieee754_sqrtf128 (__float128 a) -{ - __float128 z; - asm ("xssqrtqp %0,%1" : "=v" (z) : "v" (a)); - return z; -} -libm_alias_finite (__ieee754_sqrtf128, __sqrtf128)