41 using namespace v8::internal;
45 union {
double d; uint32_t u[2]; } dbl;
47 uint32_t exponent_bits = dbl.u[1];
49 int32_t exponent = (((exponent_bits & shifted_mask) >>
55 uint32_t unsigned_exponent =
static_cast<uint32_t
>(exponent);
57 uint32_t max_exponent =
59 if (unsigned_exponent >= max_exponent) {
67 result =
static_cast<uint32_t
>(big_result);
69 if (static_cast<int32_t>(exponent_bits) < 0) {
81 uint64_t to =
static_cast<int64_t
>(raw);
82 int result = (*callWrapper)(func, from);
83 CHECK_EQ(static_cast<int>(to), result);
95 #define NaN (OS::nan_value())
96 #define Infinity (std::numeric_limits<double>::infinity())
97 #define RunOneTruncationTest(p1, p2) \
98 RunOneTruncationTestWithTest(callWrapper, func, p1, p2)
174 #undef RunOneTruncationTest
void RunAllTruncationTests(ConvertDToIFunc func)
#define CHECK_EQ(expected, value)
static const uint64_t kExponentMask
ConvertDToICallWrapperType * ConvertDToICallWrapper
static const uint64_t kHiddenBit
static const int kExponentBias
#define RunOneTruncationTest(p1, p2)
int32_t DefaultCallWrapper(ConvertDToIFunc func, double from)
void RunOneTruncationTestWithTest(ConvertDToICallWrapper callWrapper, ConvertDToIFunc func, double from, double raw)
static const uint64_t kSignificandMask
int STDCALL ConvertDToICVersion(double d)
ConvertDToIFuncType * ConvertDToIFunc
static const int kPhysicalSignificandSize