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

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

Issue 677433002: Add floor, ceil, round (truncate) instructions for ia32, x64 (if SSE4.1) and (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix integer overflow. Created 6 years, 2 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 | Annotate | Revision Log
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/compiler/generic-node-inl.h" 5 #include "src/compiler/generic-node-inl.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 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 temps); 716 temps);
717 } 717 }
718 718
719 719
720 void InstructionSelector::VisitFloat64Sqrt(Node* node) { 720 void InstructionSelector::VisitFloat64Sqrt(Node* node) {
721 X64OperandGenerator g(this); 721 X64OperandGenerator g(this);
722 Emit(kSSEFloat64Sqrt, g.DefineAsRegister(node), g.Use(node->InputAt(0))); 722 Emit(kSSEFloat64Sqrt, g.DefineAsRegister(node), g.Use(node->InputAt(0)));
723 } 723 }
724 724
725 725
726 void InstructionSelector::VisitFloat64Floor(Node* node) {
727 X64OperandGenerator g(this);
728 Emit(kSSEFloat64Floor, g.DefineAsRegister(node),
729 g.UseRegister(node->InputAt(0)));
730 }
731
732
733 void InstructionSelector::VisitFloat64Ceil(Node* node) {
734 X64OperandGenerator g(this);
735 Emit(kSSEFloat64Ceil, g.DefineAsRegister(node),
736 g.UseRegister(node->InputAt(0)));
737 }
738
739
740 void InstructionSelector::VisitFloat64RoundTruncate(Node* node) {
741 X64OperandGenerator g(this);
742 Emit(kSSEFloat64RoundTruncate, g.DefineAsRegister(node),
743 g.UseRegister(node->InputAt(0)));
744 }
745
746
747 void InstructionSelector::VisitFloat64RoundTiesAway(Node* node) {
748 UnsupportedOperator(node);
749 }
750
751
726 void InstructionSelector::VisitCall(Node* node) { 752 void InstructionSelector::VisitCall(Node* node) {
727 X64OperandGenerator g(this); 753 X64OperandGenerator g(this);
728 CallDescriptor* descriptor = OpParameter<CallDescriptor*>(node); 754 CallDescriptor* descriptor = OpParameter<CallDescriptor*>(node);
729 755
730 FrameStateDescriptor* frame_state_descriptor = NULL; 756 FrameStateDescriptor* frame_state_descriptor = NULL;
731 if (descriptor->NeedsFrameState()) { 757 if (descriptor->NeedsFrameState()) {
732 frame_state_descriptor = GetFrameStateDescriptor( 758 frame_state_descriptor = GetFrameStateDescriptor(
733 node->InputAt(static_cast<int>(descriptor->InputCount()))); 759 node->InputAt(static_cast<int>(descriptor->InputCount())));
734 } 760 }
735 761
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 1131
1106 void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) { 1132 void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) {
1107 FlagsContinuation cont(kUnorderedLessThanOrEqual, node); 1133 FlagsContinuation cont(kUnorderedLessThanOrEqual, node);
1108 VisitFloat64Compare(this, node, &cont); 1134 VisitFloat64Compare(this, node, &cont);
1109 } 1135 }
1110 1136
1111 1137
1112 // static 1138 // static
1113 MachineOperatorBuilder::Flags 1139 MachineOperatorBuilder::Flags
1114 InstructionSelector::SupportedMachineOperatorFlags() { 1140 InstructionSelector::SupportedMachineOperatorFlags() {
1141 if (CpuFeatures::IsSupported(SSE4_1)) {
1142 return MachineOperatorBuilder::Flag::kFloat64Floor |
1143 MachineOperatorBuilder::Flag::kFloat64Ceil |
1144 MachineOperatorBuilder::Flag::kFloat64RoundTruncate;
1145 }
1115 return MachineOperatorBuilder::Flag::kNoFlags; 1146 return MachineOperatorBuilder::Flag::kNoFlags;
1116 } 1147 }
1117 } // namespace compiler 1148 } // namespace compiler
1118 } // namespace internal 1149 } // namespace internal
1119 } // namespace v8 1150 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698