Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1323563pxb; Fri, 13 Nov 2020 09:38:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+96ps1IMPvb/6NmdbEl3p+KirVmBp//asOy3vrTogQWOSKlH6bFOW2GA65v5tRF9jLzTZ X-Received: by 2002:a17:906:180b:: with SMTP id v11mr3007462eje.466.1605289097540; Fri, 13 Nov 2020 09:38:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605289097; cv=none; d=google.com; s=arc-20160816; b=ghZC+pIUVrN/f1JS8sHU+gI/MBnY+cMF4gI764wJ6ky8VOZqJgaazWADOf8yIO5VjW RDlehq//pSVvVL9AY/0L7+uPlPLTK7zjp8/CX+CgGp+Ln/qnxByIQJmbq47abaF8OT59 RM9JD6YDVopa7CxqDJep6/zJPBN/Clt03WMasaIGIDwQEzNXzvyQxjgzClD/XLJJG0MY O7FTyQZOXYyMIew2LvMlZSe7aWkqJQsVwkIvJRxRhVFUtcWioPTCeTqzduV4N0sfrLOq Z9NlJ+mf8TgnD+4BU29mUnCYDjZZMzIK9u4guOJWT/T5SI2dX1/48vV7OwMtbviUuN5q 58ag== 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=zUqXwmc7DHIdanJF7lei+LTeTtZZ0JKdZPSsChH/Pck=; b=ZLmu+sT2zTql2MSc6EqCf9NrDHrNzmoWlFRuDOY9DZMkjrV7Ykhr3X64L3Gdx4ohO7 cJASa+RU9aQJZUALQsEmC47iEa5QIfjUpzR6RWYQKJYYx20uhTVWOJ/sVf73qAF6xBPa AWSjzBo1xDXCqBYCDWAtaRZBjg/iJZztzTw0Go/nLV1RAqEwVhwc8B3FH2k8yu8wibcH wsLbEgEDres52LdypoRN0oM3/tPNadbpOEMqedb7nGtNEHnIBWEgX0iCAm/NX3PHjo35 JIW40dJqqOiuhBywZYhVWw1tLJhGWBzfuLXsTT3LKLCmERjsj3oMtFiJ6vPvn+M56Vmv GNMg== 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 y25si5742583ejc.325.2020.11.13.09.37.54; Fri, 13 Nov 2020 09:38:17 -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 S1726913AbgKMRfx (ORCPT + 99 others); Fri, 13 Nov 2020 12:35:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726136AbgKMRfv (ORCPT ); Fri, 13 Nov 2020 12:35:51 -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 4332FC0613D1 for ; Fri, 13 Nov 2020 09:35:51 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: aratiu) with ESMTPSA id 62B781F46B64 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 v3 2/2] arm: lib: xor-neon: move pragma options to makefile Date: Fri, 13 Nov 2020 19:37:23 +0200 Message-Id: <20201113173723.2078845-3-adrian.ratiu@collabora.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201113173723.2078845-1-adrian.ratiu@collabora.com> References: <20201113173723.2078845-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.29.2