Commit 0496de26 authored by Damien George's avatar Damien George
Browse files

py: Allow to enable inline assembler without native emitter.

parent f22be4eb
...@@ -58,8 +58,6 @@ typedef enum { ...@@ -58,8 +58,6 @@ typedef enum {
#define EMIT_ARG(fun, ...) (comp->emit_method_table->fun(comp->emit, __VA_ARGS__)) #define EMIT_ARG(fun, ...) (comp->emit_method_table->fun(comp->emit, __VA_ARGS__))
#define EMIT_LOAD_FAST(qst, local_num) (comp->emit_method_table->load_id.fast(comp->emit, qst, local_num)) #define EMIT_LOAD_FAST(qst, local_num) (comp->emit_method_table->load_id.fast(comp->emit, qst, local_num))
#define EMIT_LOAD_GLOBAL(qst) (comp->emit_method_table->load_id.global(comp->emit, qst)) #define EMIT_LOAD_GLOBAL(qst) (comp->emit_method_table->load_id.global(comp->emit, qst))
#define EMIT_INLINE_ASM(fun) (comp->emit_inline_asm_method_table->fun(comp->emit_inline_asm))
#define EMIT_INLINE_ASM_ARG(fun, ...) (comp->emit_inline_asm_method_table->fun(comp->emit_inline_asm, __VA_ARGS__))
#else #else
...@@ -71,6 +69,9 @@ typedef enum { ...@@ -71,6 +69,9 @@ typedef enum {
#endif #endif
#define EMIT_INLINE_ASM(fun) (comp->emit_inline_asm_method_table->fun(comp->emit_inline_asm))
#define EMIT_INLINE_ASM_ARG(fun, ...) (comp->emit_inline_asm_method_table->fun(comp->emit_inline_asm, __VA_ARGS__))
// elements in this struct are ordered to make it compact // elements in this struct are ordered to make it compact
typedef struct _compiler_t { typedef struct _compiler_t {
qstr source_file; qstr source_file;
...@@ -3386,7 +3387,6 @@ mp_obj_t mp_compile(mp_parse_tree_t *parse_tree, qstr source_file, uint emit_opt ...@@ -3386,7 +3387,6 @@ mp_obj_t mp_compile(mp_parse_tree_t *parse_tree, qstr source_file, uint emit_opt
emit_inline_thumb = emit_inline_thumb_new(max_num_labels); emit_inline_thumb = emit_inline_thumb_new(max_num_labels);
} }
comp->emit = NULL; comp->emit = NULL;
comp->emit_method_table = NULL;
comp->emit_inline_asm = emit_inline_thumb; comp->emit_inline_asm = emit_inline_thumb;
comp->emit_inline_asm_method_table = &emit_inline_thumb_method_table; comp->emit_inline_asm_method_table = &emit_inline_thumb_method_table;
compile_scope_inline_asm(comp, s, MP_PASS_CODE_SIZE); compile_scope_inline_asm(comp, s, MP_PASS_CODE_SIZE);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment