Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1088019pxb; Fri, 13 Nov 2020 04:02:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJx4TxoKToMhDKerMNxoe9a7FvkbwH/fZCh1EAQ1S28Qkr9BkA6jWeln5PDugrFjPJb+0mVR X-Received: by 2002:a05:6402:2059:: with SMTP id bc25mr2145014edb.13.1605268973317; Fri, 13 Nov 2020 04:02:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605268973; cv=none; d=google.com; s=arc-20160816; b=rKTZKgj4DDqSVWd+C7hXxrgg2jmMfvh8ahf417WJB1UdE+Byx1nSZor0OZRKG+xeVw aDbnELvISUUqgCYqlTMthWQ6OX7cXPCdByZU9KLNdDRixe3G9GyUBjBOJ2powJNouFky YQrgfhSdwxf7AY4uCUO0MUA3pHAvsvGKhjDWmiT9R7q5FxQNtvEOPCn8E8GusyffVSgl nQQxV16SfDaEd3B8t3hLhUUOBpTZU71nxMwQvGD9/4HQKfXaI8Pw2rA/IT2GW3EvAGQ1 99TrsaHPW6iiFuZmTyhBCbsvnjLXWX+k/+Iqn2cydu16DZu06Px0ogoHwkiFjuMCuwWC 7sQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=UdClbMOEBIBlBH0ZLwesm2MW8WYZ6ZeBjAW467GAWj8=; b=lURK8CfX6Z2mXWKv1Fdn4gvMVF1zveXbWlUhx/hJ8GFRo8R1ENWWkGSjO/SHtymSB1 woebDakQ6fzqgkpoaFDPavg1KfpsGF/EQACEX/UiRL9+j8n/PHWJjdQPoYAB+UCmmFkw /F9hfsCX3LfqGEMHhbhGcjXXRzXR4K6vTH/Hfk6oxDHjNW8ZnQh5uOSBh4PF9HH11/5l 3eSVK3NHvWr289QaEOysAOM5E2OHUo2Y3vyzfxoo3Q3PaeK3eh12lOA+LoCa4pMTU/e6 9C4OHjuL0jzY2YL3WcFQG/e4+DN9QaTdFH3RWV4iJI9Xw6Bb2R+GQ7byW3D7NvtURKmR sT+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lM+vBoKx; 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 bi10si956611edb.483.2020.11.13.04.02.19; Fri, 13 Nov 2020 04:02:53 -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=default header.b=lM+vBoKx; 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 S1726774AbgKMLnK (ORCPT + 99 others); Fri, 13 Nov 2020 06:43:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:33474 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726776AbgKMLlo (ORCPT ); Fri, 13 Nov 2020 06:41:44 -0500 Received: from mail-oo1-f51.google.com (mail-oo1-f51.google.com [209.85.161.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1724C2224F for ; Fri, 13 Nov 2020 11:41:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605267678; bh=IKXPZInFuWv5+BduGuX9Ec2McK9C8JFS4284M+7/ykg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=lM+vBoKxbv6L6YLuwthIY1oYPPMreS0XXqZP5fQE26ZyswUeF2R1oBIH5N/O7+be4 +L4C8tRN4faA93315ZnKT20XFJBfPSM1HW8Mp5GvlVGTGU4uSi4MhrqBwUgblSMqas KA5fkBb2cAIKlsduGofN+tzaO41a4Pg3aOr8iRm4= Received: by mail-oo1-f51.google.com with SMTP id c25so2077619ooe.13 for ; Fri, 13 Nov 2020 03:41:18 -0800 (PST) X-Gm-Message-State: AOAM5309AIluMItgS+Qr2a8ikDcIDnsOk22EyDbBD3JRJ5A4eZ/ahl79 rtYP++A6Zh0LIndeESnxscUPScXZMmYIK0tEUks= X-Received: by 2002:a4a:9806:: with SMTP id y6mr1196261ooi.45.1605267677271; Fri, 13 Nov 2020 03:41:17 -0800 (PST) MIME-Version: 1.0 References: <20201112212457.2042105-1-adrian.ratiu@collabora.com> <20201112212457.2042105-2-adrian.ratiu@collabora.com> <87mtzljz12.fsf@iwork.i-did-not-set--mail-host-address--so-tickle-me> In-Reply-To: <87mtzljz12.fsf@iwork.i-did-not-set--mail-host-address--so-tickle-me> From: Ard Biesheuvel Date: Fri, 13 Nov 2020 12:41:04 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 1/2] arm: lib: xor-neon: remove unnecessary GCC < 4.6 warning To: Adrian Ratiu Cc: Linux ARM , Nathan Chancellor , Nick Desaulniers , Arnd Bergmann , Russell King , Arvind Sankar , Collabora Kernel ML , clang-built-linux , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 13 Nov 2020 at 12:05, Adrian Ratiu wrote: > > Hi Ard, > > On Fri, 13 Nov 2020, Ard Biesheuvel wrote: > > On Thu, 12 Nov 2020 at 22:23, Adrian Ratiu > > wrote: > >> > >> From: Nathan Chancellor > >> > >> Drop warning because kernel now requires GCC >= v4.9 after > >> commit 6ec4476ac825 ("Raise gcc version requirement to 4.9"). > >> > >> Reported-by: Nick Desaulniers > >> Signed-off-by: Nathan Chancellor > >> Signed-off-by: Adrian Ratiu > > > > Again, this does not do what it says on the tin. > > > > If you want to disable the pragma for Clang, call that out in > > the commit log, and don't hide it under a GCC version change. > > I am not doing anything for Clang in this series. > > The option to auto-vectorize in Clang is enabled by default but > doesn't work for some reason (likely to do with how it computes > the cost model, so maybe not even a bug at all) and if we enable > it explicitely (eg via a Clang specific pragma) we get some > warnings we currently do not understand, so I am not changing the > Clang behaviour at the recommendation of Nick. > > So this is only for GCC as the "tin" says :) We can fix clang > separately as the Clang bug has always been present and is > unrelated. > But you are adding the IS_GCC check here, no? Is that equivalent? IOW, does Clang today identify as GCC <= 4.6? > > > > Without the pragma, the generated code is the same as the > > generic code, so it makes no sense to build xor-neon.ko at all, > > right? > > > > Yes that is correct and that is the reason why in v1 I opted to > not build xor-neon.ko for Clang anymore, but that got NACKed, so > here I'm fixing the low hanging fruit: the very obvious & clear > GCC problems. > > Fair enough. > >> --- > >> arch/arm/lib/xor-neon.c | 9 +-------- > >> 1 file changed, 1 insertion(+), 8 deletions(-) > >> > >> diff --git a/arch/arm/lib/xor-neon.c b/arch/arm/lib/xor-neon.c > >> index b99dd8e1c93f..e1e76186ec23 100644 > >> --- a/arch/arm/lib/xor-neon.c > >> +++ b/arch/arm/lib/xor-neon.c > >> @@ -19,15 +19,8 @@ MODULE_LICENSE("GPL"); > >> * -ftree-vectorize) to attempt to exploit implicit parallelism and emit > >> * NEON instructions. > >> */ > >> -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) > >> +#ifdef CONFIG_CC_IS_GCC > >> #pragma GCC optimize "tree-vectorize" > >> -#else > >> -/* > >> - * While older versions of GCC do not generate incorrect code, they fail to > >> - * recognize the parallel nature of these functions, and emit plain ARM code, > >> - * which is known to be slower than the optimized ARM code in asm-arm/xor.h. > >> - */ > >> -#warning This code requires at least version 4.6 of GCC > >> #endif > >> > >> #pragma GCC diagnostic ignored "-Wunused-variable" > >> -- > >> 2.29.2 > >>