Skip to content

decompress faster#42

Open
peterferrie wants to merge 5 commits intobadvision:masterfrom
peterferrie:master
Open

decompress faster#42
peterferrie wants to merge 5 commits intobadvision:masterfrom
peterferrie:master

Conversation

@peterferrie
Copy link
Contributor

No description provided.

badvision pushed a commit that referenced this pull request Jan 24, 2026
Cherry-picked optimization improvements from Peter Ferrie's PR #42:
- Move sec out of hot path (set once instead of repeatedly)
- Replace jmp with bne (2 cycles vs 3)
- Eliminate redundant branching in .src3A
- Reorder instructions to avoid pipeline stalls

This provides measurable speedup in the decompression loop which
runs frequently during game loading.

Original commit: b258ed4 by Peter Ferrie

Co-Authored-By: Claude <[email protected]>
@badvision
Copy link
Owner

I've extracted the decompression speedup optimization from this PR into a new branch: feature/decomp-speedup-from-pr42

The optimization includes:

  • Moving sec out of the hot path (set once instead of repeatedly in .getbt2)
  • Replacing jmp with bne (saves a cycle: 2 vs 3)
  • Eliminating redundant branching in .src3A
  • Reordering instructions to avoid pipeline stalls

This is a clean cherry-pick of the decomp.s improvements without the other outdated changes in this PR. See commit 4a0615c.

Thanks @peterferrie for the optimization!

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