-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Cleanup NativeAOT math helpers #100375
Cleanup NativeAOT math helpers #100375
Conversation
...coreclr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/CompilerHelpers/MathHelpers.cs
Outdated
Show resolved
Hide resolved
...coreclr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/CompilerHelpers/MathHelpers.cs
Outdated
Show resolved
Hide resolved
...coreclr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/CompilerHelpers/MathHelpers.cs
Outdated
Show resolved
Hide resolved
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.
LGTM. Thank you!
/azp run runtime-nativeaot-outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
...coreclr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/CompilerHelpers/MathHelpers.cs
Outdated
Show resolved
Hide resolved
...coreclr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/CompilerHelpers/MathHelpers.cs
Outdated
Show resolved
Hide resolved
The outer loop failures look unrelated. |
// We need to compare with the very next double to two63. 0x402 is epsilon to get us there. | ||
if (value is > -two63 - 0x402 and < two63) |
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.
// We need to compare with the very next double to two63. 0x402 is epsilon to get us there. | |
if (value is > -two63 - 0x402 and < two63) | |
if (value is > Math.BitDecrement(-two63) and < two63) |
Would this work here?
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.
Not a compile-time constant
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.
Would this work here?
Nope. BitDecrement is not a JIT intrinsic, and it is too complicated to make the JIT inline in and evaluate it into a constant.
...coreclr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/CompilerHelpers/MathHelpers.cs
Outdated
Show resolved
Hide resolved
…ime/CompilerHelpers/MathHelpers.cs
Thank you! |
dotnet#100375 broke optimized Windows x86 runs.
#100375 broke optimized Windows x86 runs.
* Cleanup NativeAOT math helpers * Restore checked cast helpers * Rename variables --------- Co-authored-by: Jan Kotas <[email protected]>
dotnet#100375 broke optimized Windows x86 runs.
Extracted from #98858.
cc @jkotas I'd like the cleanup here to be merged here before moving the Checked multiply helpers around.