X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fmcs51%2Fgen.c;h=f239639daf51e9c5b896594c463f1bcd8d3c2876;hb=4aaf3f38b6bb76c23d0de81978e7591dac97a4d2;hp=ac2e391e6b35a5f6d3b4b02dc129ffbf928c71a8;hpb=c7dfe1a5cd275f3da65ed8c24da944a1500da33a;p=fw%2Fsdcc diff --git a/src/mcs51/gen.c b/src/mcs51/gen.c index ac2e391e..f239639d 100644 --- a/src/mcs51/gen.c +++ b/src/mcs51/gen.c @@ -4218,7 +4218,7 @@ hasInc (operand *op, iCode *ic) return lic; } /* if the operand used or deffed */ - if (bitVectBitValue(ic->uses,op->key) || (unsigned) ic->defKey == op->key) { + if (bitVectBitValue(OP_USES(op),lic->key) || (unsigned) lic->defKey == op->key) { return NULL; } lic = lic->next; @@ -5262,6 +5262,12 @@ genRRC (iCode * ic) /* move it to the result */ size = AOP_SIZE (result); offset = size - 1; + if (size == 1) { /* special case for 1 byte */ + l = aopGet (AOP (left), offset, FALSE, FALSE); + MOVA (l); + emitcode ("rr", "a"); + goto release; + } CLRC; while (size--) { @@ -5279,6 +5285,7 @@ genRRC (iCode * ic) MOVA (l); } emitcode ("mov", "acc.7,c"); + release: aopPut (AOP (result), "a", AOP_SIZE (result) - 1); freeAsmop (left, NULL, ic, TRUE); freeAsmop (result, NULL, ic, TRUE); @@ -5307,6 +5314,10 @@ genRLC (iCode * ic) { l = aopGet (AOP (left), offset, FALSE, FALSE); MOVA (l); + if (size == 0) { /* special case for 1 byte */ + emitcode("rl","a"); + goto release; + } emitcode ("add", "a,acc"); if (AOP_SIZE (result) > 1) aopPut (AOP (result), "a", offset++); @@ -5327,6 +5338,7 @@ genRLC (iCode * ic) MOVA (l); } emitcode ("mov", "acc.0,c"); + release: aopPut (AOP (result), "a", 0); freeAsmop (left, NULL, ic, TRUE); freeAsmop (result, NULL, ic, TRUE);