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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "test/cctest/cctest.h" | 7 #include "test/cctest/cctest.h" |
8 #include "test/cctest/compiler/codegen-tester.h" | 8 #include "test/cctest/compiler/codegen-tester.h" |
9 #include "test/cctest/compiler/value-helper.h" | 9 #include "test/cctest/compiler/value-helper.h" |
10 | 10 |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 for (int i = 0; i < static_cast<int>(arraysize(int32cmp_opcodes)); i++) { | 408 for (int i = 0; i < static_cast<int>(arraysize(int32cmp_opcodes)); i++) { |
409 CmpBranchGen gen(int32cmp_opcodes[i], true, true, 595 + i, -4011 - i); | 409 CmpBranchGen gen(int32cmp_opcodes[i], true, true, 595 + i, -4011 - i); |
410 Int32BinopInputShapeTester tester(&gen); | 410 Int32BinopInputShapeTester tester(&gen); |
411 tester.TestAllInputShapes(); | 411 tester.TestAllInputShapes(); |
412 } | 412 } |
413 } | 413 } |
414 | 414 |
415 | 415 |
416 TEST(BranchCombineFloat64Compares) { | 416 TEST(BranchCombineFloat64Compares) { |
417 double inf = V8_INFINITY; | 417 double inf = V8_INFINITY; |
418 double nan = v8::base::OS::nan_value(); | 418 double nan = std::numeric_limits<double>::quiet_NaN(); |
419 double inputs[] = {0.0, 1.0, -1.0, -inf, inf, nan}; | 419 double inputs[] = {0.0, 1.0, -1.0, -inf, inf, nan}; |
420 | 420 |
421 int32_t eq_constant = -1733; | 421 int32_t eq_constant = -1733; |
422 int32_t ne_constant = 915118; | 422 int32_t ne_constant = 915118; |
423 | 423 |
424 double input_a = 0.0; | 424 double input_a = 0.0; |
425 double input_b = 0.0; | 425 double input_b = 0.0; |
426 | 426 |
427 CompareWrapper cmps[] = {CompareWrapper(IrOpcode::kFloat64Equal), | 427 CompareWrapper cmps[] = {CompareWrapper(IrOpcode::kFloat64Equal), |
428 CompareWrapper(IrOpcode::kFloat64LessThan), | 428 CompareWrapper(IrOpcode::kFloat64LessThan), |
(...skipping 24 matching lines...) Expand all Loading... |
453 : eq_constant) | 453 : eq_constant) |
454 : (cmp.Float64Compare(input_a, input_b) ? eq_constant | 454 : (cmp.Float64Compare(input_a, input_b) ? eq_constant |
455 : ne_constant); | 455 : ne_constant); |
456 CHECK_EQ(expected, m.Call()); | 456 CHECK_EQ(expected, m.Call()); |
457 } | 457 } |
458 } | 458 } |
459 } | 459 } |
460 } | 460 } |
461 } | 461 } |
462 #endif // V8_TURBOFAN_TARGET | 462 #endif // V8_TURBOFAN_TARGET |
OLD | NEW |