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

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

Issue 2270193003: X87: [turbofan] Add Float32(Max|Min) machine operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 3 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/x87/instruction-codes-x87.h ('k') | 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 954 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 965
966 966
967 void InstructionSelector::VisitFloat64Mod(Node* node) { 967 void InstructionSelector::VisitFloat64Mod(Node* node) {
968 X87OperandGenerator g(this); 968 X87OperandGenerator g(this);
969 InstructionOperand temps[] = {g.TempRegister(eax)}; 969 InstructionOperand temps[] = {g.TempRegister(eax)};
970 Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(0))); 970 Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(0)));
971 Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(1))); 971 Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(1)));
972 Emit(kX87Float64Mod, g.DefineAsFixed(node, stX_0), 1, temps)->MarkAsCall(); 972 Emit(kX87Float64Mod, g.DefineAsFixed(node, stX_0), 1, temps)->MarkAsCall();
973 } 973 }
974 974
975 void InstructionSelector::VisitFloat32Max(Node* node) {
976 X87OperandGenerator g(this);
977 Emit(kX87PushFloat32, g.NoOutput(), g.Use(node->InputAt(0)));
978 Emit(kX87PushFloat32, g.NoOutput(), g.Use(node->InputAt(1)));
979 Emit(kX87Float32Max, g.DefineAsFixed(node, stX_0), 0, nullptr);
980 }
975 981
976 void InstructionSelector::VisitFloat64Max(Node* node) { 982 void InstructionSelector::VisitFloat64Max(Node* node) {
977 X87OperandGenerator g(this); 983 X87OperandGenerator g(this);
978 Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(0))); 984 Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(0)));
979 Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(1))); 985 Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(1)));
980 Emit(kX87Float64Max, g.DefineAsFixed(node, stX_0), 0, nullptr); 986 Emit(kX87Float64Max, g.DefineAsFixed(node, stX_0), 0, nullptr);
981 } 987 }
982 988
989 void InstructionSelector::VisitFloat32Min(Node* node) {
990 X87OperandGenerator g(this);
991 Emit(kX87PushFloat32, g.NoOutput(), g.Use(node->InputAt(0)));
992 Emit(kX87PushFloat32, g.NoOutput(), g.Use(node->InputAt(1)));
993 Emit(kX87Float32Min, g.DefineAsFixed(node, stX_0), 0, nullptr);
994 }
983 995
984 void InstructionSelector::VisitFloat64Min(Node* node) { 996 void InstructionSelector::VisitFloat64Min(Node* node) {
985 X87OperandGenerator g(this); 997 X87OperandGenerator g(this);
986 Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(0))); 998 Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(0)));
987 Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(1))); 999 Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(1)));
988 Emit(kX87Float64Min, g.DefineAsFixed(node, stX_0), 0, nullptr); 1000 Emit(kX87Float64Min, g.DefineAsFixed(node, stX_0), 0, nullptr);
989 } 1001 }
990 1002
991 1003
992 void InstructionSelector::VisitFloat32Abs(Node* node) { 1004 void InstructionSelector::VisitFloat32Abs(Node* node) {
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after
1735 // static 1747 // static
1736 MachineOperatorBuilder::AlignmentRequirements 1748 MachineOperatorBuilder::AlignmentRequirements
1737 InstructionSelector::AlignmentRequirements() { 1749 InstructionSelector::AlignmentRequirements() {
1738 return MachineOperatorBuilder::AlignmentRequirements:: 1750 return MachineOperatorBuilder::AlignmentRequirements::
1739 FullUnalignedAccessSupport(); 1751 FullUnalignedAccessSupport();
1740 } 1752 }
1741 1753
1742 } // namespace compiler 1754 } // namespace compiler
1743 } // namespace internal 1755 } // namespace internal
1744 } // namespace v8 1756 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/x87/instruction-codes-x87.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698