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

Add support for ASM control flow to/from addresses which don't fit in immediate offsets. #3109

Merged
merged 4 commits into from
Oct 24, 2022

Conversation

otrho
Copy link
Contributor

@otrho otrho commented Oct 24, 2022

  • Introduce a new control flow op LoadLabel which reads an address from the data section.
  • Convert JI, JNZI, JNEI and MoveAddress to use LoadLabel and JMP or JNE when required.
  • Introduce a BLOB instruction which is for testing purposes only, and efficiently & conveniently inserts a raft of NOOPs into the binary.

Closes #2385.

… immediate offsets.

- Introduce a new control flow op `LoadLabel` which reads an address
  from the data section.
- Convert `JI`, `JNZI`, `JNEI` and `MoveAddress` to use `LoadLabel` and
  `JMP` or `JNE` when required.
- Introduce a `BLOB` instruction which is for testing purposes only, and
  efficiently & conveniently inserts a raft of `NOOP`s into the binary.
@otrho otrho added enhancement New feature or request compiler: codegen Everything to do with IR->ASM, register allocation, etc. labels Oct 24, 2022
@otrho otrho requested a review from a team October 24, 2022 02:12
@otrho otrho self-assigned this Oct 24, 2022
mohammadfawaz
mohammadfawaz previously approved these changes Oct 24, 2022
Copy link
Contributor

@mohammadfawaz mohammadfawaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 🚀

@mohammadfawaz mohammadfawaz requested a review from a team October 24, 2022 13:26
sezna
sezna previously approved these changes Oct 24, 2022
Copy link
Contributor

@sezna sezna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great :shipit:

@sezna
Copy link
Contributor

sezna commented Oct 24, 2022

Lock file issue.

@sezna sezna dismissed stale reviews from mohammadfawaz and themself via 5ab2368 October 24, 2022 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler: codegen Everything to do with IR->ASM, register allocation, etc. enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use dynamic jump instructions when the offset is too large to fit in the immediate of static jumps
3 participants