From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 43058 invoked by alias); 18 Aug 2017 09:10:55 -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 37078 invoked by uid 89); 18 Aug 2017 09:10:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=nervous X-HELO: mx1.redhat.com DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3DBFD80B22 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=fweimer@redhat.com Subject: Re: [PATCH] powerpc: Use aligned stores in memset To: Rajalakshmi Srinivasaraghavan References: <1503033107-20047-1-git-send-email-raji@linux.vnet.ibm.com> Cc: libc-alpha@sourceware.org From: Florian Weimer Message-ID: Date: Fri, 18 Aug 2017 09:10:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-08/txt/msg00844.txt.bz2 On 08/18/2017 08:51 AM, Rajalakshmi Srinivasaraghavan wrote: > > > On 08/18/2017 11:51 AM, Florian Weimer wrote: >> On 08/18/2017 07:11 AM, Rajalakshmi Srinivasaraghavan wrote: >>> * sysdeps/powerpc/powerpc64/power8/memset.S: Store byte by byte >>> for unaligned inputs if size is less than 8. >> >> This makes me rather nervous. powerpc64le was supposed to have >> reasonable efficient unaligned loads and stores. GCC happily generates >> them, too. > > This is meant ONLY for caching inhibited accesses. Caching Inhibited > accesses are required to be Guarded and properly aligned. The intent is to support memset for such memory regions, right? This change is insufficient. You have to fix GCC as well because it will inline memset of unaligned pointers, like this: typedef long __attribute__ ((aligned(1))) long_unaligned; void clear (long_unaligned *p) { memset (p, 0, sizeof (*p)); } clear: li 9,0 std 9,0(3) blr That's why I think your change is not useful in isolation. Thanks, Florian