OLD | NEW |
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/base/utils/random-number-generator.h" | 10 #include "src/base/utils/random-number-generator.h" |
(...skipping 4394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4405 CHECK_EQ(&inputs[kInputSize], m.Call()); | 4405 CHECK_EQ(&inputs[kInputSize], m.Call()); |
4406 for (int i = 0; i < kInputSize; i++) { | 4406 for (int i = 0; i < kInputSize; i++) { |
4407 CHECK_EQ(i, inputs[i]); | 4407 CHECK_EQ(i, inputs[i]); |
4408 CHECK_EQ(kInputSize - i - 1, outputs[i]); | 4408 CHECK_EQ(kInputSize - i - 1, outputs[i]); |
4409 } | 4409 } |
4410 } | 4410 } |
4411 | 4411 |
4412 | 4412 |
4413 TEST(RunSpillLotsOfThings) { | 4413 TEST(RunSpillLotsOfThings) { |
4414 static const int kInputSize = 1000; | 4414 static const int kInputSize = 1000; |
4415 RawMachineAssemblerTester<void> m; | 4415 RawMachineAssemblerTester<int32_t> m; |
4416 Node* accs[kInputSize]; | 4416 Node* accs[kInputSize]; |
4417 int32_t outputs[kInputSize]; | 4417 int32_t outputs[kInputSize]; |
4418 Node* one = m.Int32Constant(1); | 4418 Node* one = m.Int32Constant(1); |
4419 Node* acc = one; | 4419 Node* acc = one; |
4420 for (int i = 0; i < kInputSize; i++) { | 4420 for (int i = 0; i < kInputSize; i++) { |
4421 acc = m.Int32Add(acc, one); | 4421 acc = m.Int32Add(acc, one); |
4422 accs[i] = acc; | 4422 accs[i] = acc; |
4423 } | 4423 } |
4424 for (int i = 0; i < kInputSize; i++) { | 4424 for (int i = 0; i < kInputSize; i++) { |
4425 m.StoreToPointer(&outputs[i], kMachInt32, accs[i]); | 4425 m.StoreToPointer(&outputs[i], kMachInt32, accs[i]); |
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5142 m.Return(m.Int32Constant(0)); | 5142 m.Return(m.Int32Constant(0)); |
5143 for (size_t i = 0; i < arraysize(kValues); ++i) { | 5143 for (size_t i = 0; i < arraysize(kValues); ++i) { |
5144 input = kValues[i]; | 5144 input = kValues[i]; |
5145 CHECK_EQ(0, m.Call()); | 5145 CHECK_EQ(0, m.Call()); |
5146 double expected = round(kValues[i]); | 5146 double expected = round(kValues[i]); |
5147 CHECK_EQ(expected, result); | 5147 CHECK_EQ(expected, result); |
5148 } | 5148 } |
5149 } | 5149 } |
5150 | 5150 |
5151 #endif // V8_TURBOFAN_TARGET | 5151 #endif // V8_TURBOFAN_TARGET |
OLD | NEW |