From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 87349 invoked by alias); 28 Jun 2018 18:38:07 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 87332 invoked by uid 89); 28 Jun 2018 18:38:07 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-oi0-f65.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AeF+hvkozUl+u4TtuWTlta72PE/qzNd3ezdknPy6ffc=; b=mXzAB+x+6bmyDS93WHjD9KQ/NvXKvVlZZmPyUImDp1k6zU6ImbbY3dfXhiQJte0e7i Ttyfx0d29GNdOFk0IonM6rQqv6esZuZTrOGrCihWb0FIvl/H3gPx6zLKbbDJSiS4Vae6 3x/s7i7HE8qFLkrPRaHLdL+qh3X8zcFtBUDtUuSfrc+ps1m9iGhDGk1iUQzWfdOzeCMO 1STclt74nwQYgqgFKOg5uqIDOHbXKPnmJSCNRPtywMgUhNeHx55SCvmY2nzbO+rKpyAE lY9KfU9YNvY1n0/AJqZK+pD8jjoE4NuRhs5BXT1Id7Ldb2Z24uboZXUixjIle+PN6vdf Wv1A== MIME-Version: 1.0 References: <5ec6e4bf-614d-647b-f68c-5970516fd00e@linaro.org> In-Reply-To: <5ec6e4bf-614d-647b-f68c-5970516fd00e@linaro.org> From: David CARLIER Date: Thu, 28 Jun 2018 18:38:00 -0000 Message-ID: Subject: Re: [patch] explicit_bzero constraint on the destination buffer To: adhemerval.zanella@linaro.org Cc: libc-alpha@sourceware.org Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2018-06/txt/msg00915.txt.bz2 Ah right indeed it has effect only with older compilers on gcc 7.3 theree is still the additional instruction, default clang 4.0 has but not clang 6.0 for example. And I ran with those older versions sorry for the noise. On Thu, 28 Jun 2018 at 18:16, Adhemerval Zanella wrote: > > > > On 28/06/2018 13:05, David CARLIER wrote: > > Hi, > > > > This is my first message but here a little patch proposal for > > explicit_bzero function. > > > > Hope it s good. > > > > Thanks. > > > > Kind regards. > > > > Does it improve the generate code and/or compile support in any meaningful > way? What are you trying to accomplish by passing the memory pointer as an > input operand? > > At least for x86_64 and aarch64 I am not seeing any code generation > difference. For powerpc64le it seems it forces the frame-pointer to be > saved/restored on GCC 6.2.1: > > $ diff -u original.S patched.S > --- original.S 2018-06-28 14:09:55.576497556 -0300 > +++ patched.S 2018-06-28 14:11:26.914362203 -0300 > @@ -12,18 +12,21 @@ > addi 2,2,.TOC.-.LCF0@l > .localentry explicit_bzero,.-explicit_bzero > mflr 0 > + std 31,-8(1) > mr 5,4 > li 4,0 > + mr 31,3 > std 0,16(1) > - stdu 1,-32(1) > + stdu 1,-48(1) > bl memset > nop > - addi 1,1,32 > + addi 1,1,48 > ld 0,16(1) > + ld 31,-8(1) > mtlr 0 > blr > .long 0 > - .byte 0,0,0,1,128,0,0,0 > + .byte 0,0,0,1,128,1,0,0 > .size explicit_bzero,.-explicit_bzero > .ident "GCC: (GNU) 6.2.1 20161129 [gcc-6-branch revision 242956]" > .section .note.GNU-stack,"",@progbits > > I do not see it on GCC 8.1.1, but I sceptical this change brings any advantage. > > [1] https://sourceware.org/ml/libc-alpha/2016-12/msg00537.html