mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
test/codegen: port tbz/tbnz arm64 tests
And delete them from asm_test. Change-Id: I34fcf85ae8ce09cd146fe4ce6a0ae7616bd97e2d Reviewed-on: https://go-review.googlesource.com/102296 Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Giovanni Bajo <rasky@develer.com>
This commit is contained in:
parent
786899a72a
commit
a27cd4fd31
2 changed files with 26 additions and 40 deletions
|
|
@ -481,46 +481,6 @@ var linuxARM64Tests = []*asmTest{
|
||||||
pos: []string{"LSL\t\\$17"},
|
pos: []string{"LSL\t\\$17"},
|
||||||
neg: []string{"CMP"},
|
neg: []string{"CMP"},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
fn: `
|
|
||||||
func $(a int32, ptr *int) {
|
|
||||||
if a >= 0 {
|
|
||||||
*ptr = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`,
|
|
||||||
pos: []string{"TBNZ"},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
fn: `
|
|
||||||
func $(a int64, ptr *int) {
|
|
||||||
if a >= 0 {
|
|
||||||
*ptr = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`,
|
|
||||||
pos: []string{"TBNZ"},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
fn: `
|
|
||||||
func $(a int32, ptr *int) {
|
|
||||||
if a < 0 {
|
|
||||||
*ptr = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`,
|
|
||||||
pos: []string{"TBZ"},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
fn: `
|
|
||||||
func $(a int64, ptr *int) {
|
|
||||||
if a < 0 {
|
|
||||||
*ptr = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`,
|
|
||||||
pos: []string{"TBZ"},
|
|
||||||
},
|
|
||||||
// Load-combining tests.
|
// Load-combining tests.
|
||||||
{
|
{
|
||||||
fn: `
|
fn: `
|
||||||
|
|
|
||||||
|
|
@ -106,3 +106,29 @@ func CmpMem5(p **int) {
|
||||||
// amd64:`CMPL\truntime.writeBarrier\(SB\), [$]0`
|
// amd64:`CMPL\truntime.writeBarrier\(SB\), [$]0`
|
||||||
*p = nil
|
*p = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check tbz/tbnz are generated when comparing against zero on arm64
|
||||||
|
|
||||||
|
func CmpZero1(a int32, ptr *int) {
|
||||||
|
if a < 0 { // arm64:"TBZ"
|
||||||
|
*ptr = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func CmpZero2(a int64, ptr *int) {
|
||||||
|
if a < 0 { // arm64:"TBZ"
|
||||||
|
*ptr = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func CmpZero3(a int32, ptr *int) {
|
||||||
|
if a >= 0 { // arm64:"TBNZ"
|
||||||
|
*ptr = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func CmpZero4(a int64, ptr *int) {
|
||||||
|
if a >= 0 { // arm64:"TBNZ"
|
||||||
|
*ptr = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue