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

Unified Diff: test/cctest/test-assembler-a64.cc

Issue 160423002: A64 support for DoubleToIStub (truncating). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add test cases Created 6 years, 10 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/cctest.gyp ('k') | test/cctest/test-code-stubs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-assembler-a64.cc
diff --git a/test/cctest/test-assembler-a64.cc b/test/cctest/test-assembler-a64.cc
index 3597927443b3f2e6147e05bf25e54f90cca4e9a9..677dfb1e4848fae03278deac7142d9d7302ddd78 100644
--- a/test/cctest/test-assembler-a64.cc
+++ b/test/cctest/test-assembler-a64.cc
@@ -9346,107 +9346,6 @@ TEST(call_no_relocation) {
}
-static void ECMA262ToInt32Helper(int32_t expected, double input) {
- SETUP();
- START();
-
- __ Fmov(d0, input);
-
- __ ECMA262ToInt32(x0, d0, x10, x11, MacroAssembler::INT32_IN_W);
- __ ECMA262ToInt32(x1, d0, x10, x11, MacroAssembler::INT32_IN_X);
- __ ECMA262ToInt32(x2, d0, x10, x11, MacroAssembler::SMI);
-
- // The upper bits of INT32_IN_W are undefined, so make sure we don't try to
- // test them.
- __ Mov(w0, w0);
-
- END();
-
- RUN();
-
- int64_t expected64 = expected;
-
- ASSERT_EQUAL_32(expected, w0);
- ASSERT_EQUAL_64(expected64, x1);
- ASSERT_EQUAL_64(expected64 << kSmiShift | kSmiTag, x2);
-
- TEARDOWN();
-}
-
-
-TEST(ecma_262_to_int32) {
- INIT_V8();
- // ==== exponent < 64 ====
-
- ECMA262ToInt32Helper(0, 0.0);
- ECMA262ToInt32Helper(0, -0.0);
- ECMA262ToInt32Helper(1, 1.0);
- ECMA262ToInt32Helper(-1, -1.0);
-
- // The largest representable value that is less than 1.
- ECMA262ToInt32Helper(0, 0x001fffffffffffff * pow(2.0, -53));
- ECMA262ToInt32Helper(0, 0x001fffffffffffff * -pow(2.0, -53));
- ECMA262ToInt32Helper(0, std::numeric_limits<double>::denorm_min());
- ECMA262ToInt32Helper(0, -std::numeric_limits<double>::denorm_min());
-
- // The largest conversion which doesn't require the integer modulo-2^32 step.
- ECMA262ToInt32Helper(0x7fffffff, 0x7fffffff);
- ECMA262ToInt32Helper(-0x80000000, -0x80000000);
-
- // The largest simple conversion, requiring module-2^32, but where the fcvt
- // does not saturate when converting to int64_t.
- ECMA262ToInt32Helper(0xfffffc00, 0x7ffffffffffffc00);
- ECMA262ToInt32Helper(-0xfffffc00, 0x7ffffffffffffc00 * -1.0);
-
- // ==== 64 <= exponent < 84 ====
-
- // The smallest conversion where the fcvt saturates.
- ECMA262ToInt32Helper(0, 0x8000000000000000);
- ECMA262ToInt32Helper(0, 0x8000000000000000 * -1.0);
-
- // The smallest conversion where the fcvt saturates, and where all the
- // mantissa bits are '1' (to check the shift logic).
- ECMA262ToInt32Helper(0xfffff800, 0xfffffffffffff800);
- ECMA262ToInt32Helper(-0xfffff800, 0xfffffffffffff800 * -1.0);
-
- // The largest conversion which doesn't produce a zero result.
- ECMA262ToInt32Helper(0x80000000, 0x001fffffffffffff * pow(2.0, 31));
- ECMA262ToInt32Helper(-0x80000000, 0x001fffffffffffff * -pow(2.0, 31));
-
- // Some large conversions to check the shifting function.
- ECMA262ToInt32Helper(0x6789abcd, 0x001123456789abcd);
- ECMA262ToInt32Helper(0x12345678, 0x001123456789abcd * pow(2.0, -20));
- ECMA262ToInt32Helper(0x891a2b3c, 0x001123456789abcd * pow(2.0, -21));
- ECMA262ToInt32Helper(0x11234567, 0x001123456789abcd * pow(2.0, -24));
- ECMA262ToInt32Helper(-0x6789abcd, 0x001123456789abcd * -1.0);
- ECMA262ToInt32Helper(-0x12345678, 0x001123456789abcd * -pow(2.0, -20));
- ECMA262ToInt32Helper(-0x891a2b3c, 0x001123456789abcd * -pow(2.0, -21));
- ECMA262ToInt32Helper(-0x11234567, 0x001123456789abcd * -pow(2.0, -24));
-
- // ==== 84 <= exponent ====
-
- // The smallest conversion which produces a zero result by shifting the
- // mantissa out of the int32_t range.
- ECMA262ToInt32Helper(0, pow(2.0, 32));
- ECMA262ToInt32Helper(0, -pow(2.0, 32));
-
- // Some very large conversions.
- ECMA262ToInt32Helper(0, 0x001fffffffffffff * pow(2.0, 32));
- ECMA262ToInt32Helper(0, 0x001fffffffffffff * -pow(2.0, 32));
- ECMA262ToInt32Helper(0, DBL_MAX);
- ECMA262ToInt32Helper(0, -DBL_MAX);
-
- // ==== Special values. ====
-
- ECMA262ToInt32Helper(0, std::numeric_limits<double>::infinity());
- ECMA262ToInt32Helper(0, -std::numeric_limits<double>::infinity());
- ECMA262ToInt32Helper(0, std::numeric_limits<double>::quiet_NaN());
- ECMA262ToInt32Helper(0, -std::numeric_limits<double>::quiet_NaN());
- ECMA262ToInt32Helper(0, std::numeric_limits<double>::signaling_NaN());
- ECMA262ToInt32Helper(0, -std::numeric_limits<double>::signaling_NaN());
-}
-
-
static void AbsHelperX(int64_t value) {
int64_t expected;
« no previous file with comments | « test/cctest/cctest.gyp ('k') | test/cctest/test-code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698