* src/SDCCpeeph.c (operandsLiteral): new, added,
[fw/sdcc] / src / mcs51 / peeph.def
index aff964cca292a17405c7f484eb58b8d85b9de2dc..e0aed8b39b97174867b308a546b1476aa1295a64 100644 (file)
@@ -684,7 +684,7 @@ replace {
        mov     a,%2
        add     a,#0xff - %1
        mov     %3,c
-}
+} if operandsLiteral(%1)
 
 replace {
        clr     c
@@ -696,7 +696,7 @@ replace {
        mov     a,%2
        add     a,#0xff - %1
        jnc     %5
-}
+} if operandsLiteral(%1)
 
 replace {
        clr     c
@@ -708,7 +708,7 @@ replace {
        mov     a,%2
        add     a,#0xff - %1
        jc      %5
-}
+} if operandsLiteral(%1)
 
 replace {
        clr     c
@@ -720,20 +720,19 @@ replace {
        mov     a,#0x100 - %2
        add     a,%1
        mov     %3,c
-} if operandsNotRelated('0x00' %2)
+} if operandsNotRelated('0x00' %2), operandsLiteral(%2)
 
-//This peephole caused bug #1453093
-//replace {
-//     clr     c
-//     mov     a,%1
-//     subb    a,#%2
-//     jnc     %5
-//} by {
-//     ;       Peephole 132.e  optimized genCmpLt by inverse logic (carry differs)
-//     mov     a,#0x100 - %2
-//     add     a,%1
-//     jc      %5
-//} if operandsNotRelated('0x00' %2)
+replace {
+       clr     c
+       mov     a,%1
+       subb    a,#%2
+       jnc     %5
+} by {
+       ;       Peephole 132.e  optimized genCmpLt by inverse logic (carry differs)
+       mov     a,#0x100 - %2
+       add     a,%1
+       jc      %5
+} if operandsNotRelated('0x00' %2), operandsLiteral(%2)
 
 replace {
        clr     c
@@ -745,7 +744,7 @@ replace {
        mov     a,#0x100 - %2
        add     a,%1
        jnc     %5
-} if operandsNotRelated('0x00' %2)
+} if operandsNotRelated('0x00' %2), operandsLiteral(%2)
 
 
 replace {