cmd/compile: rewrite shift rules to use typed aux fields

Passes toolstash-check.

Change-Id: I02e78591fe46e19a43dc36913baef0338a014a3d
Reviewed-on: https://go-review.googlesource.com/c/go/+/228860
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
Cuong Manh Le 2020-04-20 03:26:53 +07:00
parent 366460defb
commit 0f14c2a042
3 changed files with 430 additions and 428 deletions

View file

@ -384,9 +384,11 @@ func isSameSym(sym interface{}, name string) bool {
}
// nlz returns the number of leading zeros.
func nlz(x int64) int64 {
return int64(bits.LeadingZeros64(uint64(x)))
}
func nlz(x int64) int64 { return int64(bits.LeadingZeros64(uint64(x))) } // TODO: remove when no longer used
func nlz64(x int64) int { return bits.LeadingZeros64(uint64(x)) }
func nlz32(x int32) int { return bits.LeadingZeros32(uint32(x)) }
func nlz16(x int16) int { return bits.LeadingZeros16(uint16(x)) }
func nlz8(x int8) int { return bits.LeadingZeros8(uint8(x)) }
// ntzX returns the number of trailing zeros.
func ntz(x int64) int64 { return int64(bits.TrailingZeros64(uint64(x))) } // TODO: remove when no longer used