Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1900943pxb; Mon, 18 Jan 2021 03:01:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJztkeN63aDYHfsJS9W3JKMNDyybqOyF02+PE7QsGypFro6gczvD5l/ndIOhFrmHDTtBp/t+ X-Received: by 2002:a17:906:3883:: with SMTP id q3mr16781517ejd.160.1610967694220; Mon, 18 Jan 2021 03:01:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610967694; cv=none; d=google.com; s=arc-20160816; b=CGYvf3K9owLsn9jRx8auo7trpHXWw61kNHm2q24eedyKDrwjJokpfQ3fm2nJvWKaXF rYi9rfGkN15D4sDvaQdiLs+8jBACjLhMGO0p3JEOHtZhYzsu+bpjxchZGHRYbBUen4b1 ethAamV5z9N3FXBfl2o/HvWtmet4QotLfaCZ4nGPxNsLuiBI6AwTPqU5BSmBpZ1pxhBj 308Ycs+kupgGZQTy1+iPcTsuE0rVQisjNWOFT87n8f61obZSSOuHxyIL03jZcvfWHJxg ivbvVxJw4MLQpwHDvPw2zsUigum+Db0AXbxL6XSUT41UfmpYuMwrsCQieQJfEdlrZiHa sDUQ== 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=c3uZtUbiH9x3eSUMc2oVq0lJMIpkwWlD6NCy+AN5NdQ=; b=AG2PoKprGnOo5XYBo+5WltURFWp+lOGUbKpY6fxpQkSHVTn46a1qT9ErDkYKtjh07Y ETa/yhkM/4rLICGWD/0SceTp7OPigmWG5bvD7V1/9OWtDLMURbJLM0nNExykUgcwJDY4 tDsS9+zwC5iiNMOL9UQLLw6SnzG1SJvOvxhRLtfbiNeVbyBmCmWiT7iOmxb+UoRdm/rX +MuvA0s50a2hk234OBxt67pqi96P0b+qcPuS41oLl85yXs9IGd2T+PeENt7EW68fl4I8 rTFNHlUaeIB4ZZENIttlr8KTNz5I5FJuS2pC4SKO6WcXxG3WkUkUlmfJ7H4jD5o4VPBw yOjQ== 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 t13si7279262edi.21.2021.01.18.03.01.10; Mon, 18 Jan 2021 03:01:34 -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 S2389702AbhARK6L (ORCPT + 99 others); Mon, 18 Jan 2021 05:58:11 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:42296 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389186AbhARK5O (ORCPT ); Mon, 18 Jan 2021 05:57:14 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: aratiu) with ESMTPSA id 6BB681F44C3B 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 v3 RESEND 2/2] arm: lib: xor-neon: move pragma options to makefile Date: Mon, 18 Jan 2021 12:55:57 +0200 Message-Id: <20210118105557.186614-3-adrian.ratiu@collabora.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210118105557.186614-1-adrian.ratiu@collabora.com> References: <20210118105557.186614-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 Using a pragma like GCC optimize is a bad idea because it tags all functions with an __attribute__((optimize)) which replaces optimization options rather than appending so could result in dropping important flags. Not recommended for production use. Because these options should always be enabled for this file, it's better to set them via command line. tree-vectorize is on by default in Clang, but it doesn't hurt to make it explicit. Suggested-by: Arvind Sankar Suggested-by: Ard Biesheuvel Reviewed-by: Nick Desaulniers Reviewed-by: Nathan Chancellor Signed-off-by: Adrian Ratiu --- arch/arm/lib/Makefile | 2 +- arch/arm/lib/xor-neon.c | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index 6d2ba454f25b..12d31d1a7630 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile @@ -45,6 +45,6 @@ $(obj)/csumpartialcopyuser.o: $(obj)/csumpartialcopygeneric.S ifeq ($(CONFIG_KERNEL_MODE_NEON),y) NEON_FLAGS := -march=armv7-a -mfloat-abi=softfp -mfpu=neon - CFLAGS_xor-neon.o += $(NEON_FLAGS) + CFLAGS_xor-neon.o += $(NEON_FLAGS) -ftree-vectorize -Wno-unused-variable obj-$(CONFIG_XOR_BLOCKS) += xor-neon.o endif diff --git a/arch/arm/lib/xor-neon.c b/arch/arm/lib/xor-neon.c index e1e76186ec23..62b493e386c4 100644 --- a/arch/arm/lib/xor-neon.c +++ b/arch/arm/lib/xor-neon.c @@ -14,16 +14,6 @@ MODULE_LICENSE("GPL"); #error You should compile this file with '-march=armv7-a -mfloat-abi=softfp -mfpu=neon' #endif -/* - * Pull in the reference implementations while instructing GCC (through - * -ftree-vectorize) to attempt to exploit implicit parallelism and emit - * NEON instructions. - */ -#ifdef CONFIG_CC_IS_GCC -#pragma GCC optimize "tree-vectorize" -#endif - -#pragma GCC diagnostic ignored "-Wunused-variable" #include struct xor_block_template const xor_block_neon_inner = { -- 2.30.0