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

Side by Side Diff: test/cctest/compiler/test-representation-change.cc

Issue 1908093002: [turbofan] Optimize tagged conversion based on type. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixes Created 4 years, 8 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
« no previous file with comments | « src/compiler/verifier.cc ('k') | test/cctest/compiler/test-simplified-lowering.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <limits> 5 #include <limits>
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/graph-builder-tester.h" 9 #include "test/cctest/compiler/graph-builder-tester.h"
10 #include "test/cctest/compiler/value-helper.h" 10 #include "test/cctest/compiler/value-helper.h"
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 CHECK_EQ(n, c2->InputAt(0)); 437 CHECK_EQ(n, c2->InputAt(0));
438 } 438 }
439 439
440 440
441 TEST(SingleChanges) { 441 TEST(SingleChanges) {
442 CheckChange(IrOpcode::kChangeBoolToBit, MachineRepresentation::kTagged, 442 CheckChange(IrOpcode::kChangeBoolToBit, MachineRepresentation::kTagged,
443 Type::None(), MachineRepresentation::kBit); 443 Type::None(), MachineRepresentation::kBit);
444 CheckChange(IrOpcode::kChangeBitToBool, MachineRepresentation::kBit, 444 CheckChange(IrOpcode::kChangeBitToBool, MachineRepresentation::kBit,
445 Type::None(), MachineRepresentation::kTagged); 445 Type::None(), MachineRepresentation::kTagged);
446 446
447 CheckChange(IrOpcode::kChangeInt31ToTagged, MachineRepresentation::kWord32,
448 Type::Signed31(), MachineRepresentation::kTagged);
447 CheckChange(IrOpcode::kChangeInt32ToTagged, MachineRepresentation::kWord32, 449 CheckChange(IrOpcode::kChangeInt32ToTagged, MachineRepresentation::kWord32,
448 Type::Signed32(), MachineRepresentation::kTagged); 450 Type::Signed32(), MachineRepresentation::kTagged);
449 CheckChange(IrOpcode::kChangeUint32ToTagged, MachineRepresentation::kWord32, 451 CheckChange(IrOpcode::kChangeUint32ToTagged, MachineRepresentation::kWord32,
450 Type::Unsigned32(), MachineRepresentation::kTagged); 452 Type::Unsigned32(), MachineRepresentation::kTagged);
451 CheckChange(IrOpcode::kChangeFloat64ToTagged, MachineRepresentation::kFloat64, 453 CheckChange(IrOpcode::kChangeFloat64ToTagged, MachineRepresentation::kFloat64,
452 Type::None(), MachineRepresentation::kTagged); 454 Type::Number(), MachineRepresentation::kTagged);
455 CheckTwoChanges(IrOpcode::kChangeFloat64ToInt32,
456 IrOpcode::kChangeInt31ToTagged,
457 MachineRepresentation::kFloat64, Type::Signed31(),
458 MachineRepresentation::kTagged);
459 CheckTwoChanges(IrOpcode::kChangeFloat64ToInt32,
460 IrOpcode::kChangeInt32ToTagged,
461 MachineRepresentation::kFloat64, Type::Signed32(),
462 MachineRepresentation::kTagged);
463 CheckTwoChanges(IrOpcode::kChangeFloat64ToUint32,
464 IrOpcode::kChangeUint32ToTagged,
465 MachineRepresentation::kFloat64, Type::Unsigned32(),
466 MachineRepresentation::kTagged);
453 467
454 CheckChange(IrOpcode::kChangeTaggedToInt32, MachineRepresentation::kTagged, 468 CheckChange(IrOpcode::kChangeTaggedToInt32, MachineRepresentation::kTagged,
455 Type::Signed32(), MachineRepresentation::kWord32); 469 Type::Signed32(), MachineRepresentation::kWord32);
456 CheckChange(IrOpcode::kChangeTaggedToUint32, MachineRepresentation::kTagged, 470 CheckChange(IrOpcode::kChangeTaggedToUint32, MachineRepresentation::kTagged,
457 Type::Unsigned32(), MachineRepresentation::kWord32); 471 Type::Unsigned32(), MachineRepresentation::kWord32);
458 CheckChange(IrOpcode::kChangeTaggedToFloat64, MachineRepresentation::kTagged, 472 CheckChange(IrOpcode::kChangeTaggedToFloat64, MachineRepresentation::kTagged,
459 Type::None(), MachineRepresentation::kFloat64); 473 Type::None(), MachineRepresentation::kFloat64);
460 474
461 // Int32,Uint32 <-> Float64 are actually machine conversions. 475 // Int32,Uint32 <-> Float64 are actually machine conversions.
462 CheckChange(IrOpcode::kChangeInt32ToFloat64, MachineRepresentation::kWord32, 476 CheckChange(IrOpcode::kChangeInt32ToFloat64, MachineRepresentation::kWord32,
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 MachineRepresentation::kWord64); 635 MachineRepresentation::kWord64);
622 r.CheckTypeError(MachineRepresentation::kWord32, Type::Signed32(), 636 r.CheckTypeError(MachineRepresentation::kWord32, Type::Signed32(),
623 MachineRepresentation::kWord64); 637 MachineRepresentation::kWord64);
624 r.CheckTypeError(MachineRepresentation::kWord32, Type::Unsigned32(), 638 r.CheckTypeError(MachineRepresentation::kWord32, Type::Unsigned32(),
625 MachineRepresentation::kWord64); 639 MachineRepresentation::kWord64);
626 } 640 }
627 641
628 } // namespace compiler 642 } // namespace compiler
629 } // namespace internal 643 } // namespace internal
630 } // namespace v8 644 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/verifier.cc ('k') | test/cctest/compiler/test-simplified-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698