ack/mach/proto/mcg/table
2016-09-24 19:03:55 +02:00

55 lines
911 B
Plaintext

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