perf(math): inline measured high-low arithmetic call boundaries
This commit is contained in:
@@ -55,7 +55,13 @@ inline bool IsFinite(HighLow value) {
|
||||
return IsFiniteBinary64(value.high) && IsFiniteBinary64(value.low);
|
||||
}
|
||||
/// @brief Recovers the exact error of supported finite binary64 addition.
|
||||
inline HighLow TwoSum(double left, double right) {
|
||||
/// @note Requests local expansion at the measured MSVC x64 call boundary.
|
||||
#if defined(_MSC_VER) && defined(_M_X64)
|
||||
__forceinline
|
||||
#else
|
||||
inline
|
||||
#endif
|
||||
HighLow TwoSum(double left, double right) {
|
||||
const double sum = left + right;
|
||||
const double bridge = sum - left;
|
||||
const double restored_left = sum - bridge;
|
||||
@@ -105,7 +111,13 @@ inline HighLow Subtract(HighLow left, HighLow right) {
|
||||
}
|
||||
/// @brief Returns the exponent of the least nonzero binary64 significand bit.
|
||||
/// @pre value is finite and nonzero; gradual underflow is enabled.
|
||||
inline int LowestBitExponent(double value) {
|
||||
/// @note Keeps the small integer search inside its measured MSVC x64 caller.
|
||||
#if defined(_MSC_VER) && defined(_M_X64)
|
||||
__forceinline
|
||||
#else
|
||||
inline
|
||||
#endif
|
||||
int LowestBitExponent(double value) {
|
||||
static_assert(sizeof(double) == sizeof(std::uint64_t) &&
|
||||
std::numeric_limits<double>::is_iec559 &&
|
||||
std::numeric_limits<double>::digits == 53);
|
||||
|
||||
Reference in New Issue
Block a user