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

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

Issue 1919513002: [turbofan] Introduce TruncateTaggedToWord32 simplified operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
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 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 RepresentationChangerTester r; 526 RepresentationChangerTester r;
527 527
528 CheckChange(IrOpcode::kChangeTaggedToInt32, MachineRepresentation::kTagged, 528 CheckChange(IrOpcode::kChangeTaggedToInt32, MachineRepresentation::kTagged,
529 Type::Signed32(), MachineRepresentation::kWord32); 529 Type::Signed32(), MachineRepresentation::kWord32);
530 CheckChange(IrOpcode::kChangeTaggedToUint32, MachineRepresentation::kTagged, 530 CheckChange(IrOpcode::kChangeTaggedToUint32, MachineRepresentation::kTagged,
531 Type::Unsigned32(), MachineRepresentation::kWord32); 531 Type::Unsigned32(), MachineRepresentation::kWord32);
532 CheckChange(IrOpcode::kChangeInt32ToFloat64, MachineRepresentation::kWord32, 532 CheckChange(IrOpcode::kChangeInt32ToFloat64, MachineRepresentation::kWord32,
533 Type::None(), MachineRepresentation::kFloat64); 533 Type::None(), MachineRepresentation::kFloat64);
534 CheckChange(IrOpcode::kChangeFloat64ToInt32, MachineRepresentation::kFloat64, 534 CheckChange(IrOpcode::kChangeFloat64ToInt32, MachineRepresentation::kFloat64,
535 Type::Signed32(), MachineRepresentation::kWord32); 535 Type::Signed32(), MachineRepresentation::kWord32);
536 CheckChange(IrOpcode::kTruncateFloat64ToInt32, 536 CheckChange(IrOpcode::kTruncateFloat64ToWord32,
537 MachineRepresentation::kFloat64, Type::Number(), 537 MachineRepresentation::kFloat64, Type::Number(),
538 MachineRepresentation::kWord32); 538 MachineRepresentation::kWord32);
539 539
540 CheckTwoChanges(IrOpcode::kChangeInt32ToFloat64, 540 CheckTwoChanges(IrOpcode::kChangeInt32ToFloat64,
541 IrOpcode::kTruncateFloat64ToFloat32, 541 IrOpcode::kTruncateFloat64ToFloat32,
542 MachineRepresentation::kWord32, Type::None(), 542 MachineRepresentation::kWord32, Type::None(),
543 MachineRepresentation::kFloat32); 543 MachineRepresentation::kFloat32);
544 CheckTwoChanges(IrOpcode::kChangeFloat32ToFloat64, 544 CheckTwoChanges(IrOpcode::kChangeFloat32ToFloat64,
545 IrOpcode::kTruncateFloat64ToInt32, 545 IrOpcode::kTruncateFloat64ToWord32,
546 MachineRepresentation::kFloat32, Type::Number(), 546 MachineRepresentation::kFloat32, Type::Number(),
547 MachineRepresentation::kWord32); 547 MachineRepresentation::kWord32);
548 } 548 }
549 549
550 550
551 TEST(Nops) { 551 TEST(Nops) {
552 RepresentationChangerTester r; 552 RepresentationChangerTester r;
553 553
554 // X -> X is always a nop for any single representation X. 554 // X -> X is always a nop for any single representation X.
555 for (size_t i = 0; i < arraysize(kMachineTypes); i++) { 555 for (size_t i = 0; i < arraysize(kMachineTypes); i++) {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 MachineRepresentation::kWord64); 641 MachineRepresentation::kWord64);
642 r.CheckTypeError(MachineRepresentation::kWord32, Type::Signed32(), 642 r.CheckTypeError(MachineRepresentation::kWord32, Type::Signed32(),
643 MachineRepresentation::kWord64); 643 MachineRepresentation::kWord64);
644 r.CheckTypeError(MachineRepresentation::kWord32, Type::Unsigned32(), 644 r.CheckTypeError(MachineRepresentation::kWord32, Type::Unsigned32(),
645 MachineRepresentation::kWord64); 645 MachineRepresentation::kWord64);
646 } 646 }
647 647
648 } // namespace compiler 648 } // namespace compiler
649 } // namespace internal 649 } // namespace internal
650 } // namespace v8 650 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698