[libc-commits] [PATCH] D136799: [libc] Implement a high-precision floating point class.
Tue Ly via Phabricator via libc-commits
libc-commits at lists.llvm.org
Wed Dec 7 09:04:11 PST 2022
lntue marked 4 inline comments as done.
lntue added inline comments.
================
Comment at: libc/src/__support/UInt.h:25-28
+template <typename T> struct pair {
+ T lo = 0;
+ T hi = 0;
+};
----------------
lntue wrote:
> sivachandra wrote:
> > michaelrj wrote:
> > > The `pair` class should probably be in a separate file.
> > Agree - you can choose to add a `cpp:pair` class.
> I was debating about it, because the standard `std::pair` has members named `first` and `second`, while I want to named them `hi` and `lo` to signify the high part and the low part of the numbers. I'm not sure what's the best way to have such distinction yet. Maybe rename this to `cpp::number_pair` or something similar?
These are refactored and cleaned up in https://reviews.llvm.org/D137871 and https://reviews.llvm.org/D138182
================
Comment at: libc/src/__support/UInt.h:58
+
+constexpr inline pair<uint64_t> full_mul(uint64_t a, uint64_t b) {
+ pair<uint64_t> pa = split(a);
----------------
sivachandra wrote:
> These functions just seem to me like specializations of the UInt `ful_add` and `ful_mul`. If you really need these separately, you need to add some commentary to justify.
The optimizations and updates for `UInt` add and mul are done in https://reviews.llvm.org/D137871 and https://reviews.llvm.org/D138541
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D136799/new/
https://reviews.llvm.org/D136799
More information about the libc-commits
mailing list