summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongdong Zhang <[email protected]>2022-11-29 11:54:07 +0800
committerAnup Patel <[email protected]>2022-12-05 10:47:38 +0530
commitcfbabb9ec6ba4979411ff8050638ac2628806beb (patch)
tree91d2ca508f4c6742a8705ff614531845e1b7322f
parentad2ac292635ec48fece67ce62bd7e967d9538616 (diff)
firmware: Minor optimization for relocate
The t3 register stores the address of _load_end. If relocation is not required, it is unnecessary to calculate the address of _load_end. This can reduce the operation time of two instructions. Signed-off-by: Dongdong Zhang <[email protected]> Reviewed-by: Bin Meng <[email protected]> Reviewed-by: Anup Patel <[email protected]>
-rw-r--r--firmware/fw_base.S2
1 files changed, 1 insertions, 1 deletions
diff --git a/firmware/fw_base.S b/firmware/fw_base.S
index 07be4c4b..3f622b3b 100644
--- a/firmware/fw_base.S
+++ b/firmware/fw_base.S
@@ -128,9 +128,9 @@ _relocate:
REG_L t1, 0(t1)
lla t2, _load_start
REG_L t2, 0(t2)
+ beq t0, t2, _relocate_done
sub t3, t1, t0
add t3, t3, t2
- beq t0, t2, _relocate_done
lla t4, _relocate_done
sub t4, t4, t2
add t4, t4, t0