summaryrefslogtreecommitdiff
path: root/deps/v8/test/cctest/test-macro-assembler-mips64.cc
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2017-10-18 15:03:02 -0700
committerMichaël Zasso <targos@protonmail.com>2017-10-18 17:01:41 -0700
commit3d1b3df9486c0e7708065257f7311902f6b7b366 (patch)
treecb051bdeaead11e06dcd97725783e0f113afb1bf /deps/v8/test/cctest/test-macro-assembler-mips64.cc
parente2cddbb8ccdb7b3c4a40c8acc630f68703bc77b5 (diff)
downloadnode-new-3d1b3df9486c0e7708065257f7311902f6b7b366.tar.gz
deps: update V8 to 6.2.414.32
PR-URL: https://github.com/nodejs/node/pull/15362 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'deps/v8/test/cctest/test-macro-assembler-mips64.cc')
-rw-r--r--deps/v8/test/cctest/test-macro-assembler-mips64.cc339
1 files changed, 2 insertions, 337 deletions
diff --git a/deps/v8/test/cctest/test-macro-assembler-mips64.cc b/deps/v8/test/cctest/test-macro-assembler-mips64.cc
index e198f417f6..9432584c4d 100644
--- a/deps/v8/test/cctest/test-macro-assembler-mips64.cc
+++ b/deps/v8/test/cctest/test-macro-assembler-mips64.cc
@@ -778,16 +778,6 @@ TEST(cvt_d_w_Trunc_w_d) {
}
}
-static const std::vector<int32_t> overflow_int32_test_values() {
- static const int32_t kValues[] = {
- static_cast<int32_t>(0xf0000000), static_cast<int32_t>(0x00000001),
- static_cast<int32_t>(0xff000000), static_cast<int32_t>(0x0000f000),
- static_cast<int32_t>(0x0f000000), static_cast<int32_t>(0x991234ab),
- static_cast<int32_t>(0xb0ffff01), static_cast<int32_t>(0x00006fff),
- static_cast<int32_t>(0xffffffff)};
- return std::vector<int32_t>(&kValues[0], &kValues[arraysize(kValues)]);
-}
-
static const std::vector<int64_t> overflow_int64_test_values() {
static const int64_t kValues[] = {static_cast<int64_t>(0xf000000000000000),
static_cast<int64_t>(0x0000000000000001),
@@ -875,331 +865,6 @@ static bool runOverflow(IN_TYPE valLeft, IN_TYPE valRight,
return r;
}
-TEST(BranchOverflowInt32BothLabelsTrampoline) {
- if (kArchVariant != kMips64r6) return;
- static const int kMaxBranchOffset = (1 << (18 - 1)) - 1;
-
- FOR_INT32_INPUTS(i, overflow_int32_test_values) {
- FOR_INT32_INPUTS(j, overflow_int32_test_values) {
- FOR_ENUM_INPUTS(br, OverflowBranchType, overflow_branch_type) {
- FOR_STRUCT_INPUTS(regComb, OverflowRegisterCombination,
- overflow_register_combination) {
- int32_t ii = *i;
- int32_t jj = *j;
- enum OverflowBranchType branchType = *br;
- struct OverflowRegisterCombination rc = *regComb;
-
- // If left and right register are same then left and right
- // test values must also be same, otherwise we skip the test
- if (rc.left.code() == rc.right.code()) {
- if (ii != jj) {
- continue;
- }
- }
-
- bool res1 = runOverflow<int32_t>(
- ii, jj, [branchType, rc](MacroAssembler* masm, int32_t valLeft,
- int32_t valRight) {
- Label overflow, no_overflow, end;
- __ li(rc.left, valLeft);
- __ li(rc.right, valRight);
- switch (branchType) {
- case kAddBranchOverflow:
- __ AddBranchOvf(rc.dst, rc.left, rc.right, &overflow,
- &no_overflow, rc.scratch);
- break;
- case kSubBranchOverflow:
- __ SubBranchOvf(rc.dst, rc.left, rc.right, &overflow,
- &no_overflow, rc.scratch);
- break;
- }
-
- Label done;
- size_t nr_calls =
- kMaxBranchOffset / (2 * Instruction::kInstrSize) + 2;
- for (size_t i = 0; i < nr_calls; ++i) {
- __ BranchShort(&done, eq, a0, Operand(a1));
- }
- __ bind(&done);
-
- __ li(v0, 2);
- __ Branch(&end);
- __ bind(&overflow);
- __ li(v0, 1);
- __ Branch(&end);
- __ bind(&no_overflow);
- __ li(v0, 0);
- __ bind(&end);
- });
-
- switch (branchType) {
- case kAddBranchOverflow:
- CHECK_EQ(IsAddOverflow<int32_t>(ii, jj), res1);
- break;
- case kSubBranchOverflow:
- CHECK_EQ(IsSubOverflow<int32_t>(ii, jj), res1);
- break;
- default:
- UNREACHABLE();
- }
- }
- }
- }
- }
-}
-
-TEST(BranchOverflowInt32BothLabels) {
- FOR_INT32_INPUTS(i, overflow_int32_test_values) {
- FOR_INT32_INPUTS(j, overflow_int32_test_values) {
- FOR_ENUM_INPUTS(br, OverflowBranchType, overflow_branch_type) {
- FOR_STRUCT_INPUTS(regComb, OverflowRegisterCombination,
- overflow_register_combination) {
- int32_t ii = *i;
- int32_t jj = *j;
- enum OverflowBranchType branchType = *br;
- struct OverflowRegisterCombination rc = *regComb;
-
- // If left and right register are same then left and right
- // test values must also be same, otherwise we skip the test
- if (rc.left.code() == rc.right.code()) {
- if (ii != jj) {
- continue;
- }
- }
-
- bool res1 = runOverflow<int32_t>(
- ii, jj, [branchType, rc](MacroAssembler* masm, int32_t valLeft,
- int32_t valRight) {
- Label overflow, no_overflow, end;
- __ li(rc.left, valLeft);
- __ li(rc.right, valRight);
- switch (branchType) {
- case kAddBranchOverflow:
- __ AddBranchOvf(rc.dst, rc.left, rc.right, &overflow,
- &no_overflow, rc.scratch);
- break;
- case kSubBranchOverflow:
- __ SubBranchOvf(rc.dst, rc.left, rc.right, &overflow,
- &no_overflow, rc.scratch);
- break;
- }
- __ li(v0, 2);
- __ Branch(&end);
- __ bind(&overflow);
- __ li(v0, 1);
- __ Branch(&end);
- __ bind(&no_overflow);
- __ li(v0, 0);
- __ bind(&end);
- });
-
- bool res2 = runOverflow<int32_t>(
- ii, jj, [branchType, rc](MacroAssembler* masm, int32_t valLeft,
- int32_t valRight) {
- Label overflow, no_overflow, end;
- __ li(rc.left, valLeft);
- switch (branchType) {
- case kAddBranchOverflow:
- __ AddBranchOvf(rc.dst, rc.left, Operand(valRight),
- &overflow, &no_overflow, rc.scratch);
- break;
- case kSubBranchOverflow:
- __ SubBranchOvf(rc.dst, rc.left, Operand(valRight),
- &overflow, &no_overflow, rc.scratch);
- break;
- }
- __ li(v0, 2);
- __ Branch(&end);
- __ bind(&overflow);
- __ li(v0, 1);
- __ Branch(&end);
- __ bind(&no_overflow);
- __ li(v0, 0);
- __ bind(&end);
- });
-
- switch (branchType) {
- case kAddBranchOverflow:
- CHECK_EQ(IsAddOverflow<int32_t>(ii, jj), res1);
- CHECK_EQ(IsAddOverflow<int32_t>(ii, jj), res2);
- break;
- case kSubBranchOverflow:
- CHECK_EQ(IsSubOverflow<int32_t>(ii, jj), res1);
- CHECK_EQ(IsSubOverflow<int32_t>(ii, jj), res2);
- break;
- default:
- UNREACHABLE();
- }
- }
- }
- }
- }
-}
-
-TEST(BranchOverflowInt32LeftLabel) {
- FOR_INT32_INPUTS(i, overflow_int32_test_values) {
- FOR_INT32_INPUTS(j, overflow_int32_test_values) {
- FOR_ENUM_INPUTS(br, OverflowBranchType, overflow_branch_type) {
- FOR_STRUCT_INPUTS(regComb, OverflowRegisterCombination,
- overflow_register_combination) {
- int32_t ii = *i;
- int32_t jj = *j;
- enum OverflowBranchType branchType = *br;
- struct OverflowRegisterCombination rc = *regComb;
-
- // If left and right register are same then left and right
- // test values must also be same, otherwise we skip the test
- if (rc.left.code() == rc.right.code()) {
- if (ii != jj) {
- continue;
- }
- }
-
- bool res1 = runOverflow<int32_t>(
- ii, jj, [branchType, rc](MacroAssembler* masm, int32_t valLeft,
- int32_t valRight) {
- Label overflow, end;
- __ li(rc.left, valLeft);
- __ li(rc.right, valRight);
- switch (branchType) {
- case kAddBranchOverflow:
- __ AddBranchOvf(rc.dst, rc.left, rc.right, &overflow, NULL,
- rc.scratch);
- break;
- case kSubBranchOverflow:
- __ SubBranchOvf(rc.dst, rc.left, rc.right, &overflow, NULL,
- rc.scratch);
- break;
- }
- __ li(v0, 0);
- __ Branch(&end);
- __ bind(&overflow);
- __ li(v0, 1);
- __ bind(&end);
- });
-
- bool res2 = runOverflow<int32_t>(
- ii, jj, [branchType, rc](MacroAssembler* masm, int32_t valLeft,
- int32_t valRight) {
- Label overflow, end;
- __ li(rc.left, valLeft);
- switch (branchType) {
- case kAddBranchOverflow:
- __ AddBranchOvf(rc.dst, rc.left, Operand(valRight),
- &overflow, NULL, rc.scratch);
- break;
- case kSubBranchOverflow:
- __ SubBranchOvf(rc.dst, rc.left, Operand(valRight),
- &overflow, NULL, rc.scratch);
- break;
- }
- __ li(v0, 0);
- __ Branch(&end);
- __ bind(&overflow);
- __ li(v0, 1);
- __ bind(&end);
- });
-
- switch (branchType) {
- case kAddBranchOverflow:
- CHECK_EQ(IsAddOverflow<int32_t>(ii, jj), res1);
- CHECK_EQ(IsAddOverflow<int32_t>(ii, jj), res2);
- break;
- case kSubBranchOverflow:
- CHECK_EQ(IsSubOverflow<int32_t>(ii, jj), res1);
- CHECK_EQ(IsSubOverflow<int32_t>(ii, jj), res2);
- break;
- default:
- UNREACHABLE();
- }
- }
- }
- }
- }
-}
-
-TEST(BranchOverflowInt32RightLabel) {
- FOR_INT32_INPUTS(i, overflow_int32_test_values) {
- FOR_INT32_INPUTS(j, overflow_int32_test_values) {
- FOR_ENUM_INPUTS(br, OverflowBranchType, overflow_branch_type) {
- FOR_STRUCT_INPUTS(regComb, OverflowRegisterCombination,
- overflow_register_combination) {
- int32_t ii = *i;
- int32_t jj = *j;
- enum OverflowBranchType branchType = *br;
- struct OverflowRegisterCombination rc = *regComb;
-
- // If left and right register are same then left and right
- // test values must also be same, otherwise we skip the test
- if (rc.left.code() == rc.right.code()) {
- if (ii != jj) {
- continue;
- }
- }
-
- bool res1 = runOverflow<int32_t>(
- ii, jj, [branchType, rc](MacroAssembler* masm, int32_t valLeft,
- int32_t valRight) {
- Label no_overflow, end;
- __ li(rc.left, valLeft);
- __ li(rc.right, valRight);
- switch (branchType) {
- case kAddBranchOverflow:
- __ AddBranchOvf(rc.dst, rc.left, rc.right, NULL,
- &no_overflow, rc.scratch);
- break;
- case kSubBranchOverflow:
- __ SubBranchOvf(rc.dst, rc.left, rc.right, NULL,
- &no_overflow, rc.scratch);
- break;
- }
- __ li(v0, 1);
- __ Branch(&end);
- __ bind(&no_overflow);
- __ li(v0, 0);
- __ bind(&end);
- });
-
- bool res2 = runOverflow<int32_t>(
- ii, jj, [branchType, rc](MacroAssembler* masm, int32_t valLeft,
- int32_t valRight) {
- Label no_overflow, end;
- __ li(rc.left, valLeft);
- switch (branchType) {
- case kAddBranchOverflow:
- __ AddBranchOvf(rc.dst, rc.left, Operand(valRight), NULL,
- &no_overflow, rc.scratch);
- break;
- case kSubBranchOverflow:
- __ SubBranchOvf(rc.dst, rc.left, Operand(valRight), NULL,
- &no_overflow, rc.scratch);
- break;
- }
- __ li(v0, 1);
- __ Branch(&end);
- __ bind(&no_overflow);
- __ li(v0, 0);
- __ bind(&end);
- });
-
- switch (branchType) {
- case kAddBranchOverflow:
- CHECK_EQ(IsAddOverflow<int32_t>(ii, jj), res1);
- CHECK_EQ(IsAddOverflow<int32_t>(ii, jj), res2);
- break;
- case kSubBranchOverflow:
- CHECK_EQ(IsSubOverflow<int32_t>(ii, jj), res1);
- CHECK_EQ(IsSubOverflow<int32_t>(ii, jj), res2);
- break;
- default:
- UNREACHABLE();
- }
- }
- }
- }
- }
-}
-
TEST(BranchOverflowInt64BothLabels) {
FOR_INT64_INPUTS(i, overflow_int64_test_values) {
FOR_INT64_INPUTS(j, overflow_int64_test_values) {
@@ -1501,8 +1166,8 @@ TEST(min_max_nan) {
auto handle_dnan = [masm](FPURegister dst, Label* nan, Label* back) {
__ bind(nan);
- __ LoadRoot(at, Heap::kNanValueRootIndex);
- __ Ldc1(dst, FieldMemOperand(at, HeapNumber::kValueOffset));
+ __ LoadRoot(t8, Heap::kNanValueRootIndex);
+ __ Ldc1(dst, FieldMemOperand(t8, HeapNumber::kValueOffset));
__ Branch(back);
};