[libc] Add missing cast in fputil sqrt code

A cast is necessary to avoid implicit narrowing warnings
when those are enabled.

Reviewed By: abrachet

Differential Revision: https://reviews.llvm.org/D146886
This commit is contained in:
Roland McGrath
2023-03-25 14:30:02 -07:00
parent 721defb4b9
commit 69a0924fac

View File

@@ -21,9 +21,9 @@ namespace fputil {
namespace x86 {
LIBC_INLINE void normalize(int &exponent, UInt128 &mantissa) {
const int shift =
const unsigned int shift = static_cast<unsigned int>(
unsafe_clz(static_cast<uint64_t>(mantissa)) -
(8 * sizeof(uint64_t) - 1 - MantissaWidth<long double>::VALUE);
(8 * sizeof(uint64_t) - 1 - MantissaWidth<long double>::VALUE));
exponent -= shift;
mantissa <<= shift;
}