} by {
; Peephole 123 jump optimization
cjne %1,%2,%3
- smp %4
+ sjmp %4
%3:
} if labelRefCount %3 1
jnc %1
}
+// applies to: bug-524691.c --model-large: while (uRight - uLeft > 1)
replace {
clr a
rlc a
- jnz %1
+ jnz %0
} by {
- ; Peephole 129 jump optimization
- jc %1
+ ; Peephole 129.a jump optimization
+ jc %0
}
+// applies to: _fsdiv.c --xstack: if (mant1 < mant2)
+replace {
+ clr a
+ rlc a
+ pop %1
+ jnz %0
+} by {
+ ; Peephole 129.b optimized condition
+ pop %1
+ jc %0
+} if notVolatile %1
+
+// applies to: time.c --xstack: while((days += (LEAP_YEAR(year) ? 366 : 365)) <= epoch)
+replace {
+ clr a
+ rlc a
+ pop %1
+ pop %2
+ jnz %0
+} by {
+ ; Peephole 129.c optimized condition
+ pop %1
+ pop %2
+ jc %0
+} if notVolatile %1 %2
+
+// applies to: _memmove.c --xstack: if (((int)src < (int)dst) && ((((int)src)+acount) > (int)dst))
+replace {
+ clr a
+ rlc a
+ pop %1
+ pop %2
+ pop %3
+ jnz %0
+} by {
+ ; Peephole 129.d optimized condition
+ pop %1
+ pop %2
+ pop %3
+ jc %0
+} if notVolatile %1 %2 %3
+
replace {
mov r%1,@r%2
} by {
replace {
clr a
- movx @dptr,a
- inc dptr
- movx @dptr,a
- inc dptr
+ movx @%1,a
+ inc %1
+ movx @%1,a
+ inc %1
clr a
} by {
; Peephole 226 removed unnecessary clr
clr a
- movx @dptr,a
- inc dptr
- movx @dptr,a
- inc dptr
+ movx @%1,a
+ inc %1
+ movx @%1,a
+ inc %1
}
replace {
} if notVolatile %1
// Peepholes 259.x are not compatible with peepholex 250.x
-// Peepholes 250.x add jumps to a previously unused label. As the
+// Peepholes 250.x add jumps to a previously unused label. As the
// labelRefCount is not increased, peepholes 259.x are (mistakenly) applied.
// (Mail on sdcc-devel 2004-10-25)
// Note: Peepholes 193..199, 251 remove jumps to previously used labels without
// applies to f.e. vprintf.c
//replace {
// sjmp %1
-//%2:
+//%2:
// ret
//} by {
// sjmp %1
// applies to f.e. gets.c
//replace {
// ljmp %1
-//%2:
+//%2:
// ret
//} by {
// ljmp %1
//} if labelRefCount %2 0
// optimizing jumptables
-// Please note: to enable peephole 260.x you currently have to set
+// Please note: to enable peephole 260.x you currently have to set
// the environment variable SDCC_SJMP_JUMPTABLE
replace {
add a,%1