]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/ssa: initialize t.UInt in SetTypPtrs()
authorLynn Boger <laboger@linux.vnet.ibm.com>
Wed, 9 May 2018 21:35:10 +0000 (17:35 -0400)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 10 May 2018 14:50:30 +0000 (14:50 +0000)
Initialization of t.UInt is missing from SetTypPtrs in config.go,
preventing rules that use it from matching when they should.
This adds the initialization to allow those rules to work.

Updated test/codegen/rotate.go to test for this case, which
appears in math/bits RotateLeft32 and RotateLeft64. There had been
a testcase for this in go 1.10 but that went away when asm_test.go
was removed.

Change-Id: I82fc825ad8364df6fc36a69a1e448214d2e24ed5
Reviewed-on: https://go-review.googlesource.com/112518
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/compile/internal/ssa/config.go
test/codegen/rotate.go

index 3bf62294670b0f202a0c13bfd6c49ee4aa3e118f..cb4eb182afc061c66e0046aae02344166aa9e0ae 100644 (file)
@@ -93,9 +93,10 @@ func (t *Types) SetTypPtrs() {
        t.UInt16 = types.Types[types.TUINT16]
        t.UInt32 = types.Types[types.TUINT32]
        t.UInt64 = types.Types[types.TUINT64]
+       t.Int = types.Types[types.TINT]
        t.Float32 = types.Types[types.TFLOAT32]
        t.Float64 = types.Types[types.TFLOAT64]
-       t.Int = types.Types[types.TINT]
+       t.UInt = types.Types[types.TUINT]
        t.Uintptr = types.Types[types.TUINTPTR]
        t.String = types.Types[types.TSTRING]
        t.BytePtr = types.NewPtr(types.Types[types.TUINT8])
index 43d337a09ca8a733ee1a8161acf779937d06b760..5812e1c0b1ce6564df0e2032ca071bd98170f2ad 100644 (file)
@@ -101,6 +101,7 @@ func rot64nc(x uint64, z uint) uint64 {
        z &= 63
 
        // amd64:"ROLQ"
+       // ppc64le:"ROTL"
        a += x<<z | x>>(64-z)
 
        // amd64:"RORQ"
@@ -115,6 +116,7 @@ func rot32nc(x uint32, z uint) uint32 {
        z &= 31
 
        // amd64:"ROLL"
+       // ppc64le:"ROTLW"
        a += x<<z | x>>(32-z)
 
        // amd64:"RORL"