Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- constexpr uint64_t lo(uint64_t x) { return x & UINT64_C(0xffffffff); }
- constexpr uint64_t hi(uint64_t x) { return x >> 32; }
- constexpr uint64_t mulu64(uint64_t a, uint64_t b)
- {
- return lo(lo(a) * lo(b))
- + (lo(hi(lo(a) * lo(b))
- + lo(a) * hi(b)
- + hi(a) * lo(b)) << 32);
- }
- constexpr uint64_t addu64(uint64_t a, uint64_t b)
- {
- return lo(lo(a) + lo(b))
- + (lo(hi(lo(a) + lo(b)) + (hi(a) + hi(b))) << 32);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement