Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(489)

Unified Diff: test/cctest/test-double.cc

Issue 866002: Fast double-to-ascii conversion. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/test-diy_fp.cc ('k') | test/cctest/test-grisu3.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-double.cc
===================================================================
--- test/cctest/test-double.cc (revision 4092)
+++ test/cctest/test-double.cc (working copy)
@@ -9,6 +9,7 @@
#include "diy_fp.h"
#include "double.h"
+
using namespace v8::internal;
@@ -29,18 +30,18 @@
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());
+ CHECK(V8_2PART_UINT64_C(0x00134567, 89ABCDEF) == diy_fp.f()); // NOLINT
uint64_t min_double64 = V8_2PART_UINT64_C(0x00000000, 00000001);
diy_fp = Double(min_double64).AsDiyFp();
CHECK_EQ(-0x3FF - 52 + 1, diy_fp.e());
// This is a denormal; so no hidden bit.
- CHECK(1 == diy_fp.f());
+ CHECK(1 == diy_fp.f()); // NOLINT
uint64_t max_double64 = V8_2PART_UINT64_C(0x7fefffff, ffffffff);
diy_fp = Double(max_double64).AsDiyFp();
CHECK_EQ(0x7FE - 0x3FF - 52, diy_fp.e());
- CHECK(V8_2PART_UINT64_C(0x001fffff, ffffffff) == diy_fp.f());
+ CHECK(V8_2PART_UINT64_C(0x001fffff, ffffffff) == diy_fp.f()); // NOLINT
}
@@ -48,18 +49,20 @@
uint64_t ordered = V8_2PART_UINT64_C(0x01234567, 89ABCDEF);
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());
+ CHECK((V8_2PART_UINT64_C(0x00134567, 89ABCDEF) << 11) ==
+ diy_fp.f()); // NOLINT
uint64_t min_double64 = V8_2PART_UINT64_C(0x00000000, 00000001);
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());
+ CHECK(V8_2PART_UINT64_C(0x80000000, 00000000) == diy_fp.f()); // NOLINT
uint64_t max_double64 = V8_2PART_UINT64_C(0x7fefffff, ffffffff);
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());
+ CHECK((V8_2PART_UINT64_C(0x001fffff, ffffffff) << 11) ==
+ diy_fp.f()); // NOLINT
}
@@ -145,7 +148,7 @@
// 1.5 does not have a significand of the form 2^p (for some p).
// Therefore its boundaries are at the same distance.
CHECK(diy_fp.f() - boundary_minus.f() == boundary_plus.f() - diy_fp.f());
- CHECK((1 << 10) == diy_fp.f() - boundary_minus.f());
+ CHECK((1 << 10) == diy_fp.f() - boundary_minus.f()); // NOLINT
diy_fp = Double(1.0).AsNormalizedDiyFp();
Double(1.0).NormalizedBoundaries(&boundary_minus, &boundary_plus);
@@ -154,8 +157,8 @@
// 1.0 does have a significand of the form 2^p (for some p).
// Therefore its lower boundary is twice as close as the upper boundary.
CHECK_GT(boundary_plus.f() - diy_fp.f(), diy_fp.f() - boundary_minus.f());
- CHECK((1 << 9) == diy_fp.f() - boundary_minus.f());
- CHECK((1 << 10) == boundary_plus.f() - diy_fp.f());
+ 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);
diy_fp = Double(min_double64).AsNormalizedDiyFp();
@@ -166,7 +169,8 @@
// Therefore its boundaries are at the same distance.
CHECK(diy_fp.f() - boundary_minus.f() == boundary_plus.f() - diy_fp.f());
// Denormals have their boundaries much closer.
- CHECK((static_cast<uint64_t>(1) << 62) == diy_fp.f() - boundary_minus.f());
+ CHECK((static_cast<uint64_t>(1) << 62) ==
+ diy_fp.f() - boundary_minus.f()); // NOLINT
uint64_t smallest_normal64 = V8_2PART_UINT64_C(0x00100000, 00000000);
diy_fp = Double(smallest_normal64).AsNormalizedDiyFp();
@@ -177,7 +181,7 @@
// Even though the significand is of the form 2^p (for some p), its boundaries
// are at the same distance. (This is the only exception).
CHECK(diy_fp.f() - boundary_minus.f() == boundary_plus.f() - diy_fp.f());
- CHECK((1 << 10) == diy_fp.f() - boundary_minus.f());
+ CHECK((1 << 10) == diy_fp.f() - boundary_minus.f()); // NOLINT
uint64_t largest_denormal64 = V8_2PART_UINT64_C(0x000FFFFF, FFFFFFFF);
diy_fp = Double(largest_denormal64).AsNormalizedDiyFp();
@@ -186,7 +190,7 @@
CHECK_EQ(diy_fp.e(), boundary_minus.e());
CHECK_EQ(diy_fp.e(), boundary_plus.e());
CHECK(diy_fp.f() - boundary_minus.f() == boundary_plus.f() - diy_fp.f());
- CHECK((1 << 11) == diy_fp.f() - boundary_minus.f());
+ CHECK((1 << 11) == diy_fp.f() - boundary_minus.f()); // NOLINT
uint64_t max_double64 = V8_2PART_UINT64_C(0x7fefffff, ffffffff);
diy_fp = Double(max_double64).AsNormalizedDiyFp();
@@ -196,5 +200,5 @@
// max-value does not have a significand of the form 2^p (for some p).
// Therefore its boundaries are at the same distance.
CHECK(diy_fp.f() - boundary_minus.f() == boundary_plus.f() - diy_fp.f());
- CHECK((1 << 10) == diy_fp.f() - boundary_minus.f());
+ CHECK((1 << 10) == diy_fp.f() - boundary_minus.f()); // NOLINT
}
« no previous file with comments | « test/cctest/test-diy_fp.cc ('k') | test/cctest/test-grisu3.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698