Skip to content

Commit 03053f8

Browse files
committed
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.
1 parent ae54fbf commit 03053f8

4 files changed

Lines changed: 4 additions & 0 deletions

File tree

mpy-cross/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#define MICROPY_COMP_CONST (1)
4545
#define MICROPY_COMP_DOUBLE_TUPLE_ASSIGN (1)
4646
#define MICROPY_COMP_TRIPLE_TUPLE_ASSIGN (1)
47+
#define MICROPY_COMP_RETURN_IF_EXPR (1)
4748

4849
#define MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE (0)
4950

stmhal/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
// compiler configuration
4646
#define MICROPY_COMP_MODULE_CONST (1)
4747
#define MICROPY_COMP_TRIPLE_TUPLE_ASSIGN (1)
48+
#define MICROPY_COMP_RETURN_IF_EXPR (1)
4849

4950
// optimisations
5051
#define MICROPY_OPT_COMPUTED_GOTO (1)

unix/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
#endif
4646
#define MICROPY_COMP_MODULE_CONST (1)
4747
#define MICROPY_COMP_TRIPLE_TUPLE_ASSIGN (1)
48+
#define MICROPY_COMP_RETURN_IF_EXPR (1)
4849
#define MICROPY_ENABLE_GC (1)
4950
#define MICROPY_ENABLE_FINALISER (1)
5051
#define MICROPY_STACK_CHECK (1)

windows/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#define MICROPY_EMIT_INLINE_THUMB (0)
3939
#define MICROPY_COMP_MODULE_CONST (1)
4040
#define MICROPY_COMP_TRIPLE_TUPLE_ASSIGN (1)
41+
#define MICROPY_COMP_RETURN_IF_EXPR (1)
4142
#define MICROPY_ENABLE_GC (1)
4243
#define MICROPY_ENABLE_FINALISER (1)
4344
#define MICROPY_STACK_CHECK (1)

0 commit comments

Comments
 (0)