Loads and stores (except longs, which are difficult) are now loaded with two
instructions rather than three.
This commit is contained in:
parent
52ee317878
commit
d23d2dd1b3
1 changed files with 50 additions and 0 deletions
|
@ -241,28 +241,58 @@ PATTERNS
|
||||||
emit "sw %value, %addr"
|
emit "sw %value, %addr"
|
||||||
cost 4;
|
cost 4;
|
||||||
|
|
||||||
|
STORE.I(label:LABEL.I, value:(int)reg)
|
||||||
|
emit "lui at, ha16[$label]"
|
||||||
|
emit "sw %value, lo16[$label] (at)"
|
||||||
|
cost 8;
|
||||||
|
|
||||||
STOREH.I(addr:address, value:(int)ushortX)
|
STOREH.I(addr:address, value:(int)ushortX)
|
||||||
emit "sh %value, %addr"
|
emit "sh %value, %addr"
|
||||||
cost 4;
|
cost 4;
|
||||||
|
|
||||||
|
STOREH.I(label:LABEL.I, value:(int)reg)
|
||||||
|
emit "lui at, ha16[$label]"
|
||||||
|
emit "sh %value, lo16[$label] (at)"
|
||||||
|
cost 8;
|
||||||
|
|
||||||
STOREB.I(addr:address, value:(int)ubyteX)
|
STOREB.I(addr:address, value:(int)ubyteX)
|
||||||
emit "sb %value, %addr"
|
emit "sb %value, %addr"
|
||||||
cost 4;
|
cost 4;
|
||||||
|
|
||||||
|
STOREB.I(label:LABEL.I, value:(int)reg)
|
||||||
|
emit "lui at, ha16[$label]"
|
||||||
|
emit "sb %value, lo16[$label] (at)"
|
||||||
|
cost 8;
|
||||||
|
|
||||||
STORE.F(addr:address, value:(float)reg)
|
STORE.F(addr:address, value:(float)reg)
|
||||||
emit "swc1 %value, %addr"
|
emit "swc1 %value, %addr"
|
||||||
cost 4;
|
cost 4;
|
||||||
|
|
||||||
|
STORE.F(label:LABEL.I, value:(int)reg)
|
||||||
|
emit "lui at, ha16[$label]"
|
||||||
|
emit "swc1 %value, lo16[$label] (at)"
|
||||||
|
cost 8;
|
||||||
|
|
||||||
STORE.D(addr:address, value:(double)reg)
|
STORE.D(addr:address, value:(double)reg)
|
||||||
emit "sdc1 %value, %addr"
|
emit "sdc1 %value, %addr"
|
||||||
cost 4;
|
cost 4;
|
||||||
|
|
||||||
|
STORE.D(label:LABEL.I, value:(int)reg)
|
||||||
|
emit "lui at, ha16[$label]"
|
||||||
|
emit "sdc1 %value, lo16[$label] (at)"
|
||||||
|
cost 8;
|
||||||
|
|
||||||
/* Loads */
|
/* Loads */
|
||||||
|
|
||||||
out:(int)reg = LOAD.I(addr:address)
|
out:(int)reg = LOAD.I(addr:address)
|
||||||
emit "lw %out, %addr"
|
emit "lw %out, %addr"
|
||||||
cost 4;
|
cost 4;
|
||||||
|
|
||||||
|
out:(int)reg = LOAD.I(label:LABEL.I)
|
||||||
|
emit "lui at, ha16[$label]"
|
||||||
|
emit "lw %out, lo16[$label] (at)"
|
||||||
|
cost 8;
|
||||||
|
|
||||||
/* We can't just load directly because %out.0 and %addr might share
|
/* We can't just load directly because %out.0 and %addr might share
|
||||||
* a register, resulting in %addr being corrupted before %out.1 is
|
* a register, resulting in %addr being corrupted before %out.1 is
|
||||||
* loaded. */
|
* loaded. */
|
||||||
|
@ -276,18 +306,38 @@ PATTERNS
|
||||||
emit "lhu %out, %addr"
|
emit "lhu %out, %addr"
|
||||||
cost 4;
|
cost 4;
|
||||||
|
|
||||||
|
out:(int)ushort0 = LOADH.I(label:LABEL.I)
|
||||||
|
emit "lui at, ha16[$label]"
|
||||||
|
emit "lhu %out, lo16[$label] (at)"
|
||||||
|
cost 8;
|
||||||
|
|
||||||
out:(int)ubyte0 = LOADB.I(addr:address)
|
out:(int)ubyte0 = LOADB.I(addr:address)
|
||||||
emit "lbu %out, %addr"
|
emit "lbu %out, %addr"
|
||||||
cost 4;
|
cost 4;
|
||||||
|
|
||||||
|
out:(int)ubyte0 = LOADB.I(label:LABEL.I)
|
||||||
|
emit "lui at, ha16[$label]"
|
||||||
|
emit "lbu %out, lo16[$label] (at)"
|
||||||
|
cost 8;
|
||||||
|
|
||||||
out:(float)reg = LOAD.F(addr:address)
|
out:(float)reg = LOAD.F(addr:address)
|
||||||
emit "lwc1 %out, %addr"
|
emit "lwc1 %out, %addr"
|
||||||
cost 4;
|
cost 4;
|
||||||
|
|
||||||
|
out:(float)reg = LOAD.F(label:LABEL.I)
|
||||||
|
emit "lui at, ha16[$label]"
|
||||||
|
emit "lwc1 %out, lo16[$label] (at)"
|
||||||
|
cost 8;
|
||||||
|
|
||||||
out:(double)reg = LOAD.D(addr:address)
|
out:(double)reg = LOAD.D(addr:address)
|
||||||
emit "ldc1 %out, %addr"
|
emit "ldc1 %out, %addr"
|
||||||
cost 4;
|
cost 4;
|
||||||
|
|
||||||
|
out:(double)reg = LOAD.D(label:LABEL.I)
|
||||||
|
emit "lui at, ha16[$label]"
|
||||||
|
emit "ldc1 %out, lo16[$label] (at)"
|
||||||
|
cost 8;
|
||||||
|
|
||||||
/* ubyte intrinsics */
|
/* ubyte intrinsics */
|
||||||
|
|
||||||
out:(int)ubyteX = in:(int)ubyte0
|
out:(int)ubyteX = in:(int)ubyte0
|
||||||
|
|
Loading…
Add table
Reference in a new issue