diff options
author | Damien George <damien.p.george@gmail.com> | 2015-03-02 14:29:52 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-03-02 14:29:52 +0000 |
commit | 9f142f0c8411d422f689c9cafdf890d7dc599da8 (patch) | |
tree | b7d8d4c740ac46e27af8bd168a7b45e9611c937b /py/emitinlinethumb.c | |
parent | 565da3f569afa5299ed8dd09e740620c2a3e8e6f (diff) |
py: For inline assembler, add bcc_n and bcc_w ops.
Addresses issue #1143.
Diffstat (limited to 'py/emitinlinethumb.c')
-rw-r--r-- | py/emitinlinethumb.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/py/emitinlinethumb.c b/py/emitinlinethumb.c index ddcd5d394..6fe110b7d 100644 --- a/py/emitinlinethumb.c +++ b/py/emitinlinethumb.c @@ -378,7 +378,9 @@ STATIC void emit_inline_thumb_op(emit_inline_asm_t *emit, qstr op, mp_uint_t n_a } else if (strcmp(op_str, "bx") == 0) { mp_uint_t r = get_arg_reg(emit, op_str, pn_args[0], 15); asm_thumb_op16(emit->as, 0x4700 | (r << 3)); - } else if (op_str[0] == 'b' && op_len == 3) { + } else if (op_str[0] == 'b' && (op_len == 3 + || (op_len == 5 && op_str[3] == '_' + && (op_str[4] == 'n' || op_str[4] == 'w')))) { mp_uint_t cc = -1; for (mp_uint_t i = 0; i < MP_ARRAY_SIZE(cc_name_table); i++) { if (op_str[1] == cc_name_table[i].name[0] && op_str[2] == cc_name_table[i].name[1]) { @@ -389,7 +391,7 @@ STATIC void emit_inline_thumb_op(emit_inline_asm_t *emit, qstr op, mp_uint_t n_a goto unknown_op; } int label_num = get_arg_label(emit, op_str, pn_args[0]); - if (!asm_thumb_bcc_n_label(emit->as, cc, label_num)) { + if (!asm_thumb_bcc_nw_label(emit->as, cc, label_num, op_len == 5 && op_str[4] == 'w')) { goto branch_not_in_range; } } else if (op_str[0] == 'i' && op_str[1] == 't') { |