changeset 560:f9431cb3a39c

Fix x86_rrindex_sizedir. Pass the correct scale to mov_rindexr in gen_mem_fun. BlastEm now sort of works on OS X. Runs reliably from lldb, but only intermittently from the shell
author Mike Pavone <pavone@retrodev.com>
date Mon, 23 Jun 2014 11:05:55 -0400
parents 6b248602ab84
children 666adeba5a61
files gen_x86.c m68k_to_x86.c
diffstat 2 files changed, 5 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/gen_x86.c	Tue Jun 17 01:50:29 2014 -0400
+++ b/gen_x86.c	Mon Jun 23 11:05:55 2014 -0400
@@ -359,13 +359,11 @@
 		opcode |= BIT_SIZE;
 	}
 	*(out++) = opcode | dir;
-	*(out++) = MODE_REG_INDIRECT | base | (RSP << 3);
-	if (base == RSP) {
-		if (scale == 4) {
-			scale = 3;
-		}
-		*(out++) = scale << 6 | (index << 3) | base;
+	*(out++) = MODE_REG_INDIRECT | RSP | (reg << 3);
+	if (scale == 4) {
+		scale = 3;
 	}
+	*(out++) = scale << 6 | (index << 3) | base;
 	return out;
 }
 
--- a/m68k_to_x86.c	Tue Jun 17 01:50:29 2014 -0400
+++ b/m68k_to_x86.c	Mon Jun 23 11:05:55 2014 -0400
@@ -4499,7 +4499,7 @@
 						dst = mov_rrind(dst, SCRATCH1, SCRATCH2, tmp_size);
 					} else {
 						dst = mov_ir(dst, (intptr_t)memmap[chunk].buffer, SCRATCH2, SZ_PTR);
-						dst = mov_rindexr(dst, SCRATCH2, SCRATCH1, 1, SCRATCH1, tmp_size);
+						dst = mov_rindexr(dst, SCRATCH2, SCRATCH1, 0, SCRATCH1, tmp_size);
 					}
 				}
 				if (size != tmp_size && !is_write) {