diff options
| author | Jayanth Krishnamurthy jayanth.krishnamurthy@ibm.com <jayanth.krishnamurthy@ibm.com> | 2025-10-15 04:18:52 -0500 |
|---|---|---|
| committer | Archana Ravindar <aravinda@redhat.com> | 2026-03-25 03:52:03 -0700 |
| commit | cbc2d06c9ba8285bb60f1055b44d4d1e742ca734 (patch) | |
| tree | 10c0fe04738b9da366a49f290a5173be1fd74f59 /src/debug | |
| parent | c52d784d0834d13b53e297dbcf7ebf057ba4eb8f (diff) | |
| download | go-cbc2d06c9ba8285bb60f1055b44d4d1e742ca734.tar.xz | |
cmd/compile: ppc64 fold (x+x)<<c into x<<(c+1)
On ppc64/ppc64le, rewrite (x + x) << c to x << (c+1) for constant shifts. This removes an ADD, shortens the dependency chain, and reduces code size.
Add rules for both 64-bit (SLDconst) and 32-bit (SLWconst), and extend
test/codegen/shift.go with ppc64x checks to assert a single SLD/SLW and
forbid ADD. Aligns ppc64 with other architectures that already assert
similar codegen in shift.go.
Change-Id: Ie564afbb029a5bd48887b82b0c455ca1dddd5508
Cq-Include-Trybots: luci.golang.try:gotip-linux-ppc64_power10,gotip-linux-ppc64_power8,gotip-linux-ppc64le_power8,gotip-linux-ppc64le_power9,gotip-linux-ppc64le_power10
Reviewed-on: https://go-review.googlesource.com/c/go/+/712000
Reviewed-by: Archana Ravindar <aravinda@redhat.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Diffstat (limited to 'src/debug')
0 files changed, 0 insertions, 0 deletions
