Conversation
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-numerics |
Contributor
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
A moderate performance concern remains in the BigInteger widening-divide path and requires final human review.
Review effort: Lite
Findings: None
What changed in this PR
Optimizes wide integer and decimal division by reusing quotient/remainder results and widening-division intrinsics, with focused oracle-backed tests.
Changes:
- Adds widening-division paths for
Int128,BigInteger, and decimal arithmetic. - Reuses division results for remainder and rounding operations.
- Adds boundary and randomized regression tests.
| File | Description |
|---|---|
src/tests/JIT/opt/Add/WideDivision.csproj |
Configures wide-division tests. |
src/tests/JIT/opt/Add/WideDivision.cs |
Tests integer, BigInteger, and decimal division. |
src/tests/JIT/opt/Add/DecimalWideDivision.csproj |
Configures IEEE decimal tests. |
src/tests/JIT/opt/Add/DecimalWideDivision.cs |
Tests wide power-of-ten division. |
src/libraries/System.Private.CoreLib/src/System/Numerics/BigIntegerCalculator.Shared.cs |
Adds widening-divide fast paths and fallback reuse. |
src/libraries/System.Private.CoreLib/src/System/Number.DecimalIeee754.cs |
Adds full-limb IEEE decimal division. |
src/libraries/System.Private.CoreLib/src/System/Int128.cs |
Reuses unsigned division results for signed operations. |
src/libraries/System.Private.CoreLib/src/System/Decimal.DecCalc.cs |
Reuses widening division for decimal remainder and rounding. |
This branch has not been deployed
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.
Reuse quotient/remainder results in wide-integer and decimal arithmetic instead of reconstructing remainders or decomposing inputs before an available widening divide:
Split from #134039 as suggested by @tannergooding. This uses existing APIs and JIT support and can merge independently of the new carry, multiply-chain and remainder-recognition optimizations.
Includes BigInteger-based boundary and randomized oracles for Int128, BigInteger limb division, decimal remainder/rounding, and the uint/ulong/UInt128 IEEE wide-division helper.
Validation:
git diff --checkpassed. No new throughput claim, native ARM64 run or x86 execution measurement is included in this extraction.