}
var linuxARMTests = []*asmTest{
+ // multiplication by powers of two
+ {
+ fn: `
+ func $(n int) int {
+ return 16*n
+ }
+ `,
+ pos: []string{"\tSLL\t[$]4"},
+ neg: []string{"\tMUL\t"},
+ },
+ {
+ fn: `
+ func $(n int) int {
+ return -32*n
+ }
+ `,
+ pos: []string{"\tSLL\t[$]5"},
+ neg: []string{"\tMUL\t"},
+ },
+
{
fn: `
func f0(x uint32) uint32 {
}
var linuxARM64Tests = []*asmTest{
+ // multiplication by powers of two
+ {
+ fn: `
+ func $(n int) int {
+ return 64*n
+ }
+ `,
+ pos: []string{"\tLSL\t[$]6"},
+ neg: []string{"\tMUL\t"},
+ },
+ {
+ fn: `
+ func $(n int) int {
+ return -128*n
+ }
+ `,
+ pos: []string{"\tLSL\t[$]7"},
+ neg: []string{"\tMUL\t"},
+ },
+
{
fn: `
func f0(x uint64) uint64 {