From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 47D9D385E442 for ; Mon, 26 Apr 2021 11:43:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 47D9D385E442 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 13QBY4dH077779; Mon, 26 Apr 2021 07:43:19 -0400 Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com with ESMTP id 385qexhmj1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 26 Apr 2021 07:43:19 -0400 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.0.43/8.16.0.43) with SMTP id 13QBbCoI012282; Mon, 26 Apr 2021 11:41:25 GMT Received: from b01cxnp23033.gho.pok.ibm.com (b01cxnp23033.gho.pok.ibm.com [9.57.198.28]) by ppma02dal.us.ibm.com with ESMTP id 384qdhn2ae-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 26 Apr 2021 11:41:25 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 13QBfOQ614025056 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 26 Apr 2021 11:41:24 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C6CDBAC059; Mon, 26 Apr 2021 11:41:24 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 46CE8AC06A; Mon, 26 Apr 2021 11:41:24 +0000 (GMT) Received: from localhost (unknown [9.80.229.10]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 26 Apr 2021 11:41:23 +0000 (GMT) Content-Type: text/plain; charset="utf-8" In-Reply-To: <20210408181511.28061-1-rzinsly@linux.ibm.com> References: <20210408181511.28061-1-rzinsly@linux.ibm.com> Subject: Re: [PATCH v2] powerpc: Add log IFUNC multiarch support for POWER10 From: "Lucas A. M. Magalhaes" Cc: murphyp@linux.ibm.com, tuliom@linux.ibm.com, fw@deneb.enyo.de, Raphael Moreira Zinsly To: Raphael Moreira Zinsly , libc-alpha@sourceware.org Date: Mon, 26 Apr 2021 08:41:22 -0300 Message-ID: <161943728297.77482.6392319551434903358@localhost.localdomain> User-Agent: alot/0.9.1 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: W2ucYLWroPmSvg40_wiEf9ppBBLgB_Li X-Proofpoint-ORIG-GUID: W2ucYLWroPmSvg40_wiEf9ppBBLgB_Li Content-Transfer-Encoding: quoted-printable X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-04-26_03:2021-04-26, 2021-04-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 malwarescore=0 adultscore=0 spamscore=0 priorityscore=1501 clxscore=1011 mlxlogscore=999 phishscore=0 mlxscore=0 lowpriorityscore=0 suspectscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104260087 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, 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-List-Received-Date: Mon, 26 Apr 2021 11:43:27 -0000 LGTM. All tests with -mcpu=3Dpower10. Quoting Raphael Moreira Zinsly via Libc-alpha (2021-04-08 15:15:11) > Changes since v1: > - Checks for the -mcpu=3Dpower10 support on configure instead of > checking GCC's version. > - Don't build __log_power10 without -mcpu=3Dpower10. >=20 > ---8<--- >=20 > Checked on ppc64le built without --with-cpu, with --with-cpu=3Dpower9 > and with --disable-multi-arch. > --- > config.h.in | 3 ++ > .../powerpc64/le/fpu/multiarch/Makefile | 8 ++++ > .../powerpc64/le/fpu/multiarch/configure | 33 +++++++++++++++++ > .../powerpc64/le/fpu/multiarch/configure.ac | 14 +++++++ > .../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 + > 8 files changed, 104 insertions(+) > create mode 100644 sysdeps/powerpc/powerpc64/le/fpu/multiarch/configure > create mode 100644 sysdeps/powerpc/powerpc64/le/fpu/multiarch/configure.= ac > create mode 100644 sysdeps/powerpc/powerpc64/le/fpu/multiarch/e_log-powe= r10.c > create mode 100644 sysdeps/powerpc/powerpc64/le/fpu/multiarch/e_log-ppc6= 4.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 >=20 > diff --git a/config.h.in b/config.h.in > index ca1547ae67..14c3bf0f0d 100644 > --- a/config.h.in > +++ b/config.h.in > @@ -23,6 +23,9 @@ > /* On powerpc64, use @notoc. */ > #undef USE_PPC64_NOTOC >=20=20 > +/* On powerpc64, define if the compiler supports -mcpu=3Dpower10. */ > +#undef USE_PPC64_MCPU_POWER10 > + > /* Define if _Unwind_Find_FDE should be exported from glibc. */ > #undef EXPORT_UNWIND_FIND_FDE >=20=20 > diff --git a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/Makefile b/sysdep= s/powerpc/powerpc64/le/fpu/multiarch/Makefile > index 22252d9e0a..cc073b53d3 100644 > --- a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/Makefile > +++ b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/Makefile > @@ -208,4 +208,12 @@ object-suffixes-left :=3D $(all-object-suffixes) > include $(o-iterator) >=20=20 > endif # do_f128_multiarch > + > +libm-sysdep_routines +=3D e_log-ppc64 > + > +ifeq ($(mcpu-power10), yes) > +libm-sysdep_routines +=3D e_log-power10 > +CFLAGS-e_log-power10.c +=3D -mcpu=3Dpower10 > +endif > + > endif > diff --git a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/configure b/sysde= ps/powerpc/powerpc64/le/fpu/multiarch/configure > new file mode 100644 > index 0000000000..4ca1d15833 > --- /dev/null > +++ b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/configure > @@ -0,0 +1,33 @@ > +# This file is generated from configure.ac by Autoconf. DO NOT EDIT! > + > +OLD_CFLAGS=3D"$CFLAGS" > +CFLAGS=3D"$CFLAGS -mcpu=3Dpower10" > + > +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the compiler suppor= ts -mcpu=3Dpower10" >&5 > +$as_echo_n "checking if the compiler supports -mcpu=3Dpower10... " >&6; } > +if ${libc_cv_mcpu_power10+:} false; then : > + $as_echo_n "(cached) " >&6 > +else > + > +cat confdefs.h - <<_ACEOF >conftest.$ac_ext > +/* end confdefs.h. */ > + > + > +_ACEOF > +if ac_fn_c_try_compile "$LINENO"; then : > + libc_cv_mcpu_power10=3Dyes > +else > + libc_cv_mcpu_power10=3Dno > +fi > +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext > +fi > +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mcpu_power10" = >&5 > +$as_echo "$libc_cv_mcpu_power10" >&6; } > +config_vars=3D"$config_vars > +mcpu-power10 =3D $libc_cv_mcpu_power10" > +if test "$libc_cv_mcpu_power10" =3D=3D "yes"; then : > + > + $as_echo "#define USE_PPC64_MCPU_POWER10 1" >>confdefs.h > + > +fi > +CFLAGS=3D"$OLD_CFLAGS" > diff --git a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/configure.ac b/sy= sdeps/powerpc/powerpc64/le/fpu/multiarch/configure.ac > new file mode 100644 > index 0000000000..ceb578cc59 > --- /dev/null > +++ b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/configure.ac > @@ -0,0 +1,14 @@ > +GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. > + > +OLD_CFLAGS=3D"$CFLAGS" > +CFLAGS=3D"$CFLAGS -mcpu=3Dpower10" > +AC_CACHE_CHECK([if the compiler supports -mcpu=3Dpower10], > + libc_cv_mcpu_power10, [ > +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ > +]])], > + [libc_cv_mcpu_power10=3Dyes], > + [libc_cv_mcpu_power10=3Dno])]) > +LIBC_CONFIG_VAR([mcpu-power10], [$libc_cv_mcpu_power10]) > +AS_IF([[test "$libc_cv_mcpu_power10" =3D=3D "yes"]],[ > + AC_DEFINE(USE_PPC64_MCPU_POWER10)]) > +CFLAGS=3D"$OLD_CFLAGS" > 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/s= ysdeps/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..b7961096a5 > --- /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; > +#ifdef USE_PPC64_MCPU_POWER10 > +extern __typeof (log) __log_power10 attribute_hidden; > +#endif > + > +libc_ifunc_redirected (__redirect_ieee754_log, __ieee754_log, > +#ifdef USE_PPC64_MCPU_POWER10 > + (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 > --=20 > 2.29.2 >