Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2D793C77B6C for ; Thu, 13 Apr 2023 06:20:30 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C06D38598A; Thu, 13 Apr 2023 08:20:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=tinylab.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 2980885A82; Thu, 13 Apr 2023 08:20:26 +0200 (CEST) Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F33958598A for ; Thu, 13 Apr 2023 08:20:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=tinylab.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng@tinylab.org X-QQ-mid: bizesmtp73t1681366810td8d5h7o Received: from ubuntu.. ( [111.196.129.125]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 13 Apr 2023 14:20:09 +0800 (CST) X-QQ-SSF: 01200000000000D0F000000A0000000 X-QQ-FEAT: 2wWNi4M1lefy/Khm2s7MC/ERiRrxrty192o3APV+8Ign4DLNttuzPnEJQXHO4 76mD0oRtzSlHd75eaVQcnbgBBNJl+qbc5O3L70D//C+UBVleFX1MAM0KktCgtRsGPaK4Mlp yGwU8wFVK/tcMewanJXd9Kk1CqMZknPzF0NKd0kvfuHKHyb7YVHnZMp99Tji3T/aSg6IzOm lWJUO1IzX/COp+gwudcDbAIcOtMiSbDmyqvYw8kNPNW2x4uAB8Nm4ifZmk5rbI5EBQZn2D2 NGpOz/Tbtv08efIfk6eiKSR5myDjTRKZY/PSoVY8DCNlW7IwaqNh3MMm2QCgOBBmisDhceE uzZKCVb6vlxHyOai+E= X-QQ-GoodBg: 0 X-BIZMAIL-ID: 4857026238750008461 From: Bin Meng To: u-boot@lists.denx.de Cc: Rick Chen , Leo , Nikita Shubin Subject: [PATCH v2 1/9] riscv: Optimize source end address calculation in start.S Date: Thu, 13 Apr 2023 14:20:00 +0800 Message-Id: <20230413062008.981238-1-bmeng@tinylab.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz7a-0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean The __bss_start is the source end address hence load its address directly into register 't2' for optimization. Signed-off-by: Bin Meng Reviewed-by: Rick Chen --- (no changes since v1) arch/riscv/cpu/start.S | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/riscv/cpu/start.S b/arch/riscv/cpu/start.S index 4687bca3c9..3c8344c345 100644 --- a/arch/riscv/cpu/start.S +++ b/arch/riscv/cpu/start.S @@ -283,9 +283,7 @@ stack_setup: beq t0, s4, clear_bss /* skip relocation */ mv t1, s4 /* t1 <- scratch for copy_loop */ - la t3, __bss_start - sub t3, t3, t0 /* t3 <- __bss_start_ofs */ - add t2, t0, t3 /* t2 <- source end address */ + la t2, __bss_start /* t2 <- source end address */ copy_loop: LREG t5, 0(t0) -- 2.34.1