summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-12-19 17:42:25 +1100
committerDamien George <damien.p.george@gmail.com>2016-12-19 17:42:25 +1100
commitde9cd00b39fbd66279dda69bc642ac2f3c459fa1 (patch)
tree5311d6a85add7acce267a95ccf3c2497643afcdc
parentbbd0d27a251cf337e45ec4859777ddb7baf836f2 (diff)
downloadmicropython-de9cd00b39fbd66279dda69bc642ac2f3c459fa1.tar.gz
micropython-de9cd00b39fbd66279dda69bc642ac2f3c459fa1.zip
py/compile: Add an extra pass for Xtensa inline assembler.
It needs an extra pass to compute the size of the constant table for the l32r instructions.
-rw-r--r--py/compile.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/py/compile.c b/py/compile.c
index 43a0bf454a..b84793d10a 100644
--- a/py/compile.c
+++ b/py/compile.c
@@ -3419,6 +3419,12 @@ mp_raw_code_t *mp_compile_to_raw_code(mp_parse_tree_t *parse_tree, qstr source_f
comp->emit = NULL;
comp->emit_inline_asm_method_table = &ASM_EMITTER(method_table);
compile_scope_inline_asm(comp, s, MP_PASS_CODE_SIZE);
+ #if MICROPY_EMIT_INLINE_XTENSA
+ // Xtensa requires an extra pass to compute size of l32r const table
+ // TODO this can be improved by calculating it during SCOPE pass
+ // but that requires some other structural changes to the asm emitters
+ compile_scope_inline_asm(comp, s, MP_PASS_CODE_SIZE);
+ #endif
if (comp->compile_error == MP_OBJ_NULL) {
compile_scope_inline_asm(comp, s, MP_PASS_EMIT);
}