diff options
Diffstat (limited to 'src/lj_asm_arm.h')
-rw-r--r-- | src/lj_asm_arm.h | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/lj_asm_arm.h b/src/lj_asm_arm.h index a7465cb7..ef907fbe 100644 --- a/src/lj_asm_arm.h +++ b/src/lj_asm_arm.h | |||
@@ -1574,15 +1574,23 @@ static void asm_callid(ASMState *as, IRIns *ir, IRCallID id) | |||
1574 | static void asm_callround(ASMState *as, IRIns *ir, int id) | 1574 | static void asm_callround(ASMState *as, IRIns *ir, int id) |
1575 | { | 1575 | { |
1576 | /* The modified regs must match with the *.dasc implementation. */ | 1576 | /* The modified regs must match with the *.dasc implementation. */ |
1577 | RegSet drop = RID2RSET(RID_D0)|RID2RSET(RID_D1)|RID2RSET(RID_D2)| | 1577 | RegSet drop = RID2RSET(RID_R0)|RID2RSET(RID_R1)|RID2RSET(RID_R2)| |
1578 | RID2RSET(RID_R0)|RID2RSET(RID_R1); | 1578 | RID2RSET(RID_R3)|RID2RSET(RID_R12); |
1579 | if (ra_hasreg(ir->r)) rset_clear(drop, ir->r); | 1579 | RegSet of; |
1580 | Reg dest, src; | ||
1580 | ra_evictset(as, drop); | 1581 | ra_evictset(as, drop); |
1581 | ra_destreg(as, ir, RID_FPRET); | 1582 | dest = ra_dest(as, ir, RSET_FPR); |
1582 | emit_call(as, id == IRFPM_FLOOR ? (void *)lj_vm_floor_hf : | 1583 | emit_dnm(as, ARMI_VMOV_D_RR, RID_RETLO, RID_RETHI, (dest & 15)); |
1583 | id == IRFPM_CEIL ? (void *)lj_vm_ceil_hf : | 1584 | emit_call(as, id == IRFPM_FLOOR ? (void *)lj_vm_floor_sf : |
1584 | (void *)lj_vm_trunc_hf); | 1585 | id == IRFPM_CEIL ? (void *)lj_vm_ceil_sf : |
1585 | ra_leftov(as, RID_D0, ir->op1); | 1586 | (void *)lj_vm_trunc_sf); |
1587 | /* Workaround to protect argument GPRs from being used for remat. */ | ||
1588 | of = as->freeset; | ||
1589 | as->freeset &= ~RSET_RANGE(RID_R0, RID_R1+1); | ||
1590 | as->cost[RID_R0] = as->cost[RID_R1] = REGCOST(~0u, ASMREF_L); | ||
1591 | src = ra_alloc1(as, ir->op1, RSET_FPR); /* May alloc GPR to remat FPR. */ | ||
1592 | as->freeset |= (of & RSET_RANGE(RID_R0, RID_R1+1)); | ||
1593 | emit_dnm(as, ARMI_VMOV_RR_D, RID_R0, RID_R1, (src & 15)); | ||
1586 | } | 1594 | } |
1587 | #endif | 1595 | #endif |
1588 | 1596 | ||