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=-10.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT 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 39A94C433E2 for ; Mon, 29 Jun 2020 13:42:40 +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 0770923B06 for ; Mon, 29 Jun 2020 13:42:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="vpcKZA0u"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="kV/IUQdC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0770923B06 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:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=pl7xsVw3U6kXASCG2ZTqa5ge4qfOgvZaJzK1M10lzkE=; b=vpcKZA0uB5n+YJDZnEPTbfZQO 5jE7Hq//TINm7Wr3vP2rtEqRN/hiD0Pg0ZRi+vYJxqUiNIH5Q6baqc8Qy5VErQFYjexk9DHb9wyiC sTvNXCikZrFyuuG3Z2N9kjNIjsWLkMEPXBhPHwuIdbGCtS/cEpnEzLLhHvOzxKqK9A9GDxtCr0BiG PTKqCsmSkJCTSDpqwkm8883POqGEW92giyR/96M5FqlJsvdm52yfVPzgelCHzz0cE0RvL1kr0bZoj k3fwEHSowZpf2ihB3d4WcAGUUJbL4HzL4K1wiuYa60RbywF53SrsD1qUPW9pYz6OVAozqWfO46WFK yz8DBe9eQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpu25-000101-Tc; Mon, 29 Jun 2020 13:41:13 +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 1jpu20-0000yu-1D for linux-arm-kernel@lists.infradead.org; Mon, 29 Jun 2020 13:41:09 +0000 Received: from localhost (fw-tnat.cambridge.arm.com [217.140.96.140]) (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 E47C223D6C; Mon, 29 Jun 2020 13:41:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593438067; bh=8kO9Cupeozw8bmO2vUZJanWwJOm6x0asIwSORo65o2Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kV/IUQdC4UbqOz3bqtM+xh73osmP2NS6/BErEtr6l/2grSv8rQfx85JuKmX9NixuA RqFKaWVkD3s4HZ/he3B88LAlaHpERYCmVneQJ+RNLm/RimUug/3MsibbHsnmViymLy 3+B7X32rCeSu+30AUc9/6e8kYePzTm6HkwDJ56yo= From: Mark Brown To: Catalin Marinas , Will Deacon Subject: [PATCH v3 3/8] arm64/fpsimdmacros: Allow the macro "for" to be used in more cases Date: Mon, 29 Jun 2020 14:35:51 +0100 Message-Id: <20200629133556.39825-4-broonie@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200629133556.39825-1-broonie@kernel.org> References: <20200629133556.39825-1-broonie@kernel.org> MIME-Version: 1.0 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 , zhang.lei@jp.fujitsu.com, Julien Grall , Mark Brown , 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 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. 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 .endm + .altmacro __for \from, \to + .noaltmacro .purgem _for__body .endm -- 2.20.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel