]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile,cmd/internal/obj/ppc64: fix some shift rules due to a regression
authorLynn Boger <laboger@linux.vnet.ibm.com>
Mon, 28 Sep 2020 22:20:12 +0000 (18:20 -0400)
committerLynn Boger <laboger@linux.vnet.ibm.com>
Thu, 1 Oct 2020 18:51:18 +0000 (18:51 +0000)
commitcc2a5cf4b8b0aeaccd3dd439f8d3d68f25eef358
tree42d69524aedc0bc76d7a3e2d8005f6f43f7404b8
parent4ad5dd63a7b5bc57312a95bd7dcdb6c209456a6f
cmd/compile,cmd/internal/obj/ppc64: fix some shift rules due to a regression

A recent change to improve shifts was generating some
invalid cases when the rule was based on an AND. The
extended mnemonics CLRLSLDI and CLRLSLWI only allow
certain values for the operands and in the mask case
those values were not being checked properly. This
adds a check to those rules to verify that the
'b' and 'n' values used when an AND was part of the rule
have correct values.

There was a bug in some diag messages in asm9. The
message expected 3 values but only provided 2. Those are
corrected here also.

The test/codegen/shift.go was updated to add a few more
cases to check for the case mentioned here.

Some of the comments that mention the order of operands
in these extended mnemonics were wrong and those have been
corrected.

Fixes #41683.

Change-Id: If5bb860acaa5051b9e0cd80784b2868b85898c31
Reviewed-on: https://go-review.googlesource.com/c/go/+/258138
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Paul Murphy <murp@ibm.com>
Reviewed-by: Carlos Eduardo Seo <carlos.seo@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Lynn Boger <laboger@linux.vnet.ibm.com>
src/cmd/asm/internal/asm/testdata/ppc64enc.s
src/cmd/compile/internal/ppc64/ssa.go
src/cmd/compile/internal/ssa/gen/PPC64.rules
src/cmd/compile/internal/ssa/rewrite.go
src/cmd/compile/internal/ssa/rewritePPC64.go
src/cmd/internal/obj/ppc64/asm9.go
test/codegen/shift.go