projects
/
fw
/
sdcc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* src/SDCCicode.c (printOperand): added missing else
[fw/sdcc]
/
src
/
z80
/
peeph.def
diff --git
a/src/z80/peeph.def
b/src/z80/peeph.def
index 63f57e357cd76a1e34285e8cab01aff747d8d40c..1ff4aa80724b561c4a236ad278e6d9154edc894d 100644
(file)
--- a/
src/z80/peeph.def
+++ b/
src/z80/peeph.def
@@
-1,3
+1,8
@@
+replace {
+ ld (hl),(hl)
+} by {
+ ERROR - peephole - caught (hl),(hl)
+}
replace restart {
ld %1,%1
} by {
replace restart {
ld %1,%1
} by {
@@
-9,7
+14,6
@@
replace restart {
or a,a
jp %2,%3
} by {
or a,a
jp %2,%3
} by {
- ; Removed redundent or a,a
xor a,a
or a,%1
jp %2,%3
xor a,a
or a,%1
jp %2,%3
@@
-18,7
+22,6
@@
replace restart {
cp a,#0x00
jp nz,%1
} by {
cp a,#0x00
jp nz,%1
} by {
- ; Rule 3
or a,a
jp nz,%1
}
or a,a
jp nz,%1
}
@@
-29,7
+32,6
@@
replace restart {
jp %3
%2:
} by {
jp %3
%2:
} by {
- ; Rule 4
jp z,%2
%1:
jp %3
jp z,%2
%1:
jp %3
@@
-40,7
+42,6
@@
replace restart {
jp %2
%1:
} by {
jp %2
%1:
} by {
- ; Rule 5
jp z,%2
%1:
}
jp z,%2
%1:
}
@@
-49,16
+50,170
@@
replace restart {
jp %2
%1:
} by {
jp %2
%1:
} by {
- ; Rule 6
jp nz,%2
%1:
}
replace restart {
jp nz,%2
%1:
}
replace restart {
+ or a,%1
+ or a,a
+} by {
+ or a,%1
+}
+replace restart {
+ or a,%1)
+ or a,a
+} by {
+ or a,%1)
+}
+replace restart {
+ xor a,a
+ or a,%1
+ jp nz,%2
+ xor a,a
+ or a,%3
+ jp z,%2
+} by {
+ xor a,a
+ or a,%1
+ jp nz,%2
+ or a,%3
+ jp z,%2
+}
+replace restart {
+ jp nz,%1
+ inc %3)
%1:
jp %2
%1:
jp %2
- jp %3
} by {
} by {
- ; Weird Rule 7
+ jp nz,%2
+ inc %3)
%1:
jp %2
}
%1:
jp %2
}
+replace restart {
+ xor a,a
+ ld a,#0x00
+} by {
+ xor a,a
+}
+replace {
+ ld e,#0x00
+ ld d,#0x00
+} by {
+ ld de,#0x0000
+}
+replace {
+ ld l,#0x00
+ ld h,#0x00
+} by {
+ ld hl,#0x0000
+}
+replace {
+ ld c,#0x00
+ ld b,#0x00
+} by {
+ ld bc,#0x0000
+}
+replace restart {
+ ld %1,a
+ ld a,%1
+} by {
+ ld %1,a
+} if notVolatile %1
+replace restart {
+ jp %1,%2
+ jr %3
+%2:
+ jp %4
+} by {
+ jp %1,%4
+ jr %3
+%2:
+ jp %4
+}
+replace {
+ ld l,e
+ ld h,d
+ push hl
+ ld l,c
+ ld h,b
+ push hl
+} by {
+ push de
+ push bc
+}
+replace {
+ and a,#%1
+ or a,a
+} by {
+ and a,#%1
+}
+replace {
+ ld b,l
+ ld a,b
+ pop bc
+ ld b,a
+} by {
+ ld a,l
+ pop bc
+ ld b,a
+}
+replace {
+ ld d,l
+ ld a,d
+ pop de
+ ld d,a
+} by {
+ ld a,l
+ pop de
+ ld d,a
+}
+replace {
+ ld a,b
+ push af
+ inc sp
+} by {
+ push bc
+ inc sp
+}
+replace {
+ ld a,d
+ push af
+ inc sp
+} by {
+ push de
+ inc sp
+}
+replace {
+ ld a,%1
+ sub a,#%2
+ jp m,%3
+ ld a,%1
+ sub a,#%4
+ jp p,%5
+} by {
+ ld a,%1
+ cp a,#%2
+ jp m,%3
+ cp a,#%4
+ jp p,%5
+}
+replace {
+ ld e,l
+ ld d,h
+ ld l,e
+ ld h,d
+} by {
+ ld e,l
+ ld d,h
+}
+replace {
+ ld %1,%2
+ ld %3,%4
+ ld %2,%1
+ ld %4,%3
+} by {
+ ld %1,%2
+ ld %3,%4
+}
+