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

Side by Side Diff: src/compiler/mips/instruction-selector-mips.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 "src/base/adapters.h" 5 #include "src/base/adapters.h"
6 #include "src/base/bits.h" 6 #include "src/base/bits.h"
7 #include "src/compiler/instruction-selector-impl.h" 7 #include "src/compiler/instruction-selector-impl.h"
8 #include "src/compiler/node-matchers.h" 8 #include "src/compiler/node-matchers.h"
9 #include "src/compiler/node-properties.h" 9 #include "src/compiler/node-properties.h"
10 10
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 // instruction. 712 // instruction.
713 if (CanCover(node, value) && 713 if (CanCover(node, value) &&
714 value->opcode() == IrOpcode::kChangeInt32ToFloat64) { 714 value->opcode() == IrOpcode::kChangeInt32ToFloat64) {
715 Emit(kMipsCvtSW, g.DefineAsRegister(node), 715 Emit(kMipsCvtSW, g.DefineAsRegister(node),
716 g.UseRegister(value->InputAt(0))); 716 g.UseRegister(value->InputAt(0)));
717 return; 717 return;
718 } 718 }
719 VisitRR(this, kMipsCvtSD, node); 719 VisitRR(this, kMipsCvtSD, node);
720 } 720 }
721 721
722 722 void InstructionSelector::VisitTruncateFloat64ToWord32(Node* node) {
723 void InstructionSelector::VisitTruncateFloat64ToInt32(Node* node) { 723 VisitRR(this, kArchTruncateDoubleToI, node);
724 switch (TruncationModeOf(node->op())) {
725 case TruncationMode::kJavaScript:
726 return VisitRR(this, kArchTruncateDoubleToI, node);
727 case TruncationMode::kRoundToZero:
728 return VisitRR(this, kMipsTruncWD, node);
729 }
730 UNREACHABLE();
731 } 724 }
732 725
726 void InstructionSelector::VisitRoundFloat64ToInt32(Node* node) {
727 VisitRR(this, kMipsTruncWD, node);
728 }
733 729
734 void InstructionSelector::VisitBitcastFloat32ToInt32(Node* node) { 730 void InstructionSelector::VisitBitcastFloat32ToInt32(Node* node) {
735 VisitRR(this, kMipsFloat64ExtractLowWord32, node); 731 VisitRR(this, kMipsFloat64ExtractLowWord32, node);
736 } 732 }
737 733
738 734
739 void InstructionSelector::VisitBitcastInt32ToFloat32(Node* node) { 735 void InstructionSelector::VisitBitcastInt32ToFloat32(Node* node) {
740 MipsOperandGenerator g(this); 736 MipsOperandGenerator g(this);
741 Emit(kMipsFloat64InsertLowWord32, g.DefineAsRegister(node), 737 Emit(kMipsFloat64InsertLowWord32, g.DefineAsRegister(node),
742 ImmediateOperand(ImmediateOperand::INLINE, 0), 738 ImmediateOperand(ImmediateOperand::INLINE, 0),
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
1507 MachineOperatorBuilder::kFloat32Max | 1503 MachineOperatorBuilder::kFloat32Max |
1508 MachineOperatorBuilder::kFloat32RoundDown | 1504 MachineOperatorBuilder::kFloat32RoundDown |
1509 MachineOperatorBuilder::kFloat32RoundUp | 1505 MachineOperatorBuilder::kFloat32RoundUp |
1510 MachineOperatorBuilder::kFloat32RoundTruncate | 1506 MachineOperatorBuilder::kFloat32RoundTruncate |
1511 MachineOperatorBuilder::kFloat32RoundTiesEven; 1507 MachineOperatorBuilder::kFloat32RoundTiesEven;
1512 } 1508 }
1513 1509
1514 } // namespace compiler 1510 } // namespace compiler
1515 } // namespace internal 1511 } // namespace internal
1516 } // namespace v8 1512 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698