From b3d04d8270755d92d46cb6d4b88200d7b59ffc27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Thu, 8 Dec 2022 13:20:14 +0100 Subject: [PATCH] riscv: Reduce reset trampoline code size by 2 bytes `addi` with 20 bit immediate does not have a compressed representation, so using `jalr` with immediate offset uncompressed is smaller than using `addi`+`c.jr` --- cpu/riscv_common/start.S | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cpu/riscv_common/start.S b/cpu/riscv_common/start.S index e8cbdd9c63..508b339cb8 100644 --- a/cpu/riscv_common/start.S +++ b/cpu/riscv_common/start.S @@ -19,8 +19,7 @@ _start: .option norelax csrc CSR_MSTATUS, MSTATUS_MIE lui a0, %hi(_start_real) - addi a0, a0, %lo(_start_real) - jr a0 + jalr x0, a0, %lo(_start_real) _start_real: la gp, __global_pointer$