aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/obj/riscv
diff options
context:
space:
mode:
authorJoel Sing <joel@sing.id.au>2020-01-29 20:14:18 +1100
committerJoel Sing <joel@sing.id.au>2020-01-29 16:35:37 +0000
commita50c3ffbd47e3dcfc1b5bd2a2d19d55731481eaa (patch)
treea6b487eada71261849e490fe00194e712d4e6baa /src/cmd/internal/obj/riscv
parent2e4f490b31272a2df73d4ba23aad7f5a8ca49a2f (diff)
downloadgo-a50c3ffbd47e3dcfc1b5bd2a2d19d55731481eaa.tar.xz
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/cmd/internal/obj/riscv')
-rw-r--r--src/cmd/internal/obj/riscv/obj.go9
1 files changed, 0 insertions, 9 deletions
diff --git a/src/cmd/internal/obj/riscv/obj.go b/src/cmd/internal/obj/riscv/obj.go
index e90769eb20..1d2c498110 100644
--- a/src/cmd/internal/obj/riscv/obj.go
+++ b/src/cmd/internal/obj/riscv/obj.go
@@ -55,15 +55,6 @@ func jalrToSym(ctxt *obj.Link, p *obj.Prog, newprog obj.ProgAlloc, lr int16) *ob
p.Mark |= NEED_PCREL_ITYPE_RELOC
p = obj.Appendp(p, newprog)
- // TODO(jsing): This instruction is not necessary, as the lower bits
- // of the immediate can be encoded directly in the JALR instruction.
- // However, other code currently depends on jalrToSym being 12 bytes...
- p.As = AADDI
- p.From = obj.Addr{Type: obj.TYPE_CONST}
- p.Reg = REG_TMP
- p.To = obj.Addr{Type: obj.TYPE_REG, Reg: REG_TMP}
- p = obj.Appendp(p, newprog)
-
// Leave Sym only for the CALL reloc in assemble.
p.As = AJALR
p.From.Type = obj.TYPE_REG