]> Cypherpunks repositories - gostls13.git/commit
cmd/asm,cmd/compile: generate less instructions for most 32 bit constant adds on...
authorPaul E. Murphy <murp@ibm.com>
Fri, 16 Feb 2024 19:29:16 +0000 (13:29 -0600)
committerPaul Murphy <murp@ibm.com>
Wed, 13 Mar 2024 13:58:44 +0000 (13:58 +0000)
commit6e5398bad16aba15db365b72cb70d1177330b603
treeea00cfdf9c6f9d96be1065237d4b25c8d01a2823
parenta46ecdca36b2359e7496c6d694703a9a9706d760
cmd/asm,cmd/compile: generate less instructions for most 32 bit constant adds on ppc64x

For GOPPC64 < 10 targets, most large 32 bit constants (those
exceeding int16 capacity) can be added using two instructions
instead of 3.

This cannot be done for values greater than 0x7FFF7FFF, so this
must be done during asm preprocessing as the optab matching
rules cannot differentiate this special case.

Likewise, constants 0x8000 <= x < 0x10000 are not converted. The
assembler currently generates 2 instructions sequences for these
constants.

Change-Id: I1ccc839c6c28fc32f15d286b2e52e2d22a2a06d4
Reviewed-on: https://go-review.googlesource.com/c/go/+/568116
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Run-TryBot: Paul Murphy <murp@ibm.com>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/asm/internal/asm/testdata/ppc64.s
src/cmd/internal/obj/ppc64/obj9.go
test/codegen/arithmetic.go