From patchwork Tue Dec 4 10:15:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Woodhouse X-Patchwork-Id: 203593 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 537D22C081A for ; Tue, 4 Dec 2012 21:18:44 +1100 (EST) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:4830:2446:ff00:4687:fcff:fea6:5117]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B9F152C008E for ; Tue, 4 Dec 2012 21:15:53 +1100 (EST) Received: from shinybook.infradead.org ([2001:8b0:10b:1:e6ce:8fff:fe1f:f2c0]) by bombadil.infradead.org with esmtpsa (Exim 4.76 #1 (Red Hat Linux)) id 1TfpXV-0007II-EH; Tue, 04 Dec 2012 10:15:45 +0000 Received: from dwmw2 by shinybook.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1TfpXO-0005vk-Tw; Tue, 04 Dec 2012 10:15:38 +0000 From: David Woodhouse To: dwmw2@infradead.org Subject: [PATCH 2/4] powerpc: enable ARCH_USE_BUILTIN_BSWAP Date: Tue, 4 Dec 2012 10:15:28 +0000 Message-Id: <1354616130-21587-3-git-send-email-dwmw2@infradead.org> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1354616130-21587-1-git-send-email-dwmw2@infradead.org> References: <1354616130-21587-1-git-send-email-dwmw2@infradead.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Cc: linux-arch@vger.kernel.org, x86@kernel.org, linuxppc-dev@lists.ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" From: David Woodhouse By using the compiler intrinsics instead of hand-crafted opaque inline assembler for byte-swapping, we let the compiler see what's actually happening and it gets to use lwbrx/stwbrx instructions instead of a normal load/store coupled with a sequence of rlwimi instructions to move bits around. Compiled-tested only. It gave a code size reduction of almost 4% for ext2, and more like 2.5% for ext3/ext4. Signed-off-by: David Woodhouse --- arch/powerpc/Kconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index a902a5c..b4ea516 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -78,6 +78,9 @@ config ARCH_HAS_ILOG2_U64 bool default y if 64BIT +config ARCH_USE_BUILTIN_BSWAP + def_bool y + config GENERIC_HWEIGHT bool default y