Commit e4172e5f authored by Lynn Boger's avatar Lynn Boger Committed by Brad Fitzpatrick

cmd/compile/internal/ssa: initialize t.UInt in SetTypPtrs()

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: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent f95ef94a
......@@ -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])
......
......@@ -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"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment