diff options
Diffstat (limited to '')
-rw-r--r-- | src/lj_asm_mips.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/lj_asm_mips.h b/src/lj_asm_mips.h index db42b8f3..1686b40f 100644 --- a/src/lj_asm_mips.h +++ b/src/lj_asm_mips.h | |||
@@ -1577,7 +1577,7 @@ dotypecheck: | |||
1577 | asm_guard(as, MIPSI_BEQ, RID_TMP, RID_ZERO); | 1577 | asm_guard(as, MIPSI_BEQ, RID_TMP, RID_ZERO); |
1578 | emit_tsi(as, MIPSI_SLTIU, RID_TMP, type, (int32_t)LJ_TISNUM); | 1578 | emit_tsi(as, MIPSI_SLTIU, RID_TMP, type, (int32_t)LJ_TISNUM); |
1579 | } else { | 1579 | } else { |
1580 | Reg ktype = ra_allock(as, irt_toitype(t), allow); | 1580 | Reg ktype = ra_allock(as, (ir->op2 & IRSLOAD_KEYINDEX) ? LJ_KEYINDEX : irt_toitype(t), allow); |
1581 | asm_guard(as, MIPSI_BNE, type, ktype); | 1581 | asm_guard(as, MIPSI_BNE, type, ktype); |
1582 | } | 1582 | } |
1583 | } | 1583 | } |
@@ -1595,6 +1595,10 @@ dotypecheck: | |||
1595 | if (irt_ispri(t)) { | 1595 | if (irt_ispri(t)) { |
1596 | asm_guard(as, MIPSI_BNE, type, | 1596 | asm_guard(as, MIPSI_BNE, type, |
1597 | ra_allock(as, ~((int64_t)~irt_toitype(t) << 47) , allow)); | 1597 | ra_allock(as, ~((int64_t)~irt_toitype(t) << 47) , allow)); |
1598 | } else if ((ir->op2 & IRSLOAD_KEYINDEX)) { | ||
1599 | asm_guard(as, MIPSI_BNE, RID_TMP, | ||
1600 | ra_allock(as, (int32_t)LJ_KEYINDEX, allow)); | ||
1601 | emit_dta(as, MIPSI_DSRA32, RID_TMP, type, 0); | ||
1598 | } else { | 1602 | } else { |
1599 | if (irt_isnum(t)) { | 1603 | if (irt_isnum(t)) { |
1600 | asm_guard(as, MIPSI_BEQ, RID_TMP, RID_ZERO); | 1604 | asm_guard(as, MIPSI_BEQ, RID_TMP, RID_ZERO); |
@@ -2568,7 +2572,22 @@ static void asm_stack_restore(ASMState *as, SnapShot *snap) | |||
2568 | } | 2572 | } |
2569 | emit_tsi(as, MIPSI_SW, type, RID_BASE, ofs+(LJ_BE?0:4)); | 2573 | emit_tsi(as, MIPSI_SW, type, RID_BASE, ofs+(LJ_BE?0:4)); |
2570 | #else | 2574 | #else |
2571 | asm_tvstore64(as, RID_BASE, ofs, ref); | 2575 | if ((sn & SNAP_KEYINDEX)) { |
2576 | RegSet allow = rset_exclude(RSET_GPR, RID_BASE); | ||
2577 | int64_t kki = (int64_t)LJ_KEYINDEX << 32; | ||
2578 | if (irref_isk(ref)) { | ||
2579 | emit_tsi(as, MIPSI_SD, | ||
2580 | ra_allock(as, kki | (int64_t)(uint32_t)ir->i, allow), | ||
2581 | RID_BASE, ofs); | ||
2582 | } else { | ||
2583 | Reg src = ra_alloc1(as, ref, allow); | ||
2584 | Reg rki = ra_allock(as, kki, rset_exclude(allow, src)); | ||
2585 | emit_tsi(as, MIPSI_SD, RID_TMP, RID_BASE, ofs); | ||
2586 | emit_dst(as, MIPSI_DADDU, RID_TMP, src, rki); | ||
2587 | } | ||
2588 | } else { | ||
2589 | asm_tvstore64(as, RID_BASE, ofs, ref); | ||
2590 | } | ||
2572 | #endif | 2591 | #endif |
2573 | } | 2592 | } |
2574 | checkmclim(as); | 2593 | checkmclim(as); |