Centralize a couple JIT arithmetic helpers#127781
Draft
tannergooding wants to merge 2 commits intodotnet:mainfrom
Draft
Centralize a couple JIT arithmetic helpers#127781tannergooding wants to merge 2 commits intodotnet:mainfrom
tannergooding wants to merge 2 commits intodotnet:mainfrom
Conversation
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors a few low-level JIT bit-manipulation helpers to use the shared BitOperations implementation instead of maintaining local counting/log2 helpers. It keeps the change scoped to internal helper code used by JIT bitsets and hash bit-vectors.
Changes:
- Replaced
hashbv’s localnearest_pow2and word-popcount helpers withBitOperations::Log2/PopCount. - Replaced
BitSetSupport::CountBitsInIntegralcall sites in theUINT64andShortLongbitset implementations withBitOperations::PopCount. - Removed the now-unused
BitSetSupportnibble-count table and integral bit-count helper implementation.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/coreclr/jit/hashbv.h |
Swaps nearest_pow2 over to BitOperations::Log2. |
src/coreclr/jit/hashbv.cpp |
Replaces local hashbv popcount helpers with shared BitOperations::PopCount. |
src/coreclr/jit/bitsetasuint64.h |
Uses shared popcount for the UINT64 bitset representation. |
src/coreclr/jit/bitsetasshortlong.h |
Uses shared popcount for both short and long BSShortLong counting paths. |
src/coreclr/jit/bitset.h |
Removes obsolete integral bit-count helper declarations. |
src/coreclr/jit/bitset.cpp |
Removes obsolete nibble-count lookup table definition. |
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
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.
No description provided.