]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal: improve handling of DS form offsets on ppc64x
authorLynn Boger <laboger@linux.vnet.ibm.com>
Mon, 8 Mar 2021 16:07:17 +0000 (10:07 -0600)
committerLynn Boger <laboger@linux.vnet.ibm.com>
Wed, 10 Mar 2021 19:33:23 +0000 (19:33 +0000)
commitccf9acefa8b61fb58daad233a6e0478d092d55ef
tree7aef9406ac1fcc73cd98782adf7d244da2655108
parentc41bf9ee81e26d0fc0aca858a3d96d96be29ccba
cmd/compile/internal: improve handling of DS form offsets on ppc64x

In the ppc64 ISA DS form loads and stores are restricted to offset
fields that are a multiple of 4. This is currently handled with checks
in the rules that generate MOVDload, MOVWload, MOVDstore and
MOVDstorezero to prevent invalid instructions from getting to the
assembler.

An unhandled case was discovered which led to the search for a better
solution to this problem. Now, instead of checking the offset in the
rules, this will be detected when processing these Ops in
ssaGenValues in ppc64/ssa.go. If the offset is not valid, the address
of the symbol to be loaded or stored will be computed using the base
register + offset, and that value used in the new base register.
With the full address in the base register, the offset field can be
zero in the instruction.

Updates #44739

Change-Id: I4f3c0c469ae70a63e3add295c9b55ea0e30ef9b3
Reviewed-on: https://go-review.googlesource.com/c/go/+/299789
Trust: Lynn Boger <laboger@linux.vnet.ibm.com>
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/compile/internal/ppc64/ssa.go
src/cmd/compile/internal/ssa/gen/PPC64.rules
src/cmd/compile/internal/ssa/rewritePPC64.go
test/fixedbugs/issue44739.go [new file with mode: 0644]