diff options
author | Damien George <damien.p.george@gmail.com> | 2014-10-12 14:21:06 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-10-12 14:21:06 +0100 |
commit | 1ef2348df0c15f9924d3b5be798fd20805ccd5aa (patch) | |
tree | 4289f7e1d42e55318c96ef44e7e6a499c1ea5a3c /py/asmarm.c | |
parent | 1606607bd42ce36f7d892c14b29046b7152d0fa6 (diff) | |
download | micropython-1ef2348df0c15f9924d3b5be798fd20805ccd5aa.tar.gz micropython-1ef2348df0c15f9924d3b5be798fd20805ccd5aa.zip |
py: Implement and,or,xor native ops for viper.
Diffstat (limited to 'py/asmarm.c')
-rw-r--r-- | py/asmarm.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/py/asmarm.c b/py/asmarm.c index 3fac94285b..8d328f2ca4 100644 --- a/py/asmarm.c +++ b/py/asmarm.c @@ -175,6 +175,21 @@ STATIC uint asm_arm_op_sub_reg(uint rd, uint rn, uint rm) { return 0x0400000 | (rn << 16) | (rd << 12) | rm; } +STATIC uint asm_arm_op_and_reg(uint rd, uint rn, uint rm) { + // and rd, rn, rm + return 0x0000000 | (rn << 16) | (rd << 12) | rm; +} + +STATIC uint asm_arm_op_eor_reg(uint rd, uint rn, uint rm) { + // eor rd, rn, rm + return 0x0200000 | (rn << 16) | (rd << 12) | rm; +} + +STATIC uint asm_arm_op_orr_reg(uint rd, uint rn, uint rm) { + // orr rd, rn, rm + return 0x1800000 | (rn << 16) | (rd << 12) | rm; +} + void asm_arm_bkpt(asm_arm_t *as) { // bkpt #0 emit_al(as, 0x1200070); @@ -312,6 +327,21 @@ void asm_arm_sub_reg_reg_reg(asm_arm_t *as, uint rd, uint rn, uint rm) { emit_al(as, asm_arm_op_sub_reg(rd, rn, rm)); } +void asm_arm_and_reg_reg_reg(asm_arm_t *as, uint rd, uint rn, uint rm) { + // and rd, rn, rm + emit_al(as, asm_arm_op_and_reg(rd, rn, rm)); +} + +void asm_arm_eor_reg_reg_reg(asm_arm_t *as, uint rd, uint rn, uint rm) { + // eor rd, rn, rm + emit_al(as, asm_arm_op_eor_reg(rd, rn, rm)); +} + +void asm_arm_orr_reg_reg_reg(asm_arm_t *as, uint rd, uint rn, uint rm) { + // orr rd, rn, rm + emit_al(as, asm_arm_op_orr_reg(rd, rn, rm)); +} + void asm_arm_mov_reg_local_addr(asm_arm_t *as, uint rd, int local_num) { // add rd, sp, #local_num*4 emit_al(as, asm_arm_op_add_imm(rd, ASM_ARM_REG_SP, local_num << 2)); |