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=-14.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,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 6BC73C433E6 for ; Fri, 28 Aug 2020 18:16:04 +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 40E072074A for ; Fri, 28 Aug 2020 18:16:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="zhn6iOil"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="YDsf+01D" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 40E072074A 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=zhn6iOilquJyI8FZYJtHgvGiS tZg5tWeKkpkqF/RZ4iI88Mhij92yQ9D9///wwI/i8UD3DCfWqbEmN0LjxhLNyw59/F2SbY4IS7IhY bmZcokHsjSp/lLEY+bA8d88QxHTUqA2MKUj83czY/M0jM9pImTfc8Wu1iAdMVXGTLKJ/VZNskD1w4 U4n9vTmIOFghUTa6CLJ/bLm0wg5oS5c8GN9tD9UP7gk3dtqZnjZP+75C60JNcys9YJjdVtINEyCTL n8UecMZ59gwQDgVA6ZzM1QeAKpzHuBxdIGIMX5rF6m6khEsAAfM/5lglwqqIy/I3yLePcvY8t8Wdo /VOEsfURg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBitd-0004gQ-Cx; Fri, 28 Aug 2020 18:14:41 +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 1kBitU-0004eO-Qb for linux-arm-kernel@lists.infradead.org; Fri, 28 Aug 2020 18:14:33 +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 BD11820936; Fri, 28 Aug 2020 18:14:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598638472; bh=8kO9Cupeozw8bmO2vUZJanWwJOm6x0asIwSORo65o2Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YDsf+01D96Hu7u0ptdoXuwpaKwhHK8VCLMu6lwvWsbNvwWv6s3bsA4vt+u1wH2WZ4 +uJglZS01ArffDZc59qKkLYQryNPf4E1dXwbhkvw8ThqFXkcPe7Y0Wz4rpC7wXiaQv uKUmvGNrNGUnHc+zFxMxWgeSMyMggj5X8CRh48zg= From: Mark Brown To: Catalin Marinas , Will Deacon Subject: [PATCH v4 3/8] arm64/fpsimdmacros: Allow the macro "for" to be used in more cases Date: Fri, 28 Aug 2020 19:11:50 +0100 Message-Id: <20200828181155.17745-4-broonie@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200828181155.17745-1-broonie@kernel.org> References: <20200828181155.17745-1-broonie@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200828_141432_962102_D198BFFF X-CRM114-Status: GOOD ( 13.62 ) 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 , 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