Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stl/inc/__msvc_bit_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ _NODISCARD int _Countl_zero_bsr(const _Ty _Val) noexcept {
#ifdef _M_IX86
const unsigned int _High = _Val >> 32;
if (_BitScanReverse(&_Result, _High)) {
return static_cast<int>(31 - _Result);
return static_cast<int>(31 ^ _Result);
}

const auto _Low = static_cast<unsigned int>(_Val);
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/charconv
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ _NODISCARD inline bool _Multiply_by_power_of_ten(_Big_integer_flt& _Xval, const
// Computes the number of zeroes higher than the most significant set bit in _Ux
_NODISCARD inline uint32_t _Count_sequential_high_zeroes(const uint32_t _Ux) noexcept {
unsigned long _Index; // Intentionally uninitialized for better codegen
return _BitScanReverse(&_Index, _Ux) ? 31 - _Index : 32;
return _BitScanReverse(&_Index, _Ux) ? 31 ^ _Index : 32;
}

// This high-precision integer division implementation was translated from the implementation of
Expand Down