mov %1,a
mov dptr,#%2
movx @dptr,a
-}
+} if notVolatile %1
+
replace {
mov a,acc
} by {
movx @dptr,a
inc dptr
movx @dptr,a
-}
+} if notVolatile %1
replace {
mov %1,%2
%7:
mov sp,bp
pop bp
-}
+} if notVolatile %1
replace {
mov %1,%2
} by {
; Peephole 105 removed redundant mov
mov %1,a
-}
+} if notVolatile %1
replace {
mov %1,a
; Peephole 106 removed redundant mov
mov %1,a
clr c
-}
+} if notVolatile %1
replace {
ljmp %1
mov r%1,%2
inc @r%1
mov ar%3,@r%1
-}
+} if notVolatile
replace {
mov r%1,%2
mov r%1,%2
dec @r%1
mov ar%3,@r%1
-}
+} if notVolatile
replace {
mov r%1,a
mov %1,a
mov dpl,%2
mov dph,%3
-}
+} if notVolatile %1
// WTF? Doesn't look sensible to me...
//replace {
; Peephole 166 removed redundant mov
mov %1,%2
mov %3,%1
-}
+} if notVolatile %1 %2
replace {
mov c,%1
; Peephole 176 optimized increment, removed redundant mov
inc @r%2
mov %1,@r%2
-}
+} if notVolatile
// this one will screw assignes to volatile/sfr's
-//replace {
-// mov %1,%2
-// mov %2,%1
-//} by {
-// ; Peephole 177 removed redundant mov
-// mov %1,%2
-//}
+replace {
+ mov %1,%2
+ mov %2,%1
+} by {
+ ; Peephole 177 removed redundant mov
+ mov %1,%2
+} if notVolatile %1 %2
// applies to f.e. scott-add.asm (--model-large)
replace {
; Peephole 184 removed redundant mov
cpl a
mov %1,a
-}
+} if notVolatile %1
replace {
// acc being incremented might cause problems
; Peephole 185 changed order of increment (acc incremented also!)
inc a
mov %1,a
-}
+} if notVolatile %1
replace {
add a,#%1
mov dptr,%2
movc a,@a+dptr
mov %1,a
-}
+} if notVolatile %1
replace {
anl a,#0x0f
; Peephole 189 removed redundant mov and anl
anl a,#0x0f
mov %1,a
-}
+} if notVolatile %1
// rules 190 & 191 need to be in order
replace {
; Peephole 190 removed redundant mov
mov a,%1
lcall __gptrput
-}
+} if notVolatile %1
replace {
mov %1,a
mov dpl,%2
mov dph,%3
mov b,%4
-}
+} if notVolatile %1
replace {
mov r%1,a
; Peephole 204 removed redundant mov
add a,acc
mov %1,a
-}
+} if notVolatile %1
replace {
djnz %1,%2
mov %1,%1
} by {
; Peephole 206 removed redundant mov %1,%1
-}
+} if notVolatile
replace {
mov a,_bp
xrl %1,#0x80
}
+
replace {
mov %1,a
mov a,%2
mov %1 + %2,(%2 + %1)
} by {
; Peephole 221.a remove redundant move
-}
+} if notVolatile
replace {
mov (%1 + %2 + %3),((%2 + %1) + %3)
} by {
; Peephole 221.b remove redundant move
-}
+} if notVolatile
replace {
dec r%1
; Peephole 223 removed redundant dph/dpl moves
mov %1,dpl
mov %2,dph
-}
+} if notVolatile %1 %2
replace {
mov %1,dpl
; Peephole 224 removed redundant dph/dpl moves
mov %1,dpl
mov (%1 + 1),dph
-}
+} if notVolatile %1
replace {
mov a,%1
mov dpl,%2
mov dph,%3
mov b,%4
-}
+} if notVolatile %1
replace {
clr a
mov a,#%2
movx @dptr,a
} by {
- ; Peephole 230 replaced inefficient 16 constant
+ ; Peephole 230 replaced inefficient 16 bit constant
mov dptr,#%1
mov a,#%2
movx @dptr,a
movx a,@dptr
anl a,#%2&%3
movx @dptr,a
-}
+} if notVolatile %1
replace {
mov dptr,#%1
movx a,@dptr
orl a,#%2|%3
movx @dptr,a
-}
+} if notVolatile %1
replace {
mov dptr,#%1
orl a,#%2
anl a,#%3
movx @dptr,a
-}
+} if notVolatile %1
replace {
mov dptr,#%1
anl a,#%2
orl a,#%3
movx @dptr,a
-}
+} if notVolatile %1
replace {
mov dptr,#%1
orl a,#%2
anl a,#%3&%4
movx @dptr,a
-}
+} if notVolatile %1
replace {
mov dptr,#%1
anl a,#%3
orl a,#%4
movx @dptr,a
-}
+} if notVolatile %1
replace {
mov dptr,#%1
orl a,#%3
anl a,#%4
movx @dptr,a
-}
+} if notVolatile %1
replace {
mov dptr,#%1
anl a,#%2
orl a,#%3|%4
movx @dptr,a
-}
+} if notVolatile %1
mov a,@r%5
anl a,#%2&%3
mov @r%5,a
-}
+} if notVolatile %1
replace {
mov r%5,#%1
mov a,@r%5
orl a,#%2|%3
mov @r%5,a
-}
+} if notVolatile %1
replace {
mov r%5,#%1
orl a,#%2
anl a,#%3
mov @r%5,a
-}
+} if notVolatile %1
replace {
mov r%5,#%1
anl a,#%2
orl a,#%3
mov @r%5,a
-}
+} if notVolatile %1
replace {
mov r%5,#%1
orl a,#%2
anl a,#%3&%4
mov @r%5,a
-}
+} if notVolatile %1
replace {
mov r%5,#%1
anl a,#%3
orl a,#%4
mov @r%5,a
-}
+} if notVolatile %1
replace {
mov r%5,#%1
orl a,#%3
anl a,#%4
mov @r%5,a
-}
+} if notVolatile %1
replace {
mov r%5,#%1
anl a,#%2
orl a,#%3|%4
mov @r%5,a
-}
+} if notVolatile %1
// Peepholes 248.x have to be compatible with the keyword volatile.
xrl a,%4
movx @dptr,a
}
+