Skip to content

codegen/new: optimize ROL/ROR flag rebuild#7126

Merged
Cacodemon345 merged 1 commit into
86Box:masterfrom
ChrisDeadman:codegen-new-flags-rebuild-zpna
May 10, 2026
Merged

codegen/new: optimize ROL/ROR flag rebuild#7126
Cacodemon345 merged 1 commit into
86Box:masterfrom
ChrisDeadman:codegen-new-flags-rebuild-zpna

Conversation

@ChrisDeadman

@ChrisDeadman ChrisDeadman commented May 9, 2026

Copy link
Copy Markdown
Contributor

Summary

This makes ROL/ROR instructions cheaper:

Add flags_rebuild_zpna() that materializes only ZF/NF/PF/AF, skipping the expensive CF_SET() and VF_SET() computations. Use it in all 28 ROL/ROR dynarec paths, since FLAGS_ROLxx/RORxx compute CF and VF lazily from flags_res and only need Z/N/P/A from cpu_state.flags.

Checklist

  • Closes N/A
  • I have tested my changes locally and validated that the functionality works as intended
  • I have discussed this with core contributors already
  • This pull request doesn't require changes to the ROM set
  • This pull request doesn't require changes to the asset set

Add flags_rebuild_zpna() that materializes only ZF/NF/PF/AF, skipping
the expensive CF_SET() and VF_SET() computations. Use it in all 28
ROL/ROR dynarec paths, since FLAGS_ROLxx/RORxx compute CF and VF
lazily from flags_res and only need Z/N/P/A from cpu_state.flags.
@Cacodemon345 Cacodemon345 merged commit 0c8c857 into 86Box:master May 10, 2026
45 checks passed
@ChrisDeadman ChrisDeadman deleted the codegen-new-flags-rebuild-zpna branch June 4, 2026 16:29
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