Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2753834pxb; Tue, 19 Jan 2021 05:27:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJz9t/EVWaSroga+e9HdVoamab5Hnu/zxX3hwGHvezbETZCP/6ew+lXDUlXhz9x2Ze8FC830 X-Received: by 2002:a17:906:351a:: with SMTP id r26mr2860842eja.204.1611062852563; Tue, 19 Jan 2021 05:27:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611062852; cv=none; d=google.com; s=arc-20160816; b=qjoNX/LlRZWzyP5fKy5C0bGLwYSeh/+qp/60LGSHfT3zB7IfxMSM56X6E5TQ5Nel9l lX1az/93l/HjZwnub1LpAmpwjYSPHaq1l7osFy6MwK1ZmdoM/DPBBRjLuuo9f+xr+O4S 47s5CpP+JJkMQv9Qrlo1AtqeN2XLzOzM2+xOM0it6LD4gcUAgMGRbfY7sfHuvuGTt9Z7 aLyxo5rOMyxnmW3bDlvbAlh4oN/R2bIU2oidoClwkJSJLUCsJPCjR9NxnvVlJ7D23Z6a m0SEwCAsF4yn5R18r7z4JLSd597k9yZnAxvmxXhr4vJXOwL+XBS7UinXurwewRq3NouE YAIA== 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=RI2VKPJGwl6xl9G5NX50pXLus2Qtocpv10YGrxU4qdI=; b=NZ1fj/7A7Lj2psBVQBV9qE7TcgmB7pJV/QwzhG2tjd3lGOeVKAAJKxD+8fnCu0gQE5 HAupnH7NbnlLSxpIxIT4dLuCZUOAXXil9YRQ47vKUuIZ4DldP7Qm9U+lrQayASrR0FFa 0gPQrh8xaooeBl5C31x7ruNrRLvmwGZIA0hwZ6DEBcMX2Vr0pfkuZ4qcse8TDrRyrEDS pm/wELAODik8f/EmQQeljNAC93uBMnTh0Cgs12pG8y+JBlRB8JX8jd/6nHl36VlHgZVK V8bU1HTVD/PY4Hhaji+dFK2lS6hQ5+83b0OvfZOVRybDhrzkbcFk5/dJKwG8CATIFQao Cp0g== 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 dn23si8303337edb.27.2021.01.19.05.27.09; Tue, 19 Jan 2021 05:27:32 -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 S2389204AbhASNYd (ORCPT + 99 others); Tue, 19 Jan 2021 08:24:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392307AbhASNSf (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 303EDC0613CF for ; Tue, 19 Jan 2021 05:17:34 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: aratiu) with ESMTPSA id 629A41F451BC 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 2/2] arm: lib: xor-neon: move pragma options to makefile Date: Tue, 19 Jan 2021 15:17:24 +0200 Message-Id: <20210119131724.308884-3-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 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 f9f3601cc2d1..65125ce69044 100644 --- a/arch/arm/lib/xor-neon.c +++ b/arch/arm/lib/xor-neon.c @@ -23,16 +23,6 @@ MODULE_LICENSE("GPL"); #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. - */ -#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