Skip to contentSkip to conversation

riscv: Remove unnecessary instruction

PATCH New Sean Anderson 3 participants 3 messages Jan 27, 2020 – Feb 2, 2020 1 message not in the archive RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 riscv: Remove unnecessary instruction

The add instruction on risc-v can have any three sources and targets, so there is no need for an intermediate mov.

---
 arch/riscv/cpu/start.S | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
arch/riscv/cpu/start.S +2 -3
index 1a55b7d570..365163ad19 100644
@@ -359,9 +359,8 @@ relocate_secondary_harts:
 call_board_init_r:
 	jal	invalidate_icache_all
 	jal	flush_dcache_all
-	la	t0, board_init_r
-	mv	t4, t0			/* offset of board_init_r() */
-	add	t4, t4, t6		/* real address of board_init_r() */
+	la	t0, board_init_r        /* offset of board_init_r() */
+	add	t4, t0, t6		/* real address of board_init_r() */
 /*
  * setup parameters for board_init_r
  */
Signature · 1 line
2.25.0

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

PATCH 1/1 riscv: Remove unnecessary instruction

Quoted 9 lines

From: Sean Anderson [mailto:seanga2 at gmail.com]
Sent: Tuesday, January 28, 2020 5:40 AM
To: U-Boot Mailing List
Cc: Bin Meng; Lukas Auer; Anup.Patel at wdc.com; Rick Jian-Zhi Chen(陳建志)
Subject: [PATCH] riscv: Remove unnecessary instruction

The add instruction on risc-v can have any three sources and targets, so there is no need for an intermediate mov.

Quoted 20 lines
---
 arch/riscv/cpu/start.S | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
arch/riscv/cpu/start.S +2 -4
@@ -359,9 +359,8 @@ relocate_secondary_harts:
 call_board_init_r:
        jal     invalidate_icache_all
        jal     flush_dcache_all
-       la      t0, board_init_r
-       mv      t4, t0                  /* offset of board_init_r() */
-       add     t4, t4, t6              /* real address of board_init_r() */
+       la      t0, board_init_r        /* offset of board_init_r() */
+       add     t4, t0, t6              /* real address of board_init_r() */
 /*
  * setup parameters for board_init_r
  */
--