[libc-commits] [PATCH] D105561: [libc] Capture floating point encoding and arrange it sequentially in memory
Hedin GarcĂa via Phabricator via libc-commits
libc-commits at lists.llvm.org
Tue Jul 13 09:42:41 PDT 2021
hedingarcia added inline comments.
================
Comment at: libc/utils/FPUtil/FPBits.h:76
+
+ bool getSign() const {
+ return ((bits & FloatProp::signMask) >> (FloatProp::bitWidth - 1));
----------------
lntue wrote:
> Sorry for late comments! Since you already updated to get* and set*, can you also add getBits and setBits? I think they would be a better than the current uintval() (and technically no equivalent of setBits).
These get/setBits members were used previously with a different name but now they are not required anymore since `bits` value can be directly set or read from FPBits.
================
Comment at: libc/utils/FPUtil/NextAfterLongDoubleX86.h:53
// it will never overflow "beyond" infinity.
- ++fromBits.encoding.exponent;
+ fromBits.setUnbiasedExponent(fromBits.getUnbiasedExponent() + 1);
return fromBits;
----------------
lntue wrote:
> I'm a bit curious about generated assembly of this line. @sivachandra : can we check if there is any regression with this one? I think no regression for O2 and O3 would be good enough.
The object files generated before and after this patch are the same, at least after running the check there was no difference between the files at O2 optimization level.
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