Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
3c1857a
Explain and reproduce ps2eeas's nops before div.s (opt-in @divpad)
JeremyL71 Dec 1, 2026
1e3c74a
ps2eeas_nops: count the nops already inserted before a DIV op
JeremyL71 Dec 1, 2026
0a110d1
ps2eeas_nops: a loop label's .p2align does not hide an mtc1 hazard
JeremyL71 Dec 1, 2026
15cca03
ps2eeas_nops: count sqrt.s as a DIV op
JeremyL71 Dec 3, 2026
97f415b
Match 14 PAL-only shared overlay functions
JeremyL71 Dec 1, 2026
db22ba7
Match 4 PAL-only menu functions
JeremyL71 Dec 1, 2026
562594a
Match 11 more PAL-only functions (7 menu, 4 shared overlay)
JeremyL71 Dec 1, 2026
ef358ed
Match 4 PAL functions padded by ps2eeas before div.s (@divpad)
JeremyL71 Dec 1, 2026
610a6ad
Match 20 more PAL-only functions (8 with @divpad)
JeremyL71 Dec 1, 2026
314ba96
Match 21 more PAL-only functions (16 overlay, 5 main)
JeremyL71 Dec 1, 2026
f2c85c3
Match 13 more PAL-only functions (11 overlay, 2 main)
JeremyL71 Dec 1, 2026
c4caa6a
Match 26 more PAL-only functions (8 shared overlay, 17 level, 1 main)
JeremyL71 Dec 1, 2026
524297d
Match 25 more PAL-only functions (14 shared overlay, 10 level, 1 main)
JeremyL71 Dec 1, 2026
a80c16b
Match 12 more PAL-only functions (3 shared overlay, 3 level, 6 main)
JeremyL71 Dec 1, 2026
efd2ea7
Match 29 more PAL-only functions (12 shared overlay, 14 level, 3 main)
JeremyL71 Dec 1, 2026
6c26b79
Match 17 more PAL-only functions (5 shared overlay, 9 level, 3 main)
JeremyL71 Dec 1, 2026
8e231ce
Match 18 more PAL-only functions (9 shared overlay, 7 level, 2 main)
JeremyL71 Dec 2, 2026
3fca735
Match 11 more PAL-only functions (1 shared overlay, 7 level, 3 main)
JeremyL71 Dec 2, 2026
af1975b
Match 12 more PAL-only functions (7 shared overlay, 4 level, 1 main)
JeremyL71 Dec 2, 2026
8fc5824
Match 14 more PAL-only functions (11 level, 1 shared overlay, 2 main)
JeremyL71 Dec 2, 2026
6f2af67
Match 10 more PAL-only functions (4 level, 3 shared overlay, 3 main)
JeremyL71 Dec 2, 2026
69c5345
Match 6 more PAL-only functions (3 level, 3 shared overlay)
JeremyL71 Dec 3, 2026
32343d2
Match 6 more PAL-only functions (4 level, 2 shared overlay)
JeremyL71 Dec 3, 2026
0ad38eb
chore(progress): refresh the maps and reports for 273 PAL matches
JeremyL71 Dec 3, 2026
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
273 changes: 273 additions & 0 deletions config/pal/map.tsv

Large diffs are not rendered by default.

273 changes: 273 additions & 0 deletions config/us/map.tsv

Large diffs are not rendered by default.

18 changes: 14 additions & 4 deletions docs/build/toolchain.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,20 @@ A file whose matched code relies on the `.lit4` load can keep it with the token
`@lit4` in its cflags (`/* cflags: @lit4 */`); `tools/cc.sh` removes the token
and skips the step for that file.

Not explained yet: retail has two nops before most `div.s` (281 of 435 in level code,
including library code), while the compilers in the mirrors emit none and `ps2eeas` on
small test cases adds none either; in the library code the compiler puts the `div.s` in
a jump's delay slot and retail does not.
Nops before `div.s`: retail has two before most of them (281 of 435 in level code). They
come from `ps2eeas`, which always pads the divide-unit ops (`div.s`, `sqrt.s`, `rsqrt.s`,
`vdiv`, `vsqrt`, `vrsqrt`) that sit 0 or 1 instruction after a label or after a B-type
branch's delay slot, with 2 minus that distance nops (`-Wdivbug-on` reports each pad; no
option turns it off). The labels are mostly `-g`'s line labels (`$LM<n>:`): retail was
compiled with `-g` in those files, then stripped, so a `div.s` that starts a source line has
two nops and one inside a line has none. `-g` does not change the code (a full build has the
same `.text` with and without it). A file opts in with `/* cflags: @divpad */`: `tools/cc.sh`
then compiles with `-g`, `tools/ps2eeas_stabs.py` drops the stabs but keeps the labels, and
`tools/ps2eeas_nops.py --div` adds the nops (its rule 4). Opt-in, because some retail objects
lack them (`func_L00_00590698` starts with a bare `div.s`). With it, source lines matter: put a
division on its own line when retail has two nops before it (`func_L01_004C3660`). In the
library code the compiler puts the `div.s` in a jump's delay slot and retail does not; not
explained yet.

Other near misses are a delay slot that retail leaves empty, or a register move
that retail schedules before a save where the compiler puts it after.
Expand Down
Loading
Loading