Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp674735pxb; Thu, 12 Nov 2020 13:26:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJyA6hKnzYmtZZ4XD6nz/DMK4GMT5q9nu8O6zw5Zi3AIlpL/OKVRAV3WCS04QWhnFDEWpvqI X-Received: by 2002:a17:906:adcd:: with SMTP id lb13mr1268694ejb.362.1605216380170; Thu, 12 Nov 2020 13:26:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605216380; cv=none; d=google.com; s=arc-20160816; b=SHgrfwtQw3zHaamjtoGRxu/cBnQx0SwcaAnD0Oqf+P4kV4nqMIwt1+MNfGo1BIIReS Lvc/786eEJgP2NdjwADDXkp0whpvEXVw/NL56kgKWew4dzQtef2oG3hqhYBv7+LfBrml J/Esj5SnpV58SlmGm4U0pqE8eGBuXAaFBvHYsYXTtAszwWCeKlUVGCu/3FkxvKlLN6e1 +D/Thk3tHB/CYwSGh7RT2C/n9mCLFhY1k1oYYWk6bKYR/CAzi4iX2rpzPQ+RMhjdyUcx bLuPUK/2FdsVbaLWZoGVQnQYJYrZ3DqowP1iGpoSmeViVIk6lPbWVptUdB4d0PB1cemg ezMA== 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=vMvcgy40GL32s46Dq291Ixh7h0LtTGwZzVEMpamMjqI=; b=EQFjYPxTakjvKrTp8qXHOouezVXhVnV9RmcP726w8tI1MEHw6Pp5u6jUpBrJ4vJnPD 6zyOBslD1HcR2w29Sxd5n+0OljxVtKAKmLscRJp/ww8r3CzyySHwXS2yhfn3IB2rd3FD YTraWhTC10XENbk0U0BIGa7mGBVXqhrtMMAACAqavMYiHtRfligceGkUrnlhRKZx+DTn vDJ/adoHKQKksbB0/yiNoBbVK5RXgA2RA4Wix9LNyvZJy8FU9RIzu6godLvCwhVZqzdO GtALkDs5m3QbCw+b3tnuafEDSz1M8nJaJ3oMHSDRGQsMu8lcIf8VQpI8C54xUNist8EQ elZw== 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 c15si5095827edf.17.2020.11.12.13.25.57; Thu, 12 Nov 2020 13:26:20 -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 S1727344AbgKLVXl (ORCPT + 99 others); Thu, 12 Nov 2020 16:23:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726337AbgKLVXk (ORCPT ); Thu, 12 Nov 2020 16:23:40 -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 BA2D0C0613D1 for ; Thu, 12 Nov 2020 13:23:39 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: aratiu) with ESMTPSA id 281D11F466C9 From: Adrian Ratiu To: linux-arm-kernel@lists.infradead.org Cc: Nathan Chancellor , Nick Desaulniers , Arnd Bergmann , Russell King , Ard Biesheuvel , Arvind Sankar , kernel@collabora.com, clang-built-linux , Linux Kernel Mailing List Subject: [PATCH v2 2/2] arm: lib: xor-neon: move pragma options to makefile Date: Thu, 12 Nov 2020 23:24:57 +0200 Message-Id: <20201112212457.2042105-3-adrian.ratiu@collabora.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201112212457.2042105-1-adrian.ratiu@collabora.com> References: <20201112212457.2042105-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 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.29.2