ARM patterns ============= TEMP t_n ------------------------------------------------------- LABEL label: ------------------------------------------------------- CONST(CONST_16) mov Rd, #I_16 ----------------------- CONST(*) movw Rd, #I_low_16 movt Rd, #I_high_16 ------------------------------------------------------- JUMP(NAME) b label ----------------------- JUMP(*) bx Rs ------------------------------------------------------- NAME movw rd, #:lower16:label movt rd, #:upper16:label ------------------------------------------------------- MOVE(MEM(+(*,CONST_16)),*), MOVE(MEM(+(CONST_16,*)),*) str Rs, [Rd, #I_16] ----------------------- MOVE(MEM(*),*) str Rs, [Rd] ----------------------- MOVE(*,*) mov Rd, Rs ------------------------------------------------------- BINOP(PLUS,*,*) add Rd, Rs1, Rs2 ----------------------- BINOP(PLUS,*,CONST_16), add Rd, Rs, #I_16 BINOP(PLUS,CONST_16,*) ------------------------------------------------------- BINOP(MINUS,*,*) sub Rd, Rs1, Rs2 ----------------------- BINOP(MINUS,*,CONST_16) sub Rd, Rs, #I_16 ------------------------------------------------------- BINOP(MUL,*,*) mul Rd, Rs1, Rs2 ----------------------- BINOP(MUL,*,CONST_2^k) lsl Rd, Rs, I_k BINOP(MUL,CONST_2^k,*) ------------------------------------------------------- BINOP(DIV,*,*) udiv Rd, Rs1, Rs2 ----------------------- BINOP(DIV,*,CONST_2^k), asr Rd, Rs, #I_k ------------------------------------------------------- BINOP(AND,*,*) and Rd, Rs1, Rs2 ----------------------- BINOP(AND,*,CONST_16), and Rd, Rs, #I_16 BINOP(AND,CONST_16,*) ------------------------------------------------------- BINOP(OR,*,*) orr Rd, Rs1, Rs2 ----------------------- BINOP(OR,*,CONST_16), orr Rd, Rs, #I_16 BINOP(OR,CONST_16,*) ------------------------------------------------------- BINOP(LSHIFT,*,*) lsl Rd, Rs1, Rs2 ----------------------- BINOP(LSHIFT,*,CONST_16) lsl Rd, Rs, #I_16 ------------------------------------------------------- BINOP(RSHIFT,*,*) lsr Rd, Rs1, Rs2 ----------------------- BINOP(RSHIFT,*,CONST_16) lsr Rd, Rs, #I_16 ------------------------------------------------------- BINOP(ARSHIFT,*,*) asr Rd, Rs1, Rs2 ----------------------- BINOP(ARSHIFT,*,CONST_16) asr Rd, Rs, #I_16 ------------------------------------------------------- BINOP(BITXOR,*,*) eor Rd, Rs1, Rs2 ----------------------- BINOP(BITXOR,*,CONST_16), eor Rd, Rs, #I_16 BINOP(BITXOR,CONST_16,*) ------------------------------------------------------- MEM(+(CONST_16,*)), ldr Rd, [Rs, #I_16] MEM(+(*,CONST_16)) ----------------------- MEM(*) ldr Rd, [Rs] ------------------------------------------------------- CJUMP(op,*,*,label,*) cmp Rs1, Rs2 beq label bne label blt label bgt label ble label bge label ------------------------------------------------------- CALL(*,*) mov or str for params label bl label ----------------------- else mov lr, pc bx Rs