ack/mach/proto/mcg/table

55 lines
911 B
Text
Raw Normal View History

2016-09-24 17:03:55 +00:00
PATTERNS
2016-09-24 15:20:40 +00:00
2016-09-24 17:03:55 +00:00
STORE4(addr:address, value:reg)
2016-09-24 15:20:40 +00:00
ins value:GPR
emit "str %value, %addr"
cost 4;
reg = LOAD4(addr:address)
2016-09-24 15:20:40 +00:00
outs dest:ANY
emit "ld %dest, %addr"
cost 4;
address = ADD4(addr:reg, offset:CONST)
2016-09-24 15:20:40 +00:00
ins addr:GPR
fragment "[%addr, #%offset.ivalue]";
address = addr:reg
ins addr:GPR
fragment "[%addr]";
2016-09-24 17:03:55 +00:00
reg;
2016-09-24 15:20:40 +00:00
reg = ADD4(left:reg, right:aluparam)
2016-09-24 15:20:40 +00:00
ins left:GPR, right:GPR
outs out:GPR
emit "add %out, %left, %right"
cost 4;
reg = ADD4(left:aluparam, right:reg)
2016-09-24 15:20:40 +00:00
ins left:GPR, right:GPR
outs out:GPR
emit "add %out, %right, %left"
cost 4;
aluparam = value:CONST4
2016-09-24 15:20:40 +00:00
when { return false; }
fragment "#%value.ivalue";
aluparam = reg;
reg = value:aluparam
outs out:GPR
emit "mov %out, %value"
cost 4;
reg = value:LABEL4
2016-09-24 15:20:40 +00:00
outs out:GPR
emit "adr %out, #value.lvalue"
cost 4;
reg = value:CONST4
2016-09-24 15:20:40 +00:00
outs out:GPR
emit "ldr %out, #value.lvalue"
cost 4;