[libc-commits] [PATCH] D146886: [libc] Add missing cast in fputil sqrt code

Roland McGrath via Phabricator via libc-commits libc-commits at lists.llvm.org
Sat Mar 25 16:24:19 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG69a0924fac6f: [libc] Add missing cast in fputil sqrt code (authored by mcgrathr).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146886/new/

https://reviews.llvm.org/D146886

Files:
  libc/src/__support/FPUtil/generic/sqrt_80_bit_long_double.h


Index: libc/src/__support/FPUtil/generic/sqrt_80_bit_long_double.h
===================================================================
--- libc/src/__support/FPUtil/generic/sqrt_80_bit_long_double.h
+++ libc/src/__support/FPUtil/generic/sqrt_80_bit_long_double.h
@@ -21,9 +21,9 @@
 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;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146886.508352.patch
Type: text/x-patch
Size: 686 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230325/1411ba07/attachment.bin>


More information about the libc-commits mailing list