Skip to content

Commit

Permalink
[release-branch.go1.8] cmd/compile: fix s390x unsigned comparison con…
Browse files Browse the repository at this point in the history
…stant 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.

Change-Id: I1331558a0ee0c4ac33bf8ea488f3ea190d06f110
Reviewed-on: https://go-review.googlesource.com/40931
Reviewed-by: Brad Fitzpatrick <[email protected]>
Run-TryBot: Brad Fitzpatrick <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
  • Loading branch information
mundaym committed Apr 17, 2017
1 parent a4c18f0 commit 708966a
Show file tree
Hide file tree
Showing 5 changed files with 2,474 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/cmd/compile/internal/gc/ssa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ func TestArithmeticConst(t *testing.T) { runTest(t, "arithConst.go") }

func TestChan(t *testing.T) { runTest(t, "chan.go") }

// TestComparisonsConst tests results for comparison operations against constants.
func TestComparisonsConst(t *testing.T) { runTest(t, "cmpConst.go") }

func TestCompound(t *testing.T) { runTest(t, "compound.go") }

func TestCtl(t *testing.T) { runTest(t, "ctl.go") }
Expand Down
Loading

0 comments on commit 708966a

Please sign in to comment.