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

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

Issue 1583323004: [turbofan] Add the TruncateFloat32ToInt32 operator to turbofan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed a small bug Created 4 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
« no previous file with comments | « src/compiler/x64/instruction-scheduler-x64.cc ('k') | src/compiler/x87/code-generator-x87.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 <algorithm> 5 #include <algorithm>
6 6
7 #include "src/base/adapters.h" 7 #include "src/base/adapters.h"
8 #include "src/compiler/instruction-selector-impl.h" 8 #include "src/compiler/instruction-selector-impl.h"
9 #include "src/compiler/node-matchers.h" 9 #include "src/compiler/node-matchers.h"
10 #include "src/compiler/node-properties.h" 10 #include "src/compiler/node-properties.h"
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 Emit(kSSEFloat64ToInt32, g.DefineAsRegister(node), g.Use(node->InputAt(0))); 850 Emit(kSSEFloat64ToInt32, g.DefineAsRegister(node), g.Use(node->InputAt(0)));
851 } 851 }
852 852
853 853
854 void InstructionSelector::VisitChangeFloat64ToUint32(Node* node) { 854 void InstructionSelector::VisitChangeFloat64ToUint32(Node* node) {
855 X64OperandGenerator g(this); 855 X64OperandGenerator g(this);
856 Emit(kSSEFloat64ToUint32, g.DefineAsRegister(node), g.Use(node->InputAt(0))); 856 Emit(kSSEFloat64ToUint32, g.DefineAsRegister(node), g.Use(node->InputAt(0)));
857 } 857 }
858 858
859 859
860 void InstructionSelector::VisitTruncateFloat32ToInt32(Node* node) {
861 X64OperandGenerator g(this);
862 Emit(kSSEFloat32ToInt32, g.DefineAsRegister(node), g.Use(node->InputAt(0)));
863 }
864
865
860 void InstructionSelector::VisitTryTruncateFloat32ToInt64(Node* node) { 866 void InstructionSelector::VisitTryTruncateFloat32ToInt64(Node* node) {
861 X64OperandGenerator g(this); 867 X64OperandGenerator g(this);
862 InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0))}; 868 InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0))};
863 InstructionOperand outputs[2]; 869 InstructionOperand outputs[2];
864 size_t output_count = 0; 870 size_t output_count = 0;
865 outputs[output_count++] = g.DefineAsRegister(node); 871 outputs[output_count++] = g.DefineAsRegister(node);
866 872
867 Node* success_output = NodeProperties::FindProjection(node, 1); 873 Node* success_output = NodeProperties::FindProjection(node, 1);
868 if (success_output) { 874 if (success_output) {
869 outputs[output_count++] = g.DefineAsRegister(success_output); 875 outputs[output_count++] = g.DefineAsRegister(success_output);
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
1801 MachineOperatorBuilder::kFloat64RoundTruncate | 1807 MachineOperatorBuilder::kFloat64RoundTruncate |
1802 MachineOperatorBuilder::kFloat32RoundTiesEven | 1808 MachineOperatorBuilder::kFloat32RoundTiesEven |
1803 MachineOperatorBuilder::kFloat64RoundTiesEven; 1809 MachineOperatorBuilder::kFloat64RoundTiesEven;
1804 } 1810 }
1805 return flags; 1811 return flags;
1806 } 1812 }
1807 1813
1808 } // namespace compiler 1814 } // namespace compiler
1809 } // namespace internal 1815 } // namespace internal
1810 } // namespace v8 1816 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/x64/instruction-scheduler-x64.cc ('k') | src/compiler/x87/code-generator-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698