diff --git a/ports/raspberrypi/Makefile b/ports/raspberrypi/Makefile index 6348dc941f7..13499baf0f7 100755 --- a/ports/raspberrypi/Makefile +++ b/ports/raspberrypi/Makefile @@ -217,7 +217,10 @@ CFLAGS += \ -DPICO_NO_BI_BOOTSEL_VIA_DOUBLE_RESET=0 \ -DDVI_1BPP_BIT_REVERSE=0 -OPTIMIZATION_FLAGS ?= -O3 +# -O2 plus the two -O3 flags that measure: -funswitch-loops (16 KB) carries the sprite +# blits, -fvect-cost-model=dynamic (4 KB) the fills and memcpy. Same speed as -O3 on both +# cores for about 125 KB less flash. Boards may override this in mpconfigboard.mk. +OPTIMIZATION_FLAGS ?= -O2 -funswitch-loops -fvect-cost-model=dynamic # TinyUSB defines CFLAGS += \ -DCFG_TUSB_OS=OPT_OS_PICO \ diff --git a/ports/raspberrypi/boards/pajenicko_picopad/mpconfigboard.mk b/ports/raspberrypi/boards/pajenicko_picopad/mpconfigboard.mk index b5df0e6ecb5..03a203dc2de 100644 --- a/ports/raspberrypi/boards/pajenicko_picopad/mpconfigboard.mk +++ b/ports/raspberrypi/boards/pajenicko_picopad/mpconfigboard.mk @@ -50,8 +50,3 @@ CFLAGS += \ # Must be accompanied by a linker script change CFLAGS += -DCIRCUITPY_FIRMWARE_SIZE='(1536 * 1024)' - -# The rp2 port default is -O3; on this Cortex-M0+ (no SIMD/FPU, 16 KB XIP cache) -O2 plus -# these five loop passes measures within +-1% of -O3 across the picogame render kernels -# while using ~150 KB less flash (gc.o/vm.o stay -O3 via SUPEROPT regardless). -OPTIMIZATION_FLAGS = -O2 -funswitch-loops -fpredictive-commoning -fgcse-after-reload -ftree-partial-pre -fsplit-paths diff --git a/ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.mk b/ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.mk index 28a3c6a641a..38ee11df70b 100644 --- a/ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.mk +++ b/ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.mk @@ -18,7 +18,3 @@ CIRCUITPY_PICOGAME_FAST_DISPLAY = 1 CIRCUITPY_AUDIOIO = 1 FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython-stage/picosystem - -# The default is -O3. picogame does not fit at -O3; these loop passes keep the render -# kernels within 1% of it. -OPTIMIZATION_FLAGS = -O2 -funswitch-loops -fpredictive-commoning -fgcse-after-reload -ftree-partial-pre -fsplit-paths diff --git a/ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.mk b/ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.mk index 20607d50e41..c53ddbbd7e4 100644 --- a/ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.mk +++ b/ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.mk @@ -9,4 +9,8 @@ CHIP_FAMILY = rp2 EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ" CIRCUITPY__EVE = 1 + +CIRCUITPY_PICOGAME = 1 +CIRCUITPY_PICOGAME_FAST_DISPLAY = 1 + CIRCUITPY_PICODVI = 1 diff --git a/ports/raspberrypi/boards/raspberry_pi_pico_w/mpconfigboard.mk b/ports/raspberrypi/boards/raspberry_pi_pico_w/mpconfigboard.mk index e658db65f4d..bb7a9208899 100644 --- a/ports/raspberrypi/boards/raspberry_pi_pico_w/mpconfigboard.mk +++ b/ports/raspberrypi/boards/raspberry_pi_pico_w/mpconfigboard.mk @@ -12,6 +12,9 @@ CIRCUITPY_USB_HOST = 0 CIRCUITPY__EVE = 1 +CIRCUITPY_PICOGAME = 1 +CIRCUITPY_PICOGAME_FAST_DISPLAY = 1 + CIRCUITPY_CYW43 = 1 CIRCUITPY_SSL = 1 CIRCUITPY_HASHLIB = 1