-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Enable fast floating point model and fast debug linking #11466
Conversation
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.
Love it
I believe we should ship this with 1.12 so dE doesn't regress launch perf as significantly 😄 (how much speed are we losing, would you say, on startup right now?) |
@msftbot merge this in 5 minutes |
Hello @DHowett! Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:
If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you". |
curious if this has any effect on directional movement if you have a bunch of panes open. It should be fine since I'm checking for an epsilon of 1e-4, but who knows how bad accuracy could get. |
The precise model isn't actually really that much more precise than the fast one... |
build's failing, curiously! |
The tests work on my AMD CPU. The CI servers are clearly running on Intel CPUs. heh. 😎 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@msftbot merge this in 5 minutes |
Hello @lhecker! Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:
If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you". |
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.
Blocking to review the new!
} | ||
|
||
const auto nDiff = static_cast<std::make_signed_t<U>>(*reinterpret_cast<U*>(&a) - *reinterpret_cast<U*>(&b)); | ||
const auto uDiff = static_cast<U>(nDiff < 0 ? -nDiff : nDiff); |
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.
What the heck? This is legal??
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.
And not UB?
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.
No this is 100% undefined behavior. But it works because MSVC doesn't do strict aliasing. In C++20 you can use std::bit_cast
.
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.
Regarding the question about legality of reading floats like that: Yeah that's legal, because the bit patterns of IEEE floats are clearly defined.
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.
I've added til::bit_cast
and replaced the reinterpret_cast
hack.
#ifdef __cpp_lib_bit_cast | ||
#warning "Replace til::bit_cast and __builtin_bit_cast with std::bit_cast" | ||
#endif | ||
return __builtin_bit_cast(To, _Val); |
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.
Whoa
@lhecker the build is still failing, fyi. 😄 |
This commit enables /fp:fast. This doubles the performance of the Delta E computation in #11095 for instance. Additionally it re-enables two options for debug builds which are normally enabled by default by Visual Studio. ## PR Checklist * [x] I work here * [x] Tests added/passed ## Validation Steps Performed * No change in binary size * No obvious change in behavior
This commit enables /fp:fast. This doubles the performance of the Delta E
computation in #11095 for instance. Additionally it re-enables two options for
debug builds which are normally enabled by default by Visual Studio.
PR Checklist
Validation Steps Performed