Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp962347pxb; Thu, 12 Nov 2020 23:54:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJw/4OhfSw98nxq3DeKRzdLDi8/Jlzrg1XutEaLeYe2hJwcFNxhOhuvCN92BqNBU9d+FkxGh X-Received: by 2002:aa7:d1d8:: with SMTP id g24mr1325153edp.324.1605254077459; Thu, 12 Nov 2020 23:54:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605254077; cv=none; d=google.com; s=arc-20160816; b=v+l2/jnNcR57CJmUjOK6c8cN48AnPdh39PYXms/nL9rcWfQi/lTUuD1ZAvOlaUqIhy rbqnlXVqXddAxrewbNMwy1Kpx3GvKoYm/gnjuj6wlXQ/7VubUozDQBtox7E0HPt3Oxm4 r1w0vN9KloNB/rYWHibDb9B7rszny6C3Fm0TyohMxpk06Q50ZqqyTiPXjqC+Ka+/CpLG lRki/zD7wcQy85gOSXGLwg5wgsTOZ/c60tA5HVLdVKKkxc2sr68d+IX+Ge4LVaaWuu8u LD7dZwgeb9z+jtSaZRd6ZlXBgxE0lUSJNUZlQKvrdQEvYoubvlO1u0lDFAQhAtBbqTUA /epQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=qkCTkuZb8nsRkWx2Zs7FLZzf6vDbXTKCAZnBFvzQ7XE=; b=fDfrfD8zUXClZK5/WpggWwFzl8ZUfNjo6LsSWPeZLwfTtTE/pmfkfPXlDl25AfleGH +SEetkvoJzjaaoRWsSKTHfLsw2D/nR378k0Fdr8fgAlNdWVZ4LpB+4FUN2Z9y16jT0xb thRfYCfgSfIDPdHCR92MLmCBMRWSpGiBnkAIz1naXuNLVVNQ9Q43zgORKFNd4MMuRTNA XVpzWyVJJDItaq9E/oXud+/5r0GIuqrr/gY6iUlbTnU2QnjhMLMG+Eu4XQjPhu4o3Lir Hyjuib3rqZAG1K1T9y9FPi1veq/DY26FxmtFpLAkvqAeIYyBq54LunjAjpudIDgq7Ff/ c57g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wewAVQn1; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m20si4375589ejg.474.2020.11.12.23.54.13; Thu, 12 Nov 2020 23:54:37 -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; dkim=pass header.i=@kernel.org header.s=default header.b=wewAVQn1; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726148AbgKMHue (ORCPT + 99 others); Fri, 13 Nov 2020 02:50:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:48450 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725866AbgKMHue (ORCPT ); Fri, 13 Nov 2020 02:50:34 -0500 Received: from mail-oo1-f46.google.com (mail-oo1-f46.google.com [209.85.161.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8A77D208D5 for ; Fri, 13 Nov 2020 07:50:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605253833; bh=d6BGyCcCSgbHoYMKMxTIl0AJYabKgxYHNH+q+hkvaho=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=wewAVQn1W4pd4getXESlJMCq4Vj3/AT37H2Rz5gNA0D8n1QlIfVLMj29ZlqRbSikM tt1/C6F8v/oIIS9Hu9VRcNgay1/48d8qTFmgPxXxN/vRVwBQ+zwMmEoOm5A2dmHsgz Gv88P56niLiVBD1YFbAMWaegrTsRkqxMK5ZTHZcw= Received: by mail-oo1-f46.google.com with SMTP id y3so1960252ooq.2 for ; Thu, 12 Nov 2020 23:50:33 -0800 (PST) X-Gm-Message-State: AOAM533hFWwN5MmTg7GT8XcgNXpTM6XhRifQrKnSIgmtJHaHR6pbuYOD 4rTIhFRAfQc2L51rGbhp0JgqZFO6Al7rxLiN6cE= X-Received: by 2002:a4a:8928:: with SMTP id f37mr621623ooi.41.1605253832849; Thu, 12 Nov 2020 23:50:32 -0800 (PST) MIME-Version: 1.0 References: <20201112212457.2042105-1-adrian.ratiu@collabora.com> <20201112212457.2042105-3-adrian.ratiu@collabora.com> In-Reply-To: <20201112212457.2042105-3-adrian.ratiu@collabora.com> From: Ard Biesheuvel Date: Fri, 13 Nov 2020 08:50:20 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 2/2] arm: lib: xor-neon: move pragma options to makefile To: Adrian Ratiu Cc: Linux ARM , Nathan Chancellor , Nick Desaulniers , Arnd Bergmann , Russell King , Arvind Sankar , kernel@collabora.com, clang-built-linux , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 12 Nov 2020 at 22:23, Adrian Ratiu wrote: > > 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 > So what is the status now here? How does putting -ftree-vectorize on the command line interact with Clang?