]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix s390x unsigned comparison constant merging rules
authorMichael Munday <munday@ca.ibm.com>
Wed, 12 Apr 2017 22:37:27 +0000 (18:37 -0400)
committerMichael Munday <munday@ca.ibm.com>
Thu, 13 Apr 2017 18:35:11 +0000 (18:35 +0000)
commitf75b5e99ed19e97ea78e62a406d03c1632efa7d4
tree1e0450d8c1fb549574530ade90565d674f702ace
parentdc09a7af2e72fe4863cac51f51f8581779ee28e0
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).

Fixes #19940.

Change-Id: Ifd6aa989fd3d50e282f7d30fec9db462c28422b1
Reviewed-on: https://go-review.googlesource.com/40433
Run-TryBot: Michael Munday <munday@ca.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
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