Skip to content

Commit

Permalink
MIPS64: Add soft-float support to JIT compiler backend.
Browse files Browse the repository at this point in the history
Contributed by Djordje Kovacevic and Stefan Pejic from RT-RK.com.
Sponsored by Cisco Systems, Inc.
  • Loading branch information
Mike Pall committed Jun 7, 2017
1 parent 0e4a551 commit a057a07
Show file tree
Hide file tree
Showing 13 changed files with 286 additions and 75 deletions.
4 changes: 1 addition & 3 deletions src/lj_arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,6 @@
#define LJ_ARCH_BITS 32
#define LJ_TARGET_MIPS32 1
#else
#if LJ_ABI_SOFTFP || !LJ_ARCH_HASFPU
#define LJ_ARCH_NOJIT 1 /* NYI */
#endif
#define LJ_ARCH_BITS 64
#define LJ_TARGET_MIPS64 1
#define LJ_TARGET_GC64 1
Expand Down Expand Up @@ -512,6 +509,7 @@
#define LJ_ABI_SOFTFP 0
#endif
#define LJ_SOFTFP (!LJ_ARCH_HASFPU)
#define LJ_SOFTFP32 (LJ_SOFTFP && LJ_32)

#if LJ_ARCH_ENDIAN == LUAJIT_BE
#define LJ_LE 0
Expand Down
8 changes: 4 additions & 4 deletions src/lj_asm.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ static Reg ra_rematk(ASMState *as, IRRef ref)
ra_modified(as, r);
ir->r = RID_INIT; /* Do not keep any hint. */
RA_DBGX((as, "remat $i $r", ir, r));
#if !LJ_SOFTFP
#if !LJ_SOFTFP32
if (ir->o == IR_KNUM) {
emit_loadk64(as, r, ir);
} else
Expand Down Expand Up @@ -1305,7 +1305,7 @@ static void asm_call(ASMState *as, IRIns *ir)
asm_gencall(as, ci, args);
}

#if !LJ_SOFTFP
#if !LJ_SOFTFP32
static void asm_fppow(ASMState *as, IRIns *ir, IRRef lref, IRRef rref)
{
const CCallInfo *ci = &lj_ir_callinfo[IRCALL_pow];
Expand Down Expand Up @@ -1652,10 +1652,10 @@ static void asm_ir(ASMState *as, IRIns *ir)
case IR_MUL: asm_mul(as, ir); break;
case IR_MOD: asm_mod(as, ir); break;
case IR_NEG: asm_neg(as, ir); break;
#if LJ_SOFTFP
#if LJ_SOFTFP32
case IR_DIV: case IR_POW: case IR_ABS:
case IR_ATAN2: case IR_LDEXP: case IR_FPMATH: case IR_TOBIT:
lua_assert(0); /* Unused for LJ_SOFTFP. */
lua_assert(0); /* Unused for LJ_SOFTFP32. */
break;
#else
case IR_DIV: asm_div(as, ir); break;
Expand Down
Loading

0 comments on commit a057a07

Please sign in to comment.