mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: remove ntz function
Use ntzX variants instead. Passes toolstash-check -a. Change-Id: I7a627f46f75c3d339034bd3e81c190cea5409c88 Reviewed-on: https://go-review.googlesource.com/c/go/+/229140 Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Michael Munday <mike.munday@ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
b71eafbcec
commit
79395c55e2
3 changed files with 25 additions and 26 deletions
|
|
@ -392,7 +392,6 @@ 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
|
||||
func ntz64(x int64) int { return bits.TrailingZeros64(uint64(x)) }
|
||||
func ntz32(x int32) int { return bits.TrailingZeros32(uint32(x)) }
|
||||
func ntz16(x int16) int { return bits.TrailingZeros16(uint16(x)) }
|
||||
|
|
@ -406,7 +405,7 @@ func oneBit64(x int64) bool { return x&(x-1) == 0 && x != 0 }
|
|||
|
||||
// nto returns the number of trailing ones.
|
||||
func nto(x int64) int64 {
|
||||
return ntz(^x)
|
||||
return int64(ntz64(^x))
|
||||
}
|
||||
|
||||
// log2 returns logarithm in base 2 of uint64(n), with log2(0) = -1.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue