]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/internal/obj/arm64: avoid unnecessary literal pool usage for moves
authorJoel Sing <joel@sing.id.au>
Wed, 3 May 2023 11:56:18 +0000 (21:56 +1000)
committerJoel Sing <joel@sing.id.au>
Mon, 31 Jul 2023 16:38:47 +0000 (16:38 +0000)
commit208fc13245add90c33cf48571e1419caf80a637c
tree9190814b6d6382bf6c632ab26d99386b31351f2d
parent3313b39bae9ee6b830fecaaaaa004de646f82e50
cmd/internal/obj/arm64: avoid unnecessary literal pool usage for moves

In a number of load and store cases, the use of the literal pool can be
entirely avoided by simply adding or subtracting the offset from the
register. This uses the same number of instructions, while avoiding a
load from memory, along with the need for the value to be in the literal
pool. Overall this reduces the size of binaries slightly and should have
lower overhead.

Updates #59615

Change-Id: I9cb6a403dc71e34a46af913f5db87dbf52f8688c
Reviewed-on: https://go-review.googlesource.com/c/go/+/512539
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Joel Sing <joel@sing.id.au>
src/cmd/asm/internal/asm/testdata/arm64.s
src/cmd/internal/obj/arm64/asm7.go