]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile,cmd/internal/obj/riscv: load >32-bit constants from memory for riscv64
authorJoel Sing <joel@sing.id.au>
Wed, 17 Mar 2021 16:32:32 +0000 (03:32 +1100)
committerJoel Sing <joel@sing.id.au>
Thu, 18 Mar 2021 04:17:00 +0000 (04:17 +0000)
commitc2d625168fd636a390e1e69b10c7f3c98569ded8
tree3b84df49d30bc513169c76c57981d5981bd773ad
parent42c25e65f321a75b9be1725d77ea3e7175dc34ad
cmd/compile,cmd/internal/obj/riscv: load >32-bit constants from memory for riscv64

Follow what MIPS does and load >32-bit constants from memory using two instructions,
rather than generating a four to six instruction sequence. This removes more than 2,500
instructions from the Go binary. This also makes it possible to load >32-bit constants
via a single assembly instruction, if required.

Change-Id: Ie679a0754071e6d8c52fe0d027f00eb241b3a758
Reviewed-on: https://go-review.googlesource.com/c/go/+/302609
Trust: Joel Sing <joel@sing.id.au>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/asm/internal/asm/testdata/riscv64.s
src/cmd/compile/internal/ssa/gen/RISCV64.rules
src/cmd/compile/internal/ssa/rewriteRISCV64.go
src/cmd/internal/obj/riscv/obj.go