Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2756732pxb; Tue, 19 Jan 2021 05:32:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJw7+YsVas0CAWI9Jx5blwVlK3zcThpuUEWzMSUYqRg5oxgi2m7/E8kiA6y6WCQ+S6TMNQ4R X-Received: by 2002:a17:906:5e4c:: with SMTP id b12mr3037968eju.297.1611063122678; Tue, 19 Jan 2021 05:32:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611063122; cv=none; d=google.com; s=arc-20160816; b=XAz+9r0vVyhdROGtYHnvYN+pSx1PCQ1UnwTtvl3cenFW7XQ4YFFMCmwXaG7xCwNRpX s3csifZyM0zLFjrwdeUqyjBvEJU8tzQiPyhUAmc8fLGYNQ/YtVjVp/X2j6bYa5DSWr+1 7Qn5UAlmySfo25eYRysyFR+Ntg0nE0VWumv19UHT/c0YISgMRV++yBBhZBymiWVXM7Xl itxbEKAtK+yI7Y4psri8zNx1GXvySzL3qsT838sghDXuYx+JXGa/IoZvUWp4CBCpgqGh QbR5rI9t2+9Izao3i3u12Zo8Pmf0uFbWptsPGII68uoio7gNBNtsCcnQ14pfu1/f+Elq xr6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=hlS3Sknu8hUQPnz1MRlov1O+XRd2hcGfShWoQFazYbg=; b=r7RmE+xdqAlomB6iK3juZELnCUAUKxbV9PqxqKygJPL1QLfjWuj2qjXvnZAMvg1jfN EPx+5jTloIFxEF/Cv6tIcyREZV1p1XPOpiqt7f1ZurMDCDop14rvV+mbw2OFCqwAGCb3 +MMRXe6wVm/iVfBiV5GYwQsElHzj/PnjeyWt8bbpGd8IaQwcVw1EsmU3XvAGPv66O4AO jTD+vSDlzv1/+jb7HSL497uAjv3TIDnl40vGxzM0j7KXOves9uK7lK9T5Co8+TVp5lgI GGNdyIoGvd4r6H/NM7f5HcsIhtgnzLC7otXvV7Ods+avql78QEQGksShhM0rLNEuy/gw mB9w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mb27si2751630ejb.165.2021.01.19.05.31.39; Tue, 19 Jan 2021 05:32:02 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393045AbhASN2f (ORCPT + 99 others); Tue, 19 Jan 2021 08:28:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391951AbhASNSf (ORCPT ); Tue, 19 Jan 2021 08:18:35 -0500 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84CF8C061575 for ; Tue, 19 Jan 2021 05:17:33 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: aratiu) with ESMTPSA id D0B0C1F451BA From: Adrian Ratiu To: linux-arm-kernel@lists.infradead.org Cc: Nathan Chancellor , Nick Desaulniers , Arnd Bergmann , Russell King , Ard Biesheuvel , Arvind Sankar , clang-built-linux , kernel@collabora.com, Linux Kernel Mailing List Subject: [PATCH v4 1/2] arm: lib: xor-neon: remove unnecessary GCC < 4.6 warning Date: Tue, 19 Jan 2021 15:17:23 +0200 Message-Id: <20210119131724.308884-2-adrian.ratiu@collabora.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210119131724.308884-1-adrian.ratiu@collabora.com> References: <20210119131724.308884-1-adrian.ratiu@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Chancellor Drop warning because kernel now requires GCC >= v4.9 after commit 6ec4476ac825 ("Raise gcc version requirement to 4.9") and clarify that -ftree-vectorize now always needs enabling for GCC by directly testing the presence of CONFIG_CC_IS_GCC. Another reason to remove the warning is that Clang exposes itself as GCC < 4.6 so it triggers the warning about GCC which doesn't make much sense and misleads Clang users by telling them to update GCC. Because Clang is now supported by the kernel print a clear Clang-specific warning. Link: https://github.com/ClangBuiltLinux/linux/issues/496 Link: https://github.com/ClangBuiltLinux/linux/issues/503 Reported-by: Nick Desaulniers Reviewed-by: Nick Desaulniers Signed-off-by: Nathan Chancellor Signed-off-by: Adrian Ratiu --- arch/arm/lib/xor-neon.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/arch/arm/lib/xor-neon.c b/arch/arm/lib/xor-neon.c index b99dd8e1c93f..f9f3601cc2d1 100644 --- a/arch/arm/lib/xor-neon.c +++ b/arch/arm/lib/xor-neon.c @@ -14,20 +14,22 @@ MODULE_LICENSE("GPL"); #error You should compile this file with '-march=armv7-a -mfloat-abi=softfp -mfpu=neon' #endif +/* + * TODO: Even though -ftree-vectorize is enabled by default in Clang, the + * compiler does not produce vectorized code due to its cost model. + * See: https://github.com/ClangBuiltLinux/linux/issues/503 + */ +#ifdef CONFIG_CC_IS_CLANG +#warning Clang does not vectorize code in this file. +#endif + /* * Pull in the reference implementations while instructing GCC (through * -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.30.0