Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752567AbdIANaA (ORCPT ); Fri, 1 Sep 2017 09:30:00 -0400 Received: from ozlabs.org ([103.22.144.67]:39995 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752466AbdIAN34 (ORCPT ); Fri, 1 Sep 2017 09:29:56 -0400 X-powerpc-patch-notification: thanks X-powerpc-patch-commit: da74f659205ea08cb0fd0b3050637b0e0eb31520 In-Reply-To: <118f28ccb9be59c72f4c7a2a0ce3c8591dea6582.1503277387.git.christophe.leroy@c-s.fr> To: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , Scott Wood From: Michael Ellerman Cc: "Naveen N. Rao" , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [1/4] powerpc/32: add memset16() Message-Id: <3xkKq71dbNz9t42@ozlabs.org> Date: Fri, 1 Sep 2017 23:29:54 +1000 (AEST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1247 Lines: 32 On Wed, 2017-08-23 at 14:54:32 UTC, Christophe Leroy wrote: > Commit 694fc88ce271f ("powerpc/string: Implement optimized > memset variants") added memset16(), memset32() and memset64() > for the 64 bits PPC. > > On 32 bits, memset64() is not relevant, and as shown below, > the generic version of memset32() gives a good code, so only > memset16() is candidate for an optimised version. > > 000009c0 : > 9c0: 2c 05 00 00 cmpwi r5,0 > 9c4: 39 23 ff fc addi r9,r3,-4 > 9c8: 4d 82 00 20 beqlr > 9cc: 7c a9 03 a6 mtctr r5 > 9d0: 94 89 00 04 stwu r4,4(r9) > 9d4: 42 00 ff fc bdnz 9d0 > 9d8: 4e 80 00 20 blr > > The last part of memset() handling the not 4-bytes multiples > operates on bytes, making it unsuitable for handling word without > modification. As it would increase memset() complexity, it is > better to implement memset16() from scratch. In addition it > has the advantage of allowing a more optimised memset16() than what > we would have by using the memset() function. > > Signed-off-by: Christophe Leroy Series applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/da74f659205ea08cb0fd0b3050637b cheers