X-Git-Url: https://git.gag.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmcs51%2Fgen.c;h=957d58dca8dcff26bb363f35348308b930bc40fd;hb=334d46c82420b40682d224b62f2930eb7d77af75;hp=39a01cbe694c2e0d65af6fe2f0e3d582abbb0e1a;hpb=feadd099f18ad86df8ea40a8c926e1217014935f;p=fw%2Fsdcc diff --git a/src/mcs51/gen.c b/src/mcs51/gen.c index 39a01cbe..957d58dc 100644 --- a/src/mcs51/gen.c +++ b/src/mcs51/gen.c @@ -66,8 +66,6 @@ static char *accUse[] = static unsigned short rbank = -1; -#define IS_OP_RUONLY(x) (x && IS_SYMOP(x) && OP_SYMBOL(x)->ruonly) - #define REG_WITH_INDEX mcs51_regWithIdx #define AOP(op) op->aop @@ -1854,7 +1852,7 @@ outBitC (operand * result) /* if the result is bit */ if (AOP_TYPE (result) == AOP_CRY) { - if (!OP_SYMBOL (result)->ruonly) + if (!IS_OP_RUONLY (result)) aopPut (result, "c", 0); } else @@ -2008,7 +2006,7 @@ genNot (iCode * ic) } else { - emitcode ("mov", "c,%s", IC_LEFT (ic)->aop->aopu.aop_dir); + toCarry (IC_LEFT (ic)); emitcode ("cpl", "c"); outBitC (IC_RESULT (ic)); } @@ -4055,7 +4053,7 @@ genRet (iCode * ic) if (IS_BIT(_G.currentFunc->etype)) { - if (!(IS_SYMOP (IC_LEFT (ic)) && OP_SYMBOL (IC_LEFT (ic))->ruonly)) + if (!IS_OP_RUONLY (IC_LEFT (ic))) toCarry (IC_LEFT (ic)); } else @@ -7454,21 +7452,8 @@ genXor (iCode * ic, iCode * ifx) } else { - int sizer = AOP_SIZE (right); // c = bit ^ val - // if val>>1 != 0, result = 1 - emitcode ("setb", "c"); - while (sizer) - { - MOVA (aopGet (right, sizer - 1, FALSE, FALSE)); - if (sizer == 1) - // test the msb of the lsb - emitcode ("anl", "a,#0xfe"); - emitcode ("jnz", "%05d$", tlbl->key + 100); - sizer--; - } - // val = (0,1) - emitcode ("rrc", "a"); + toCarry (right); } emitcode ("jnb", "%s,%05d$", AOP (left)->aopu.aop_dir, (tlbl->key + 100)); emitcode ("cpl", "c");