[llvm] Fix bitcasting E8M0 APFloat to APInt (PR #113298)

Durgadoss R via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 22 09:43:49 PDT 2024


================
@@ -3663,7 +3663,7 @@ APInt IEEEFloat::convertIEEEFloatToAPInt() const {
   std::array<uint64_t, (S.sizeInBits + 63) / 64> words;
   auto words_iter =
       std::copy_n(mysignificand.begin(), mysignificand.size(), words.begin());
-  if constexpr (significand_mask != 0) {
+  if constexpr (significand_mask != 0 || trailing_significand_bits == 0) {
     // Clear the integer bit.
----------------
durga4github wrote:

This fix looks right to me.

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


More information about the llvm-commits mailing list