* src/z80/peeph-gbz80.def: applied patch
authorborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 16 Feb 2008 15:05:19 +0000 (15:05 +0000)
committerborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 16 Feb 2008 15:05:19 +0000 (15:05 +0000)
  #1880235: Z80 return peephole, thanks to Philipp Krause

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5012 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/z80/peeph-z80.def

index a9de75a2623b7b768dc8bf7f1bfee5bdaac08223..3d1b6a461ec63fea5590b59367a2171f194c1672 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,15 @@
 2008-02-16 Borut Razem <borut.razem AT siol.net>
 
-       * 
+       * as/z80/asmain.c, as/z80/asm.h, as/z80/asdata.c,
+         as/link/z80/lkmain.c, as/z80/as_gbz80.dsp, as/z80/as_z80.dsp,
+         as/z80/Makefile.in. as/z80/Makefile.bcc: 
+         applied patch #1893393: patch for as-z80 and link-z80 to generate
+         cdb, thanks to Armin Diehl
+       * as/*/asnoice.c, as/hc08/as_hc08.dsp, as/hc08/Makefile.in,
+         as/mcs51/asx8051.dsp, as/mcs51/Makefile.in:
+         asnoice.c moved to as/asxxsrc/asnoice.c
+       * src/z80/peeph-gbz80.def: applied patch
+         #1880235: Z80 return peephole, thanks to Philipp Krause
 
 2008-02-14 Maarten Brock <sourceforge.brock AT dse.nl>
 
index f717847ad2a11dd08f784864a7cbd5d78ba05909..01901e87dbe50dbbebeadd8ca11143003aca4028 100644 (file)
@@ -151,22 +151,31 @@ replace restart {
        jp      %1,%5
 } by {
        ret     %1
-       ; peephole z12 replaced jump by return.
+       ; peephole z11a replaced jump by return.
 } if labelIsReturnOnly(), labelRefCountChange(%5 -1)
 
 // Should be one of the last ones. Opens the code to further peephole optimization.
 replace restart {
 %1:
 } by {
-       ; peephole z13 removed unused label %1.
+       ; peephole z12 removed unused label %1.
 } if labelRefCount(%1 0)
 
+// Applying z11 or z11a followed by z12 will often leave a dead ret at the end of the function. Remove it.
+replace {
+       jp      %5
+       ret
+} by {
+       jp      %5
+       ; peephole z13 removed unused ret.
+}
+
 // These should be the last rules, so that the peepholes above need to look at jp only.
 replace {
        jp      %5
 } by {
        jr      %5
-       ; peephole z14 changed absolute to relative conditional jump.
+       ; peephole z14 changed absolute to relative unconditional jump.
 } if labelInRange()
 
 replace {