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

Simple assembler optimization #19

Closed
Shadlock0133 opened this issue Nov 14, 2018 · 1 comment
Closed

Simple assembler optimization #19

Shadlock0133 opened this issue Nov 14, 2018 · 1 comment

Comments

@Shadlock0133
Copy link

Currently for li a0, 0xff000000 assembler will generate two instructions lui x10 1044480; addi x10 x10 0. The second instruction is practically a nop.

A simple check in assembling immediate instructions with the same register and value of zero (for addi, ori, xori, slli, srli, srai) should be enough for starters.

@mortbopet
Copy link
Owner

Thank you for mentioning it! The optimization is implemented in the referenced commit

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

No branches or pull requests

2 participants