Abseil 128-bit integers

47 views
Skip to first unread message

Alex Turner

unread,
Jan 20, 2022, 5:08:08 PM1/20/22
to c...@chromium.org, lin...@chromium.org
Hi all,

Are there any thoughts on allowing absl::uint128 and absl::int128? A third-party library we're using uses them and we'd like to keep them in higher-level parts of our code, i.e. instead of rolling our own pair<int64_t, int64_t> or similar.

They're currently listed as a TBD feature here.

Thanks,
Alex

Nico Weber

unread,
Jan 20, 2022, 5:28:46 PM1/20/22
to Alex Turner, cxx, lin...@chromium.org
Do you know how they're implemented on Windows? Have you sent a try job to make sure they work on all platforms?

--
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAA%2BBiFnpYUi%3Do0sfbfi7BSNHooLySoGo7wRQGB8cRC-teMwq7A%40mail.gmail.com.

Ryan Hamilton

unread,
Jan 20, 2022, 5:35:33 PM1/20/22
to Nico Weber, Alex Turner, cxx, lin...@chromium.org
For what it's worth, QUICHE uses abls::uint128 for QUIC. It works fine on Windows in Chrome.

Cheers,

Ryan

Alex Turner

unread,
Jan 20, 2022, 5:38:41 PM1/20/22
to Ryan Hamilton, Nico Weber, cxx, lin...@chromium.org
I believe the unsigned version is implemented as two uint64_ts for all platforms. The signed version does something similar for platforms that don't have an intrinsic 128-bit integer. Otherwise, they just wrap that intrinsic option.

In any case, we're already using absl::uint128 to pass to that third-party library and it seems to work fine on all platforms.

Peter Kasting

unread,
Jan 20, 2022, 5:58:38 PM1/20/22
to Alex Turner, cxx, lin...@chromium.org
I think allowing these sounds ok.

PK

--

Nico Weber

unread,
Jan 20, 2022, 6:03:04 PM1/20/22
to Peter Kasting, Alex Turner, cxx, lin...@chromium.org

Alex Turner

unread,
Jan 21, 2022, 2:38:26 PM1/21/22
to Nico Weber, Peter Kasting, cxx, lin...@chromium.org
Great, thanks all. I've put up a cl (crrev.com/c/3405496) to approve them. I'll put it out for review sometime next week, if there are no objections by then.
Reply all
Reply to author
Forward
0 new messages