Optimise the case when a 8-bit value is being written to a local and then
authorDavid Given <dg@cowlark.com>
Tue, 12 Mar 2019 23:57:07 +0000 (00:57 +0100)
committerDavid Given <dg@cowlark.com>
Tue, 12 Mar 2019 23:57:07 +0000 (00:57 +0100)
immediately read back from the local.

mach/i80/ncg/table

index 74c85f8..7f017d9 100644 (file)
@@ -557,8 +557,18 @@ uses hl_or_de={label,$1}           yields %a
 /* Group 2: Store instructions            */
 /******************************************/
 
+pat lal sti lal loi ($1==$3) && ($2==1) && ($4==1)
+   with areg
+      yields a a
+      leaving
+         lal $1
+         sti 1
+
 pat stl lol $1==$2
-with dereg                             yields de de leaving stl $1
+   with dereg
+      yields de de
+      leaving
+         stl $1
 
 #ifdef USE_I80_RSTS
    pat stl $1==0-2