Commit 89253d33 authored by lrn@chromium.org's avatar lrn@chromium.org

Fixed problem with test on big-endian-float ARM.

Review URL: http://codereview.chromium.org/338044


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3143 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent fb2317b6
......@@ -8499,14 +8499,28 @@ THREADED_TEST(GetHeapStatistics) {
static double DoubleFromBits(uint64_t value) {
double target;
#ifdef BIG_ENDIAN_FLOATING_POINT
const int kIntSize = 4;
// Somebody swapped the lower and higher half of doubles.
memcpy(&target, reinterpret_cast<char*>(&value) + kIntSize, kIntSize);
memcpy(reinterpret_cast<char*>(&target) + kIntSize, &value, kIntSize);
#else
memcpy(&target, &value, sizeof(target));
#endif
return target;
}
static uint64_t DoubleToBits(double value) {
uint64_t target;
#ifdef BIG_ENDIAN_FLOATING_POINT
const int kIntSize = 4;
// Somebody swapped the lower and higher half of doubles.
memcpy(&target, reinterpret_cast<char*>(&value) + kIntSize, kIntSize);
memcpy(reinterpret_cast<char*>(&target) + kIntSize, &value, kIntSize);
#else
memcpy(&target, &value, sizeof(target));
#endif
return target;
}
......
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