]> git.gag.com Git - fw/sdcc/commitdiff
some optimizations (eg. selective strength reduction)
authorsandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 21 May 2000 04:40:01 +0000 (04:40 +0000)
committersandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 21 May 2000 04:40:01 +0000 (04:40 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@255 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCloop.c
src/mcs51/peeph.def
src/mcs51/ralloc.c

index 8eb38af30a2c566740b0e69147187489149e367f..e98192ad074c909d6f15f5e715673fc01edddd7b 100644 (file)
@@ -872,6 +872,12 @@ set *basicInduction (region *loopReg , eBBlock **ebbs, int count)
            if (! applyToSetFTrue (basicInd,findInduction,aSym,&ip))
                continue ;                  
            
+           /* ask port for size not worth if native instruction
+              exist for multiply & divide */
+           if (getSize(operandType(IC_LEFT(ic))) <= port->muldiv.native_below ||
+               getSize(operandType(IC_RIGHT(ic))) <= port->muldiv.native_below)
+               continue;
+
            /* if this is a division then the remainder should be zero 
               for it to be inducted */
            if (ic->op == '/' && (ip->cval % litVal))
index ef2963b914ef7558eb63440ad8a53310ba67280f..630a6e6cfbdbd441b701e57d9e1e78b019c995f1 100644 (file)
@@ -1786,4 +1786,11 @@ replace {
        mov     (%1 + %2 + %3),((%2 + %1) + %3)
 } by {
        ; Peephole 221b remove redundant move
+}
+
+replace {
+       dec     r%1
+       inc     r%1
+} by {
+       ; removed dec/inc pair
 }
\ No newline at end of file
index 4440eb05cbce34d6a55ca900eddbb08fef9c4f91..80d81667596cc4a31c44ffd53864fac490832f2b 100644 (file)
@@ -1729,7 +1729,9 @@ static iCode *packRegsForOneuse (iCode *ic, operand *op , eBBlock *ebp)
        the usage of b, & acc */
     if (getSize(operandType(op)) >  (fReturnSize - 2) &&
        ic->op != RETURN             &&
-       ic->op != SEND)
+       ic->op != SEND               &&
+       !POINTER_SET(ic)             &&
+       !POINTER_GET(ic))
        return NULL;
 
     /* this routine will mark the a symbol as used in one 
@@ -1820,7 +1822,7 @@ static iCode *packRegsForOneuse (iCode *ic, operand *op , eBBlock *ebp)
                return NULL;
 
        /* if left or right or result is in far space */
-       if (isOperandInFarSpace(IC_LEFT(dic))   ||
+       if (isOperandInFarSpace(IC_LEFT(dic))   ||
            isOperandInFarSpace(IC_RIGHT(dic))  ||
            isOperandInFarSpace(IC_RESULT(dic)) ||
            IS_OP_RUONLY(IC_LEFT(dic))          ||