MCPcopy Create free account
hub / github.com/apache/arrow / uint128_t

Class uint128_t

cpp/src/arrow/util/basic_decimal.cc:505–528  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

503// multiplication operations when there may or may not be native support.
504#ifdef ARROW_USE_NATIVE_INT128
505struct uint128_t {
506 uint128_t() {}
507 uint128_t(uint64_t hi, uint64_t lo) : val_((static_cast<__uint128_t>(hi) << 64) | lo) {}
508 explicit uint128_t(const BasicDecimal128& decimal) {
509 val_ = (static_cast<__uint128_t>(decimal.high_bits()) << 64) | decimal.low_bits();
510 }
511
512 explicit uint128_t(uint64_t value) : val_(value) {}
513
514 uint64_t hi() { return val_ >> 64; }
515 uint64_t lo() { return val_ & kInt64Mask; }
516
517 uint128_t& operator+=(const uint128_t& other) {
518 val_ += other.val_;
519 return *this;
520 }
521
522 uint128_t& operator*=(const uint128_t& other) {
523 val_ *= other.val_;
524 return *this;
525 }
526
527 __uint128_t val_;
528};
529
530#else
531// Multiply two 64 bit word components into a 128 bit result, with high bits

Callers 1

MultiplyUnsignedArrayFunction · 0.85

Calls 1

ExtendAndMultiplyFunction · 0.85

Tested by

no test coverage detected