[libc-commits] [libc] [libc][NFC] fix int warnings in float conversion (PR #74379)

via libc-commits libc-commits at lists.llvm.org
Mon Dec 4 16:04:32 PST 2023


================
@@ -34,7 +34,9 @@ LIBC_INLINE double as_double(uint64_t x) { return cpp::bit_cast<double>(x); }
 
 LIBC_INLINE uint32_t top12_bits(float x) { return as_uint32_bits(x) >> 20; }
 
-LIBC_INLINE uint32_t top12_bits(double x) { return as_uint64_bits(x) >> 52; }
+LIBC_INLINE uint32_t top12_bits(double x) {
+  return static_cast<uint32_t>(as_uint64_bits(x) >> 52);
+}
----------------
michaelrj-google wrote:

I don't think so, it looks like it was used previously but has been superseded by FPBits. I've removed it, along with the related unused functions in this file.

https://github.com/llvm/llvm-project/pull/74379


More information about the libc-commits mailing list