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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 | 437 |
438 MLabel blocka, blockb; | 438 MLabel blocka, blockb; |
439 Node* cond = cmp.MakeNode(&m, a, b); | 439 Node* cond = cmp.MakeNode(&m, a, b); |
440 if (invert) cond = m.Word32Equal(cond, m.Int32Constant(0)); | 440 if (invert) cond = m.Word32Equal(cond, m.Int32Constant(0)); |
441 m.Branch(cond, &blocka, &blockb); | 441 m.Branch(cond, &blocka, &blockb); |
442 m.Bind(&blocka); | 442 m.Bind(&blocka); |
443 m.Return(m.Int32Constant(eq_constant)); | 443 m.Return(m.Int32Constant(eq_constant)); |
444 m.Bind(&blockb); | 444 m.Bind(&blockb); |
445 m.Return(m.Int32Constant(ne_constant)); | 445 m.Return(m.Int32Constant(ne_constant)); |
446 | 446 |
447 for (size_t i = 0; i < arraysize(inputs); i++) { | 447 for (size_t i = 0; i < arraysize(inputs); ++i) { |
448 for (size_t j = 0; j < arraysize(inputs); j += 2) { | 448 for (size_t j = 0; j < arraysize(inputs); ++j) { |
449 input_a = inputs[i]; | 449 input_a = inputs[i]; |
450 input_b = inputs[i]; | 450 input_b = inputs[j]; |
451 int32_t expected = | 451 int32_t expected = |
452 invert ? (cmp.Float64Compare(input_a, input_b) ? ne_constant | 452 invert ? (cmp.Float64Compare(input_a, input_b) ? ne_constant |
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 |