summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2016-02-10 18:51:02 +0100
committerMike Pall <mike>2016-02-10 18:51:02 +0100
commita44388967763d0f7f5f78dfd71703437afa69fc0 (patch)
treee8ae572e8b2c446c669190ba9cac1592a345c669
parent3d4c9f96391b38fc02536bd4147545f08ae7c1e9 (diff)
downloadluajit2-a44388967763d0f7f5f78dfd71703437afa69fc0.tar.gz
Don't allocate unused 2nd result register in JIT compiler backend.
-rw-r--r--src/lj_asm_arm.h2
-rw-r--r--src/lj_asm_mips.h2
-rw-r--r--src/lj_asm_ppc.h2
-rw-r--r--src/lj_asm_x86.h2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/lj_asm_arm.h b/src/lj_asm_arm.h
index 9e4cf436..ba65f45b 100644
--- a/src/lj_asm_arm.h
+++ b/src/lj_asm_arm.h
@@ -426,7 +426,7 @@ static void asm_gencall(ASMState *as, const CCallInfo *ci, IRRef *args)
static void asm_setupresult(ASMState *as, IRIns *ir, const CCallInfo *ci)
{
RegSet drop = RSET_SCRATCH;
- int hiop = ((ir+1)->o == IR_HIOP);
+ int hiop = ((ir+1)->o == IR_HIOP && !irt_isnil((ir+1)->t));
if (ra_hasreg(ir->r))
rset_clear(drop, ir->r); /* Dest reg handled below. */
if (hiop && ra_hasreg((ir+1)->r))
diff --git a/src/lj_asm_mips.h b/src/lj_asm_mips.h
index 78bd26d5..8cdd913b 100644
--- a/src/lj_asm_mips.h
+++ b/src/lj_asm_mips.h
@@ -291,7 +291,7 @@ static void asm_gencall(ASMState *as, const CCallInfo *ci, IRRef *args)
static void asm_setupresult(ASMState *as, IRIns *ir, const CCallInfo *ci)
{
RegSet drop = RSET_SCRATCH;
- int hiop = ((ir+1)->o == IR_HIOP);
+ int hiop = ((ir+1)->o == IR_HIOP && !irt_isnil((ir+1)->t));
if ((ci->flags & CCI_NOFPRCLOBBER))
drop &= ~RSET_FPR;
if (ra_hasreg(ir->r))
diff --git a/src/lj_asm_ppc.h b/src/lj_asm_ppc.h
index 2c5d74a8..e6129032 100644
--- a/src/lj_asm_ppc.h
+++ b/src/lj_asm_ppc.h
@@ -298,7 +298,7 @@ static void asm_gencall(ASMState *as, const CCallInfo *ci, IRRef *args)
static void asm_setupresult(ASMState *as, IRIns *ir, const CCallInfo *ci)
{
RegSet drop = RSET_SCRATCH;
- int hiop = ((ir+1)->o == IR_HIOP);
+ int hiop = ((ir+1)->o == IR_HIOP && !irt_isnil((ir+1)->t));
if ((ci->flags & CCI_NOFPRCLOBBER))
drop &= ~RSET_FPR;
if (ra_hasreg(ir->r))
diff --git a/src/lj_asm_x86.h b/src/lj_asm_x86.h
index 0b6b2d4a..a79be4e6 100644
--- a/src/lj_asm_x86.h
+++ b/src/lj_asm_x86.h
@@ -531,7 +531,7 @@ static void asm_gencall(ASMState *as, const CCallInfo *ci, IRRef *args)
static void asm_setupresult(ASMState *as, IRIns *ir, const CCallInfo *ci)
{
RegSet drop = RSET_SCRATCH;
- int hiop = (LJ_32 && (ir+1)->o == IR_HIOP);
+ int hiop = (LJ_32 && (ir+1)->o == IR_HIOP && !irt_isnil((ir+1)->t));
if ((ci->flags & CCI_NOFPRCLOBBER))
drop &= ~RSET_FPR;
if (ra_hasreg(ir->r))