diff options
author | graham sanderson <graham.sanderson@raspberrypi.org> | 2021-01-17 21:56:34 -0600 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2021-01-29 23:57:10 +1100 |
commit | 794df0f1d502bf715449ed6d36f16cf52b095d0b (patch) | |
tree | 9f5e10ec2b1b6d7232defff515db2023d7fa268d /py/asmthumb.c | |
parent | 15ac5a3df9b90eade2b4743e08e23ce219cb4f7f (diff) |
py/emitnative: Support binary ops on ARMv6M without use of ite instr.
Diffstat (limited to 'py/asmthumb.c')
-rw-r--r-- | py/asmthumb.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/py/asmthumb.c b/py/asmthumb.c index e3558b2cf..f7ac87fa0 100644 --- a/py/asmthumb.c +++ b/py/asmthumb.c @@ -564,6 +564,18 @@ void asm_thumb_bcc_label(asm_thumb_t *as, int cond, uint label) { } } +void asm_thumb_bcc_rel9(asm_thumb_t *as, int cond, int rel) { + rel -= 4; // account for instruction prefetch, PC is 4 bytes ahead of this instruction + assert(SIGNED_FIT9(rel)); + asm_thumb_op16(as, OP_BCC_N(cond, rel)); +} + +void asm_thumb_b_rel12(asm_thumb_t *as, int rel) { + rel -= 4; // account for instruction prefetch, PC is 4 bytes ahead of this instruction + assert(SIGNED_FIT12(rel)); + asm_thumb_op16(as, OP_B_N(rel)); +} + #define OP_BLX(reg) (0x4780 | ((reg) << 3)) #define OP_SVC(arg) (0xdf00 | (arg)) |