Skip to content

Improve hsd_803B51C8 - #3077

Draft
g-guthrie wants to merge 1 commit into
doldecomp:masterfrom
g-guthrie:agent/improve-hsd-3b51c8
Draft

Improve hsd_803B51C8#3077
g-guthrie wants to merge 1 commit into
doldecomp:masterfrom
g-guthrie:agent/improve-hsd-3b51c8

Conversation

@g-guthrie

Copy link
Copy Markdown
Contributor

What changed

  • replace four fixed-size JPEG metadata memcpy calls with typed aggregate copies so MWCC emits the target's inline word-copy sequences
  • hoist the quantization divisor once per coefficient loop instead of reloading the global for every coefficient
  • limit the chroma quantization table pointer lifetime so it reuses the target register
  • align the stack frame and width/height register allocation with the original function

Why

hsd_803B51C8 was one of the largest remaining fuzzy mismatches. The fixed-size copies and repeated global loads produced substantially different instruction sequences from the original JPEG encoder.

The local target-object comparison improves from 81.44211% to 95.6%.

Validation

  • uvx pre-commit run --files src/sysdolphin/baselib/hsd_3B34.c
  • exact MWCC 1.2.5n compile with project flags
  • local objdiff comparison against the exported hsd_803B51C8 target object: 95.6%

@decomp-dev

decomp-dev Bot commented Aug 14, 2026

Copy link
Copy Markdown

Report for GALE01 (7eb1511 - 403a22f)

📈 2 improvements in unmatched items
Unit Item Bytes Before After
main/sysdolphin/baselib/hsd_3B34 hsd_803B51C8 +425 80.44% 96.40%
main/sysdolphin/baselib/hsd_3B34 extab +1 88.64% 90.91%

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.

1 participant