Commit 5b65f0c7 authored by Damien George's avatar Damien George
Browse files

py: Rename USE_COMPUTED_GOTOS to USE_COMPUTED_GOTO and enable on stmhal.

On stmhal, computed gotos make the binary about 1k bigger, but makes it
run faster, and we have the room, so why not.  All tests pass on
pyboard using computed gotos.
parent 559d8239
......@@ -166,8 +166,8 @@ typedef double mp_float_t;
// Whether to use computed gotos in the VM, or a switch
// Computed gotos are roughly 10% faster, and increase VM code size by a little
#ifndef MICROPY_USE_COMPUTED_GOTOS
#define MICROPY_USE_COMPUTED_GOTOS (0)
#ifndef MICROPY_USE_COMPUTED_GOTO
#define MICROPY_USE_COMPUTED_GOTO (0)
#endif
// Additional builtin function definitions - see builtintables.c:builtin_object_table for format.
......
......@@ -165,7 +165,7 @@ mp_vm_return_kind_t mp_execute_byte_code_2(const byte *code_info, const byte **i
mp_obj_t *fastn, mp_obj_t **sp_in_out,
mp_exc_stack_t *exc_stack, mp_exc_stack_t **exc_sp_in_out,
volatile mp_obj_t inject_exc) {
#if MICROPY_USE_COMPUTED_GOTOS
#if MICROPY_USE_COMPUTED_GOTO
#include "vmentrytable.h"
#define DISPATCH() do { \
save_ip = ip; \
......@@ -220,7 +220,7 @@ outer_dispatch_loop:
// loop to execute byte code
for (;;) {
dispatch_loop:
#if MICROPY_USE_COMPUTED_GOTOS
#if MICROPY_USE_COMPUTED_GOTO
DISPATCH();
#else
save_ip = ip;
......@@ -935,7 +935,7 @@ yield:
fastn[0] = obj1;
return MP_VM_RETURN_EXCEPTION;
#if !MICROPY_USE_COMPUTED_GOTOS
#if !MICROPY_USE_COMPUTED_GOTO
} // switch
#endif
} // for loop
......
......@@ -11,6 +11,7 @@
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
#define MICROPY_PATH_MAX (128)
#define MICROPY_USE_COMPUTED_GOTO (1)
/* Enable FatFS LFNs
0: Disable LFN feature.
1: Enable LFN with static working buffer on the BSS. Always NOT reentrant.
......
......@@ -13,7 +13,7 @@
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_DOUBLE)
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
#define MICROPY_PATH_MAX (PATH_MAX)
#define MICROPY_USE_COMPUTED_GOTOS (1)
#define MICROPY_USE_COMPUTED_GOTO (1)
#define MICROPY_MOD_SYS_STDFILES (1)
#define MICROPY_ENABLE_MOD_CMATH (1)
......
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