build: the filed i2c cost comes back, -70 B on the tiny85

1316 -> 1246. libavr took the finding this repo filed when its pin last moved:
the shared transaction ladder's cost was never the ladder but the argument
list reaching it - AVR passes eight bytes in call-clobbered registers and the
rest in call-saved ones, so twelve bytes made every forwarder save four it
never reads. A write has no read span, so the write path now passes eight.

Worth recording that the candidate this repo suggested was measured and
rejected upstream, and the numbers filed from here are why: it wins 66 B on a
driver like this one and charges a single-byte reader 20, which is a class
rather than one program.

The mega328P does not move at 1480 - its TWI backend has its own ladder and
was never charged. Net over the whole 22-commit advance the tiny85 is +8 B,
and all of it is the bit-period fix that made the wire rate stop following the
inliner.

Sixteen tests green, cross-mode identity held on both chips.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-23 06:22:23 +02:00
parent bd604ec288
commit 925106394b
3 changed files with 3 additions and 3 deletions

View File

@@ -27,7 +27,7 @@ cmake --build --preset attiny85-generated
Presets cover attiny85/atmega328p in both libavr modes (generated and Presets cover attiny85/atmega328p in both libavr modes (generated and
reflect); `ctest` runs the consteval battery over the BCD, the hours reflect); `ctest` runs the consteval battery over the BCD, the hours
register's two formats, the weekday and the alarm rate encodings, and holds register's two formats, the weekday and the alarm rate encodings, and holds
the example to its stated size — **1480 B** on the mega328P and **1316 B** the example to its stated size — **1480 B** on the mega328P and **1246 B**
on the tiny85, byte-identical across the two modes. The legacy on the tiny85, byte-identical across the two modes. The legacy
yazoalfa-based driver lives on the `master` branch. yazoalfa-based driver lives on the `master` branch.

2
libavr

Submodule libavr updated: aec9955ad3...e69792013e

View File

@@ -5,7 +5,7 @@ libavr_format_test()
if(LIBAVR_MCU STREQUAL "atmega328p") if(LIBAVR_MCU STREQUAL "atmega328p")
libavr_size_claim_test(clock 1480) libavr_size_claim_test(clock 1480)
elseif(LIBAVR_MCU STREQUAL "attiny85") elseif(LIBAVR_MCU STREQUAL "attiny85")
libavr_size_claim_test(clock 1316) libavr_size_claim_test(clock 1246)
endif() endif()
# The README says the two modes emit the same image, and only a tree with # The README says the two modes emit the same image, and only a tree with