Minor peephole improvement
authorspth <spth@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 15 Aug 2008 20:39:49 +0000 (20:39 +0000)
committerspth <spth@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 15 Aug 2008 20:39:49 +0000 (20:39 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5215 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/z80/peep.c
src/z80/peeph-z80.def

index 3f370c6127386ffa3738be7edaabf0249f53c720..747720b477fc847da80b55a6a942383e491bc801 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-08-14 Philipp Klaus Krause <pkk AT spth.de>
+
+       * src/z80/peep.c,
+       * src/z80/peeph-z80.def: minor peephole improvement
+
+
 2008-08-15 Raphael Neider <rneider AT web.de>
 
        * src/z80/gen.c (_vemit2): suppress compiler warning
index bef434a7d51af643425f097f6afee16a3f4cc673..7e27c07e52de6355648fc61d46d5b1f8efad36dd 100644 (file)
@@ -245,6 +245,7 @@ z80MightRead(const lineNode *pl, const char *what)
     strncmp(pl->line, "rl\t", 3) == 0 ||
     strncmp(pl->line, "rr\t", 3) == 0 ||  
     strncmp(pl->line, "sla\t", 4) == 0 ||
+    strncmp(pl->line, "sra\t", 4) == 0 ||
     strncmp(pl->line, "srl\t", 4) == 0)
     {
        return (strstr(pl->line + 3, what) != 0);
index b34a6b0dd1457912282bf438875f225836f20465..911dc62240e43100e4484cfa286798f4a78e47de 100644 (file)
@@ -137,6 +137,14 @@ replace restart {
        push    de
 } if notUsed('de'), notUsed('hl')
 
+replace restart {
+       ex      de,hl
+       push    de
+} by {
+       ; peephole 0k' pushed de directly instead of going through hl.
+       push    hl
+} if notUsed('de'), notUsed('hl')
+
 replace restart {
        ex      de,hl
        push    bc