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

Side by Side Diff: test/cctest/compiler/test-run-machops.cc

Issue 960783002: [turbofan] Fix bogus covering of Word64Equal w/ zero. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: [arm64] Fix unittests. Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <cmath> 5 #include <cmath>
6 #include <functional> 6 #include <functional>
7 #include <limits> 7 #include <limits>
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 4418 matching lines...) Expand 10 before | Expand all | Expand 10 after
4429 FOR_INT32_INPUTS(i) { 4429 FOR_INT32_INPUTS(i) {
4430 FOR_INT32_INPUTS(j) { 4430 FOR_INT32_INPUTS(j) {
4431 int32_t expected; 4431 int32_t expected;
4432 if (bits::SignedSubOverflow32(*i, *j, &expected)) expected = constant; 4432 if (bits::SignedSubOverflow32(*i, *j, &expected)) expected = constant;
4433 CHECK_EQ(expected, bt.call(*i, *j)); 4433 CHECK_EQ(expected, bt.call(*i, *j));
4434 } 4434 }
4435 } 4435 }
4436 } 4436 }
4437 4437
4438 4438
4439 TEST(RunWord64EqualInBranchP) {
4440 int64_t input;
4441 MLabel blocka, blockb;
4442 RawMachineAssemblerTester<int64_t> m;
4443 if (!m.machine()->Is64()) return;
4444 Node* value = m.LoadFromPointer(&input, kMachInt64);
4445 m.Branch(m.Word64Equal(value, m.Int64Constant(0)), &blocka, &blockb);
4446 m.Bind(&blocka);
4447 m.Return(m.Int32Constant(1));
4448 m.Bind(&blockb);
4449 m.Return(m.Int32Constant(2));
4450 input = V8_INT64_C(0);
4451 CHECK_EQ(1, m.Call());
4452 input = V8_INT64_C(1);
4453 CHECK_EQ(2, m.Call());
4454 input = V8_INT64_C(0x100000000);
4455 CHECK_EQ(2, m.Call());
4456 }
4457
4458
4439 TEST(RunChangeInt32ToInt64P) { 4459 TEST(RunChangeInt32ToInt64P) {
4440 if (kPointerSize < 8) return; 4460 if (kPointerSize < 8) return;
4441 int64_t actual = -1; 4461 int64_t actual = -1;
4442 RawMachineAssemblerTester<int32_t> m(kMachInt32); 4462 RawMachineAssemblerTester<int32_t> m(kMachInt32);
4443 m.StoreToPointer(&actual, kMachInt64, m.ChangeInt32ToInt64(m.Parameter(0))); 4463 m.StoreToPointer(&actual, kMachInt64, m.ChangeInt32ToInt64(m.Parameter(0)));
4444 m.Return(m.Int32Constant(0)); 4464 m.Return(m.Int32Constant(0));
4445 FOR_INT32_INPUTS(i) { 4465 FOR_INT32_INPUTS(i) {
4446 int64_t expected = *i; 4466 int64_t expected = *i;
4447 CHECK_EQ(0, m.Call(*i)); 4467 CHECK_EQ(0, m.Call(*i));
4448 CHECK_EQ(expected, actual); 4468 CHECK_EQ(expected, actual);
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
4786 &result, kMachFloat64, 4806 &result, kMachFloat64,
4787 m.Float64RoundTiesAway(m.LoadFromPointer(&input, kMachFloat64))); 4807 m.Float64RoundTiesAway(m.LoadFromPointer(&input, kMachFloat64)));
4788 m.Return(m.Int32Constant(0)); 4808 m.Return(m.Int32Constant(0));
4789 for (size_t i = 0; i < arraysize(kValues); ++i) { 4809 for (size_t i = 0; i < arraysize(kValues); ++i) {
4790 input = kValues[i]; 4810 input = kValues[i];
4791 CHECK_EQ(0, m.Call()); 4811 CHECK_EQ(0, m.Call());
4792 double expected = round(kValues[i]); 4812 double expected = round(kValues[i]);
4793 CHECK_EQ(expected, result); 4813 CHECK_EQ(expected, result);
4794 } 4814 }
4795 } 4815 }
4816
4796 #endif // V8_TURBOFAN_TARGET 4817 #endif // V8_TURBOFAN_TARGET
OLDNEW
« no previous file with comments | « src/compiler/x64/instruction-selector-x64.cc ('k') | test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698