Skip to content

recompiler: sync GTE read-helper classification with runtime accessor semantics - #272

Merged
mstan merged 1 commit into
mstan:masterfrom
Alexbeav:pr/gte-read-classification
Aug 31, 2026
Merged

recompiler: sync GTE read-helper classification with runtime accessor semantics#272
mstan merged 1 commit into
mstan:masterfrom
Alexbeav:pr/gte-read-classification

Conversation

@Alexbeav

Copy link
Copy Markdown
Contributor

Problem

The emitter's mfc2/cfc2 raw-vs-helper classification
(gte_register_classification.h) was out of sync with the runtime's
gte_read_data/gte_read_ctrl special cases: compiled code read OTZ(7)
and SZ0-3(16-19) unmasked and the sign-extended class (1,3,5,8-11)
raw, and cfc2 missed ctrl regs 4/12/20 — while the interpreter always
goes through the accessors. Nine data regs + three ctrl regs of
backend semantic divergence, locked in by a stale static_assert mask.

Fix

data_read_needs_helper/ctrl_read_needs_helper now cover every accessor
special case (static_assert masks 0xB08F8FAA data / 0xEC101010 ctrl).
Titles must be regenerated to pick up the change.

Notes

Found while chasing the CMR2 corruption (which turned out to be the
separate stale-static-overlay bug); this desync is real regardless and
affects any title whose game code mfc2-reads the affected registers
into arithmetic. No measured regression on the CMR2 boot/attract path
after regeneration.

… semantics

The emitter's mfc2/cfc2 raw-vs-helper classification
(gte_register_classification.h) was out of sync with the runtime's
gte_read_data/gte_read_ctrl special cases: compiled code read OTZ(7)
and SZ0-3(16-19) unmasked and VZ/IR-class regs (1,3,5,8-11) without
sign extension, and cfc2 missed ctrl regs 4/12/20 — while the
interpreter always goes through the accessors. Nine data regs + three
ctrl regs of backend semantic divergence, locked in by a stale
static_assert mask.

data_read_needs_helper now covers every gte_read_data special case
(masks 0xB08F8FAA data / 0xEC101010 ctrl); regenerate titles to pick
it up.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants