[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:28:55 PDT 2021
hedingarcia marked 6 inline comments as done.
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:
> 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.
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