mirror of
https://github.com/golang/go.git
synced 2025-11-12 06:31:05 +00:00
test/codegen: port math/bits.OnesCount tests to codegen
And remove them from ssa_test. Change-Id: I3efac5fea529bb0efa2dae32124530482ba5058e Reviewed-on: https://go-review.googlesource.com/98815 Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
parent
f624445473
commit
18ae5eca3b
2 changed files with 28 additions and 52 deletions
|
|
@ -96,6 +96,34 @@ func Len8(n uint8) int {
|
|||
return bits.Len8(n)
|
||||
}
|
||||
|
||||
// -------------------- //
|
||||
// bits.OnesCount //
|
||||
// -------------------- //
|
||||
|
||||
func OnesCount(n uint) int {
|
||||
//amd64:"POPCNTQ",".*support_popcnt"
|
||||
//arm64:"VCNT","VUADDLV"
|
||||
return bits.OnesCount(n)
|
||||
}
|
||||
|
||||
func OnesCount64(n uint64) int {
|
||||
//amd64:"POPCNTQ",".*support_popcnt"
|
||||
//arm64:"VCNT","VUADDLV"
|
||||
return bits.OnesCount64(n)
|
||||
}
|
||||
|
||||
func OnesCount32(n uint32) int {
|
||||
//amd64:"POPCNTL",".*support_popcnt"
|
||||
//arm64:"VCNT","VUADDLV"
|
||||
return bits.OnesCount32(n)
|
||||
}
|
||||
|
||||
func OnesCount16(n uint16) int {
|
||||
//amd64:"POPCNTL",".*support_popcnt"
|
||||
//arm64:"VCNT","VUADDLV"
|
||||
return bits.OnesCount16(n)
|
||||
}
|
||||
|
||||
// ------------------------ //
|
||||
// bits.TrailingZeros //
|
||||
// ------------------------ //
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue