aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2012-03-29 01:11:23 +0200
committerMike Pall <mike>2012-03-29 01:11:23 +0200
commita53a5497742c5249a6cad7e3e25075b8e679ba85 (patch)
tree3eff25655743090e3c102874f71c84195d4a14d5
parent509ca0f0dbdd4854a8db54563d8f29c4566418e5 (diff)
downloadluajit-a53a5497742c5249a6cad7e3e25075b8e679ba85.tar.gz
luajit-a53a5497742c5249a6cad7e3e25075b8e679ba85.tar.bz2
luajit-a53a5497742c5249a6cad7e3e25075b8e679ba85.zip
PPC: Fix HREFK code generation for huge tables.
-rw-r--r--src/lj_asm_ppc.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lj_asm_ppc.h b/src/lj_asm_ppc.h
index 69a4aec2..73942b8b 100644
--- a/src/lj_asm_ppc.h
+++ b/src/lj_asm_ppc.h
@@ -730,12 +730,12 @@ static void asm_hrefk(ASMState *as, IRIns *ir)
730 IRIns *irkey = IR(kslot->op1); 730 IRIns *irkey = IR(kslot->op1);
731 int32_t ofs = (int32_t)(kslot->op2 * sizeof(Node)); 731 int32_t ofs = (int32_t)(kslot->op2 * sizeof(Node));
732 int32_t kofs = ofs + (int32_t)offsetof(Node, key); 732 int32_t kofs = ofs + (int32_t)offsetof(Node, key);
733 Reg dest = (ra_used(ir)||ofs > 65535) ? ra_dest(as, ir, RSET_GPR) : RID_NONE; 733 Reg dest = (ra_used(ir)||ofs > 32736) ? ra_dest(as, ir, RSET_GPR) : RID_NONE;
734 Reg node = ra_alloc1(as, ir->op1, RSET_GPR); 734 Reg node = ra_alloc1(as, ir->op1, RSET_GPR);
735 Reg key = RID_NONE, type = RID_TMP, idx = node; 735 Reg key = RID_NONE, type = RID_TMP, idx = node;
736 RegSet allow = rset_exclude(RSET_GPR, node); 736 RegSet allow = rset_exclude(RSET_GPR, node);
737 lua_assert(ofs % sizeof(Node) == 0); 737 lua_assert(ofs % sizeof(Node) == 0);
738 if (ofs > 65535) { 738 if (ofs > 32736) {
739 idx = dest; 739 idx = dest;
740 rset_clear(allow, dest); 740 rset_clear(allow, dest);
741 kofs = (int32_t)offsetof(Node, key); 741 kofs = (int32_t)offsetof(Node, key);
@@ -761,7 +761,7 @@ static void asm_hrefk(ASMState *as, IRIns *ir)
761 } 761 }
762 if (ra_hasreg(key)) emit_tai(as, PPCI_LWZ, key, idx, kofs+4); 762 if (ra_hasreg(key)) emit_tai(as, PPCI_LWZ, key, idx, kofs+4);
763 emit_tai(as, PPCI_LWZ, type, idx, kofs); 763 emit_tai(as, PPCI_LWZ, type, idx, kofs);
764 if (ofs > 65535) { 764 if (ofs > 32736) {
765 emit_tai(as, PPCI_ADDIS, dest, dest, (ofs + 32768) >> 16); 765 emit_tai(as, PPCI_ADDIS, dest, dest, (ofs + 32768) >> 16);
766 emit_tai(as, PPCI_ADDI, dest, node, ofs); 766 emit_tai(as, PPCI_ADDI, dest, node, ofs);
767 } 767 }