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

gh-119726: emit AArch64 trampolines in the data section #121280

Merged
merged 2 commits into from
Jul 3, 2024

Conversation

diegorusso
Copy link
Contributor

@diegorusso diegorusso commented Jul 2, 2024

Emit AArch64 trampolines in the data section (instead of the code) of the stencil. In many cases this allows the branch to the next micro-op at the end of the stencil to be replaced with a fall-through NOP.

Emit AArch64 trampolines in the data section (instead of the code) of
the stencil. In many cases this allows the branch to the next micro-op
at the end of the stencil to be replaced with a fall-through NOP.
@diegorusso
Copy link
Contributor Author

@brandtbucher I have provided a news entry but I feel we can skip it for the PR. Let me know what you think.

@brandtbucher brandtbucher self-assigned this Jul 2, 2024
@brandtbucher brandtbucher added performance Performance or resource usage skip news interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-JIT and removed skip news labels Jul 2, 2024
Copy link
Member

@brandtbucher brandtbucher 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! Just one minor comment:

where = slice(hole.offset, hole.offset + 4)
instruction = int.from_bytes(self.body[where], sys.byteorder)
instruction &= 0xFC000000
instruction |= ((base - hole.offset) >> 2) & 0x03FFFFFF
self.body[where] = instruction.to_bytes(4, sys.byteorder)
new_hole = hole.replace(addend=base, symbol=None, value=HoleValue.DATA)
Copy link
Member

Choose a reason for hiding this comment

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

This is so much nicer!

…e-119726.Fjv_Ab.rst

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
@brandtbucher brandtbucher merged commit 84512c0 into python:main Jul 3, 2024
61 checks passed
@diegorusso diegorusso deleted the gh-119726-trampolines-data branch July 3, 2024 13:36
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage topic-JIT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants