]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
riscv: Optimize source end address calculation in start.S
authorBin Meng <bmeng@tinylab.org>
Thu, 13 Apr 2023 06:20:00 +0000 (14:20 +0800)
committerLeo Yu-Chi Liang <ycliang@andestech.com>
Thu, 20 Apr 2023 12:45:08 +0000 (20:45 +0800)
The __bss_start is the source end address hence load its address
directly into register 't2' for optimization.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Rick Chen <rick@andestech.com>
arch/riscv/cpu/start.S

index 4687bca3c996618a3ac40a027af8b22a186519af..3c8344c345bc033883f31f2bad79b37065231070 100644 (file)
@@ -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)