-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Fix BigInteger.LeadingZeroCount, PopCount, TrailingZeroCount, RotateLeft, and RotateRight for platform-independent 32-bit word semantics #126259
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
tannergooding
merged 22 commits into
main
from
copilot/fix-leading-zero-count-implementation
Apr 25, 2026
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
876617a
Fix BigInteger.LeadingZeroCount to restore 32-bit behavior and add tests
Copilot bef3d9b
Address review feedback: use Environment.Is64BitProcess, merge tests …
Copilot 03facaa
Fix PopCount and TrailingZeroCount for platform-independent 32-bit wo…
stephentoub d9c38b9
Simplify LeadingZeroCount _bits path per review feedback
stephentoub d9749d7
Fix RotateLeft/RotateRight _sign path for 32-bit word semantics and u…
Copilot b52efac
Fix Rotate _bits path for 32-bit word semantics and update tests
Copilot b57835d
Fix SwapUpperAndLower32 to use ArrayPool, simplify zLimbCount, remove…
Copilot 77e8bdd
Fix Rotate endianness: replace MemoryMarshal.Cast with arithmetic wor…
Copilot 57e1322
Remove dead nuint-based Rotate helpers, avoid Array.Resize in Rotate
Copilot b7b342a
Use IndexOfAnyExcept for first-non-zero word search in Rotate
Copilot 5284673
Update src/libraries/System.Runtime.Numerics/src/System/Numerics/BigI…
stephentoub f016fd4
Optimize Rotate() to avoid temporary uint[] array allocation
Copilot 7d1b36c
Add SIMD (Vector128/256/512) optimizations to LeftShiftSelf32/RightSh…
Copilot 62f5905
Merge branch 'main' into copilot/fix-leading-zero-count-implementation
stephentoub 05ce40b
Replace ArrayPool<uint> with RentedBuffer in SwapUpperAndLower32
Copilot 2357508
Add mixed-bit negative multiword PopCount tests
Copilot 8fa9da9
Merge branch 'main' into copilot/fix-leading-zero-count-implementation
tannergooding 620c2d9
Simplify PopCount negative path and deduplicate SIMD in LeftShiftSelf…
Copilot c0e1c28
Rename rotation helpers: remove "32" suffix, improve documentation
Copilot c876239
Restructure rotation: restore nuint RotateLeft in BigIntegerCalculato…
Copilot cf79f6c
Address code review: use BitsPerUInt32 instead of inline constant, ma…
Copilot 1ee9f9f
Rework rotation to use nuint directly with last-index fixup per revie…
Copilot 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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.