MIPS: Add soft-float support to JIT compiler backend.

This commit is contained in:
Mike Pall
2016-02-10 18:49:22 +01:00
parent 825dcdc4d1
commit f547a1425e
7 changed files with 418 additions and 83 deletions

View File

@@ -152,16 +152,18 @@ static void emit_jmp(ASMState *as, MCode *target)
emit_branch(as, MIPSI_B, RID_ZERO, RID_ZERO, (target));
}
static void emit_call(ASMState *as, void *target)
static void emit_call(ASMState *as, void *target, int needcfa)
{
MCode *p = as->mcp;
*--p = MIPSI_NOP;
if ((((uintptr_t)target ^ (uintptr_t)p) >> 28) == 0)
if ((((uintptr_t)target ^ (uintptr_t)p) >> 28) == 0) {
*--p = MIPSI_JAL | (((uintptr_t)target >>2) & 0x03ffffffu);
else /* Target out of range: need indirect call. */
} else { /* Target out of range: need indirect call. */
*--p = MIPSI_JALR | MIPSF_S(RID_CFUNCADDR);
needcfa = 1;
}
as->mcp = p;
ra_allockreg(as, i32ptr(target), RID_CFUNCADDR);
if (needcfa) ra_allockreg(as, i32ptr(target), RID_CFUNCADDR);
}
/* -- Emit generic operations --------------------------------------------- */