65816-llvm-mos/compare
Scott Duensing d95c30e819 Update.
2026-05-20 20:14:20 -05:00
..
evalAt.c Checkpoint 2026-05-13 15:48:34 -05:00
evalAt.calypsi.lst Update. 2026-05-20 20:14:20 -05:00
evalAt.ours.s Update. 2026-05-20 20:14:20 -05:00
mul16to32.c Checkpoint 2026-05-13 15:48:34 -05:00
mul16to32.calypsi.lst Update. 2026-05-20 20:14:20 -05:00
mul16to32.ours.s ORCA/C demos seem to be working! 2026-05-18 14:43:35 -05:00
README.md Update. 2026-05-20 20:14:20 -05:00
regen.sh Checkpoint 2026-05-13 15:48:34 -05:00
sumSquares.c Checkpoint 2026-05-13 15:48:34 -05:00
sumSquares.calypsi.lst Update. 2026-05-20 20:14:20 -05:00
sumSquares.ll Checkpoint 2026-05-13 20:54:28 -05:00
sumSquares.ours.s ORCA/C demos seem to be working! 2026-05-18 14:43:35 -05:00

compare/ — backend output side-by-side with Calypsi 5.16

Each test case lives as three files:

  • <name>.c — the C source.
  • <name>.ours.s — our backend's assembly (clang --target=w65816 -O2 -S).
  • <name>.calypsi.lst — Calypsi's listing file with source, hex bytes, and asm in one document (cc65816 --speed -O 2 --64bit-doubles).

Calypsi's --output flag emits an ELF object, not text — its --list-file is the human-readable artifact. (32-bit-doubles is Calypsi's default; we pass --64bit-doubles so FP-heavy tests compare apples to apples against our IEEE-754 double ABI.)

Regenerating

bash compare/regen.sh

Recompiles every *.c in this directory under both compilers and prints an instruction-count summary:

test                          ours  calypsi    ratio
----                          ----  -------    -----
evalAt                         472      254    1.86x
mul16to32                        1        4    0.25x
sumSquares                      26       31    0.84x

(Numbers above are current as of 2026-05-20 — re-run for latest.)

Adding a new comparison

Drop a <name>.c in this directory and run regen.sh. No other wiring needed.

Counting methodology

The summary counts asm-line opcodes (lda/sta/jsl/...) on our side and listing lines that begin with a hex byte (Calypsi's emit-byte column) on theirs. Both metrics are static instruction counts, NOT bytes. They underestimate calls-to-runtime (each libcall counts as one jsl, not the body it expands to). For cycle counts, use scripts/benchCycles.sh.