pos: []string{"\tADDQ\t[$]19", "\tIMULQ"}, // (a+19)*n
},
{
- `
+ fn: `
func mul4(n int) int {
return 23*n - 9*n
}`,
- []string{"\tIMULQ\t[$]14"}, // 14*n
+ pos: []string{"\tIMULQ\t[$]14"}, // 14*n
},
{
- `
+ fn: `
func mul5(a, n int) int {
return a*n - 19*n
}`,
- []string{"\tADDQ\t[$]-19", "\tIMULQ"}, // (a-19)*n
+ pos: []string{"\tADDQ\t[$]-19", "\tIMULQ"}, // (a-19)*n
},
// see issue 19595.
pos: []string{"TEXT\t.*, [$]0-4"},
},
{
- `
+ fn: `
func mul3(n int) int {
return 23*n - 9*n
}`,
- []string{"\tIMULL\t[$]14"}, // 14*n
+ pos: []string{"\tIMULL\t[$]14"}, // 14*n
},
{
- `
+ fn: `
func mul4(a, n int) int {
return n*a - a*19
}`,
- []string{"\tADDL\t[$]-19", "\tIMULL"}, // (n-19)*a
+ pos: []string{"\tADDL\t[$]-19", "\tIMULL"}, // (n-19)*a
},
}