From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 4EBD51F462 for ; Wed, 29 May 2019 13:18:55 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-type; q=dns; s=default; b=aOTq6 SUT6bBFlh4vzuVFFsDOQioXQeJOzPLaPvk03qVQsLEjotIfO+VV6z9NQ6U2Vdi/N KUjxQCOYOGjxyEPZ+kSZOWDMEJMAz+u9/aWm4ccdXRbfYauA8Bk4dFbwXx6mWa1c DgLhuFXcZH1D5qe3dEAGqBqkS4a7cvzlnWFDro= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-type; s=default; bh=PX38b4WPkyl +okU/+CEhIqxFKW0=; b=kktNcPXrmMMei+OB7Jby2lpeEjgEwHayZ1HjGFQrJp5 O63Vu5ux2gAj9uQDrUOK3iVoWJlIo+87YoGomJe4SA1bqZm1n8y9v0uTGasOmDTd lzNC3XhGf6DRGP134GPARWHccUMtkNLvgPyNn48B5LvIUamm9xB79w0TWrQCmAyw = Received: (qmail 121184 invoked by alias); 29 May 2019 13:18:53 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 120737 invoked by uid 89); 29 May 2019 13:18:52 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: palegreen.birch.relay.mailchannels.net X-Sender-Id: dreamhost|x-authsender|tuliom@ascii.art.br X-Sender-Id: dreamhost|x-authsender|tuliom@ascii.art.br X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|tuliom@ascii.art.br X-MailChannels-Auth-Id: dreamhost X-Spot-Occur: 3b07106414221f26_1559135928420_1641739870 X-MC-Loop-Signature: 1559135928420:2834763956 X-MC-Ingress-Time: 1559135928420 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=ascii.art.br; h=from:to:cc :subject:in-reply-to:references:date:message-id:mime-version :content-type; s=ascii.art.br; bh=PX38b4WPkyl+okU/+CEhIqxFKW0=; b= KhSQ44pS7MKFJEPnFhIQBc6d6xBE0Wrx+F3MAMVS+VHa9xkVNeFxKW8OacKSP5cV kejO/Hc13xJJtPBD6A460jyp66/guJTMxWxm8WOek2Mcgdr1cF06h9jgjcqzCuda aCsGRLB2LF1VAdutCl3IgSOoJqqu5njJEDKk7sA7wcQ= X-DH-BACKEND: pdx1-sub0-mail-a4 From: Tulio Magno Quites Machado Filho To: Shawn Landden , libc-alpha@sourceware.org Cc: Subject: Re: [v2 2/2] PPC64: Add libmvec SIMD double-precision natural exponent function. In-Reply-To: <20190527174717.21619-2-shawn@git.icu> References: <20190512032812.22021-1-shawn@git.icu> <20190527174717.21619-1-shawn@git.icu> <20190527174717.21619-2-shawn@git.icu> User-Agent: Notmuch/0.27 (http://notmuchmail.org) Emacs/25.3.1 (x86_64-redhat-linux-gnu) Date: Wed, 29 May 2019 10:18:34 -0300 Message-ID: <87tvddl7px.fsf@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -93 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddruddvjedgieegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrhhlucfvnfffucdljedmnecujfgurhephffvufgjfhgffffkgggtsehttdertddtredtnecuhfhrohhmpefvuhhlihhoucforghgnhhoucfsuhhithgvshcuofgrtghhrgguohcuhfhilhhhohcuoehtuhhlihhomhesrghstghiihdrrghrthdrsghrqeenucffohhmrghinhepghhnuhdrohhrghenucfkphepudekjedruddtuddrgedtrddujedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopegrshgtihhirdgrrhhtrdgsrhdpihhnvghtpedukeejrddutddurdegtddrudejtddprhgvthhurhhnqdhprghthhepvfhulhhiohcuofgrghhnohcusfhuihhtvghsucforggthhgrughoucfhihhlhhhouceothhulhhiohhmsegrshgtihhirdgrrhhtrdgsrheqpdhmrghilhhfrhhomhepthhulhhiohhmsegrshgtihhirdgrrhhtrdgsrhdpnhhrtghpthhtoheplhhisggtqdgrlhhphhgrsehsohhurhgtvgifrghrvgdrohhrghenucevlhhushhtvghrufhiiigvpedt Hi Shawn, This patch is a lot better. Shawn Landden writes: > Passes all tests. > > Unlike other libmvec functions, this sets the onderflow and overflow bits. s/onderflow/underflow/ > The caller can check these flags, and possibly re-run the calculations with > scalar expf to figure out what is causing the overflow or underflow. > > The special-case path is not vectorized, and performs much woorse than s/woorse/worse/ > 2019-05-11 Shawn Landden > > [BZ #24209] > * NEWS: Noted the addition of PPC64 vector exp function. > * sysdeps/powerpc/bits/math-vector.h: Added entry for vector exp. > * sysdeps/powerpc/powerpc64/fpu/Versions: Added vector exp entry. > * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile: > (libmvec-sysdep_routines, CFLAGS-vec_d_exp2_vsx.c): > (CFLAGS-vec_d_exp_data.c): Added build of VSX SIMD expf > function and tests. Added vec_math_err.c to build. > * sysdeps/powerpc/powerpc64/fpu/multiarch/math_config.h: Renamed to ... > * sysdeps/powerpc/powerpc64/fpu/multiarch/math_config_dbl.h: ... and > modified for exp. > * sysdeps/powerpc/powerpc64/fpu/multiarch/test-double-vlen2-wrappers.c: > Added entry for vector exp. > * sysdeps/powerpc/powerpc64/fpu/multiarch/vec_d_exp2_vsx.c: New file. > * sysdeps/powerpc/powerpc64/fpu/multiarch/vec_d_exp_data.c: Likewise. > * sysdeps/powerpc/powerpc64/fpu/multiarch/vec_math_err.c: Likewise. > * sysdeps/unix/sysv/linux/powerpc/powerpc64/libmvec.abilist: SIMD expf > added. > * sysdeps/powerpc/powerpc64/fpu/multiarch/vec_d_log_data.c: Change to > reflect rename of math_config.h > * sysdeps/powerpc/powerpc64/fpu/multiarch/vec_d_log2_vsx.c: Likewise There are still 11 lines indented with spaces instead of tab here. You can identify easily in this quote. > diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile > index ad3c29b1ab..aceaedee0a 100644 > --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile > +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile > @@ -47,11 +47,12 @@ ifeq ($(subdir),mathvec) > libmvec-sysdep_routines += vec_d_cos2_vsx vec_s_cosf4_vsx \ > vec_d_sin2_vsx vec_s_sinf4_vsx \ > vec_d_log2_vsx vec_d_log_data \ > vec_s_logf4_vsx vec_s_logf_data \ > vec_s_expf4_vsx vec_s_exp2f_data \ > - vec_math_errf \ > + vec_math_errf vec_math_err \ > + vec_d_exp2_vsx vec_d_exp_data \ > vec_d_sincos2_vsx vec_s_sincosf4_vsx > CFLAGS-vec_d_cos2_vsx.c += -mabi=altivec -maltivec -mvsx -mpower8-vector > CFLAGS-vec_d_log2_vsx.c += -mabi=altivec -maltivec -mvsx -mpower8-vector > CFLAGS-vec_d_log_data.c += -mabi=altivec -maltivec -mvsx -mpower8-vector > CFLAGS-vec_s_cosf4_vsx.c += -mabi=altivec -maltivec -mvsx > @@ -61,18 +62,20 @@ CFLAGS-vec_d_sin2_vsx.c += -mabi=altivec -maltivec -mvsx -mpower8-vector > CFLAGS-vec_s_sinf4_vsx.c += -mabi=altivec -maltivec -mvsx > CFLAGS-vec_d_sincos2_vsx.c += -mabi=altivec -maltivec -mvsx -mpower8-vector > CFLAGS-vec_s_sincosf4_vsx.c += -mabi=altivec -maltivec -mvsx > CFLAGS-vec_s_expf4_vsx.c += -mabi=altivec -maltivec -mvsx > CFLAGS-vec_s_exp2f_data.c += -mabi=altivec -maltivec -mvsx > +CFLAGS-vec_d_exp2_vsx.c += -mabi=altivec -maltivec -mvsx -mpower8-vector > +CFLAGS-vec_d_exp_data.c += -mabi=altivec -maltivec -mvsx vec_math_err.c includes altivec.h indirectly, requiring the same CFLAGS. > diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/vec_d_exp2_vsx.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/vec_d_exp2_vsx.c > new file mode 100644 > index 0000000000..5d59cc429d > --- /dev/null > +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/vec_d_exp2_vsx.c > @@ -0,0 +1,204 @@ > +/* Double-precision vector exp function. > + Copyright 2019 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 > + . */ We need to reuse the copyright template that is available in the file that you used as a base for this one. You just need to update the year. That means to keep "(C)". > +/* Based on sysdeps/ieee754/dbl-64/e_exp.c which came from > + Szabolcs Nagy at ARM Ltd. */ Thanks for adding this. > diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/vec_d_exp_data.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/vec_d_exp_data.c > new file mode 100644 > index 0000000000..8038a7b592 > --- /dev/null > +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/vec_d_exp_data.c > @@ -0,0 +1,211 @@ > +/* Shared data between exp, exp2 and pow. Should this be just exp? > + > + Copyright 2019 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 > + . */ Same comment here. > +/* Based on ./sysdeps/ieee754/dbl-64/e_exp_data.c which came from > + Szabolcs Nagy at ARM Ltd. */ Thanks again. > +// Used for rounding when !TOINT_INTRINSICS > +#if EXP_USE_TOINT_NARROW This usage is still lost here and causes a build failure. > diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/vec_math_err.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/vec_math_err.c > new file mode 100644 > index 0000000000..2f88b81ab2 > --- /dev/null > +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/vec_math_err.c > @@ -0,0 +1,41 @@ > ... > +attribute_hidden double > +__math_oflow (uint32_t sign) > +{ > + return xflow (sign, 0x1p769); > +} > + Extra line at EOF. > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libmvec.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libmvec.abilist > index 63770c8da3..26175bb1a0 100644 > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libmvec.abilist > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libmvec.abilist > @@ -4,6 +4,7 @@ GLIBC_2.30 _ZGVbN2v_sin F > GLIBC_2.30 _ZGVbN2vvv_sincos F > GLIBC_2.30 _ZGVbN4v_cosf F > GLIBC_2.30 _ZGVbN4v_logf F > GLIBC_2.30 _ZGVbN4v_sinf F > GLIBC_2.30 _ZGVbN4vvv_sincosf F > +GLIBC_2.30 _ZGVbN2v_exp F This is still causing an issue with mathvec/check-abi-libmvec -- Tulio Magno