-
Notifications
You must be signed in to change notification settings - Fork 37
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
Mark instruction helpers appropriately as constexpr #567
Conversation
@@ -423,7 +423,7 @@ __attribute__((no_sanitize("float-divide-by-zero"))) inline constexpr T fdiv(T a | |||
} | |||
|
|||
template <typename T> | |||
inline constexpr T fmin(T a, T b) noexcept | |||
inline T fmin(T a, T b) noexcept |
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.
Both fmin
and fmax
use std::signbit
which is not constexpr: https://en.cppreference.com/w/cpp/numeric/math/signbit
@chfast could you benchmark this? |
Check assembly output first. |
I don't see any change in any of the functions touched by this. Some stuff is moved around, so can't tell much with benchmarking. |
Codecov Report
@@ Coverage Diff @@
## master #567 +/- ##
=======================================
Coverage 98.24% 98.24%
=======================================
Files 62 62
Lines 9048 9048
=======================================
Hits 8889 8889
Misses 159 159 |
The |
It wasn't identical for me. Let me check again. Still not identical, interestingly the resulting |
I totally forgot to consider optimiser settings when comparing the output. With the settings of the release build indeed it is identical. |
Pulled out of #562.