Skip to content

Commit

Permalink
Merge #19026
Browse files Browse the repository at this point in the history
19026: riscv: Reduce reset trampoline code size by 2 bytes r=maribu a=jnohlgard

`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`

Co-authored-by: Joakim Nohlgård <[email protected]>
  • Loading branch information
bors[bot] and jnohlgard authored Dec 11, 2022
2 parents bc0dcb9 + b3d04d8 commit 7c7aede
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cpu/riscv_common/start.S
Original file line number Diff line number Diff line change
Expand Up @@ -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$
Expand Down

0 comments on commit 7c7aede

Please sign in to comment.