From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCF6FC2D0E4 for ; Thu, 12 Nov 2020 21:40:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 63D32216FD for ; Thu, 12 Nov 2020 21:40:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="cOF2ey3p" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727257AbgKLVkU (ORCPT ); Thu, 12 Nov 2020 16:40:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726960AbgKLVkU (ORCPT ); Thu, 12 Nov 2020 16:40:20 -0500 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 083D6C0613D1 for ; Thu, 12 Nov 2020 13:40:20 -0800 (PST) Received: by mail-pl1-x643.google.com with SMTP id d3so3482786plo.4 for ; Thu, 12 Nov 2020 13:40:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GIyDKMHXNrYMltrg0Ujyp5HW7ajXeXqAEMraB5j3fgw=; b=cOF2ey3p32E/WPRacgmh1fqaFaYNQO2Ze5R+m28PA1t4QjIOuo6JuYSRX9nAaPKo3n rwK7yxWwaMYB1h1lG0459LkGnP24QJGWjAhaqZeDjTKIHTBD34EAEBNK/tG77r2JzxpD /MKW6/x2jgihNtDKEKlIsvcA9aNEqh56IEXOq52dSukXleXMs5lDv+1JicPVdJIB2GbR nPJBk6cKGp055Hn/pUjiccTc6E+xup/P/rw1DvkIQ3DA/kVcJUOqyQLQtppeOjI/baYf LJuJlhBRXN2J+8XFbTmJi3AN5f6CKQ9PCrqO5/T25J2KV0rk3UDtoADIKJn5XNAk65Lh m6PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GIyDKMHXNrYMltrg0Ujyp5HW7ajXeXqAEMraB5j3fgw=; b=H0xa4a4ikM0CGT+nWCHB75LYkx+xh8IHQvh8BKcDwUFiJoRC+HLCWlA0CIbHkARumU VHSnBmi6Hx7tak9wHKwp7l1S8A74nzNnMCtJ7jUvAMTToDaaS5IuhNOUXg6XSSsTIbxd aSnltr9DvO/EffvQa0kFzkAf7G8qb7pt+WxcOvJXAd7t9VVhNSdMpBKSQL1MH3kvg6HQ o8E+JDhoPrOsiOe9p0UWYkGjkKf19e336KmhdA6kpT3lPykdL/O8OzfR7wWqzVcSs21u JeaZ8oCmFe+xClA+zTIsTGA+XoWLNkKA3mmNP72E4KpTq3Qc4xscFYPUHB0e7FeGSZRf QsFw== X-Gm-Message-State: AOAM531UpnhBTQPoRL4YS+g0dT91duY0KnfRxZAa1x/Pww4tR5icMyPy aNQklkSbowl2fuZ1mEx6wii7FjNKH157tblCXyYRHg== X-Google-Smtp-Source: ABdhPJznItuRRJQmJBKENd+Q0531MmGeJWXEhK6Ijzu6puZ+ZDzXCwLJ5bSRXvVnMHZ1eWlsSBSpEitWFibpJq6qW5A= X-Received: by 2002:a17:902:760c:b029:d6:efa5:4cdd with SMTP id k12-20020a170902760cb02900d6efa54cddmr1142305pll.56.1605217219357; Thu, 12 Nov 2020 13:40:19 -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: Nick Desaulniers Date: Thu, 12 Nov 2020 13:40:08 -0800 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 , Arnd Bergmann , Russell King , Ard Biesheuvel , Arvind Sankar , Collabora Kernel ML , 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, Nov 12, 2020 at 1:23 PM 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 Reviewed-by: Nick Desaulniers > --- > 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 > -- Thanks, ~Nick Desaulniers From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48A18C2D0E4 for ; Thu, 12 Nov 2020 21:41:35 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A09F120657 for ; Thu, 12 Nov 2020 21:41:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="d/BX19PW"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="cOF2ey3p" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A09F120657 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=NAXMcloD1cDRKLXjA72v4BbuiuiS3ke9WZL5JJluG44=; b=d/BX19PWyO7pElIrtAhJt2ikE yJJY4IIirV/rqZFp2Ev/MfXtieZV7BbAmtuMBfwNoBc2aap7+8Ql84zSjU7pPZwtah5G65r5hURei Bys0H91bNw7omcLJyEkjL/FHGKj6dm98H1tdGFKk51EPw9MU9JuMDz5Xcbj8FmbRvKvjX6mLljYw+ 7FjGWn6zuYDRPo9oeV115yi0D1Kn8tHZVYEMt/lh6wuQWUOK3zT+rO8916sc9HTX+rY+OoXyg3WjF FIh4Tlf5QcODckFBMApZMEPL7edbPylKZriemkA3dg1haacR9ljUcg5micqaj154kHlAtPwzXVNzx 1yE13cR0Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdKKN-0005nh-NO; Thu, 12 Nov 2020 21:40:23 +0000 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdKKL-0005mz-N5 for linux-arm-kernel@lists.infradead.org; Thu, 12 Nov 2020 21:40:22 +0000 Received: by mail-pl1-x642.google.com with SMTP id z1so3467739plo.12 for ; Thu, 12 Nov 2020 13:40:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GIyDKMHXNrYMltrg0Ujyp5HW7ajXeXqAEMraB5j3fgw=; b=cOF2ey3p32E/WPRacgmh1fqaFaYNQO2Ze5R+m28PA1t4QjIOuo6JuYSRX9nAaPKo3n rwK7yxWwaMYB1h1lG0459LkGnP24QJGWjAhaqZeDjTKIHTBD34EAEBNK/tG77r2JzxpD /MKW6/x2jgihNtDKEKlIsvcA9aNEqh56IEXOq52dSukXleXMs5lDv+1JicPVdJIB2GbR nPJBk6cKGp055Hn/pUjiccTc6E+xup/P/rw1DvkIQ3DA/kVcJUOqyQLQtppeOjI/baYf LJuJlhBRXN2J+8XFbTmJi3AN5f6CKQ9PCrqO5/T25J2KV0rk3UDtoADIKJn5XNAk65Lh m6PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GIyDKMHXNrYMltrg0Ujyp5HW7ajXeXqAEMraB5j3fgw=; b=SFP6aoyTQmwZNrW6vqDYUymI8V5GofBYYgMtIOkZTWXD27D23s4cw9S6I2qxNCQBz7 Vc8yNXzsW5j6qm7d/LJWGv/PwilCnFQkI8y53+mbwHN997TpEffLTkQeDl5m9nQ1a4Dc QcDuqJkljoObuwYMXcWvkbmy+UQM7rNv+W6UYyx3Yd3faAs9lGGA8HS+RBBZPv2Yhj6d j5DFKxhF15HmRHc8h0yDJETvXgeBug3Nmr9KRkcLHDRVpSyuIUzhuwEi7jiDjYsa1udM kvveYv4yOAflufnI0PQjO4gPnsC2p+g7nNCp6KKYCROD8bQRFjNoBFt0qbyetgnzI0XT CzgQ== X-Gm-Message-State: AOAM531KRsUUzd99Bz75qdUfDsD7FheabIwZBH2yRmHIY/YHxSroev7U 096amSqoWjtIsRzjNSnWyVIgONHP+KBWHKg3YvTimQ== X-Google-Smtp-Source: ABdhPJznItuRRJQmJBKENd+Q0531MmGeJWXEhK6Ijzu6puZ+ZDzXCwLJ5bSRXvVnMHZ1eWlsSBSpEitWFibpJq6qW5A= X-Received: by 2002:a17:902:760c:b029:d6:efa5:4cdd with SMTP id k12-20020a170902760cb02900d6efa54cddmr1142305pll.56.1605217219357; Thu, 12 Nov 2020 13:40:19 -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: Nick Desaulniers Date: Thu, 12 Nov 2020 13:40:08 -0800 Message-ID: Subject: Re: [PATCH v2 2/2] arm: lib: xor-neon: move pragma options to makefile To: Adrian Ratiu X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201112_164021_836624_6438A9BF X-CRM114-Status: GOOD ( 21.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Russell King , Linux Kernel Mailing List , clang-built-linux , Arvind Sankar , Nathan Chancellor , Collabora Kernel ML , Ard Biesheuvel , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Nov 12, 2020 at 1:23 PM 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 Reviewed-by: Nick Desaulniers > --- > 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 > -- Thanks, ~Nick Desaulniers _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel