Message ID | 5ec6e4bf-614d-647b-f68c-5970516fd00e@linaro.org |
---|---|
State | Dropped |
Headers |
Received: (qmail 63881 invoked by alias); 28 Jun 2018 17:16:04 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <libc-alpha.sourceware.org> List-Unsubscribe: <mailto:libc-alpha-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:libc-alpha-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 63218 invoked by uid 89); 28 Jun 2018 17:15:54 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-qk0-f181.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=BgnN3Y/kPpyd5fi6ns5+0HGTrgPYTT9DPtg5ZPjy5Eo=; b=T8WepmmwUO896h5U9EhvrBCCEAssiHLWXSkhMHs+kGJkVazPQozm4w1nlL31RPJkZJ 2zodp81vcM1wa3Ksu85y5DGkhWl67p+BQi0R6TVnlb86x07ojKD6WHlY6v1QO0tNT0H1 Mw/2508SkVZeULag47ZOwkQ7mOTYjDRsIRpJY= Return-Path: <adhemerval.zanella@linaro.org> Subject: Re: [patch] explicit_bzero constraint on the destination buffer To: libc-alpha@sourceware.org References: <CA+XhMqzL0=OhSMRMFjW8R5qpgjBHLuJK5n_ttcFYgpUTJx03uQ@mail.gmail.com> From: Adhemerval Zanella <adhemerval.zanella@linaro.org> Openpgp: preference=signencrypt Message-ID: <5ec6e4bf-614d-647b-f68c-5970516fd00e@linaro.org> Date: Thu, 28 Jun 2018 14:15:44 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <CA+XhMqzL0=OhSMRMFjW8R5qpgjBHLuJK5n_ttcFYgpUTJx03uQ@mail.gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit |
Commit Message
Adhemerval Zanella
June 28, 2018, 5:15 p.m. UTC
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 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
Comments
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 <adhemerval.zanella@linaro.org> 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
On 28/06/2018 15:37, David CARLIER wrote: > 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. Which version exactly are you seeing any code generation differences and which kind of differences? > On Thu, 28 Jun 2018 at 18:16, Adhemerval Zanella > <adhemerval.zanella@linaro.org> 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
--- 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