py: Add support for emitting native x86 machine code.

This commit is contained in:
Damien George
2014-09-06 23:06:36 +01:00
parent 33b50a0217
commit c90f59ec3a
10 changed files with 987 additions and 249 deletions

View File

@@ -3638,6 +3638,11 @@ mp_obj_t mp_compile(mp_parse_node_t pn, qstr source_file, uint emit_opt, bool is
emit_native = emit_native_x64_new(max_num_labels);
}
comp->emit_method_table = &emit_native_x64_method_table;
#elif MICROPY_EMIT_X86
if (emit_native == NULL) {
emit_native = emit_native_x86_new(max_num_labels);
}
comp->emit_method_table = &emit_native_x86_method_table;
#elif MICROPY_EMIT_THUMB
if (emit_native == NULL) {
emit_native = emit_native_thumb_new(max_num_labels);
@@ -3689,6 +3694,8 @@ mp_obj_t mp_compile(mp_parse_node_t pn, qstr source_file, uint emit_opt, bool is
if (emit_native != NULL) {
#if MICROPY_EMIT_X64
emit_native_x64_free(emit_native);
#elif MICROPY_EMIT_X86
emit_native_x86_free(emit_native);
#elif MICROPY_EMIT_THUMB
emit_native_thumb_free(emit_native);
#elif MICROPY_EMIT_ARM