25 #ifndef RAPIDJSON_DIYFP_H_ 26 #define RAPIDJSON_DIYFP_H_ 31 #pragma intrinsic(_BitScanReverse64) 40 RAPIDJSON_DIAG_OFF(effc++)
71 #if defined(_MSC_VER) && defined(_M_AMD64) 76 return DiyFp(h,
e + rhs.
e + 64);
77 #elif (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__x86_64__) 78 unsigned __int128
p =
static_cast<unsigned __int128
>(
f) * static_cast<unsigned __int128>(rhs.
f);
83 return DiyFp(h,
e + rhs.
e + 64);
94 uint64_t tmp = (bd >> 32) + (ad & M32) + (bc & M32);
96 return DiyFp(ac + (ad >> 32) + (bc >> 32) + (tmp >> 32),
e + rhs.
e + 64);
101 #if defined(_MSC_VER) && defined(_M_AMD64) 103 _BitScanReverse64(&index,
f);
104 return DiyFp(
f << (63 - index),
e - (63 - index));
105 #elif defined(__GNUC__) && __GNUC__ >= 4 106 int s = __builtin_clzll(
f);
110 while (!(res.
f & (static_cast<uint64_t>(1) << 63))) {
130 DiyFp pl =
DiyFp((
f << 1) + 1,
e - 1).NormalizeBoundary();
132 mi.
f <<= mi.
e - pl.
e;
181 static const uint64_t kCachedPowers_F[] = {
227 static const int16_t kCachedPowers_E[] = {
228 -1220, -1193, -1166, -1140, -1113, -1087, -1060, -1034, -1007, -980,
229 -954, -927, -901, -874, -847, -821, -794, -768, -741, -715,
230 -688, -661, -635, -608, -582, -555, -529, -502, -475, -449,
231 -422, -396, -369, -343, -316, -289, -263, -236, -210, -183,
232 -157, -130, -103, -77, -50, -24, 3, 30, 56, 83,
233 109, 136, 162, 189, 216, 242, 269, 295, 322, 348,
234 375, 402, 428, 455, 481, 508, 534, 561, 588, 614,
235 641, 667, 694, 720, 747, 774, 800, 827, 853, 880,
236 907, 933, 960, 986, 1013, 1039, 1066
238 return DiyFp(kCachedPowers_F[index], kCachedPowers_E[index]);
244 double dk = (-61 -
e) * 0.30102999566398114 + 347;
245 int k =
static_cast<int>(dk);
249 unsigned index =
static_cast<unsigned>((k >> 3) + 1);
250 *K = -(-348 +
static_cast<int>(index << 3));
256 unsigned index = (exp + 348) / 8;
257 *outExp = -348 + index * 8;
268 #endif // RAPIDJSON_DIYFP_H_ unsigned long long uint64_t
Definition: ptypes.h:120
int e
Definition: diyfp.h:176
DOMString p
Definition: WebCryptoAPI.idl:116
DiyFp operator-(const DiyFp &rhs) const
Definition: diyfp.h:66
int c
Definition: cpp_unittests.cpp:275
#define RAPIDJSON_UINT64_C2(high32, low32)
Construct a 64-bit literal by a pair of 32-bit integer.
Definition: rapidjson.h:232
DiyFp operator*(const DiyFp &rhs) const
Definition: diyfp.h:70
DiyFp(uint64_t fp, int exp)
Definition: diyfp.h:46
OPENSSL_EXPORT pem_password_cb void * u
Definition: pem.h:398
static const int kDiySignificandSize
Definition: diyfp.h:165
double U(int64_t x, double alpha)
Definition: metric_recorder.cc:414
DiyFp GetCachedPower10(int exp, int *outExp)
Definition: diyfp.h:255
DiyFp NormalizeBoundary() const
Definition: diyfp.h:118
#define RAPIDJSON_NAMESPACE_BEGIN
provide custom rapidjson namespace (opening expression)
Definition: rapidjson.h:91
signed short int16_t
Definition: ptypes.h:93
std::integral_constant< std::uint64_t, V > uint64_t
Definition: Brigand.h:445
static const uint64_t kDpExponentMask
Definition: diyfp.h:171
DiyFp(double d)
Definition: diyfp.h:48
#define K
Definition: gcc-loops.cpp:16
static const int kDpSignificandSize
Definition: diyfp.h:166
DOMString k
Definition: WebCryptoAPI.idl:122
static const uint64_t kDpSignificandMask
Definition: diyfp.h:172
GLuint index
Definition: gl2.h:383
double ToDouble() const
Definition: diyfp.h:138
DiyFp Normalize() const
Definition: diyfp.h:100
#define RAPIDJSON_NAMESPACE_END
provide custom rapidjson namespace (closing expression)
Definition: rapidjson.h:94
GLboolean GLboolean GLboolean GLboolean a
Definition: gl2ext.h:306
static const int kDpMaxExponent
Definition: diyfp.h:168
GLfloat f
Definition: gl2.h:417
static const int kDpDenormalExponent
Definition: diyfp.h:170
Definition: document.h:393
void NormalizedBoundaries(DiyFp *minus, DiyFp *plus) const
Definition: diyfp.h:129
GLfloat GLfloat GLfloat GLfloat h
Definition: gl2ext.h:3060
static const int kDpExponentBias
Definition: diyfp.h:167
GLboolean GLboolean GLboolean b
Definition: gl2ext.h:306
res
Definition: harness.py:111
uint64_t f
Definition: diyfp.h:175
DiyFp()
Definition: diyfp.h:44
DiyFp GetCachedPower(int e, int *K)
Definition: diyfp.h:241
DiyFp GetCachedPowerByIndex(size_t index)
Definition: diyfp.h:179
static const int kDpMinExponent
Definition: diyfp.h:169
#define d
Definition: float-mm.c:30
static const uint64_t kDpHiddenBit
Definition: diyfp.h:173