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=-13.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 876CCC43464 for ; Mon, 21 Sep 2020 12:39:28 +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 22C2E20756 for ; Mon, 21 Sep 2020 12:39:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SEgARWyu"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="bAKi4FUt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 22C2E20756 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=LW55GAH+IQq+LufSpMX+7Vgle09yTxW8GqxKlC0EobQ=; b=SEgARWyu1Vp9iZ+6aOfYN3aNl hBGYWudSgW7vuXm4Yxb6/05kMv6Sj/MH9uCrTikX2+STrC/b4d+ZQnoj/speO2P22Wr42DoH6az2z wrKgZ7UFXrVwGStB9IJpYBEkQyBsPQkk4khzLvIHKoWfT4mG/G2+GgTmhnioRTPJGVwx9u7UAm6Br bKaks7LAvh4b/ok/Y1O9PYzDd8h5FRV9MSmK/vFNMuh9nDr65HE4Cr7cK+5p+jkdsFa+rlX6djxTZ f0UvBRlScXSBM6vnN9hnKBmw7MLX2iUGXcx02+cF8OSmKxibZhdsM5OqjsxPMF9LpDUlIKr6RzD8H bY+0DvrkA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKL59-0000Wj-Ub; Mon, 21 Sep 2020 12:38:12 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKL57-0000WC-0v for linux-arm-kernel@lists.infradead.org; Mon, 21 Sep 2020 12:38:09 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E1EAB20756; Mon, 21 Sep 2020 12:38:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600691888; bh=hXSj2k3fV8zkhuuuw/ArhLWUnOm0tJzQIR4T/Q1t8IY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bAKi4FUtgUENt7FD2Ty2cIM4Ew5EOu4p7Vk+kr5A+dO6o9XuyTnwkqREeBrpXL5He hAp2UvJzh109iNYDmHlEhGeP/xprswi6CL29E7GLzSiOjWNoJ65hCAZFUAriNtRas+ Q6UGh94HAwPSzDA/VgD2BnCgE26OcCboGgZ90+9M= Date: Mon, 21 Sep 2020 13:38:03 +0100 From: Will Deacon To: Mark Brown Subject: Re: [PATCH v4 3/8] arm64/fpsimdmacros: Allow the macro "for" to be used in more cases Message-ID: <20200921123802.GG2139@willie-the-truck> References: <20200828181155.17745-1-broonie@kernel.org> <20200828181155.17745-4-broonie@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200828181155.17745-4-broonie@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200921_083809_229597_179D9ADA X-CRM114-Status: GOOD ( 22.47 ) 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: Julien Grall , Catalin Marinas , Zhang Lei , Julien Grall , Dave Martin , linux-arm-kernel@lists.infradead.org, Daniel Kiss 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 Fri, Aug 28, 2020 at 07:11:50PM +0100, Mark Brown wrote: > From: Julien Grall > > The current version of the macro "for" is not able to work when the > counter is used to generate registers using mnemonics. This is because > gas is not able to evaluate the expression generated if used in > register's name (i.e x\n). > > Gas offers a way to evaluate macro arguments by using % in front of > them under the alternate macro mode. altmacro mode doesn't appear to be very widely used in the kernel at all, so I'm a bit nervous about this. > The implementation of "for" is updated to use the alternate macro mode > and %, so we can use the macro in more cases. As the alternate macro > mode may have side-effects, this is disabled when expanding the body. > > While it is enough to prefix the argument of the macro "__for_body" > with %, the arguments of "__for" are also prefixed to get a more > bearable value in case of compilation error. > > Suggested-by: Dave Martin > Signed-off-by: Julien Grall > Reviewed-by: Dave Martin > Signed-off-by: Mark Brown > --- > arch/arm64/include/asm/fpsimdmacros.h | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/arch/arm64/include/asm/fpsimdmacros.h b/arch/arm64/include/asm/fpsimdmacros.h > index 636e9d9c7929..75293f111a6b 100644 > --- a/arch/arm64/include/asm/fpsimdmacros.h > +++ b/arch/arm64/include/asm/fpsimdmacros.h > @@ -166,19 +166,23 @@ > > .macro __for from:req, to:req > .if (\from) == (\to) > - _for__body \from > + _for__body %\from > .else > - __for \from, (\from) + ((\to) - (\from)) / 2 > - __for (\from) + ((\to) - (\from)) / 2 + 1, \to > + __for %\from, %((\from) + ((\to) - (\from)) / 2) > + __for %((\from) + ((\to) - (\from)) / 2 + 1), %\to > .endif > .endm > > .macro _for var:req, from:req, to:req, insn:vararg > .macro _for__body \var:req > + .noaltmacro > \insn > + .altmacro Why do we need to disable alt macro mode here? > .endm > > + .altmacro > __for \from, \to > + .noaltmacro Why do we enable it here, rather than in the __for macro itself? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel