summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2019-06-12 11:08:22 -0400
committerDan Halbert <halbert@halwitz.org>2019-06-12 11:08:22 -0400
commit1bb4fccc3b28edd1010013b3043e419ec2940f7f (patch)
treed1b64a9693754c81456a3809e6ddbc1935238929 /py
parent0b3f29780afe9706c1b8d7fb1d39b7ef8cd96fcb (diff)
Turn off SUPEROPT on gc.c instead of trying to squueze inline limit so much; reorganize mpconfigboard.mk files
Diffstat (limited to 'py')
-rw-r--r--py/circuitpy_mpconfig.mk14
-rw-r--r--py/py.mk19
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)
diff --git a/py/py.mk b/py/py.mk
index a69243b01..b4f1f00ef 100644
--- a/py/py.mk
+++ b/py/py.mk
@@ -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