Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1038571AbdDULSs (ORCPT ); Fri, 21 Apr 2017 07:18:48 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:3954 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1038520AbdDULSq (ORCPT ); Fri, 21 Apr 2017 07:18:46 -0400 Message-Id: From: Christophe Leroy Subject: [PATCH 0/4] powerpc: Replace some bitops functions by builtin/generic ones To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Scott Wood Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Fri, 21 Apr 2017 13:18:44 +0200 (CEST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 862 Lines: 25 This patchset replaces the following bitops by builtin/generic ones: - ffs() / __ffs() - fls() / __fls() / fls64() - ffz() - __ilog2() / __ilog2_u32() / __ilog2_u64() The current functions are written as inline assembly which prevents GCC to optimise them in case of constant parameters and obliges GCC to group the related instructions all together. With the builtin alternatives, GCC optimises better Christophe Leroy (4): powerpc: Discard ffs()/__ffs() function and use builtin functions instead powerpc: Use builtin functions for fls()/__fls()/fls64() powerpc: Replace ffz() by equivalent generic function powerpc: remove __ilog2()s and use generic ones arch/powerpc/Kconfig | 8 ---- arch/powerpc/include/asm/bitops.h | 87 ++++----------------------------------- 2 files changed, 7 insertions(+), 88 deletions(-) -- 2.12.0