aboutsummaryrefslogtreecommitdiff
path: root/src/lj_asm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_asm.c')
-rw-r--r--src/lj_asm.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/lj_asm.c b/src/lj_asm.c
index 7c27a98f..1a78e32a 100644
--- a/src/lj_asm.c
+++ b/src/lj_asm.c
@@ -155,6 +155,8 @@ IRFLDEF(FLOFS)
155#include "lj_emit_arm.h" 155#include "lj_emit_arm.h"
156#elif LJ_TARGET_PPC 156#elif LJ_TARGET_PPC
157#include "lj_emit_ppc.h" 157#include "lj_emit_ppc.h"
158#elif LJ_TARGET_MIPS
159#include "lj_emit_mips.h"
158#else 160#else
159#error "Missing instruction emitter for target CPU" 161#error "Missing instruction emitter for target CPU"
160#endif 162#endif
@@ -441,12 +443,22 @@ static Reg ra_scratch(ASMState *as, RegSet allow)
441/* Evict all registers from a set (if not free). */ 443/* Evict all registers from a set (if not free). */
442static void ra_evictset(ASMState *as, RegSet drop) 444static void ra_evictset(ASMState *as, RegSet drop)
443{ 445{
446 RegSet work;
444 as->modset |= drop; 447 as->modset |= drop;
445 drop &= ~as->freeset; 448#if !LJ_SOFTFP
446 while (drop) { 449 work = (drop & ~as->freeset) & RSET_FPR;
447 Reg r = rset_pickbot(drop); 450 while (work) {
451 Reg r = rset_pickbot(work);
448 ra_restore(as, regcost_ref(as->cost[r])); 452 ra_restore(as, regcost_ref(as->cost[r]));
449 rset_clear(drop, r); 453 rset_clear(work, r);
454 checkmclim(as);
455 }
456#endif
457 work = (drop & ~as->freeset) & RSET_GPR;
458 while (work) {
459 Reg r = rset_pickbot(work);
460 ra_restore(as, regcost_ref(as->cost[r]));
461 rset_clear(work, r);
450 checkmclim(as); 462 checkmclim(as);
451 } 463 }
452} 464}
@@ -1153,6 +1165,8 @@ static void asm_loop(ASMState *as)
1153#include "lj_asm_arm.h" 1165#include "lj_asm_arm.h"
1154#elif LJ_TARGET_PPC 1166#elif LJ_TARGET_PPC
1155#include "lj_asm_ppc.h" 1167#include "lj_asm_ppc.h"
1168#elif LJ_TARGET_MIPS
1169#include "lj_asm_mips.h"
1156#else 1170#else
1157#error "Missing assembler for target CPU" 1171#error "Missing assembler for target CPU"
1158#endif 1172#endif
@@ -1530,9 +1544,7 @@ static void asm_setup_regsp(ASMState *as)
1530#if LJ_SOFTFP 1544#if LJ_SOFTFP
1531 case IR_MIN: case IR_MAX: 1545 case IR_MIN: case IR_MAX:
1532#endif 1546#endif
1533#if LJ_BE
1534 (ir-1)->prev = REGSP_HINT(RID_RETLO); 1547 (ir-1)->prev = REGSP_HINT(RID_RETLO);
1535#endif
1536 ir->prev = REGSP_HINT(RID_RETHI); 1548 ir->prev = REGSP_HINT(RID_RETHI);
1537 continue; 1549 continue;
1538 default: 1550 default: