From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751809AbdFEKW1 (ORCPT ); Mon, 5 Jun 2017 06:22:27 -0400 Received: from ozlabs.org ([103.22.144.67]:35187 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751425AbdFEKVv (ORCPT ); Mon, 5 Jun 2017 06:21:51 -0400 X-powerpc-patch-notification: thanks X-powerpc-patch-commit: f83647d642270f6b9d75736817fb5a66273ec903 In-Reply-To: To: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , Scott Wood From: Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [1/4] powerpc: Discard ffs()/__ffs() function and use builtin functions instead Message-Id: <3wh9pj6YD0z9sD5@ozlabs.org> Date: Mon, 5 Jun 2017 20:21:49 +1000 (AEST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2017-04-21 at 11:18:46 UTC, Christophe Leroy wrote: > With the ffs() function as defined in arch/powerpc/include/asm/bitops.h > GCC will not optimise the code in case of constant parameter, as shown > by the small exemple below. ... > > In addition, when reading the generated vmlinux, we can observe > that with the builtin functions, GCC sometimes efficiently spreads > the instructions within the generated functions while the inline > assembly force them to remain grouped together. > > __builtin_ffs() is already used in arch/powerpc/include/asm/page_32.h > > Those builtins have been in GCC since at least 3.4.6 (see > https://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Other-Builtins.html ) > > Signed-off-by: Christophe Leroy Series applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/f83647d642270f6b9d75736817fb5a cheers