aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Chambers <[email protected]>2021-10-14 23:48:44 +1300
committerAndrew Chambers <[email protected]>2021-10-14 23:48:44 +1300
commite80556c2e0f516a6b584a354b491bf353e96830e (patch)
treec28b862c6aca411f3615336772b6a1cf05255465
parent3d3adabbcde9576de5ef7a08defd99c7974971cb (diff)
Fix incorrect arg order.
-rw-r--r--main.c2
-rw-r--r--test/test.sh8
2 files changed, 5 insertions, 5 deletions
diff --git a/main.c b/main.c
index 1d88fe8..e425d3e 100644
--- a/main.c
+++ b/main.c
@@ -941,7 +941,7 @@ static void assemble(void) {
} else if (v->instr.variant < 14) {
opcode = 0x01000faf;
prefix = ((v->instr.variant - 8) % 3) == 0 ? 0x66 : -1;
- assemblerrm(&v->instr, prefix, opcode, 0);
+ assemblerrm(&v->instr, prefix, opcode, 1);
} else {
const Imm *imm;
imm = &v->instr.arg3->imm;
diff --git a/test/test.sh b/test/test.sh
index 9734915..ba4a036 100644
--- a/test/test.sh
+++ b/test/test.sh
@@ -231,10 +231,10 @@ t "imul %rax"
t "imulq (%rax)"
t "imulq (%rip)"
-t "imul %rax, %rax"
-t "imulq (%rax), %rax"
-t "imul %eax, %eax"
-t "imull (%rax), %eax"
+t "imul %rax, %rbx"
+t "imulq (%rax), %rbx"
+t "imul %eax, %ebx"
+t "imull (%rax), %ebx"
t "imul \$2147483647, %rax, %rbx"
t "imul \$2147483647, (%rax), %rbx"