mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
MIPS: Fix calls to floor/ceil/trunc.
This commit is contained in:
parent
f58a84d0bc
commit
2ac083cb5a
@ -364,15 +364,13 @@ static void asm_callid(ASMState *as, IRIns *ir, IRCallID id)
|
|||||||
static void asm_callround(ASMState *as, IRIns *ir, IRCallID id)
|
static void asm_callround(ASMState *as, IRIns *ir, IRCallID id)
|
||||||
{
|
{
|
||||||
/* The modified regs must match with the *.dasc implementation. */
|
/* The modified regs must match with the *.dasc implementation. */
|
||||||
RegSet drop = RID2RSET(RID_R1)|RID2RSET(RID_R12)|RID2RSET(RID_F2)|
|
RegSet drop = RID2RSET(RID_R1)|RID2RSET(RID_R12)|RID2RSET(RID_FPRET)|
|
||||||
RID2RSET(RID_F4)|RID2RSET(RID_F12)|RID2RSET(RID_F14);
|
RID2RSET(RID_F2)|RID2RSET(RID_F4)|RID2RSET(REGARG_FIRSTFPR);
|
||||||
const CCallInfo *ci = &lj_ir_callinfo[id];
|
if (ra_hasreg(ir->r)) rset_clear(drop, ir->r);
|
||||||
IRRef args[2];
|
|
||||||
args[0] = ir->op1;
|
|
||||||
args[1] = ir->op2;
|
|
||||||
ra_evictset(as, drop);
|
ra_evictset(as, drop);
|
||||||
ra_destreg(as, ir, RID_FPRET);
|
ra_destreg(as, ir, RID_FPRET);
|
||||||
asm_gencall(as, ci, args);
|
emit_call(as, (void *)lj_ir_callinfo[id].func);
|
||||||
|
ra_leftov(as, REGARG_FIRSTFPR, ir->op1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -- Returns ------------------------------------------------------------- */
|
/* -- Returns ------------------------------------------------------------- */
|
||||||
|
@ -2154,7 +2154,7 @@ static void build_subroutines(BuildCtx *ctx)
|
|||||||
|//-- Math helper functions ----------------------------------------------
|
|//-- Math helper functions ----------------------------------------------
|
||||||
|//-----------------------------------------------------------------------
|
|//-----------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
|// Modifies AT, TMP0, FRET1, FRET2, f4. Keeps all others incl. FARG1, FARG2.
|
|// Modifies AT, TMP0, FRET1, FRET2, f4. Keeps all others incl. FARG1.
|
||||||
|.macro vm_round, func
|
|.macro vm_round, func
|
||||||
| lui TMP0, 0x4330 // Hiword of 2^52 (double).
|
| lui TMP0, 0x4330 // Hiword of 2^52 (double).
|
||||||
| mtc1 r0, f4
|
| mtc1 r0, f4
|
||||||
|
Loading…
Reference in New Issue
Block a user