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 37BE4C6FD1D for ; Thu, 30 Mar 2023 12:36:26 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 89C0385E35; Thu, 30 Mar 2023 14:36:23 +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 EB97185D8B; Thu, 30 Mar 2023 06:20:41 +0200 (CEST) Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.221.58]) (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 A26E1856E5 for ; Thu, 30 Mar 2023 06:20:36 +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: bizesmtp81t1680150026t8203gyw Received: from ubuntu.. ( [111.196.129.125]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 30 Mar 2023 12:20:24 +0800 (CST) X-QQ-SSF: 01200000000000D0E000000A0000000 X-QQ-FEAT: CR3LFp2JE4knx4A2Mrdy2Daqf2xWvocrqKDf7tNHeuQj8aNSVpBedF0x60oSU nXeZU08aXbeULau7lUlXvBPcf3BCL6dMV9TpjmzxHykUSmWa7IQaeqSC6mNDlzyPucbG7er Ri/gd4ElYO0H/v7eO3ZhxLT2WpvBc/gckiQMKFN/pC4FIxC6x4BI/LjcnV/OERJyD26okMn u/+V0Yr6qjEeLbnzoSZxP9VL2mmsrvkdO/sOD9L9aG2SFboAVSZD7bn2w9MhytkBMirYLXj EHZZqHjwUHwAkLONZXNQXIwXHnfRNvxJ69Qb3hU/7LdPhGI+BmMLQMSdDx4U5ph0OoqPcOc 705YHwF X-QQ-GoodBg: 0 X-BIZMAIL-ID: 12853875043017767505 From: Bin Meng To: u-boot@lists.denx.de Cc: Leo , Nikita Shubin , Rick Chen Subject: [PATCH 1/8] riscv: Optimize source end address calculation in start.S Date: Thu, 30 Mar 2023 12:20:17 +0800 Message-Id: <20230330042024.721710-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:qybglogicsvr:qybglogicsvr3 X-Mailman-Approved-At: Thu, 30 Mar 2023 14:36:20 +0200 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 --- 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