-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[mypyc] Foundational work to help support native ints #12884
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ilevkivskyi
approved these changes
Jun 1, 2022
# If True, error/undefined value overlaps with a valid value. To detect | ||
# an exception, PyErr_Occurred() must be used in addition to checking for | ||
# error value. | ||
error_overlap = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This concept is a bit counterintuitive, so maybe specifically give an example of fixed ints here? Also do I understand correctly that the only kind of error that can happen is an overflow (zero division could only come from float)?
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some IR and codegen changes that help with native int support.
This was split off from a branch with a working implementation of
native ints to make reviewing easier. Some tests and primitives
are missing here and I will include them in follow-up PRs.
Summary of major changes below.
Allow ambiguous error returns from functions. Since all values
of
i64
values are valid return values, none can be reserved forerrors. The approach here is to have the error value overlap a
valid value, and use
PyErr_Occurred()
as a secondary checkto make sure it actually was an error.
Add
Extend
op which extends a value to a larger integertype with either zero or sign extension.
Improve subtype checking with native int types.
Fill in other minor gaps in IR and codegen support for native
ints.
Work on mypyc/mypyc#837.