diff options
author | Joel Sing <joel@sing.id.au> | 2020-01-29 20:14:18 +1100 |
---|---|---|
committer | Joel Sing <joel@sing.id.au> | 2020-01-29 16:35:37 +0000 |
commit | a50c3ffbd47e3dcfc1b5bd2a2d19d55731481eaa (patch) | |
tree | a6b487eada71261849e490fe00194e712d4e6baa /src/runtime/asm_riscv64.s | |
parent | 2e4f490b31272a2df73d4ba23aad7f5a8ca49a2f (diff) | |
download | go-a50c3ffbd47e3dcfc1b5bd2a2d19d55731481eaa.tar.gz go-a50c3ffbd47e3dcfc1b5bd2a2d19d55731481eaa.zip |
cmd/internal/obj/riscv,cmd/link: shorten the riscv64 call sequence
Now that the other dependent offset has been identified, we can remove the
unnecessary ADDI instruction from the riscv64 call sequence (reducing it
to AUIPC+JALR, rather than the previous AUIPC+ADDI+JALR).
Change-Id: I348c4efb686f9f71ed1dd1d25fb9142a41230b0d
Reviewed-on: https://go-review.googlesource.com/c/go/+/216798
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/asm_riscv64.s')
-rw-r--r-- | src/runtime/asm_riscv64.s | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/runtime/asm_riscv64.s b/src/runtime/asm_riscv64.s index 444e2bba1b..31dc94ce54 100644 --- a/src/runtime/asm_riscv64.s +++ b/src/runtime/asm_riscv64.s @@ -254,12 +254,11 @@ TEXT runtime·gogo(SB), NOSPLIT, $16-8 // func jmpdefer(fv *funcval, argp uintptr) // called from deferreturn // 1. grab stored return address from the caller's frame -// 2. sub 12 bytes to get back to JAL deferreturn +// 2. sub 8 bytes to get back to JAL deferreturn // 3. JMP to fn -// TODO(sorear): There are shorter jump sequences. This function will need to be updated when we use them. TEXT runtime·jmpdefer(SB), NOSPLIT|NOFRAME, $0-16 MOV 0(X2), RA - ADD $-12, RA + ADD $-8, RA MOV fv+0(FP), CTXT MOV argp+8(FP), X2 |