Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions ports/raspberrypi/boards/pajenicko_picopad/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ CHIP_FAMILY = rp2
EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ"

CIRCUITPY__EVE = 1

CIRCUITPY_PICOGAME = 1
CIRCUITPY_PICOGAME_FAST_DISPLAY = 1
CIRCUITPY_PICODVI = 1
3 changes: 3 additions & 0 deletions ports/raspberrypi/boards/raspberry_pi_pico_w/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 27 additions & 0 deletions ports/raspberrypi/mpconfigport.mk
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,33 @@ CIRCUITPY_TOUCHIO ?= 1

# delay in ms before calling cyw43_arch_init_with_country
CIRCUITPY_CYW43_INIT_DELAY ?= 1000

# -O2 plus the two flags that carry -O3 here, which is 130 KB less flash than -O3 for the same
# speed on everything measured. That headroom is what lets a board fit.
#
# -funswitch-loops Hoists a test that cannot change inside a loop out of it and keeps
# one copy of the body per value. Costs 16 KB, because it duplicates
# loop bodies in 94 functions. Buys 24 % on a flipped sprite blit,
# 9 % on a textured floor, and 1-2 % on bitmaptools.alphablend and
# the ulab reductions.
#
# -fvect-cost-model=dynamic -O2 sets very-cheap, which turns nearly every loop down. dynamic
# accepts them, which here means memset, memcpy and a 16-bit row
# fill get unrolled with an alignment prologue. Costs 4 KB. Buys
# 37 % on rectangle fills and bytearray copies and 16 % on aesio.
# Runs shorter than the prologue lose: a four-pixel span fill is
# 7 % slower.
#
# The four other -O3 loop passes we measured (-fpredictive-commoning, -fgcse-after-reload,
# -ftree-partial-pre, -fsplit-paths) emit the same code as -O2 for the loops that matter here,
# so they are left out. So is the rest of -O3: its inline parameters alone are 92 KB, and they
# also take the 60-factorial loop 56 % slower.
#
# Neither flag reaches the bytecode dispatch loop: py/py.mk builds gc.o and vm.o at -O3 whatever
# this is set to, so pure interpreter work measures the same under all of them.
#
# RP2350 keeps plain -O3. There an -O2 set runs 24-41 % slower on fill loops.
OPTIMIZATION_FLAGS ?= -O2 -funswitch-loops -fvect-cost-model=dynamic
endif

ifeq ($(CHIP_VARIANT),RP2350)
Expand Down
Loading