diff options
Diffstat (limited to 'py')
| -rw-r--r-- | py/circuitpy_mpconfig.mk | 14 | ||||
| -rw-r--r-- | py/py.mk | 19 |
2 files changed, 23 insertions, 10 deletions
diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index ed9b9f461..47303a73a 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -32,13 +32,13 @@ # CIRCUITPY_FULL_BUILD = 0 ifndef CIRCUITPY_FULL_BUILD -ifeq ($(CIRCUITPY_SMALL_BUILD),1) -CIRCUITPY_FULL_BUILD = 0 -CFLAGS += -DCIRCUITPY_FULL_BUILD=0 -else -CIRCUITPY_FULL_BUILD = 1 -CFLAGS += -DCIRCUITPY_FULL_BUILD=1 -endif + ifeq ($(CIRCUITPY_SMALL_BUILD),1) + CIRCUITPY_FULL_BUILD = 0 + CFLAGS += -DCIRCUITPY_FULL_BUILD=0 + else + CIRCUITPY_FULL_BUILD = 1 + CFLAGS += -DCIRCUITPY_FULL_BUILD=1 + endif endif # All builtin modules are listed below, with default values (0 for off, 1 for on) @@ -107,9 +107,9 @@ endif # External modules written in C. ifneq ($(USER_C_MODULES),) -# pre-define USERMOD variables as expanded so that variables are immediate +# pre-define USERMOD variables as expanded so that variables are immediate # expanded as they're added to them -SRC_USERMOD := +SRC_USERMOD := CFLAGS_USERMOD := LDFLAGS_USERMOD := $(foreach module, $(wildcard $(USER_C_MODULES)/*/micropython.mk), \ @@ -343,10 +343,23 @@ $(PY_BUILD)/qstr.o: $(HEADER_BUILD)/qstrdefs.generated.h $(PY_BUILD)/nlr%.o: CFLAGS += -Os # optimising gc for speed; 5ms down to 4ms on pybv2 +ifndef SUPEROPT_GC + SUPEROPT_GC = 1 +endif + +ifeq ($(SUPEROPT_GC),1) $(PY_BUILD)/gc.o: CFLAGS += $(CSUPEROPT) +endif # optimising vm for speed, adds only a small amount to code size but makes a huge difference to speed (20% faster) -$(PY_BUILD)/vm.o: CFLAGS += $(CSUPEROPT) +ifndef SUPEROPT_VM + SUPEROPT_VM = 1 +endif + +ifeq ($(SUPEROPT_VM),1) +#$(PY_BUILD)/vm.o: CFLAGS += $(CSUPEROPT) +endif + # Optimizing vm.o for modern deeply pipelined CPUs with branch predictors # may require disabling tail jump optimization. This will make sure that # each opcode has its own dispatching jump which will improve branch |
