diff --git a/internal/gen/loadertest.go b/internal/gen/loadertest.go
index 1f705ce..361f496 100644
--- a/internal/gen/loadertest.go
+++ b/internal/gen/loadertest.go
@@ -4,6 +4,7 @@ import (
"fmt"
"io"
"math"
+ "strconv"
"strings"
"github.com/mmcloughlin/avo/internal/inst"
@@ -85,7 +86,7 @@ func (l LoaderTest) args(opcode string, ops []inst.Operand) []string {
as := make([]string, len(ops))
for i, op := range ops {
- a := l.arg(op.Type)
+ a := l.arg(op.Type, i)
if a == "" {
return nil
}
@@ -95,7 +96,7 @@ func (l LoaderTest) args(opcode string, ops []inst.Operand) []string {
}
// arg generates an argument for an operand of the given type.
-func (l LoaderTest) arg(t string) string {
+func (l LoaderTest) arg(t string, i int) string {
m := map[string]string{
"1": "$1", //
"3": "$3", //
@@ -106,21 +107,21 @@ func (l LoaderTest) arg(t string) string {
"imm32": fmt.Sprintf("$%d", math.MaxInt32), //
"imm64": fmt.Sprintf("$%d", math.MaxInt64), //
- "al": "AL", //
- "cl": "CL", //
- "r8": "CH", //
- "ax": "AX", //
- "r16": "SI", //
- "eax": "AX", //
- "r32": "DX", //
- "rax": "AX", //
- "r64": "R15", //
- "mm": "M5", //
- "xmm0": "X0", //
- "xmm": "X7", //
+ "al": "AL", //
+ "cl": "CL", //
+ "r8": "CH", //
+ "ax": "AX", //
+ "r16": "SI", //
+ "eax": "AX", //
+ "r32": "DX", //
+ "rax": "AX", //
+ "r64": "R15", //
+ "mm": "M5", //
+ "xmm0": "X0", //
+ "xmm": "X" + strconv.Itoa(7+i), //
//
//
- "ymm": "Y13", //
+ "ymm": "Y" + strconv.Itoa(3+i), //
//
//
//
@@ -130,7 +131,7 @@ func (l LoaderTest) arg(t string) string {
//
//
//
- //
+ "m": "0(AX)(CX*2)", //
"m8": "8(AX)(CX*2)", //
"m16": "16(AX)(CX*2)", //
//
@@ -153,7 +154,7 @@ func (l LoaderTest) arg(t string) string {
//
//
//
- //
+ "vm32x": "32(X14*8)", //
//
//
//