Skip to content

GH-117512: Allow 64-bit JIT operands on 32-bit platforms #117527

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

Merged
merged 2 commits into from
Apr 6, 2024

Conversation

brandtbucher
Copy link
Member

@brandtbucher brandtbucher commented Apr 3, 2024

We can't burn in anything wider than a pointer, so split 64-bit operands in half on 32-bit platforms and burn them in separately. This doesn't pessimize loads of operands less than the width of a pointer on any platform.

Unblocks GH-117396.

@brandtbucher brandtbucher added type-bug An unexpected behavior, bug, or error skip news interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Apr 3, 2024
@brandtbucher brandtbucher self-assigned this Apr 3, 2024
patches[HoleValue_OPERAND] = instruction->operand;
#else
assert(SIZEOF_VOID_P == 4);
patches[HoleValue_OPERAND_HI] = instruction->operand >> 32;
Copy link
Member

Choose a reason for hiding this comment

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

Should patches become uintptr_t instead of uint64_t? (on all platforms).
Given many of the casts are of the form (uint64_t)some_pointer, changing them to (uintptr_t)some_pointer avoids unnecessary widening on 32 bit platforms.

@brandtbucher brandtbucher merged commit 62aeb0e into python:main Apr 6, 2024
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 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) skip news topic-JIT type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants