Revision: 9948 Author: [email protected] Date: Thu Nov 10 00:25:23 2011 Log: MIPS: Fix the cctest QuietSignalingNaNs for MIPS.
MIPS uses a different NAN bit pattern to represent quiet or signalling NANs than does x86 or ARM. BUG= TEST= Review URL: http://codereview.chromium.org/8510007 Patch from Gergely Kis <[email protected]>. http://code.google.com/p/v8/source/detail?r=9948 Modified: /branches/bleeding_edge/test/cctest/test-api.cc ======================================= --- /branches/bleeding_edge/test/cctest/test-api.cc Wed Nov 9 06:18:30 2011 +++ /branches/bleeding_edge/test/cctest/test-api.cc Thu Nov 10 00:25:23 2011 @@ -13564,7 +13564,13 @@ } else { uint64_t stored_bits = DoubleToBits(stored_number); // Check if quiet nan (bits 51..62 all set). +#if defined(V8_TARGET_ARCH_MIPS) && !defined(USE_SIMULATOR) + // Most significant fraction bit for quiet nan is set to 0 + // on MIPS architecture. Allowed by IEEE-754. + CHECK_EQ(0xffe, static_cast<int>((stored_bits >> 51) & 0xfff)); +#else CHECK_EQ(0xfff, static_cast<int>((stored_bits >> 51) & 0xfff)); +#endif } // Check that Date::New preserves non-NaNs in the date range and @@ -13577,7 +13583,13 @@ } else { uint64_t stored_bits = DoubleToBits(stored_date); // Check if quiet nan (bits 51..62 all set). +#if defined(V8_TARGET_ARCH_MIPS) && !defined(USE_SIMULATOR) + // Most significant fraction bit for quiet nan is set to 0 + // on MIPS architecture. Allowed by IEEE-754. + CHECK_EQ(0xffe, static_cast<int>((stored_bits >> 51) & 0xfff)); +#else CHECK_EQ(0xfff, static_cast<int>((stored_bits >> 51) & 0xfff)); +#endif } } } -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
