From 42e0c593084784cb0b630d99b8361bc88abadb78 Mon Sep 17 00:00:00 2001 From: Damien George Date: Sat, 14 Mar 2015 13:11:35 +0000 Subject: py: Add MICROPY_COMP_{DOUBLE,TRIPLE}_TUPLE_ASSIGN config options. These allow to fine-tune the compiler to select whether it optimises tuple assignments of the form a, b = c, d and a, b, c = d, e, f. Sensible defaults are provided. --- py/mpconfig.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'py/mpconfig.h') diff --git a/py/mpconfig.h b/py/mpconfig.h index bfa412167..aac3ade08 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -175,6 +175,18 @@ #define MICROPY_COMP_CONST (1) #endif +// Whether to enable optimisation of: a, b = c, d +// Costs 124 bytes (Thumb2) +#ifndef MICROPY_COMP_DOUBLE_TUPLE_ASSIGN +#define MICROPY_COMP_DOUBLE_TUPLE_ASSIGN (1) +#endif + +// Whether to enable optimisation of: a, b, c = d, e, f +// Cost 156 bytes (Thumb2) +#ifndef MICROPY_COMP_TRIPLE_TUPLE_ASSIGN +#define MICROPY_COMP_TRIPLE_TUPLE_ASSIGN (0) +#endif + /*****************************************************************************/ /* Internal debugging stuff */ -- cgit v1.2.3