| 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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 TEST(BranchCombineInt32CmpAllInputShapes_inverted_materialized) { | 371 TEST(BranchCombineInt32CmpAllInputShapes_inverted_materialized) { |
| 372 for (size_t i = 0; i < ARRAY_SIZE(int32cmp_opcodes); i++) { | 372 for (size_t i = 0; i < ARRAY_SIZE(int32cmp_opcodes); i++) { |
| 373 CmpMaterializeBoolGen gen(int32cmp_opcodes[i], true); | 373 CmpMaterializeBoolGen gen(int32cmp_opcodes[i], true); |
| 374 Int32BinopInputShapeTester tester(&gen); | 374 Int32BinopInputShapeTester tester(&gen); |
| 375 tester.TestAllInputShapes(); | 375 tester.TestAllInputShapes(); |
| 376 } | 376 } |
| 377 } | 377 } |
| 378 | 378 |
| 379 | 379 |
| 380 TEST(BranchCombineInt32CmpAllInputShapes_branch_true) { | 380 TEST(BranchCombineInt32CmpAllInputShapes_branch_true) { |
| 381 for (size_t i = 0; i < ARRAY_SIZE(int32cmp_opcodes); i++) { | 381 for (int i = 0; i < static_cast<int>(ARRAY_SIZE(int32cmp_opcodes)); i++) { |
| 382 CmpBranchGen gen(int32cmp_opcodes[i], false, false, 995 + i, -1011 - i); | 382 CmpBranchGen gen(int32cmp_opcodes[i], false, false, 995 + i, -1011 - i); |
| 383 Int32BinopInputShapeTester tester(&gen); | 383 Int32BinopInputShapeTester tester(&gen); |
| 384 tester.TestAllInputShapes(); | 384 tester.TestAllInputShapes(); |
| 385 } | 385 } |
| 386 } | 386 } |
| 387 | 387 |
| 388 | 388 |
| 389 TEST(BranchCombineInt32CmpAllInputShapes_branch_false) { | 389 TEST(BranchCombineInt32CmpAllInputShapes_branch_false) { |
| 390 for (size_t i = 0; i < ARRAY_SIZE(int32cmp_opcodes); i++) { | 390 for (int i = 0; i < static_cast<int>(ARRAY_SIZE(int32cmp_opcodes)); i++) { |
| 391 CmpBranchGen gen(int32cmp_opcodes[i], false, true, 795 + i, -2011 - i); | 391 CmpBranchGen gen(int32cmp_opcodes[i], false, true, 795 + i, -2011 - i); |
| 392 Int32BinopInputShapeTester tester(&gen); | 392 Int32BinopInputShapeTester tester(&gen); |
| 393 tester.TestAllInputShapes(); | 393 tester.TestAllInputShapes(); |
| 394 } | 394 } |
| 395 } | 395 } |
| 396 | 396 |
| 397 | 397 |
| 398 TEST(BranchCombineInt32CmpAllInputShapes_inverse_branch_true) { | 398 TEST(BranchCombineInt32CmpAllInputShapes_inverse_branch_true) { |
| 399 for (size_t i = 0; i < ARRAY_SIZE(int32cmp_opcodes); i++) { | 399 for (int i = 0; i < static_cast<int>(ARRAY_SIZE(int32cmp_opcodes)); i++) { |
| 400 CmpBranchGen gen(int32cmp_opcodes[i], true, false, 695 + i, -3011 - i); | 400 CmpBranchGen gen(int32cmp_opcodes[i], true, false, 695 + i, -3011 - i); |
| 401 Int32BinopInputShapeTester tester(&gen); | 401 Int32BinopInputShapeTester tester(&gen); |
| 402 tester.TestAllInputShapes(); | 402 tester.TestAllInputShapes(); |
| 403 } | 403 } |
| 404 } | 404 } |
| 405 | 405 |
| 406 | 406 |
| 407 TEST(BranchCombineInt32CmpAllInputShapes_inverse_branch_false) { | 407 TEST(BranchCombineInt32CmpAllInputShapes_inverse_branch_false) { |
| 408 for (size_t i = 0; i < ARRAY_SIZE(int32cmp_opcodes); i++) { | 408 for (int i = 0; i < static_cast<int>(ARRAY_SIZE(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 = v8::base::OS::nan_value(); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |