x86-64 recompiler now at parity with x86-32

This commit is contained in:
TomW 2015-08-04 18:36:27 +01:00
commit 0bf08d9e74
10 changed files with 4591 additions and 222 deletions

View file

@ -1,7 +1,7 @@
#define SHIFT(size, size2, count) \
STORE_IMM_ADDR_ ## size((uint32_t)&flags_op2, count); \
#define SHIFT(size, size2, count, res_store) \
STORE_IMM_ADDR_L((uint32_t)&flags_op2, count); \
reg = LOAD_REG_ ## size(fetchdat & 7); \
STORE_HOST_REG_ADDR((uint32_t)&flags_op1, reg); \
res_store((uint32_t)&flags_op1, reg); \
\
switch (fetchdat & 0x38) \
{ \
@ -21,7 +21,7 @@
break; \
} \
\
STORE_HOST_REG_ADDR((uint32_t)&flags_res, reg); \
res_store((uint32_t)&flags_res, reg); \
STORE_REG_ ## size ## _RELEASE(reg);
static uint32_t ropC0(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block)
@ -36,7 +36,7 @@ static uint32_t ropC0(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_
count = (fetchdat >> 8) & 0x1f;
SHIFT(B, 8, count);
SHIFT(B, 8, count, STORE_HOST_REG_ADDR_BL);
return op_pc + 2;
}
@ -52,7 +52,7 @@ static uint32_t ropC1_w(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint3
count = (fetchdat >> 8) & 0x1f;
SHIFT(W, 16, count);
SHIFT(W, 16, count, STORE_HOST_REG_ADDR_WL);
return op_pc + 2;
}
@ -68,7 +68,7 @@ static uint32_t ropC1_l(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint3
count = (fetchdat >> 8) & 0x1f;
SHIFT(L, 32, count);
SHIFT(L, 32, count, STORE_HOST_REG_ADDR);
return op_pc + 2;
}
@ -82,7 +82,7 @@ static uint32_t ropD0(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_
if ((fetchdat & 0x38) < 0x20)
return 0;
SHIFT(B, 8, 1);
SHIFT(B, 8, 1, STORE_HOST_REG_ADDR_BL);
return op_pc + 1;
}
@ -95,7 +95,7 @@ static uint32_t ropD1_w(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint3
if ((fetchdat & 0x38) < 0x20)
return 0;
SHIFT(W, 16, 1);
SHIFT(W, 16, 1, STORE_HOST_REG_ADDR_WL);
return op_pc + 1;
}
@ -108,7 +108,7 @@ static uint32_t ropD1_l(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint3
if ((fetchdat & 0x38) < 0x20)
return 0;
SHIFT(L, 32, 1);
SHIFT(L, 32, 1, STORE_HOST_REG_ADDR);
return op_pc + 1;
}