mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +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
|
|
@ -547,34 +547,6 @@ var linuxAMD64Tests = []*asmTest{
|
|||
`,
|
||||
pos: []string{"\tROLW\t\\$8,"},
|
||||
},
|
||||
{
|
||||
fn: `
|
||||
func pop1(x uint64) int {
|
||||
return bits.OnesCount64(x)
|
||||
}`,
|
||||
pos: []string{"\tPOPCNTQ\t", "support_popcnt"},
|
||||
},
|
||||
{
|
||||
fn: `
|
||||
func pop2(x uint32) int {
|
||||
return bits.OnesCount32(x)
|
||||
}`,
|
||||
pos: []string{"\tPOPCNTL\t", "support_popcnt"},
|
||||
},
|
||||
{
|
||||
fn: `
|
||||
func pop3(x uint16) int {
|
||||
return bits.OnesCount16(x)
|
||||
}`,
|
||||
pos: []string{"\tPOPCNTL\t", "support_popcnt"},
|
||||
},
|
||||
{
|
||||
fn: `
|
||||
func pop4(x uint) int {
|
||||
return bits.OnesCount(x)
|
||||
}`,
|
||||
pos: []string{"\tPOPCNTQ\t", "support_popcnt"},
|
||||
},
|
||||
// multiplication merging tests
|
||||
{
|
||||
fn: `
|
||||
|
|
@ -1492,30 +1464,6 @@ var linuxARM64Tests = []*asmTest{
|
|||
`,
|
||||
pos: []string{"TBZ"},
|
||||
},
|
||||
{
|
||||
fn: `
|
||||
func $(x uint64) int {
|
||||
return bits.OnesCount64(x)
|
||||
}
|
||||
`,
|
||||
pos: []string{"\tVCNT\t", "\tVUADDLV\t"},
|
||||
},
|
||||
{
|
||||
fn: `
|
||||
func $(x uint32) int {
|
||||
return bits.OnesCount32(x)
|
||||
}
|
||||
`,
|
||||
pos: []string{"\tVCNT\t", "\tVUADDLV\t"},
|
||||
},
|
||||
{
|
||||
fn: `
|
||||
func $(x uint16) int {
|
||||
return bits.OnesCount16(x)
|
||||
}
|
||||
`,
|
||||
pos: []string{"\tVCNT\t", "\tVUADDLV\t"},
|
||||
},
|
||||
// Load-combining tests.
|
||||
{
|
||||
fn: `
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue