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

Side by Side Diff: src/compiler/arm64/instruction-selector-arm64.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: Address changes and fix compilation on mac. Created 6 years, 1 month 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
« no previous file with comments | « src/compiler/arm64/instruction-codes-arm64.h ('k') | src/compiler/ia32/code-generator-ia32.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 7
8 namespace v8 { 8 namespace v8 {
9 namespace internal { 9 namespace internal {
10 namespace compiler { 10 namespace compiler {
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 } 79 }
80 80
81 private: 81 private:
82 bool IsLoadStoreImmediate(int64_t value, LSDataSize size) { 82 bool IsLoadStoreImmediate(int64_t value, LSDataSize size) {
83 return Assembler::IsImmLSScaled(value, size) || 83 return Assembler::IsImmLSScaled(value, size) ||
84 Assembler::IsImmLSUnscaled(value); 84 Assembler::IsImmLSUnscaled(value);
85 } 85 }
86 }; 86 };
87 87
88 88
89 static void VisitRRFloat64(InstructionSelector* selector, ArchOpcode opcode,
90 Node* node) {
91 Arm64OperandGenerator g(selector);
92 selector->Emit(opcode, g.DefineAsRegister(node),
93 g.UseRegister(node->InputAt(0)));
94 }
95
96
89 static void VisitRRR(InstructionSelector* selector, ArchOpcode opcode, 97 static void VisitRRR(InstructionSelector* selector, ArchOpcode opcode,
90 Node* node) { 98 Node* node) {
91 Arm64OperandGenerator g(selector); 99 Arm64OperandGenerator g(selector);
92 selector->Emit(opcode, g.DefineAsRegister(node), 100 selector->Emit(opcode, g.DefineAsRegister(node),
93 g.UseRegister(node->InputAt(0)), 101 g.UseRegister(node->InputAt(0)),
94 g.UseRegister(node->InputAt(1))); 102 g.UseRegister(node->InputAt(1)));
95 } 103 }
96 104
97 105
98 static void VisitRRRFloat64(InstructionSelector* selector, ArchOpcode opcode, 106 static void VisitRRRFloat64(InstructionSelector* selector, ArchOpcode opcode,
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 900
893 void InstructionSelector::VisitFloat64Mod(Node* node) { 901 void InstructionSelector::VisitFloat64Mod(Node* node) {
894 Arm64OperandGenerator g(this); 902 Arm64OperandGenerator g(this);
895 Emit(kArm64Float64Mod, g.DefineAsFixed(node, d0), 903 Emit(kArm64Float64Mod, g.DefineAsFixed(node, d0),
896 g.UseFixed(node->InputAt(0), d0), 904 g.UseFixed(node->InputAt(0), d0),
897 g.UseFixed(node->InputAt(1), d1))->MarkAsCall(); 905 g.UseFixed(node->InputAt(1), d1))->MarkAsCall();
898 } 906 }
899 907
900 908
901 void InstructionSelector::VisitFloat64Sqrt(Node* node) { 909 void InstructionSelector::VisitFloat64Sqrt(Node* node) {
902 Arm64OperandGenerator g(this); 910 VisitRRFloat64(this, kArm64Float64Sqrt, node);
903 Emit(kArm64Float64Sqrt, g.DefineAsRegister(node),
904 g.UseRegister(node->InputAt(0)));
905 } 911 }
906 912
907 913
914 void InstructionSelector::VisitFloat64Floor(Node* node) {
915 VisitRRFloat64(this, kArm64Float64Floor, node);
916 }
917
918
919 void InstructionSelector::VisitFloat64Ceil(Node* node) {
920 VisitRRFloat64(this, kArm64Float64Ceil, node);
921 }
922
923
924 void InstructionSelector::VisitFloat64RoundTruncate(Node* node) {
925 VisitRRFloat64(this, kArm64Float64RoundTruncate, node);
926 }
927
928
929 void InstructionSelector::VisitFloat64RoundTiesAway(Node* node) {
930 VisitRRFloat64(this, kArm64Float64RoundTiesAway, node);
931 }
932
933
908 void InstructionSelector::VisitCall(Node* node) { 934 void InstructionSelector::VisitCall(Node* node) {
909 Arm64OperandGenerator g(this); 935 Arm64OperandGenerator g(this);
910 CallDescriptor* descriptor = OpParameter<CallDescriptor*>(node); 936 CallDescriptor* descriptor = OpParameter<CallDescriptor*>(node);
911 937
912 FrameStateDescriptor* frame_state_descriptor = NULL; 938 FrameStateDescriptor* frame_state_descriptor = NULL;
913 if (descriptor->NeedsFrameState()) { 939 if (descriptor->NeedsFrameState()) {
914 frame_state_descriptor = 940 frame_state_descriptor =
915 GetFrameStateDescriptor(node->InputAt(descriptor->InputCount())); 941 GetFrameStateDescriptor(node->InputAt(descriptor->InputCount()));
916 } 942 }
917 943
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
1310 1336
1311 void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) { 1337 void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) {
1312 FlagsContinuation cont(kUnorderedLessThanOrEqual, node); 1338 FlagsContinuation cont(kUnorderedLessThanOrEqual, node);
1313 VisitFloat64Compare(this, node, &cont); 1339 VisitFloat64Compare(this, node, &cont);
1314 } 1340 }
1315 1341
1316 1342
1317 // static 1343 // static
1318 MachineOperatorBuilder::Flags 1344 MachineOperatorBuilder::Flags
1319 InstructionSelector::SupportedMachineOperatorFlags() { 1345 InstructionSelector::SupportedMachineOperatorFlags() {
1320 return MachineOperatorBuilder::kNoFlags; 1346 return MachineOperatorBuilder::kFloat64Floor |
1347 MachineOperatorBuilder::kFloat64Ceil |
1348 MachineOperatorBuilder::kFloat64RoundTruncate |
1349 MachineOperatorBuilder::kFloat64RoundTiesAway;
1321 } 1350 }
1322
1323 } // namespace compiler 1351 } // namespace compiler
1324 } // namespace internal 1352 } // namespace internal
1325 } // namespace v8 1353 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/arm64/instruction-codes-arm64.h ('k') | src/compiler/ia32/code-generator-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698