]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.8] cmd/compile: fix s390x unsigned comparison constant merging...
authorMichael Munday <munday@ca.ibm.com>
Mon, 17 Apr 2017 16:29:32 +0000 (12:29 -0400)
committerChris Broadfoot <cbro@golang.org>
Tue, 23 May 2017 20:03:07 +0000 (20:03 +0000)
commit51f508bb4aab97e7d0401e78804916453dd77e4c
treec7adc7c131deadc5163b668460e62593d43a0104
parent243dee1737c82340064d166abd589dae5f4f0b38
[release-branch.go1.8] cmd/compile: fix s390x unsigned comparison constant merging rules

On s390x unsigned integer comparisons with immediates require the immediate
to be an unsigned 32-bit integer. The rule was checking that the immediate
was a signed 32-bit integer.

This CL also adds a test for comparisons that could be turned into compare
with immediate or equivalent instructions (depending on architecture and
optimizations applied).

Cherry-pick of CL 40433 and CL 40873.

Fixes #19940.

Reviewed-on: https://go-review.googlesource.com/40931
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

Change-Id: I3daaeaa40d7637bd4421e6b8d37ea4ffd74448ce
Reviewed-on: https://go-review.googlesource.com/43994
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/compile/internal/gc/ssa_test.go
src/cmd/compile/internal/gc/testdata/cmpConst.go [new file with mode: 0644]
src/cmd/compile/internal/gc/testdata/gen/cmpConstGen.go [new file with mode: 0644]
src/cmd/compile/internal/ssa/gen/S390X.rules
src/cmd/compile/internal/ssa/rewriteS390X.go