-
-
Notifications
You must be signed in to change notification settings - Fork 32k
GH-101291: Rearrange the size bits in PyLongObject #102464
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
markshannon
merged 37 commits into
python:main
from
faster-cpython:long-rearrange-size-bits
Mar 22, 2023
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
0ec07e4
Add functions to hide some internals of long object.
markshannon 292b9d0
Add internal functions to longobject.c for setting sign and digit count.
markshannon 5c54894
Replace Py_SIZE(x) < 0 with _PyLong_IsNegative(x) in longobject.c
markshannon 029aaa4
Replace Py_ABS(Py_SIZE(a)) with _PyLong_DigitCount(a) in longobject.c
markshannon b56e6da
Remove many uses of Py_SIZE in longobject.c
markshannon 91269fc
Remove _PyLong_AssignValue, as it is no longer used.
markshannon c48e825
Remove some more uses of Py_SIZE in longobject.c.
markshannon 449c0e2
Remove a few more uses of Py_SIZE in longobject.c.
markshannon c5ba601
Remove some more uses of Py_SIZE, replacing with _PyLong_UnsignedDigi…
markshannon 4b3a3e8
Replace a few Py_SIZE() with _PyLong_SameSign().
markshannon 9ef9d2c
Remove a few more Py_SIZE() from longobject.c
markshannon 9c408c1
Replace uses of IS_MEDIUM_VALUE macro with _PyLong_IsSingleDigit.
markshannon 548d656
Remove most of the remaining uses of Py_SIZE in longobject.c
markshannon 3e3fefd
Replace last remaining uses of Py_SIZE applied to longobject with _Py…
markshannon 391fb51
Don't use _PyObject_InitVar and move a couple of inline functions to …
markshannon df8c7d3
Correct name of inline function.
markshannon bc14fa6
Eliminate all remaining uses of Py_SIZE and Py_SET_SIZE on PyLongObject.
markshannon 54c6f1b
Change layout of size/sign bits in longobject to support future addit…
markshannon ce6bfb2
Test pairs of longs together on fast path of add/mul/sub.
markshannon 4c1956b
Tidy up comment and delete commented out code.
markshannon 301158b
Add news.
markshannon 1aa1891
Remove debugging asserts.
markshannon bf2a9af
Fix storage classes.
markshannon 169f521
Remove development debug functions.
markshannon 90f9072
Avoid casting to smaller int.
markshannon f143443
Apply suggestions from code review.
markshannon a0d661e
Widen types to avoid data loss.
markshannon 145a2e4
Fix syntax error.
markshannon 638a98f
Replace 'SingleDigit' with 'Compact' as the term 'single digit' seems…
markshannon 7f5acc0
Address review comments.
markshannon b06bb6f
Merge branch 'main' into long-rearrange-size-bits
markshannon a19b0a7
Merge branch 'main' into long-rearrange-size-bits
markshannon 87f49b2
Fix _PyLong_Sign
markshannon f764aa8
Replace _PyLong_Sign(x) < 0 with _PyLong_IsNegative(x).
markshannon 9843ac0
fix sign check
markshannon d6cb917
Address some review comments.
markshannon 469d26f
Change asserts on digit counts to asserts on sign where applicable.
markshannon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Replace Py_ABS(Py_SIZE(a)) with _PyLong_DigitCount(a) in longobject.c
- Loading branch information
commit 029aaa4eb7a0e1c83287b7cdf60a82cc4b010a0d
There are no files selected for viewing
This file contains hidden or 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
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.
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.
To avoid UB with bitwise op in signed ints, as we're doing some spring cleaning here: