10 #ifndef EIGEN_CXX11_TENSOR_TENSOR_UINT128_H 11 #define EIGEN_CXX11_TENSOR_TENSOR_UINT128_H 19 static const uint64_t value = n;
20 EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
operator uint64_t()
const {
return n; }
22 EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
static_val() { }
25 EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
static_val(
const T& v) {
31 template <
typename HIGH = u
int64_t,
typename LOW = u
int64_t>
37 template<
typename OTHER_HIGH,
typename OTHER_LOW>
38 EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
40 EIGEN_STATIC_ASSERT(
sizeof(OTHER_HIGH) <=
sizeof(HIGH), YOU_MADE_A_PROGRAMMING_MISTAKE);
41 EIGEN_STATIC_ASSERT(
sizeof(OTHER_LOW) <=
sizeof(LOW), YOU_MADE_A_PROGRAMMING_MISTAKE);
44 template<
typename OTHER_HIGH,
typename OTHER_LOW>
45 EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
47 EIGEN_STATIC_ASSERT(
sizeof(OTHER_HIGH) <=
sizeof(HIGH), YOU_MADE_A_PROGRAMMING_MISTAKE);
48 EIGEN_STATIC_ASSERT(
sizeof(OTHER_LOW) <=
sizeof(LOW), YOU_MADE_A_PROGRAMMING_MISTAKE);
55 EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
56 explicit TensorUInt128(
const T& x) : high(0), low(x) {
61 EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
62 TensorUInt128(HIGH y, LOW x) : high(y), low(x) { }
64 EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
operator LOW()
const {
67 EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE LOW lower()
const {
70 EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE HIGH upper()
const {
76 template <
typename HL,
typename LL,
typename HR,
typename LR>
77 EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
80 return (lhs.high == rhs.high) & (lhs.low == rhs.low);
83 template <
typename HL,
typename LL,
typename HR,
typename LR>
84 EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
87 return (lhs.high != rhs.high) | (lhs.low != rhs.low);
90 template <
typename HL,
typename LL,
typename HR,
typename LR>
91 EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
94 if (lhs.high != rhs.high) {
95 return lhs.high > rhs.high;
97 return lhs.low >= rhs.low;
100 template <
typename HL,
typename LL,
typename HR,
typename LR>
101 EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
104 if (lhs.high != rhs.high) {
105 return lhs.high < rhs.high;
107 return lhs.low < rhs.low;
110 template <
typename HL,
typename LL,
typename HR,
typename LR>
111 EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
115 if (result.low < rhs.low) {
121 template <
typename HL,
typename LL,
typename HR,
typename LR>
122 EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
126 if (result.low > lhs.low) {
133 template <
typename HL,
typename LL,
typename HR,
typename LR>
134 static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
148 const uint64_t LOW = 0x00000000FFFFFFFFLL;
149 const uint64_t HIGH = 0xFFFFFFFF00000000LL;
151 uint64_t d = lhs.low & LOW;
152 uint64_t c = (lhs.low & HIGH) >> 32LL;
153 uint64_t b = lhs.high & LOW;
154 uint64_t a = (lhs.high & HIGH) >> 32LL;
156 uint64_t h = rhs.low & LOW;
157 uint64_t g = (rhs.low & HIGH) >> 32LL;
158 uint64_t f = rhs.high & LOW;
159 uint64_t e = (rhs.high & HIGH) >> 32LL;
162 uint64_t acc = d * h;
163 uint64_t low = acc & LOW;
167 uint64_t acc2 = acc + c * h;
175 low |= (acc << 32LL);
179 acc2 = (acc >> 32LL) | (carry << 32LL);
194 uint64_t high = acc & LOW;
197 acc2 = (acc >> 32LL) | (carry << 32LL);
203 high |= (acc2 << 32LL);
208 template <
typename HL,
typename LL,
typename HR,
typename LR>
209 static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
214 }
else if (lhs < rhs) {
224 power2 = power2 + power2;
232 result = result + power2;
248 #endif // EIGEN_CXX11_TENSOR_TENSOR_UINT128_H Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:85
Holds information about the various numeric (i.e.
Definition: NumTraits.h:150
Definition: TensorUInt128.h:18
Definition: BandTriangularSolver.h:13
Generic expression where a coefficient-wise unary operator is applied to an expression.
Definition: CwiseUnaryOp.h:55
Definition: TensorUInt128.h:32