From 03053f82db8fb79e8f62524948ebc2331c957af8 Mon Sep 17 00:00:00 2001 From: Damien George Date: Sat, 22 Apr 2017 15:09:15 +1000 Subject: [PATCH] mpy-cross, unix, windows, stmhal: Enable return-if-else optimisation. Prior to making this a config option it was previously available on these (and all other) ports, and it makes sense to keep it enabled for mpy-cross as well as ports that have a decent amount of space for the code. --- mpy-cross/mpconfigport.h | 1 + stmhal/mpconfigport.h | 1 + unix/mpconfigport.h | 1 + windows/mpconfigport.h | 1 + 4 files changed, 4 insertions(+) diff --git a/mpy-cross/mpconfigport.h b/mpy-cross/mpconfigport.h index 383de14399..e227d1be54 100644 --- a/mpy-cross/mpconfigport.h +++ b/mpy-cross/mpconfigport.h @@ -44,6 +44,7 @@ #define MICROPY_COMP_CONST (1) #define MICROPY_COMP_DOUBLE_TUPLE_ASSIGN (1) #define MICROPY_COMP_TRIPLE_TUPLE_ASSIGN (1) +#define MICROPY_COMP_RETURN_IF_EXPR (1) #define MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE (0) diff --git a/stmhal/mpconfigport.h b/stmhal/mpconfigport.h index 2186e2ed64..444ce93032 100644 --- a/stmhal/mpconfigport.h +++ b/stmhal/mpconfigport.h @@ -45,6 +45,7 @@ // compiler configuration #define MICROPY_COMP_MODULE_CONST (1) #define MICROPY_COMP_TRIPLE_TUPLE_ASSIGN (1) +#define MICROPY_COMP_RETURN_IF_EXPR (1) // optimisations #define MICROPY_OPT_COMPUTED_GOTO (1) diff --git a/unix/mpconfigport.h b/unix/mpconfigport.h index 4067e19500..d197f4503d 100644 --- a/unix/mpconfigport.h +++ b/unix/mpconfigport.h @@ -45,6 +45,7 @@ #endif #define MICROPY_COMP_MODULE_CONST (1) #define MICROPY_COMP_TRIPLE_TUPLE_ASSIGN (1) +#define MICROPY_COMP_RETURN_IF_EXPR (1) #define MICROPY_ENABLE_GC (1) #define MICROPY_ENABLE_FINALISER (1) #define MICROPY_STACK_CHECK (1) diff --git a/windows/mpconfigport.h b/windows/mpconfigport.h index cad76e7810..8cef506713 100644 --- a/windows/mpconfigport.h +++ b/windows/mpconfigport.h @@ -38,6 +38,7 @@ #define MICROPY_EMIT_INLINE_THUMB (0) #define MICROPY_COMP_MODULE_CONST (1) #define MICROPY_COMP_TRIPLE_TUPLE_ASSIGN (1) +#define MICROPY_COMP_RETURN_IF_EXPR (1) #define MICROPY_ENABLE_GC (1) #define MICROPY_ENABLE_FINALISER (1) #define MICROPY_STACK_CHECK (1)