emit "mov r0, %in"
cost 4;
+ STACKADJUST4(delta:aluparam)
+ emit "add sp, sp, %delta"
+ cost 4;
+
int = in:REG4
prefers int(in)
cost 1;
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;
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)
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 */
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";