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

Side by Side Diff: test/cctest/compiler/test-branch-combine.cc

Issue 850653002: [turbofan] Improve code generation for unordered comparisons. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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 "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
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
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