Skip to content

Commit de9cd00

Browse files
committed
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.
1 parent bbd0d27 commit de9cd00

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

py/compile.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3419,6 +3419,12 @@ mp_raw_code_t *mp_compile_to_raw_code(mp_parse_tree_t *parse_tree, qstr source_f
34193419
comp->emit = NULL;
34203420
comp->emit_inline_asm_method_table = &ASM_EMITTER(method_table);
34213421
compile_scope_inline_asm(comp, s, MP_PASS_CODE_SIZE);
3422+
#if MICROPY_EMIT_INLINE_XTENSA
3423+
// Xtensa requires an extra pass to compute size of l32r const table
3424+
// TODO this can be improved by calculating it during SCOPE pass
3425+
// but that requires some other structural changes to the asm emitters
3426+
compile_scope_inline_asm(comp, s, MP_PASS_CODE_SIZE);
3427+
#endif
34223428
if (comp->compile_error == MP_OBJ_NULL) {
34233429
compile_scope_inline_asm(comp, s, MP_PASS_EMIT);
34243430
}

0 commit comments

Comments
 (0)