From patchwork Tue Mar 30 20:19:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael M Zinsly X-Patchwork-Id: 1460239 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=RrP47CAS; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4F915L2DB8z9sRR for ; Wed, 31 Mar 2021 07:19:50 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 37954385802A; Tue, 30 Mar 2021 20:19:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 37954385802A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1617135584; bh=Ejgaa/GieNCAyngCC2X03tRROu3G2sYECDjQ+sn63DE=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=RrP47CAStUYZMKAoFVEnqJkfcvA9Cl0svZ17tAzQcHk4puhkwZyCgdI8Ikz9QB7e2 9ZJOeuBrNDSznzwZ6VDXt+3xrc+Zelgpik9thAgVC+/UEOiXWbZj46/YfozZWt1Epa aylqscZ6GoLVS4gDO0q08MPQWrcAmHKyPuFhezQs= 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 3F47C3858012 for ; Tue, 30 Mar 2021 20:19:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3F47C3858012 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 12UK3oUX037413 for ; Tue, 30 Mar 2021 16:19:41 -0400 Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0b-001b2d01.pphosted.com with ESMTP id 37jj8bx1hm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 30 Mar 2021 16:19:40 -0400 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.0.43/8.16.0.43) with SMTP id 12UKC3SC030407 for ; Tue, 30 Mar 2021 20:19:40 GMT Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by ppma04dal.us.ibm.com with ESMTP id 37hvb9e003-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 30 Mar 2021 20:19:40 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 12UKJcTI31523092 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Mar 2021 20:19:38 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 56401C605B; Tue, 30 Mar 2021 20:19:38 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CD291C6059; Tue, 30 Mar 2021 20:19:37 +0000 (GMT) Received: from localhost (unknown [9.160.118.162]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Tue, 30 Mar 2021 20:19:37 +0000 (GMT) To: libc-alpha@sourceware.org Subject: [PATCH] powerpc: Add log IFUNC multiarch support for POWER10 Date: Tue, 30 Mar 2021 17:19:24 -0300 Message-Id: <20210330201924.27874-1-rzinsly@linux.ibm.com> X-Mailer: git-send-email 2.29.2 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: dHGggsW2qNW_QEjxXw7JKyR3unlndPOY X-Proofpoint-ORIG-GUID: dHGggsW2qNW_QEjxXw7JKyR3unlndPOY X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369, 18.0.761 definitions=2021-03-30_09:2021-03-30, 2021-03-30 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 clxscore=1015 malwarescore=0 suspectscore=0 spamscore=0 bulkscore=0 lowpriorityscore=0 impostorscore=0 mlxlogscore=999 priorityscore=1501 phishscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2103250000 definitions=main-2103300145 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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: Raphael Moreira Zinsly via Libc-alpha From: Raphael M Zinsly Reply-To: Raphael Moreira Zinsly Cc: murphyp@linux.ibm.com, tuliom@linux.ibm.com, Raphael Moreira Zinsly Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Checked on ppc64le built without --with-cpu, with --with-cpu=power9 and with --disable-multi-arch. --- .../powerpc64/le/fpu/multiarch/Makefile | 7 ++++ .../le/fpu/multiarch/e_log-power10.c | 4 ++ .../powerpc64/le/fpu/multiarch/e_log-ppc64.c | 4 ++ .../powerpc64/le/fpu/multiarch/e_log.c | 37 +++++++++++++++++++ .../powerpc64/le/fpu/multiarch/w_log.c | 1 + .../powerpc/powerpc64/le/power10/Makeconfig | 6 +++ 6 files changed, 59 insertions(+) create mode 100644 sysdeps/powerpc/powerpc64/le/fpu/multiarch/e_log-power10.c create mode 100644 sysdeps/powerpc/powerpc64/le/fpu/multiarch/e_log-ppc64.c create mode 100644 sysdeps/powerpc/powerpc64/le/fpu/multiarch/e_log.c create mode 100644 sysdeps/powerpc/powerpc64/le/fpu/multiarch/w_log.c create mode 100644 sysdeps/powerpc/powerpc64/le/power10/Makeconfig diff --git a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/Makefile index 767805b510..20510c8a2d 100644 --- a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/Makefile +++ b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/Makefile @@ -199,4 +199,11 @@ object-suffixes-left := $(all-object-suffixes) include $(o-iterator) endif # do_f128_multiarch + +libm-sysdep_routines += e_log-power10 \ + e_log-ppc64 +ifeq ($(mcpu_power10), yes) +CFLAGS-e_log-power10.c += -mcpu=power10 +endif + endif diff --git a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/e_log-power10.c b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/e_log-power10.c new file mode 100644 index 0000000000..4226e07643 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/e_log-power10.c @@ -0,0 +1,4 @@ +#include + +#define __log __log_power10 +#include diff --git a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/e_log-ppc64.c b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/e_log-ppc64.c new file mode 100644 index 0000000000..cb902d727a --- /dev/null +++ b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/e_log-ppc64.c @@ -0,0 +1,4 @@ +#include +#define __log __log_ppc64 + +#include diff --git a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/e_log.c b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/e_log.c new file mode 100644 index 0000000000..76112a0621 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/e_log.c @@ -0,0 +1,37 @@ +/* Multiple versions of IEEE 754 log. + Copyright (C) 2021 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 "init-arch.h" +#include + +extern double __redirect_ieee754_log (double); + +extern __typeof (log) __log_ppc64 attribute_hidden; +#if __GNUC_PREREQ (10, 0) +extern __typeof (log) __log_power10 attribute_hidden; +#endif + +libc_ifunc_redirected (__redirect_ieee754_log, __ieee754_log, +#if __GNUC_PREREQ (10, 0) + (hwcap2 & PPC_FEATURE2_ARCH_3_1) + ? __log_power10 : +#endif + __log_ppc64); + +libm_alias_finite (__ieee754_log, __log) diff --git a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/w_log.c b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/w_log.c new file mode 100644 index 0000000000..9b2b018711 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/w_log.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/powerpc/powerpc64/le/power10/Makeconfig b/sysdeps/powerpc/powerpc64/le/power10/Makeconfig new file mode 100644 index 0000000000..a85cab248f --- /dev/null +++ b/sysdeps/powerpc/powerpc64/le/power10/Makeconfig @@ -0,0 +1,6 @@ +# -mcpu=power10 was introduced on GCC 10 +GCC_VER := $(shell gcc --version) + +ifeq (10.0,$(firstword $(sort $(GCC_VER) 10.0))) +mcpu_powe10 = yes +endif