[libc-commits] [PATCH] D105561: [libc] Creating a struct that captures floating point encoding and manually arranges it sequentially in memory

Hedin GarcĂ­a via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Jul 8 14:44:42 PDT 2021


hedingarcia added inline comments.


================
Comment at: libc/utils/FPUtil/FPBits.h:117
+      return uint16_t((valueFP & FloatProp::exponentMask) >>
+                      (FloatProp::bitWidth - 1 - FloatProp::exponentWidth));
+    }
----------------
aeubanks wrote:
> hedingarcia wrote:
> > aeubanks wrote:
> > > this is very confusing, can we just use `mantissaWidth`?
> > The reason why we cannot use mantissaWidth is because in the 80-bit long double implementation the value for that field is 63 instead of 64. An explicit bit is considered in the 63 bit as the integer part of the significand (https://en.wikipedia.org/wiki/Extended_precision ). This exception leads to that long expression in getExponent(), because with only the value of mantissaWidth the shift will still require to move one bit in order to return all the bits of the exponent.  
> I thought that only applied to the version in LongDoubleBitsX86
Yes, however should the same implementation in LongDoubleBitsX86.h  be kept the same even in FPBits.h?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105561



More information about the libc-commits mailing list