From patchwork Thu Jun 28 17:15:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 28108 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: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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: Subject: Re: [patch] explicit_bzero constraint on the destination buffer To: libc-alpha@sourceware.org References: From: Adhemerval Zanella 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: 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 --- 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