[libc-commits] [PATCH] D149594: [libc] Add explicit constructor calls to fix compilation when using UInt<T>

Michael Jones via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon May 22 14:32:06 PDT 2023


michaelrj added inline comments.


================
Comment at: libc/src/__support/FPUtil/x86_64/LongDoubleBits.h:129
+    bits_with_explicit_bit &= ~(UIntType(1) << FloatProp::MANTISSA_WIDTH);
+    bits_with_explicit_bit |= (UIntType(true) << FloatProp::MANTISSA_WIDTH);
+    return cpp::bit_cast<long double>(bits_with_explicit_bit);
----------------
I'm not sure this is correct, this seems to be setting the explicit bit in the output regardless of if it is set in the actual number. An example of where this might go wrong is the number `0.0`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149594



More information about the libc-commits mailing list