From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from aye.elm.relay.mailchannels.net (aye.elm.relay.mailchannels.net [23.83.212.6]) by sourceware.org (Postfix) with ESMTPS id 3AA87386EC78 for ; Thu, 12 Nov 2020 17:10:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3AA87386EC78 X-Sender-Id: dreamhost|x-authsender|tuliom@ascii.art.br Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 6BEB8542072; Thu, 12 Nov 2020 17:10:06 +0000 (UTC) Received: from pdx1-sub0-mail-a43.g.dreamhost.com (100-96-5-201.trex.outbound.svc.cluster.local [100.96.5.201]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 8C53554201A; Thu, 12 Nov 2020 17:10:05 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|tuliom@ascii.art.br Received: from pdx1-sub0-mail-a43.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.10); Thu, 12 Nov 2020 17:10:06 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|tuliom@ascii.art.br X-MailChannels-Auth-Id: dreamhost X-Illustrious-Broad: 231b45d73fc4745e_1605201005858_74226709 X-MC-Loop-Signature: 1605201005858:1388109044 X-MC-Ingress-Time: 1605201005858 Received: from pdx1-sub0-mail-a43.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a43.g.dreamhost.com (Postfix) with ESMTP id 38DF07E0D4; Thu, 12 Nov 2020 09:10:05 -0800 (PST) Received: from ascii.art.br (ip-187-17-251-140.isp.valenet.com.br [187.17.251.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: tuliom@ascii.art.br) by pdx1-sub0-mail-a43.g.dreamhost.com (Postfix) with ESMTPSA id 48B667E600; Thu, 12 Nov 2020 09:10:03 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a43 From: Tulio Magno Quites Machado Filho To: Raphael Moreira Zinsly , libc-alpha@sourceware.org Cc: murphyp@linux.ibm.com, pc@us.ibm.com, msc@linux.ibm.com Subject: Re: [PATCH v3 1/2] powerpc: Add optimized strncpy for POWER9 In-Reply-To: <20200929152103.18564-1-rzinsly@linux.ibm.com> References: <20200929152103.18564-1-rzinsly@linux.ibm.com> User-Agent: Notmuch/0.29.1 (http://notmuchmail.org) Emacs/26.3 (x86_64-redhat-linux-gnu) Date: Thu, 12 Nov 2020 14:09:59 -0300 Message-ID: <87a6vmfqmw.fsf@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-9.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, 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: Thu, 12 Nov 2020 17:10:10 -0000 Raphael Moreira Zinsly writes: > Similar to the strcpy P9 optimization, this version uses VSX to improve > performance. Remember to add the Reviewed-by: lines you collected in previous versions. ;-) > +#define FRAMESIZE (FRAME_MIN_SIZE+48) I think you actually meant to use FRAME_MIN_SIZE+8 here. Fixed. > +L(zero_padding_end): > + sldi r10,r5,56 /* stxvl wants size in top 8 bits */ > + stxvl v18,r11,r10 /* Partial store */ > + blr > + > + .align 4 > +L(zero_padding_memset): > + std r30,-8(r1) /* Save r30 on the stack. */ This requires to add CFI: cfi_offset(r30, -8) Done. > +#if defined __LITTLE_ENDIAN__ && IS_IN (libc) > +#define STRNCPY __strncpy_power9 > + > +#undef libc_hidden_builtin_def > +#define libc_hidden_builtin_def(name) > + > +/* memset is used to pad the end of the string. */ > +#define MEMSET __memset_power8 > +#ifdef SHARED > +#define MEMSET_is_local Wrong indentation in the previous lines. Fixed. I wonder if we can improve this and stop depending on the list of memset implementations on this file. Anyway, this isn't new and is a future work. > diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncpy.c b/sysdeps/powerpc/powerpc64/multiarch/strncpy.c > index 7bacf28aca..3f2108ddae 100644 > --- a/sysdeps/powerpc/powerpc64/multiarch/strncpy.c > +++ b/sysdeps/powerpc/powerpc64/multiarch/strncpy.c > @@ -28,11 +28,19 @@ > extern __typeof (strncpy) __strncpy_ppc attribute_hidden; > extern __typeof (strncpy) __strncpy_power7 attribute_hidden; > extern __typeof (strncpy) __strncpy_power8 attribute_hidden; > +# ifdef __LITTLE_ENDIAN__ > +extern __typeof (strncpy) __strncpy_power9 attribute_hidden; > +# endif > # undef strncpy > > /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle > ifunc symbol properly. */ > libc_ifunc_redirected (__redirect_strncpy, strncpy, > +# ifdef __LITTLE_ENDIAN__ > + (hwcap2 & PPC_FEATURE2_ARCH_3_00) && > + (hwcap & PPC_FEATURE_HAS_VSX) > + ? __strncpy_power9 : Wrong indentation here. Fixed. Reviewed-by: Tulio Magno Quites Machado Filho Pushed as b9d83bf3eb57. Thanks! -- Tulio Magno