From 99ed716f69594954295d848e2a388a6fce7ddb1d Mon Sep 17 00:00:00 2001 From: spth Date: Fri, 3 Apr 2009 17:40:28 +0000 Subject: [PATCH] Enabled use of hl as inter-i-code temporary git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5426 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 5 +++++ src/z80/ralloc.c | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7faafa69..dbbc84a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-04-03 Philipp Klaus Krause + + * src/z80/ralloc.c: + Enabled use of hl as inter-i-code temporary. + 2009-04-03 Philipp Klaus Krause * src/z80/peeph-z80.def: diff --git a/src/z80/ralloc.c b/src/z80/ralloc.c index aebe825e..b738cda5 100644 --- a/src/z80/ralloc.c +++ b/src/z80/ralloc.c @@ -53,7 +53,7 @@ enum DISABLE_PACK_ACC = 0, DISABLE_PACK_ASSIGN = 0, DISABLE_PACK_ONE_USE = 0, - DISABLE_PACK_HL = 1, + DISABLE_PACK_HL = 0, DISABLE_PACK_IY = 0 }; @@ -2478,14 +2478,18 @@ packRegsForHLUse3 (iCode * lic, operand * op, eBBlock * ebp) if (ic->op == LEFT_OP && isOperandLiteral (IC_RIGHT (ic))) continue; + if (ic->op == '+' && + (isOperandEqual (op, IC_LEFT (ic)) || isOperandEqual (op, IC_RIGHT (ic)))) + continue; + if ((ic->op == '=' && !POINTER_SET(ic)) || ic->op == UNARYMINUS || - ic->op == '+' || ic->op == '-' || ic->op == '>' || ic->op == '<' || ic->op == EQ_OP || - 0) + (ic->op == '+' && getSize (operandType (IC_RESULT (ic))) == 1)) + /* 16 bit addition uses add hl, rr */ continue; if (ic->op == '*' && isOperandEqual (op, IC_LEFT (ic))) -- 2.30.2