Make betterer.
This commit is contained in:
parent
65e75be42d
commit
06059233da
1 changed files with 30 additions and 0 deletions
|
@ -61,6 +61,10 @@ PATTERNS
|
|||
emit "mov r0, %in"
|
||||
cost 4;
|
||||
|
||||
STACKADJUST4(delta:aluparam)
|
||||
emit "add sp, sp, %delta"
|
||||
cost 4;
|
||||
|
||||
int = in:REG4
|
||||
prefers int(in)
|
||||
cost 1;
|
||||
|
@ -82,6 +86,10 @@ PATTERNS
|
|||
emit "str %value, %addr"
|
||||
cost 4;
|
||||
|
||||
STORE1(addr:address, value:int)
|
||||
emit "strb %value, %addr"
|
||||
cost 4;
|
||||
|
||||
int = LOAD4(addr:address)
|
||||
emit "ldr %int, %addr"
|
||||
cost 4;
|
||||
|
@ -114,10 +122,14 @@ PATTERNS
|
|||
address = ADD4(addr:int, offset:CONST4)
|
||||
emit "[%addr, #$offset]";
|
||||
|
||||
address = ADD4(addr1:int, addr2:int)
|
||||
emit "[%addr1, %addr2]";
|
||||
|
||||
address = addr:int
|
||||
emit "[%addr]";
|
||||
|
||||
|
||||
|
||||
/* Branches */
|
||||
|
||||
JUMP(addr:BLOCK4)
|
||||
|
@ -129,6 +141,15 @@ PATTERNS
|
|||
emit "b $false"
|
||||
cost 8;
|
||||
|
||||
CJUMPLE(value:cc, PAIR(true:BLOCK4, false:BLOCK4))
|
||||
emit "ble $true"
|
||||
emit "b $false"
|
||||
cost 8;
|
||||
|
||||
CALL(dest:LABEL4)
|
||||
emit "bl $dest"
|
||||
cost 4;
|
||||
|
||||
|
||||
/* Comparisons */
|
||||
|
||||
|
@ -168,6 +189,15 @@ PATTERNS
|
|||
emit "add %int, %right, %left"
|
||||
cost 4;
|
||||
|
||||
int = MOD4(left:int, right:int)
|
||||
emit "udiv %int, %left, %right"
|
||||
emit "mls %int, %int, %right, %left"
|
||||
cost 8;
|
||||
|
||||
int = DIV4(left:int, right:aluparam)
|
||||
emit "div %int, %left, %right"
|
||||
cost 4;
|
||||
|
||||
aluparam = value:CONST4
|
||||
emit "#$value";
|
||||
|
||||
|
|
Loading…
Reference in a new issue