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

Side by Side Diff: src/compiler/x87/instruction-selector-x87.cc

Issue 1912403002: X87: [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
« no previous file with comments | « no previous file | no next file » | 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 "src/base/adapters.h" 5 #include "src/base/adapters.h"
6 #include "src/compiler/instruction-selector-impl.h" 6 #include "src/compiler/instruction-selector-impl.h"
7 #include "src/compiler/node-matchers.h" 7 #include "src/compiler/node-matchers.h"
8 #include "src/compiler/node-properties.h" 8 #include "src/compiler/node-properties.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 } 839 }
840 840
841 void InstructionSelector::VisitTruncateFloat64ToFloat32(Node* node) { 841 void InstructionSelector::VisitTruncateFloat64ToFloat32(Node* node) {
842 X87OperandGenerator g(this); 842 X87OperandGenerator g(this);
843 Emit(kX87Float64ToFloat32, g.DefineAsFixed(node, stX_0), 843 Emit(kX87Float64ToFloat32, g.DefineAsFixed(node, stX_0),
844 g.Use(node->InputAt(0))); 844 g.Use(node->InputAt(0)));
845 } 845 }
846 846
847 void InstructionSelector::VisitTruncateFloat64ToWord32(Node* node) { 847 void InstructionSelector::VisitTruncateFloat64ToWord32(Node* node) {
848 X87OperandGenerator g(this); 848 X87OperandGenerator g(this);
849 Emit(kArchTruncateDoubleToI, g.DefineAsRegister(node),
850 g.Use(node->InputAt(0)));
851 }
849 852
850 switch (TruncationModeOf(node->op())) { 853 void InstructionSelector::VisitRoundFloat64ToInt32(Node* node) {
851 case TruncationMode::kJavaScript: 854 X87OperandGenerator g(this);
852 Emit(kArchTruncateDoubleToI, g.DefineAsRegister(node), 855 Emit(kX87Float64ToInt32, g.DefineAsRegister(node), g.Use(node->InputAt(0)));
853 g.Use(node->InputAt(0)));
854 return;
855 case TruncationMode::kRoundToZero:
856 Emit(kX87Float64ToInt32, g.DefineAsRegister(node),
857 g.Use(node->InputAt(0)));
858 return;
859 }
860 UNREACHABLE();
861 } 856 }
862 857
863 858
864 void InstructionSelector::VisitBitcastFloat32ToInt32(Node* node) { 859 void InstructionSelector::VisitBitcastFloat32ToInt32(Node* node) {
865 X87OperandGenerator g(this); 860 X87OperandGenerator g(this);
866 Emit(kX87PushFloat32, g.NoOutput(), g.Use(node->InputAt(0))); 861 Emit(kX87PushFloat32, g.NoOutput(), g.Use(node->InputAt(0)));
867 Emit(kX87BitcastFI, g.DefineAsRegister(node), 0, nullptr); 862 Emit(kX87BitcastFI, g.DefineAsRegister(node), 0, nullptr);
868 } 863 }
869 864
870 865
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
1618 MachineOperatorBuilder::kFloat32RoundTruncate | 1613 MachineOperatorBuilder::kFloat32RoundTruncate |
1619 MachineOperatorBuilder::kFloat64RoundTruncate | 1614 MachineOperatorBuilder::kFloat64RoundTruncate |
1620 MachineOperatorBuilder::kFloat32RoundTiesEven | 1615 MachineOperatorBuilder::kFloat32RoundTiesEven |
1621 MachineOperatorBuilder::kFloat64RoundTiesEven; 1616 MachineOperatorBuilder::kFloat64RoundTiesEven;
1622 return flags; 1617 return flags;
1623 } 1618 }
1624 1619
1625 } // namespace compiler 1620 } // namespace compiler
1626 } // namespace internal 1621 } // namespace internal
1627 } // namespace v8 1622 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698