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

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

Issue 998283002: [turbofan] Introduce optional Float64Min and Float64Max machine operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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/ia32/instruction-codes-ia32.h ('k') | src/compiler/instruction-selector.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 "src/compiler/instruction-selector-impl.h" 5 #include "src/compiler/instruction-selector-impl.h"
6 #include "src/compiler/node-matchers.h" 6 #include "src/compiler/node-matchers.h"
7 #include "src/compiler/node-properties.h" 7 #include "src/compiler/node-properties.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 695
696 void InstructionSelector::VisitFloat64Mod(Node* node) { 696 void InstructionSelector::VisitFloat64Mod(Node* node) {
697 IA32OperandGenerator g(this); 697 IA32OperandGenerator g(this);
698 InstructionOperand temps[] = {g.TempRegister(eax)}; 698 InstructionOperand temps[] = {g.TempRegister(eax)};
699 Emit(kSSEFloat64Mod, g.DefineSameAsFirst(node), 699 Emit(kSSEFloat64Mod, g.DefineSameAsFirst(node),
700 g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)), 1, 700 g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)), 1,
701 temps); 701 temps);
702 } 702 }
703 703
704 704
705 void InstructionSelector::VisitFloat64Max(Node* node) {
706 IA32OperandGenerator g(this);
707 if (IsSupported(AVX)) {
708 Emit(kAVXFloat64Max, g.DefineAsRegister(node),
709 g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1)));
710 } else {
711 Emit(kSSEFloat64Max, g.DefineSameAsFirst(node),
712 g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1)));
713 }
714 }
715
716
717 void InstructionSelector::VisitFloat64Min(Node* node) {
718 IA32OperandGenerator g(this);
719 if (IsSupported(AVX)) {
720 Emit(kAVXFloat64Min, g.DefineAsRegister(node),
721 g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1)));
722 } else {
723 Emit(kSSEFloat64Min, g.DefineSameAsFirst(node),
724 g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1)));
725 }
726 }
727
728
705 void InstructionSelector::VisitFloat64Sqrt(Node* node) { 729 void InstructionSelector::VisitFloat64Sqrt(Node* node) {
706 IA32OperandGenerator g(this); 730 IA32OperandGenerator g(this);
707 Emit(kSSEFloat64Sqrt, g.DefineAsRegister(node), g.Use(node->InputAt(0))); 731 Emit(kSSEFloat64Sqrt, g.DefineAsRegister(node), g.Use(node->InputAt(0)));
708 } 732 }
709 733
710 734
711 void InstructionSelector::VisitFloat64RoundDown(Node* node) { 735 void InstructionSelector::VisitFloat64RoundDown(Node* node) {
712 VisitRRFloat64(this, kSSEFloat64Round | MiscField::encode(kRoundDown), node); 736 VisitRRFloat64(this, kSSEFloat64Round | MiscField::encode(kRoundDown), node);
713 } 737 }
714 738
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 Node* right = node->InputAt(1); 1152 Node* right = node->InputAt(1);
1129 Emit(kSSEFloat64InsertHighWord32, g.DefineSameAsFirst(node), 1153 Emit(kSSEFloat64InsertHighWord32, g.DefineSameAsFirst(node),
1130 g.UseRegister(left), g.Use(right)); 1154 g.UseRegister(left), g.Use(right));
1131 } 1155 }
1132 1156
1133 1157
1134 // static 1158 // static
1135 MachineOperatorBuilder::Flags 1159 MachineOperatorBuilder::Flags
1136 InstructionSelector::SupportedMachineOperatorFlags() { 1160 InstructionSelector::SupportedMachineOperatorFlags() {
1137 MachineOperatorBuilder::Flags flags = 1161 MachineOperatorBuilder::Flags flags =
1162 MachineOperatorBuilder::kFloat64Max |
1163 MachineOperatorBuilder::kFloat64Min |
1138 MachineOperatorBuilder::kWord32ShiftIsSafe; 1164 MachineOperatorBuilder::kWord32ShiftIsSafe;
1139 if (CpuFeatures::IsSupported(SSE4_1)) { 1165 if (CpuFeatures::IsSupported(SSE4_1)) {
1140 flags |= MachineOperatorBuilder::kFloat64RoundDown | 1166 flags |= MachineOperatorBuilder::kFloat64RoundDown |
1141 MachineOperatorBuilder::kFloat64RoundTruncate; 1167 MachineOperatorBuilder::kFloat64RoundTruncate;
1142 } 1168 }
1143 return flags; 1169 return flags;
1144 } 1170 }
1145 1171
1146 } // namespace compiler 1172 } // namespace compiler
1147 } // namespace internal 1173 } // namespace internal
1148 } // namespace v8 1174 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ia32/instruction-codes-ia32.h ('k') | src/compiler/instruction-selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698