A little fiddling with store instructions. The PowerPC is not friendly to
authorDavid Given <dg@cowlark.com>
Mon, 10 Oct 2016 22:23:35 +0000 (00:23 +0200)
committerDavid Given <dg@cowlark.com>
Mon, 10 Oct 2016 22:23:35 +0000 (00:23 +0200)
iburg.

mach/proto/mcg/table

index 4a853a6..20ef46b 100644 (file)
@@ -73,6 +73,7 @@ REGISTERS
 DECLARATIONS
 
        cr;
+    ubyte_to_be;
 
        address   fragment;
 
@@ -129,10 +130,23 @@ PATTERNS
                emit "sth %value, %addr"
                cost 4;
 
-       STORE1(addr:address, value:(int)reg)
+    STORE1(addr:address, value:(int)ubyte_to_be)
                emit "stb %value, %addr"
                cost 4;
 
+    STORE1(ADD4(left:(int)reg, right:(int)reg), value:(int)ubyte_to_be)
+        emit "stbx %value, %left, %right"
+        cost 4;
+
+    out:(int)ubyte_to_be = in:(int)reg
+        cost 1;
+
+    out:(int)ubyte_to_be = CIU41(value:(int)reg)
+        cost 1;
+
+    out:(int)ubyte_to_be = CIU41(CII14(CIU41(value:(int)reg)))
+        cost 1;
+
        out:(int)reg = LOAD4(addr:address)
                emit "lwz %out, %addr"
                cost 4;
@@ -325,7 +339,7 @@ PATTERNS
                cost 4;
 
        out:(int)reg = value:CONST4
-               emit "la %out, $value"
+               emit "li %out, $value"
                cost 8;