Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mirco-optimizations #32

Merged
merged 2 commits into from
Aug 5, 2022
Merged

Mirco-optimizations #32

merged 2 commits into from
Aug 5, 2022

Conversation

lilweege
Copy link
Contributor

@lilweege lilweege commented Aug 5, 2022

Some more optimizations, noted in order from most to least effective (on my PC)

  • Add [[likely]] and [[unlikely]] attributes
  • Mark critical functions as static
  • Change microinstructionData from vector to static array
  • Promote types of integer variables for better codegen
  • Change ((InstructionReg >> 11) * 64) to ((InstructionReg >> 5) & 0b11111000000)

Altogether an improvement in the pong example from 56MHz to 70MHz. Tested on Arch Linux x86_64 with Intel i5-7400.

@sam-astro sam-astro merged commit a761c97 into sam-astro:dev Aug 5, 2022
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