]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
RISC-V: Change CALL macro to use ra as the temporary address register
authorMichael Clark <michaeljclark@mac.com>
Thu, 27 Apr 2017 04:08:46 +0000 (16:08 +1200)
committerPalmer Dabbelt <palmer@dabbelt.com>
Fri, 5 May 2017 18:34:54 +0000 (11:34 -0700)
commit1e46401a6a0a1aab4865fd5e0d775c09d75215ca
treed63a835456a7f49a80db981819ed7a1b86bb3e09
parentb3b0532691d3010b7b754724399d74d0c884138c
RISC-V: Change CALL macro to use ra as the temporary address register

e.g.

    1:  auipc ra, %pcrel_hi(symbol)
        jalr  ra, %pcrel_lo(1b)(ra)

The use of ra instead of t1 for address construction provides an
opportunity for a microarchitecture to elide the write of the
destination address, and instead read the target address as an
immediate spread across the fused auipc+jalr pair. The link
register ra in the jalr overwrites the target address temporary.
opcodes/ChangeLog
opcodes/riscv-opc.c