Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp662897pxb; Thu, 25 Feb 2021 11:44:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJx/dITtpoydupW0VVdu3edHZluAzuUS9J7/8InE1bhSMqCNrEvALCAhN2/bZyFrDRaA0jKb X-Received: by 2002:a05:6402:1853:: with SMTP id v19mr4823440edy.10.1614282262871; Thu, 25 Feb 2021 11:44:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614282262; cv=none; d=google.com; s=arc-20160816; b=kzlEYdZ2471fUypcS4zpqki86FJzKYolEfxfLAhPgK6cLTdWYPthftcZN+Zc67T9jA 37gyJ+MxJT97tf4jf0q74s3bnBDpzFOtfVz/YY5uEPxkHNgiYwUL/MyZBF0BjlQ3nTcM b4oFYzgb4RdfmmmEkGOHjGX6dUeLPT16MICRXuzZUbHF2XZe2bNwcbfwi2jzrAN7oxBy Hv8khaLLapmixRIPL/LXco/ugInbRpmcQ6rdEpcib/I5ujXvNzx6Rdpp3aykbFoG99NQ sBFbcGw8XQU8qkcv5bQvQV6aFzRtNfHKB38waoszeVV58RzJim8IIPh8lO0OEkoeiKOv 1hCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=4VTMSsErzKukku0zzN6GHA1w/5hzsFhmm9SUsiZLcmo=; b=qYbZ38cJgaeYgbSATpDUyV+NGu6AHNrhfCarqKRmRbi0a3gfsFESp41TXI87hivDXR 4XR0g9qzp6BW09BB5eA77F8OfbYMsD/oLVyPbhZ6qKVKJaSiQicAq8MPRi4BGQmjf3bH LWpfe0QdS/0OHm4iCrZ8E8a6mC61wkV6ew6X7SvDZ6pAgcD5T7yoo84E0Pm+8j9Zy0Ew 3+pCPnBvBMV5C++dfS5L8lkQ//uNn0J99GLZq40hXZhJze9XNpQz4ZyG+ohosTzDV5fh o/+58tN0IgUlLRGlAZ+j7OeUfaNfXBye+PqQMFYcl457BCxXMPNX06beuT6hFca/dxDO IORQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TIk98Mwy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m5si2054143edi.319.2021.02.25.11.43.59; Thu, 25 Feb 2021 11:44:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TIk98Mwy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233276AbhBYTlF (ORCPT + 99 others); Thu, 25 Feb 2021 14:41:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:42622 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234355AbhBYTgw (ORCPT ); Thu, 25 Feb 2021 14:36:52 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0D63064F27; Thu, 25 Feb 2021 19:29:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614281386; bh=pjao6kRqK0VYhuK41pYwn+/iPwXCCek5r5Nlw4CqnS4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TIk98Mwyw4SCY7D8ZsQal3Zzw+0p/n+g4j4H0PD28Wpv633Sih0wXShM1g/LXGY7G Rizd/vSpb6hSxw2H3jE9x4Sw7x0SPReMU2I1sXK1wJrnFC+cAieKGhdoi0qBCn+VFc M3CfD3ErVGg/PCiZw8stFxPWx25U6y5PMlzUxjV46bxR+Ew2kY+AiPhlx/iJ/LQFKK HL/ml8wXSh6XhFYhF6WzsldgSg/5D4SBVQbXUWOgyixfH/toJTgVfPBAey5jJgpM2c DSnHHxfmAv3EPHf7G1AdloR1fBm8Xqsr2PYpkK8k+oZEUtnCpgEeY8rf9eo0KV/BOm vzi93VfDepxsw== Date: Thu, 25 Feb 2021 12:29:41 -0700 From: Nathan Chancellor To: Arnd Bergmann Cc: Masahiro Yamada , Nick Desaulniers , Arnd Bergmann , Miguel Ojeda , Kees Cook , Andrew Morton , Marco Elver , Sami Tolvanen , Arvind Sankar , Randy Dunlap , clang-built-linux@googlegroups.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] linux/compiler-clang.h: define HAVE_BUILTIN_BSWAP* Message-ID: <20210225192941.GA2026@MSI.localdomain> References: <20210225164513.3667778-1-arnd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210225164513.3667778-1-arnd@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 25, 2021 at 05:45:09PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > Separating compiler-clang.h from compiler-gcc.h inadventently dropped the > definitions of the three HAVE_BUILTIN_BSWAP macros, which requires falling > back to the open-coded version and hoping that the compiler detects it. > > Since all versions of clang support the __builtin_bswap interfaces, > add back the flags and have the headers pick these up automatically. > > This results in a 4% improvement of compilation speed for arm defconfig. > > Fixes: 815f0ddb346c ("include/linux/compiler*.h: make compiler-*.h mutually exclusive") > Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chancellor > --- > include/linux/compiler-clang.h | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h > index 6478bff6fcc2..bbfa9ff6a2ec 100644 > --- a/include/linux/compiler-clang.h > +++ b/include/linux/compiler-clang.h > @@ -33,6 +33,16 @@ > #define __no_sanitize_thread > #endif > > +/* > + * sparse (__CHECKER__) pretends to be gcc, but can't do constant > + * folding in __builtin_bswap*() (yet), so don't set these for it. > + */ > +#if defined(CONFIG_ARCH_USE_BUILTIN_BSWAP) && !defined(__CHECKER__) > +#define __HAVE_BUILTIN_BSWAP32__ > +#define __HAVE_BUILTIN_BSWAP64__ > +#define __HAVE_BUILTIN_BSWAP16__ > +#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP && !__CHECKER__ */ > + > #if __has_feature(undefined_behavior_sanitizer) > /* GCC does not have __SANITIZE_UNDEFINED__ */ > #define __no_sanitize_undefined \ > -- > 2.29.2 >