Commit c512d617 authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[cleanup] Remove V8_2PART_UINT64_C macro

Replace by inline constants with separators (single quotes) for better
readability.

R=mlippautz@chromium.org

Bug: v8:10506
Change-Id: Iae7c72eeb9d463c63c2d135f6236edc6821d1e63
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2297379
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68939}
parent 88b010c3
......@@ -5098,7 +5098,7 @@ struct OneByteMask<4> {
};
template <>
struct OneByteMask<8> {
static const uint64_t value = V8_2PART_UINT64_C(0xFF00FF00, FF00FF00);
static const uint64_t value = 0xFF00'FF00'FF00'FF00;
};
static const uintptr_t kOneByteMask = OneByteMask<sizeof(uintptr_t)>::value;
static const uintptr_t kAlignmentMask = sizeof(uintptr_t) - 1;
......
......@@ -89,7 +89,7 @@ namespace {
#define SET_HIGH_WORD(d, v) \
do { \
uint64_t bits = bit_cast<uint64_t>(d); \
bits &= V8_2PART_UINT64_C(0x00000000, FFFFFFFF); \
bits &= 0x0000'0000'FFFF'FFFF; \
bits |= static_cast<uint64_t>(v) << 32; \
(d) = bit_cast<double>(bits); \
} while (false)
......@@ -99,7 +99,7 @@ namespace {
#define SET_LOW_WORD(d, v) \
do { \
uint64_t bits = bit_cast<uint64_t>(d); \
bits &= V8_2PART_UINT64_C(0xFFFFFFFF, 00000000); \
bits &= 0xFFFF'FFFF'0000'0000; \
bits |= static_cast<uint32_t>(v); \
(d) = bit_cast<double>(bits); \
} while (false)
......
......@@ -325,12 +325,7 @@ V8_INLINE A implicit_cast(A x) {
#define V8PRIuPTR "lxu"
#endif
// The following macro works on both 32 and 64-bit platforms.
// Usage: instead of writing 0x1234567890123456
// write V8_2PART_UINT64_C(0x12345678,90123456);
#define V8_2PART_UINT64_C(a, b) (((static_cast<uint64_t>(a) << 32) + 0x##b##u))
// A variant of V8_2PART_UINT64_C but for non-constants.
// Make a uint64 from two uint32_t halves.
inline uint64_t make_uint64(uint32_t high, uint32_t low) {
return (uint64_t{high} << 32) + low;
}
......
......@@ -130,9 +130,9 @@ class V8_BASE_EXPORT RandomNumberGenerator final {
static uint64_t MurmurHash3(uint64_t);
private:
static const int64_t kMultiplier = V8_2PART_UINT64_C(0x5, deece66d);
static const int64_t kMultiplier = 0x5'deec'e66d;
static const int64_t kAddend = 0xb;
static const int64_t kMask = V8_2PART_UINT64_C(0xffff, ffffffff);
static const int64_t kMask = 0xffff'ffff'ffff;
int Next(int bits) V8_WARN_UNUSED_RESULT;
......
......@@ -455,8 +455,7 @@ static void InitialScaledStartValuesNegativeExponentPositivePower(
static void InitialScaledStartValuesNegativeExponentNegativePower(
double v, int estimated_power, bool need_boundary_deltas, Bignum* numerator,
Bignum* denominator, Bignum* delta_minus, Bignum* delta_plus) {
const uint64_t kMinimalNormalizedExponent =
V8_2PART_UINT64_C(0x00100000, 00000000);
const uint64_t kMinimalNormalizedExponent = 0x0010'0000'0000'0000;
uint64_t significand = Double(v).Significand();
int exponent = Double(v).Exponent();
// Instead of multiplying the denominator with 10^estimated_power we
......
......@@ -262,7 +262,7 @@ void Bignum::MultiplyByUInt64(uint64_t factor) {
}
void Bignum::MultiplyByPowerOfTen(int exponent) {
const uint64_t kFive27 = V8_2PART_UINT64_C(0x6765C793, fa10079d);
const uint64_t kFive27 = 0x6765'C793'FA10'079D;
const uint16_t kFive1 = 5;
const uint16_t kFive2 = kFive1 * 5;
const uint16_t kFive3 = kFive2 * 5;
......
......@@ -22,93 +22,50 @@ struct CachedPower {
};
static const CachedPower kCachedPowers[] = {
{V8_2PART_UINT64_C(0xFA8FD5A0, 081C0288), -1220, -348},
{V8_2PART_UINT64_C(0xBAAEE17F, A23EBF76), -1193, -340},
{V8_2PART_UINT64_C(0x8B16FB20, 3055AC76), -1166, -332},
{V8_2PART_UINT64_C(0xCF42894A, 5DCE35EA), -1140, -324},
{V8_2PART_UINT64_C(0x9A6BB0AA, 55653B2D), -1113, -316},
{V8_2PART_UINT64_C(0xE61ACF03, 3D1A45DF), -1087, -308},
{V8_2PART_UINT64_C(0xAB70FE17, C79AC6CA), -1060, -300},
{V8_2PART_UINT64_C(0xFF77B1FC, BEBCDC4F), -1034, -292},
{V8_2PART_UINT64_C(0xBE5691EF, 416BD60C), -1007, -284},
{V8_2PART_UINT64_C(0x8DD01FAD, 907FFC3C), -980, -276},
{V8_2PART_UINT64_C(0xD3515C28, 31559A83), -954, -268},
{V8_2PART_UINT64_C(0x9D71AC8F, ADA6C9B5), -927, -260},
{V8_2PART_UINT64_C(0xEA9C2277, 23EE8BCB), -901, -252},
{V8_2PART_UINT64_C(0xAECC4991, 4078536D), -874, -244},
{V8_2PART_UINT64_C(0x823C1279, 5DB6CE57), -847, -236},
{V8_2PART_UINT64_C(0xC2109436, 4DFB5637), -821, -228},
{V8_2PART_UINT64_C(0x9096EA6F, 3848984F), -794, -220},
{V8_2PART_UINT64_C(0xD77485CB, 25823AC7), -768, -212},
{V8_2PART_UINT64_C(0xA086CFCD, 97BF97F4), -741, -204},
{V8_2PART_UINT64_C(0xEF340A98, 172AACE5), -715, -196},
{V8_2PART_UINT64_C(0xB23867FB, 2A35B28E), -688, -188},
{V8_2PART_UINT64_C(0x84C8D4DF, D2C63F3B), -661, -180},
{V8_2PART_UINT64_C(0xC5DD4427, 1AD3CDBA), -635, -172},
{V8_2PART_UINT64_C(0x936B9FCE, BB25C996), -608, -164},
{V8_2PART_UINT64_C(0xDBAC6C24, 7D62A584), -582, -156},
{V8_2PART_UINT64_C(0xA3AB6658, 0D5FDAF6), -555, -148},
{V8_2PART_UINT64_C(0xF3E2F893, DEC3F126), -529, -140},
{V8_2PART_UINT64_C(0xB5B5ADA8, AAFF80B8), -502, -132},
{V8_2PART_UINT64_C(0x87625F05, 6C7C4A8B), -475, -124},
{V8_2PART_UINT64_C(0xC9BCFF60, 34C13053), -449, -116},
{V8_2PART_UINT64_C(0x964E858C, 91BA2655), -422, -108},
{V8_2PART_UINT64_C(0xDFF97724, 70297EBD), -396, -100},
{V8_2PART_UINT64_C(0xA6DFBD9F, B8E5B88F), -369, -92},
{V8_2PART_UINT64_C(0xF8A95FCF, 88747D94), -343, -84},
{V8_2PART_UINT64_C(0xB9447093, 8FA89BCF), -316, -76},
{V8_2PART_UINT64_C(0x8A08F0F8, BF0F156B), -289, -68},
{V8_2PART_UINT64_C(0xCDB02555, 653131B6), -263, -60},
{V8_2PART_UINT64_C(0x993FE2C6, D07B7FAC), -236, -52},
{V8_2PART_UINT64_C(0xE45C10C4, 2A2B3B06), -210, -44},
{V8_2PART_UINT64_C(0xAA242499, 697392D3), -183, -36},
{V8_2PART_UINT64_C(0xFD87B5F2, 8300CA0E), -157, -28},
{V8_2PART_UINT64_C(0xBCE50864, 92111AEB), -130, -20},
{V8_2PART_UINT64_C(0x8CBCCC09, 6F5088CC), -103, -12},
{V8_2PART_UINT64_C(0xD1B71758, E219652C), -77, -4},
{V8_2PART_UINT64_C(0x9C400000, 00000000), -50, 4},
{V8_2PART_UINT64_C(0xE8D4A510, 00000000), -24, 12},
{V8_2PART_UINT64_C(0xAD78EBC5, AC620000), 3, 20},
{V8_2PART_UINT64_C(0x813F3978, F8940984), 30, 28},
{V8_2PART_UINT64_C(0xC097CE7B, C90715B3), 56, 36},
{V8_2PART_UINT64_C(0x8F7E32CE, 7BEA5C70), 83, 44},
{V8_2PART_UINT64_C(0xD5D238A4, ABE98068), 109, 52},
{V8_2PART_UINT64_C(0x9F4F2726, 179A2245), 136, 60},
{V8_2PART_UINT64_C(0xED63A231, D4C4FB27), 162, 68},
{V8_2PART_UINT64_C(0xB0DE6538, 8CC8ADA8), 189, 76},
{V8_2PART_UINT64_C(0x83C7088E, 1AAB65DB), 216, 84},
{V8_2PART_UINT64_C(0xC45D1DF9, 42711D9A), 242, 92},
{V8_2PART_UINT64_C(0x924D692C, A61BE758), 269, 100},
{V8_2PART_UINT64_C(0xDA01EE64, 1A708DEA), 295, 108},
{V8_2PART_UINT64_C(0xA26DA399, 9AEF774A), 322, 116},
{V8_2PART_UINT64_C(0xF209787B, B47D6B85), 348, 124},
{V8_2PART_UINT64_C(0xB454E4A1, 79DD1877), 375, 132},
{V8_2PART_UINT64_C(0x865B8692, 5B9BC5C2), 402, 140},
{V8_2PART_UINT64_C(0xC83553C5, C8965D3D), 428, 148},
{V8_2PART_UINT64_C(0x952AB45C, FA97A0B3), 455, 156},
{V8_2PART_UINT64_C(0xDE469FBD, 99A05FE3), 481, 164},
{V8_2PART_UINT64_C(0xA59BC234, DB398C25), 508, 172},
{V8_2PART_UINT64_C(0xF6C69A72, A3989F5C), 534, 180},
{V8_2PART_UINT64_C(0xB7DCBF53, 54E9BECE), 561, 188},
{V8_2PART_UINT64_C(0x88FCF317, F22241E2), 588, 196},
{V8_2PART_UINT64_C(0xCC20CE9B, D35C78A5), 614, 204},
{V8_2PART_UINT64_C(0x98165AF3, 7B2153DF), 641, 212},
{V8_2PART_UINT64_C(0xE2A0B5DC, 971F303A), 667, 220},
{V8_2PART_UINT64_C(0xA8D9D153, 5CE3B396), 694, 228},
{V8_2PART_UINT64_C(0xFB9B7CD9, A4A7443C), 720, 236},
{V8_2PART_UINT64_C(0xBB764C4C, A7A44410), 747, 244},
{V8_2PART_UINT64_C(0x8BAB8EEF, B6409C1A), 774, 252},
{V8_2PART_UINT64_C(0xD01FEF10, A657842C), 800, 260},
{V8_2PART_UINT64_C(0x9B10A4E5, E9913129), 827, 268},
{V8_2PART_UINT64_C(0xE7109BFB, A19C0C9D), 853, 276},
{V8_2PART_UINT64_C(0xAC2820D9, 623BF429), 880, 284},
{V8_2PART_UINT64_C(0x80444B5E, 7AA7CF85), 907, 292},
{V8_2PART_UINT64_C(0xBF21E440, 03ACDD2D), 933, 300},
{V8_2PART_UINT64_C(0x8E679C2F, 5E44FF8F), 960, 308},
{V8_2PART_UINT64_C(0xD433179D, 9C8CB841), 986, 316},
{V8_2PART_UINT64_C(0x9E19DB92, B4E31BA9), 1013, 324},
{V8_2PART_UINT64_C(0xEB96BF6E, BADF77D9), 1039, 332},
{V8_2PART_UINT64_C(0xAF87023B, 9BF0EE6B), 1066, 340},
{0xFA8F'D5A0'081C'0288, -1220, -348}, {0xBAAE'E17F'A23E'BF76, -1193, -340},
{0x8B16'FB20'3055'AC76, -1166, -332}, {0xCF42'894A'5DCE'35EA, -1140, -324},
{0x9A6B'B0AA'5565'3B2D, -1113, -316}, {0xE61A'CF03'3D1A'45DF, -1087, -308},
{0xAB70'FE17'C79A'C6CA, -1060, -300}, {0xFF77'B1FC'BEBC'DC4F, -1034, -292},
{0xBE56'91EF'416B'D60C, -1007, -284}, {0x8DD0'1FAD'907F'FC3C, -980, -276},
{0xD351'5C28'3155'9A83, -954, -268}, {0x9D71'AC8F'ADA6'C9B5, -927, -260},
{0xEA9C'2277'23EE'8BCB, -901, -252}, {0xAECC'4991'4078'536D, -874, -244},
{0x823C'1279'5DB6'CE57, -847, -236}, {0xC210'9436'4DFB'5637, -821, -228},
{0x9096'EA6F'3848'984F, -794, -220}, {0xD774'85CB'2582'3AC7, -768, -212},
{0xA086'CFCD'97BF'97F4, -741, -204}, {0xEF34'0A98'172A'ACE5, -715, -196},
{0xB238'67FB'2A35'B28E, -688, -188}, {0x84C8'D4DF'D2C6'3F3B, -661, -180},
{0xC5DD'4427'1AD3'CDBA, -635, -172}, {0x936B'9FCE'BB25'C996, -608, -164},
{0xDBAC'6C24'7D62'A584, -582, -156}, {0xA3AB'6658'0D5F'DAF6, -555, -148},
{0xF3E2'F893'DEC3'F126, -529, -140}, {0xB5B5'ADA8'AAFF'80B8, -502, -132},
{0x8762'5F05'6C7C'4A8B, -475, -124}, {0xC9BC'FF60'34C1'3053, -449, -116},
{0x964E'858C'91BA'2655, -422, -108}, {0xDFF9'7724'7029'7EBD, -396, -100},
{0xA6DF'BD9F'B8E5'B88F, -369, -92}, {0xF8A9'5FCF'8874'7D94, -343, -84},
{0xB944'7093'8FA8'9BCF, -316, -76}, {0x8A08'F0F8'BF0F'156B, -289, -68},
{0xCDB0'2555'6531'31B6, -263, -60}, {0x993F'E2C6'D07B'7FAC, -236, -52},
{0xE45C'10C4'2A2B'3B06, -210, -44}, {0xAA24'2499'6973'92D3, -183, -36},
{0xFD87'B5F2'8300'CA0E, -157, -28}, {0xBCE5'0864'9211'1AEB, -130, -20},
{0x8CBC'CC09'6F50'88CC, -103, -12}, {0xD1B7'1758'E219'652C, -77, -4},
{0x9C40'0000'0000'0000, -50, 4}, {0xE8D4'A510'0000'0000, -24, 12},
{0xAD78'EBC5'AC62'0000, 3, 20}, {0x813F'3978'F894'0984, 30, 28},
{0xC097'CE7B'C907'15B3, 56, 36}, {0x8F7E'32CE'7BEA'5C70, 83, 44},
{0xD5D2'38A4'ABE9'8068, 109, 52}, {0x9F4F'2726'179A'2245, 136, 60},
{0xED63'A231'D4C4'FB27, 162, 68}, {0xB0DE'6538'8CC8'ADA8, 189, 76},
{0x83C7'088E'1AAB'65DB, 216, 84}, {0xC45D'1DF9'4271'1D9A, 242, 92},
{0x924D'692C'A61B'E758, 269, 100}, {0xDA01'EE64'1A70'8DEA, 295, 108},
{0xA26D'A399'9AEF'774A, 322, 116}, {0xF209'787B'B47D'6B85, 348, 124},
{0xB454'E4A1'79DD'1877, 375, 132}, {0x865B'8692'5B9B'C5C2, 402, 140},
{0xC835'53C5'C896'5D3D, 428, 148}, {0x952A'B45C'FA97'A0B3, 455, 156},
{0xDE46'9FBD'99A0'5FE3, 481, 164}, {0xA59B'C234'DB39'8C25, 508, 172},
{0xF6C6'9A72'A398'9F5C, 534, 180}, {0xB7DC'BF53'54E9'BECE, 561, 188},
{0x88FC'F317'F222'41E2, 588, 196}, {0xCC20'CE9B'D35C'78A5, 614, 204},
{0x9816'5AF3'7B21'53DF, 641, 212}, {0xE2A0'B5DC'971F'303A, 667, 220},
{0xA8D9'D153'5CE3'B396, 694, 228}, {0xFB9B'7CD9'A4A7'443C, 720, 236},
{0xBB76'4C4C'A7A4'4410, 747, 244}, {0x8BAB'8EEF'B640'9C1A, 774, 252},
{0xD01F'EF10'A657'842C, 800, 260}, {0x9B10'A4E5'E991'3129, 827, 268},
{0xE710'9BFB'A19C'0C9D, 853, 276}, {0xAC28'20D9'623B'F429, 880, 284},
{0x8044'4B5E'7AA7'CF85, 907, 292}, {0xBF21'E440'03AC'DD2D, 933, 300},
{0x8E67'9C2F'5E44'FF8F, 960, 308}, {0xD433'179D'9C8C'B841, 986, 316},
{0x9E19'DB92'B4E3'1BA9, 1013, 324}, {0xEB96'BF6E'BADF'77D9, 1039, 332},
{0xAF87'023B'9BF0'EE6B, 1066, 340},
};
#ifdef DEBUG
......
......@@ -134,7 +134,7 @@ bool IsUint32Double(double value) {
bool DoubleToUint32IfEqualToSelf(double value, uint32_t* uint32_value) {
const double k2Pow52 = 4503599627370496.0;
const uint32_t kValidTopBits = 0x43300000;
const uint64_t kBottomBitMask = V8_2PART_UINT64_C(0x00000000, FFFFFFFF);
const uint64_t kBottomBitMask = 0x0000'0000'FFFF'FFFF;
// Add 2^52 to the double, to place valid uint32 values in the low-significant
// bits of the exponent, by effectively setting the (implicit) top bit of the
......
......@@ -18,13 +18,10 @@ inline double uint64_to_double(uint64_t d64) { return bit_cast<double>(d64); }
// Helper functions for doubles.
class Double {
public:
static constexpr uint64_t kSignMask = V8_2PART_UINT64_C(0x80000000, 00000000);
static constexpr uint64_t kExponentMask =
V8_2PART_UINT64_C(0x7FF00000, 00000000);
static constexpr uint64_t kSignificandMask =
V8_2PART_UINT64_C(0x000FFFFF, FFFFFFFF);
static constexpr uint64_t kHiddenBit =
V8_2PART_UINT64_C(0x00100000, 00000000);
static constexpr uint64_t kSignMask = 0x8000'0000'0000'0000;
static constexpr uint64_t kExponentMask = 0x7FF0'0000'0000'0000;
static constexpr uint64_t kSignificandMask = 0x000F'FFFF'FFFF'FFFF;
static constexpr uint64_t kHiddenBit = 0x0010'0000'0000'0000;
static constexpr int kPhysicalSignificandSize =
52; // Excludes the hidden bit.
static constexpr int kSignificandSize = 53;
......@@ -173,7 +170,7 @@ class Double {
static constexpr int kExponentBias = 0x3FF + kPhysicalSignificandSize;
static constexpr int kDenormalExponent = -kExponentBias + 1;
static constexpr int kMaxExponent = 0x7FF - kExponentBias;
static constexpr uint64_t kInfinity = V8_2PART_UINT64_C(0x7FF00000, 00000000);
static constexpr uint64_t kInfinity = 0x7FF0'0000'0000'0000;
// The field d64_ is not marked as const to permit the usage of the copy
// constructor.
......
......@@ -428,7 +428,7 @@ static bool DigitGen(DiyFp low, DiyFp w, DiyFp high, Vector<char> buffer,
// and thus one.e >= -60.
DCHECK_GE(one.e(), -60);
DCHECK(fractionals < one.f());
DCHECK(V8_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFF) / 10 >= one.f());
DCHECK(0xFFFF'FFFF'FFFF'FFFF / 10 >= one.f());
while (true) {
fractionals *= 10;
unit *= 10;
......@@ -531,7 +531,7 @@ static bool DigitGenCounted(DiyFp w, int requested_digits, Vector<char> buffer,
// and thus one.e >= -60.
DCHECK_GE(one.e(), -60);
DCHECK(fractionals < one.f());
DCHECK(V8_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFF) / 10 >= one.f());
DCHECK(0xFFFF'FFFF'FFFF'FFFF / 10 >= one.f());
while (requested_digits > 0 && fractionals > w_error) {
fractionals *= 10;
w_error *= 10;
......
......@@ -301,7 +301,7 @@ bool FastFixedDtoa(double v, int fractional_count, Vector<char> buffer,
// The quotient delivers the first digits, and the remainder fits into a 64
// bit number.
// Dividing by 10^17 is equivalent to dividing by 5^17*2^17.
const uint64_t kFive17 = V8_2PART_UINT64_C(0xB1, A2BC2EC5); // 5^17
const uint64_t kFive17 = 0xB1'A2BC'2EC5; // 5^17
uint64_t divisor = kFive17;
int divisor_power = 17;
uint64_t dividend = significand;
......
......@@ -33,7 +33,7 @@ static const int kMaxDecimalPower = 309;
static const int kMinDecimalPower = -324;
// 2^64 = 18446744073709551616
static const uint64_t kMaxUint64 = V8_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFF);
static const uint64_t kMaxUint64 = 0xFFFF'FFFF'FFFF'FFFF;
// clang-format off
static const double exact_powers_of_ten[] = {
......@@ -210,19 +210,19 @@ static DiyFp AdjustmentPowerOfTen(int exponent) {
DCHECK_EQ(PowersOfTenCache::kDecimalExponentDistance, 8);
switch (exponent) {
case 1:
return DiyFp(V8_2PART_UINT64_C(0xA0000000, 00000000), -60);
return DiyFp(0xA000'0000'0000'0000, -60);
case 2:
return DiyFp(V8_2PART_UINT64_C(0xC8000000, 00000000), -57);
return DiyFp(0xC800'0000'0000'0000, -57);
case 3:
return DiyFp(V8_2PART_UINT64_C(0xFA000000, 00000000), -54);
return DiyFp(0xFA00'0000'0000'0000, -54);
case 4:
return DiyFp(V8_2PART_UINT64_C(0x9C400000, 00000000), -50);
return DiyFp(0x9C40'0000'0000'0000, -50);
case 5:
return DiyFp(V8_2PART_UINT64_C(0xC3500000, 00000000), -47);
return DiyFp(0xC350'0000'0000'0000, -47);
case 6:
return DiyFp(V8_2PART_UINT64_C(0xF4240000, 00000000), -44);
return DiyFp(0xF424'0000'0000'0000, -44);
case 7:
return DiyFp(V8_2PART_UINT64_C(0x98968000, 00000000), -40);
return DiyFp(0x9896'8000'0000'0000, -40);
default:
UNREACHABLE();
}
......
......@@ -489,9 +489,9 @@ TEST(AssemblerIa32Extractps) {
#endif
F4 f = FUNCTION_CAST<F4>(code->entry());
uint64_t value1 = V8_2PART_UINT64_C(0x12345678, 87654321);
uint64_t value1 = 0x1234'5678'8765'4321;
CHECK_EQ(0x12345678, f(uint64_to_double(value1)));
uint64_t value2 = V8_2PART_UINT64_C(0x87654321, 12345678);
uint64_t value2 = 0x8765'4321'1234'5678;
CHECK_EQ(static_cast<int>(0x87654321), f(uint64_to_double(value2)));
}
......
......@@ -376,12 +376,12 @@ TEST(AssemblerX64XchglOperations) {
masm.GetCode(CcTest::i_isolate(), &desc);
buffer->MakeExecutable();
// Call the function from C++.
uint64_t left = V8_2PART_UINT64_C(0x10000000, 20000000);
uint64_t right = V8_2PART_UINT64_C(0x30000000, 40000000);
uint64_t left = 0x1000'0000'2000'0000;
uint64_t right = 0x3000'0000'4000'0000;
auto f = GeneratedCode<F4>::FromBuffer(CcTest::i_isolate(), buffer->start());
uint64_t result = f.Call(&left, &right);
CHECK_EQ(V8_2PART_UINT64_C(0x00000000, 40000000), left);
CHECK_EQ(V8_2PART_UINT64_C(0x00000000, 20000000), right);
CHECK_EQ(0x0000'0000'4000'0000, left);
CHECK_EQ(0x0000'0000'2000'0000, right);
USE(result);
}
......@@ -399,11 +399,11 @@ TEST(AssemblerX64OrlOperations) {
masm.GetCode(CcTest::i_isolate(), &desc);
buffer->MakeExecutable();
// Call the function from C++.
uint64_t left = V8_2PART_UINT64_C(0x10000000, 20000000);
uint64_t right = V8_2PART_UINT64_C(0x30000000, 40000000);
uint64_t left = 0x1000'0000'2000'0000;
uint64_t right = 0x3000'0000'4000'0000;
auto f = GeneratedCode<F4>::FromBuffer(CcTest::i_isolate(), buffer->start());
uint64_t result = f.Call(&left, &right);
CHECK_EQ(V8_2PART_UINT64_C(0x10000000, 60000000), left);
CHECK_EQ(0x1000'0000'6000'0000, left);
USE(result);
}
......@@ -421,10 +421,10 @@ TEST(AssemblerX64RollOperations) {
masm.GetCode(CcTest::i_isolate(), &desc);
buffer->MakeExecutable();
// Call the function from C++.
uint64_t src = V8_2PART_UINT64_C(0x10000000, C0000000);
uint64_t src = 0x1000'0000'C000'0000;
auto f = GeneratedCode<F5>::FromBuffer(CcTest::i_isolate(), buffer->start());
uint64_t result = f.Call(src);
CHECK_EQ(V8_2PART_UINT64_C(0x00000000, 80000001), result);
CHECK_EQ(0x0000'0000'8000'0001, result);
}
......@@ -441,11 +441,11 @@ TEST(AssemblerX64SublOperations) {
masm.GetCode(CcTest::i_isolate(), &desc);
buffer->MakeExecutable();
// Call the function from C++.
uint64_t left = V8_2PART_UINT64_C(0x10000000, 20000000);
uint64_t right = V8_2PART_UINT64_C(0x30000000, 40000000);
uint64_t left = 0x1000'0000'2000'0000;
uint64_t right = 0x3000'0000'4000'0000;
auto f = GeneratedCode<F4>::FromBuffer(CcTest::i_isolate(), buffer->start());
uint64_t result = f.Call(&left, &right);
CHECK_EQ(V8_2PART_UINT64_C(0x10000000, E0000000), left);
CHECK_EQ(0x1000'0000'E000'0000, left);
USE(result);
}
......@@ -469,8 +469,8 @@ TEST(AssemblerX64TestlOperations) {
masm.GetCode(CcTest::i_isolate(), &desc);
buffer->MakeExecutable();
// Call the function from C++.
uint64_t left = V8_2PART_UINT64_C(0x10000000, 20000000);
uint64_t right = V8_2PART_UINT64_C(0x30000000, 00000000);
uint64_t left = 0x1000'0000'2000'0000;
uint64_t right = 0x3000'0000'0000'0000;
auto f = GeneratedCode<F4>::FromBuffer(CcTest::i_isolate(), buffer->start());
uint64_t result = f.Call(&left, &right);
CHECK_EQ(1u, result);
......@@ -514,11 +514,11 @@ TEST(AssemblerX64XorlOperations) {
masm.GetCode(CcTest::i_isolate(), &desc);
buffer->MakeExecutable();
// Call the function from C++.
uint64_t left = V8_2PART_UINT64_C(0x10000000, 20000000);
uint64_t right = V8_2PART_UINT64_C(0x30000000, 60000000);
uint64_t left = 0x1000'0000'2000'0000;
uint64_t right = 0x3000'0000'6000'0000;
auto f = GeneratedCode<F4>::FromBuffer(CcTest::i_isolate(), buffer->start());
uint64_t result = f.Call(&left, &right);
CHECK_EQ(V8_2PART_UINT64_C(0x10000000, 40000000), left);
CHECK_EQ(0x1000'0000'4000'0000, left);
USE(result);
}
......@@ -870,9 +870,9 @@ TEST(AssemblerX64Extractps) {
#endif
auto f = GeneratedCode<F3>::FromCode(*code);
uint64_t value1 = V8_2PART_UINT64_C(0x12345678, 87654321);
uint64_t value1 = 0x1234'5678'8765'4321;
CHECK_EQ(0x12345678u, f.Call(uint64_to_double(value1)));
uint64_t value2 = V8_2PART_UINT64_C(0x87654321, 12345678);
uint64_t value2 = 0x8765'4321'1234'5678;
CHECK_EQ(0x87654321u, f.Call(uint64_to_double(value2)));
}
......
......@@ -189,7 +189,7 @@ TEST(BignumDtoaVariousDoubles) {
CHECK_EQ(0, strcmp("35844466", buffer.begin()));
CHECK_EQ(299, point);
uint64_t smallest_normal64 = V8_2PART_UINT64_C(0x00100000, 00000000);
uint64_t smallest_normal64 = 0x0010'0000'0000'0000;
double v = Double(smallest_normal64).value();
BignumDtoa(v, BIGNUM_DTOA_SHORTEST, 0, buffer, &length, &point);
CHECK_EQ(0, strcmp("22250738585072014", buffer.begin()));
......@@ -201,7 +201,7 @@ TEST(BignumDtoaVariousDoubles) {
CHECK_EQ(0, strcmp("22250738585072013831", buffer.begin()));
CHECK_EQ(-307, point);
uint64_t largest_denormal64 = V8_2PART_UINT64_C(0x000FFFFF, FFFFFFFF);
uint64_t largest_denormal64 = 0x000F'FFFF'FFFF'FFFF;
v = Double(largest_denormal64).value();
BignumDtoa(v, BIGNUM_DTOA_SHORTEST, 0, buffer, &length, &point);
CHECK_EQ(0, strcmp("2225073858507201", buffer.begin()));
......
......@@ -80,12 +80,12 @@ TEST(Assign) {
CHECK(bignum.ToHexString(buffer, kBufferSize));
CHECK_EQ(0, strcmp("12345678", buffer));
uint64_t big = V8_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFF);
uint64_t big = 0xFFFF'FFFF'FFFF'FFFF;
bignum.AssignUInt64(big);
CHECK(bignum.ToHexString(buffer, kBufferSize));
CHECK_EQ(0, strcmp("FFFFFFFFFFFFFFFF", buffer));
big = V8_2PART_UINT64_C(0x12345678, 9ABCDEF0);
big = 0x1234'5678'9ABC'DEF0;
bignum.AssignUInt64(big);
CHECK(bignum.ToHexString(buffer, kBufferSize));
CHECK_EQ(0, strcmp("123456789ABCDEF0", buffer));
......@@ -205,49 +205,49 @@ TEST(AddUInt64) {
CHECK_EQ(0, strcmp("1000000000000000000000FFFF", buffer));
AssignHexString(&bignum, "0");
bignum.AddUInt64(V8_2PART_UINT64_C(0xA, 00000000));
bignum.AddUInt64(0xA'0000'0000);
CHECK(bignum.ToHexString(buffer, kBufferSize));
CHECK_EQ(0, strcmp("A00000000", buffer));
AssignHexString(&bignum, "1");
bignum.AddUInt64(V8_2PART_UINT64_C(0xA, 00000000));
bignum.AddUInt64(0xA'0000'0000);
CHECK(bignum.ToHexString(buffer, kBufferSize));
CHECK_EQ(0, strcmp("A00000001", buffer));
AssignHexString(&bignum, "1");
bignum.AddUInt64(V8_2PART_UINT64_C(0x100, 00000000));
bignum.AddUInt64(0x100'0000'0000);
CHECK(bignum.ToHexString(buffer, kBufferSize));
CHECK_EQ(0, strcmp("10000000001", buffer));
AssignHexString(&bignum, "1");
bignum.AddUInt64(V8_2PART_UINT64_C(0xFFFF, 00000000));
bignum.AddUInt64(0xFFFF'0000'0000);
CHECK(bignum.ToHexString(buffer, kBufferSize));
CHECK_EQ(0, strcmp("FFFF00000001", buffer));
AssignHexString(&bignum, "FFFFFFF");
bignum.AddUInt64(V8_2PART_UINT64_C(0x1, 00000000));
bignum.AddUInt64(0x1'0000'0000);
CHECK(bignum.ToHexString(buffer, kBufferSize));
CHECK_EQ(0, strcmp("10FFFFFFF", buffer));
AssignHexString(&bignum, "10000000000000000000000000000000000000000000");
bignum.AddUInt64(V8_2PART_UINT64_C(0xFFFF, 00000000));
bignum.AddUInt64(0xFFFF'0000'0000);
CHECK(bignum.ToHexString(buffer, kBufferSize));
CHECK_EQ(0, strcmp("10000000000000000000000000000000FFFF00000000", buffer));
AssignHexString(&bignum, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF");
bignum.AddUInt64(V8_2PART_UINT64_C(0x1, 00000000));
bignum.AddUInt64(0x1'0000'0000);
CHECK(bignum.ToHexString(buffer, kBufferSize));
CHECK_EQ(0, strcmp("1000000000000000000000000000000000000FFFFFFFF", buffer));
bignum.AssignUInt16(0x1);
bignum.ShiftLeft(100);
bignum.AddUInt64(V8_2PART_UINT64_C(0x1, 00000000));
bignum.AddUInt64(0x1'0000'0000);
CHECK(bignum.ToHexString(buffer, kBufferSize));
CHECK_EQ(0, strcmp("10000000000000000100000000", buffer));
bignum.AssignUInt16(0x1);
bignum.ShiftLeft(100);
bignum.AddUInt64(V8_2PART_UINT64_C(0xFFFF, 00000000));
bignum.AddUInt64(0xFFFF'0000'0000);
CHECK(bignum.ToHexString(buffer, kBufferSize));
CHECK_EQ(0, strcmp("10000000000000FFFF00000000", buffer));
}
......@@ -569,7 +569,7 @@ TEST(MultiplyUInt64) {
CHECK_EQ(0, strcmp("FFFF00000000000000", buffer));
AssignHexString(&bignum, "100000000000000");
bignum.MultiplyByUInt64(V8_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFF));
bignum.MultiplyByUInt64(0xFFFF'FFFF'FFFF'FFFF);
CHECK(bignum.ToHexString(buffer, kBufferSize));
CHECK_EQ(0, strcmp("FFFFFFFFFFFFFFFF00000000000000", buffer));
......@@ -579,7 +579,7 @@ TEST(MultiplyUInt64) {
CHECK_EQ(0, strcmp("12333335552433", buffer));
AssignHexString(&bignum, "1234567ABCD");
bignum.MultiplyByUInt64(V8_2PART_UINT64_C(0xFF, FFFFFFFF));
bignum.MultiplyByUInt64(0xFF'FFFF'FFFF);
CHECK(bignum.ToHexString(buffer, kBufferSize));
CHECK_EQ(0, strcmp("1234567ABCBDCBA985433", buffer));
......@@ -599,7 +599,7 @@ TEST(MultiplyUInt64) {
CHECK_EQ(0, strcmp("EFFFFFFFFFFFFFFF1", buffer));
AssignHexString(&bignum, "FFFFFFFFFFFFFFFF");
bignum.MultiplyByUInt64(V8_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFF));
bignum.MultiplyByUInt64(0xFFFF'FFFF'FFFF'FFFF);
CHECK(bignum.ToHexString(buffer, kBufferSize));
CHECK_EQ(0, strcmp("FFFFFFFFFFFFFFFE0000000000000001", buffer));
......@@ -634,12 +634,12 @@ TEST(MultiplyUInt64) {
bignum.AssignUInt16(0xFFFF);
bignum.ShiftLeft(100);
// "FFFF0 0000 0000 0000 0000 0000 0000"
bignum.MultiplyByUInt64(V8_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFF));
bignum.MultiplyByUInt64(0xFFFF'FFFF'FFFF'FFFF);
CHECK(bignum.ToHexString(buffer, kBufferSize));
CHECK_EQ(0, strcmp("FFFEFFFFFFFFFFFF00010000000000000000000000000", buffer));
AssignDecimalString(&bignum, "15611230384529777");
bignum.MultiplyByUInt64(V8_2PART_UINT64_C(0x8AC72304, 89E80000));
bignum.MultiplyByUInt64(0x8AC7'2304'89E8'0000);
CHECK(bignum.ToHexString(buffer, kBufferSize));
CHECK_EQ(0, strcmp("1E10EE4B11D15A7F3DE7F3C7680000", buffer));
}
......
......@@ -357,12 +357,12 @@ TEST(BitField64) {
uint64_t x;
// Test most significant bits.
x = V8_2PART_UINT64_C(0xE0000000, 00000000);
x = 0xE000'0000'0000'0000;
CHECK(x == UpperBits::encode(7));
CHECK_EQ(7, UpperBits::decode(x));
// Test the 32/64-bit boundary bits.
x = V8_2PART_UINT64_C(0x00000001, 80000000);
x = 0x0000'0001'8000'0000;
CHECK(x == MiddleBits::encode(3));
CHECK_EQ(3, MiddleBits::decode(x));
}
......
......@@ -60,20 +60,20 @@ TEST(Multiply) {
CHECK_EQ(0, diy_fp1.f());
CHECK_EQ(64, diy_fp1.e());
diy_fp1 = DiyFp(V8_2PART_UINT64_C(0x80000000, 00000000), 11);
diy_fp1 = DiyFp(0x8000'0000'0000'0000, 11);
diy_fp2 = DiyFp(2, 13);
product = DiyFp::Times(diy_fp1, diy_fp2);
CHECK_EQ(1, product.f());
CHECK_EQ(11 + 13 + 64, product.e());
// Test rounding.
diy_fp1 = DiyFp(V8_2PART_UINT64_C(0x80000000, 00000001), 11);
diy_fp1 = DiyFp(0x8000'0000'0000'0001, 11);
diy_fp2 = DiyFp(1, 13);
product = DiyFp::Times(diy_fp1, diy_fp2);
CHECK_EQ(1, product.f());
CHECK_EQ(11 + 13 + 64, product.e());
diy_fp1 = DiyFp(V8_2PART_UINT64_C(0x7FFFFFFF, FFFFFFFF), 11);
diy_fp1 = DiyFp(0x7FFF'FFFF'FFFF'FFFF, 11);
diy_fp2 = DiyFp(1, 13);
product = DiyFp::Times(diy_fp1, diy_fp2);
CHECK_EQ(0, product.f());
......@@ -82,11 +82,11 @@ TEST(Multiply) {
// Halfway cases are allowed to round either way. So don't check for it.
// Big numbers.
diy_fp1 = DiyFp(V8_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFF), 11);
diy_fp2 = DiyFp(V8_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFF), 13);
diy_fp1 = DiyFp(0xFFFF'FFFF'FFFF'FFFF, 11);
diy_fp2 = DiyFp(0xFFFF'FFFF'FFFF'FFFF, 13);
// 128bit result: 0xFFFFFFFFFFFFFFFE0000000000000001
product = DiyFp::Times(diy_fp1, diy_fp2);
CHECK(V8_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFE) == product.f());
CHECK_EQ(0xFFFF'FFFF'FFFF'FFFE, product.f());
CHECK_EQ(11 + 13 + 64, product.e());
}
......
......@@ -39,64 +39,62 @@ namespace internal {
TEST(Uint64Conversions) {
// Start by checking the byte-order.
uint64_t ordered = V8_2PART_UINT64_C(0x01234567, 89ABCDEF);
uint64_t ordered = 0x0123'4567'89AB'CDEF;
CHECK_EQ(3512700564088504e-318, Double(ordered).value());
uint64_t min_double64 = V8_2PART_UINT64_C(0x00000000, 00000001);
uint64_t min_double64 = 0x0000'0000'0000'0001;
CHECK_EQ(5e-324, Double(min_double64).value());
uint64_t max_double64 = V8_2PART_UINT64_C(0x7FEFFFFF, FFFFFFFF);
uint64_t max_double64 = 0x7FEF'FFFF'FFFF'FFFF;
CHECK_EQ(1.7976931348623157e308, Double(max_double64).value());
}
TEST(AsDiyFp) {
uint64_t ordered = V8_2PART_UINT64_C(0x01234567, 89ABCDEF);
uint64_t ordered = 0x0123'4567'89AB'CDEF;
DiyFp diy_fp = Double(ordered).AsDiyFp();
CHECK_EQ(0x12 - 0x3FF - 52, diy_fp.e());
// The 52 mantissa bits, plus the implicit 1 in bit 52 as a UINT64.
CHECK(V8_2PART_UINT64_C(0x00134567, 89ABCDEF) == diy_fp.f()); // NOLINT
CHECK(0x0013'4567'89AB'CDEF == diy_fp.f()); // NOLINT
uint64_t min_double64 = V8_2PART_UINT64_C(0x00000000, 00000001);
uint64_t min_double64 = 0x0000'0000'0000'0001;
diy_fp = Double(min_double64).AsDiyFp();
CHECK_EQ(-0x3FF - 52 + 1, diy_fp.e());
// This is a denormal; so no hidden bit.
CHECK_EQ(1, diy_fp.f());
uint64_t max_double64 = V8_2PART_UINT64_C(0x7FEFFFFF, FFFFFFFF);
uint64_t max_double64 = 0x7FEF'FFFF'FFFF'FFFF;
diy_fp = Double(max_double64).AsDiyFp();
CHECK_EQ(0x7FE - 0x3FF - 52, diy_fp.e());
CHECK(V8_2PART_UINT64_C(0x001FFFFF, FFFFFFFF) == diy_fp.f()); // NOLINT
CHECK(0x001F'FFFF'FFFF'FFFF == diy_fp.f()); // NOLINT
}
TEST(AsNormalizedDiyFp) {
uint64_t ordered = V8_2PART_UINT64_C(0x01234567, 89ABCDEF);
uint64_t ordered = 0x0123'4567'89AB'CDEF;
DiyFp diy_fp = Double(ordered).AsNormalizedDiyFp();
CHECK_EQ(0x12 - 0x3FF - 52 - 11, diy_fp.e());
CHECK((V8_2PART_UINT64_C(0x00134567, 89ABCDEF) << 11) ==
diy_fp.f()); // NOLINT
CHECK((uint64_t{0x0013'4567'89AB'CDEF} << 11) == diy_fp.f()); // NOLINT
uint64_t min_double64 = V8_2PART_UINT64_C(0x00000000, 00000001);
uint64_t min_double64 = 0x0000'0000'0000'0001;
diy_fp = Double(min_double64).AsNormalizedDiyFp();
CHECK_EQ(-0x3FF - 52 + 1 - 63, diy_fp.e());
// This is a denormal; so no hidden bit.
CHECK(V8_2PART_UINT64_C(0x80000000, 00000000) == diy_fp.f()); // NOLINT
CHECK(0x8000'0000'0000'0000 == diy_fp.f()); // NOLINT
uint64_t max_double64 = V8_2PART_UINT64_C(0x7FEFFFFF, FFFFFFFF);
uint64_t max_double64 = 0x7FEF'FFFF'FFFF'FFFF;
diy_fp = Double(max_double64).AsNormalizedDiyFp();
CHECK_EQ(0x7FE - 0x3FF - 52 - 11, diy_fp.e());
CHECK((V8_2PART_UINT64_C(0x001FFFFF, FFFFFFFF) << 11) ==
diy_fp.f()); // NOLINT
CHECK((uint64_t{0x001F'FFFF'FFFF'FFFF} << 11) == diy_fp.f());
}
TEST(IsDenormal) {
uint64_t min_double64 = V8_2PART_UINT64_C(0x00000000, 00000001);
uint64_t min_double64 = 0x0000'0000'0000'0001;
CHECK(Double(min_double64).IsDenormal());
uint64_t bits = V8_2PART_UINT64_C(0x000FFFFF, FFFFFFFF);
uint64_t bits = 0x000F'FFFF'FFFF'FFFF;
CHECK(Double(bits).IsDenormal());
bits = V8_2PART_UINT64_C(0x00100000, 00000000);
bits = 0x0010'0000'0000'0000;
CHECK(!Double(bits).IsDenormal());
}
......@@ -105,7 +103,7 @@ TEST(IsSpecial) {
CHECK(Double(V8_INFINITY).IsSpecial());
CHECK(Double(-V8_INFINITY).IsSpecial());
CHECK(Double(std::numeric_limits<double>::quiet_NaN()).IsSpecial());
uint64_t bits = V8_2PART_UINT64_C(0xFFF12345, 00000000);
uint64_t bits = 0xFFF1'2345'0000'0000;
CHECK(Double(bits).IsSpecial());
// Denormals are not special:
CHECK(!Double(5e-324).IsSpecial());
......@@ -132,7 +130,7 @@ TEST(IsInfinite) {
CHECK(!Double(-0.0).IsInfinite());
CHECK(!Double(1.0).IsInfinite());
CHECK(!Double(-1.0).IsInfinite());
uint64_t min_double64 = V8_2PART_UINT64_C(0x00000000, 00000001);
uint64_t min_double64 = 0x0000'0000'0000'0001;
CHECK(!Double(min_double64).IsInfinite());
}
......@@ -143,7 +141,7 @@ TEST(Sign) {
CHECK_EQ(-1, Double(-V8_INFINITY).Sign());
CHECK_EQ(1, Double(0.0).Sign());
CHECK_EQ(-1, Double(-0.0).Sign());
uint64_t min_double64 = V8_2PART_UINT64_C(0x00000000, 00000001);
uint64_t min_double64 = 0x0000'0000'0000'0001;
CHECK_EQ(1, Double(min_double64).Sign());
}
......@@ -170,7 +168,7 @@ TEST(NormalizedBoundaries) {
CHECK((1 << 9) == diy_fp.f() - boundary_minus.f()); // NOLINT
CHECK((1 << 10) == boundary_plus.f() - diy_fp.f()); // NOLINT
uint64_t min_double64 = V8_2PART_UINT64_C(0x00000000, 00000001);
uint64_t min_double64 = 0x0000'0000'0000'0001;
diy_fp = Double(min_double64).AsNormalizedDiyFp();
Double(min_double64).NormalizedBoundaries(&boundary_minus, &boundary_plus);
CHECK_EQ(diy_fp.e(), boundary_minus.e());
......@@ -182,7 +180,7 @@ TEST(NormalizedBoundaries) {
CHECK((static_cast<uint64_t>(1) << 62) ==
diy_fp.f() - boundary_minus.f()); // NOLINT
uint64_t smallest_normal64 = V8_2PART_UINT64_C(0x00100000, 00000000);
uint64_t smallest_normal64 = 0x0010'0000'0000'0000;
diy_fp = Double(smallest_normal64).AsNormalizedDiyFp();
Double(smallest_normal64).NormalizedBoundaries(&boundary_minus,
&boundary_plus);
......@@ -193,7 +191,7 @@ TEST(NormalizedBoundaries) {
CHECK(diy_fp.f() - boundary_minus.f() == boundary_plus.f() - diy_fp.f());
CHECK((1 << 10) == diy_fp.f() - boundary_minus.f()); // NOLINT
uint64_t largest_denormal64 = V8_2PART_UINT64_C(0x000FFFFF, FFFFFFFF);
uint64_t largest_denormal64 = 0x000F'FFFF'FFFF'FFFF;
diy_fp = Double(largest_denormal64).AsNormalizedDiyFp();
Double(largest_denormal64).NormalizedBoundaries(&boundary_minus,
&boundary_plus);
......@@ -202,7 +200,7 @@ TEST(NormalizedBoundaries) {
CHECK(diy_fp.f() - boundary_minus.f() == boundary_plus.f() - diy_fp.f());
CHECK((1 << 11) == diy_fp.f() - boundary_minus.f()); // NOLINT
uint64_t max_double64 = V8_2PART_UINT64_C(0x7FEFFFFF, FFFFFFFF);
uint64_t max_double64 = 0x7FEF'FFFF'FFFF'FFFF;
diy_fp = Double(max_double64).AsNormalizedDiyFp();
Double(max_double64).NormalizedBoundaries(&boundary_minus, &boundary_plus);
CHECK_EQ(diy_fp.e(), boundary_minus.e());
......@@ -225,8 +223,7 @@ TEST(NextDouble) {
CHECK_EQ(0.0, d2.value());
CHECK_EQ(4e-324, d2.NextDouble());
CHECK_EQ(-1.7976931348623157e308, Double(-V8_INFINITY).NextDouble());
CHECK_EQ(V8_INFINITY,
Double(V8_2PART_UINT64_C(0x7FEFFFFF, FFFFFFFF)).NextDouble());
CHECK_EQ(V8_INFINITY, Double(uint64_t{0x7FEF'FFFF'FFFF'FFFF}).NextDouble());
}
} // namespace internal
......
......@@ -212,7 +212,7 @@ TEST(DtoaVariousDoubles) {
CHECK_EQ(0, strcmp("35844466", buffer.begin()));
CHECK_EQ(299, point);
uint64_t smallest_normal64 = V8_2PART_UINT64_C(0x00100000, 00000000);
uint64_t smallest_normal64 = 0x0010'0000'0000'0000;
double v = Double(smallest_normal64).value();
DoubleToAscii(v, DTOA_SHORTEST, 0, buffer, &sign, &length, &point);
CHECK_EQ(0, strcmp("22250738585072014", buffer.begin()));
......@@ -224,7 +224,7 @@ TEST(DtoaVariousDoubles) {
CHECK_EQ(0, strcmp("22250738585072013831", buffer.begin()));
CHECK_EQ(-307, point);
uint64_t largest_denormal64 = V8_2PART_UINT64_C(0x000FFFFF, FFFFFFFF);
uint64_t largest_denormal64 = 0x000F'FFFF'FFFF'FFFF;
v = Double(largest_denormal64).value();
DoubleToAscii(v, DTOA_SHORTEST, 0, buffer, &sign, &length, &point);
CHECK_EQ(0, strcmp("2225073858507201", buffer.begin()));
......
......@@ -103,7 +103,7 @@ TEST(FastDtoaShortestVariousDoubles) {
CHECK_EQ(299, point);
}
uint64_t smallest_normal64 = V8_2PART_UINT64_C(0x00100000, 00000000);
uint64_t smallest_normal64 = 0x0010'0000'0000'0000;
double v = Double(smallest_normal64).value();
status = FastDtoa(v, FAST_DTOA_SHORTEST, 0, buffer, &length, &point);
if (status) {
......@@ -111,7 +111,7 @@ TEST(FastDtoaShortestVariousDoubles) {
CHECK_EQ(-307, point);
}
uint64_t largest_denormal64 = V8_2PART_UINT64_C(0x000FFFFF, FFFFFFFF);
uint64_t largest_denormal64 = 0x000F'FFFF'FFFF'FFFF;
v = Double(largest_denormal64).value();
status = FastDtoa(v, FAST_DTOA_SHORTEST, 0, buffer, &length, &point);
if (status) {
......@@ -192,14 +192,14 @@ TEST(FastDtoaPrecisionVariousDoubles) {
CHECK_EQ(0, strcmp("35844466", buffer.begin()));
CHECK_EQ(299, point);
uint64_t smallest_normal64 = V8_2PART_UINT64_C(0x00100000, 00000000);
uint64_t smallest_normal64 = 0x0010'0000'0000'0000;
double v = Double(smallest_normal64).value();
status = FastDtoa(v, FAST_DTOA_PRECISION, 17, buffer, &length, &point);
CHECK(status);
CHECK_EQ(0, strcmp("22250738585072014", buffer.begin()));
CHECK_EQ(-307, point);
uint64_t largest_denormal64 = V8_2PART_UINT64_C(0x000FFFFF, FFFFFFFF);
uint64_t largest_denormal64 = 0x000F'FFFF'FFFF'FFFF;
v = Double(largest_denormal64).value();
status = FastDtoa(v, FAST_DTOA_PRECISION, 17, buffer, &length, &point);
CHECK(status);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment