OLD | NEW |
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 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1061 VisitFloat64Compare(this, node, &cont); | 1061 VisitFloat64Compare(this, node, &cont); |
1062 } | 1062 } |
1063 | 1063 |
1064 | 1064 |
1065 void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) { | 1065 void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) { |
1066 FlagsContinuation cont(kUnsignedGreaterThanOrEqual, node); | 1066 FlagsContinuation cont(kUnsignedGreaterThanOrEqual, node); |
1067 VisitFloat64Compare(this, node, &cont); | 1067 VisitFloat64Compare(this, node, &cont); |
1068 } | 1068 } |
1069 | 1069 |
1070 | 1070 |
| 1071 void InstructionSelector::VisitFloat64ExtractLowWord32(Node* node) { |
| 1072 IA32OperandGenerator g(this); |
| 1073 Emit(kSSEFloat64ExtractLowWord32, g.DefineAsRegister(node), |
| 1074 g.Use(node->InputAt(0))); |
| 1075 } |
| 1076 |
| 1077 |
| 1078 void InstructionSelector::VisitFloat64ExtractHighWord32(Node* node) { |
| 1079 IA32OperandGenerator g(this); |
| 1080 Emit(kSSEFloat64ExtractHighWord32, g.DefineAsRegister(node), |
| 1081 g.Use(node->InputAt(0))); |
| 1082 } |
| 1083 |
| 1084 |
| 1085 void InstructionSelector::VisitFloat64InsertLowWord32(Node* node) { |
| 1086 IA32OperandGenerator g(this); |
| 1087 Node* left = node->InputAt(0); |
| 1088 Node* right = node->InputAt(1); |
| 1089 Float64Matcher mleft(left); |
| 1090 if (mleft.HasValue() && (bit_cast<uint64_t>(mleft.Value()) >> 32) == 0u) { |
| 1091 Emit(kSSEFloat64LoadLowWord32, g.DefineAsRegister(node), g.Use(right)); |
| 1092 return; |
| 1093 } |
| 1094 Emit(kSSEFloat64InsertLowWord32, g.DefineSameAsFirst(node), |
| 1095 g.UseRegister(left), g.Use(right)); |
| 1096 } |
| 1097 |
| 1098 |
| 1099 void InstructionSelector::VisitFloat64InsertHighWord32(Node* node) { |
| 1100 IA32OperandGenerator g(this); |
| 1101 Node* left = node->InputAt(0); |
| 1102 Node* right = node->InputAt(1); |
| 1103 Emit(kSSEFloat64InsertHighWord32, g.DefineSameAsFirst(node), |
| 1104 g.UseRegister(left), g.Use(right)); |
| 1105 } |
| 1106 |
| 1107 |
1071 // static | 1108 // static |
1072 MachineOperatorBuilder::Flags | 1109 MachineOperatorBuilder::Flags |
1073 InstructionSelector::SupportedMachineOperatorFlags() { | 1110 InstructionSelector::SupportedMachineOperatorFlags() { |
1074 MachineOperatorBuilder::Flags flags = | 1111 MachineOperatorBuilder::Flags flags = |
1075 MachineOperatorBuilder::kWord32ShiftIsSafe; | 1112 MachineOperatorBuilder::kWord32ShiftIsSafe; |
1076 if (CpuFeatures::IsSupported(SSE4_1)) { | 1113 if (CpuFeatures::IsSupported(SSE4_1)) { |
1077 flags |= MachineOperatorBuilder::kFloat64Floor | | 1114 flags |= MachineOperatorBuilder::kFloat64Floor | |
1078 MachineOperatorBuilder::kFloat64Ceil | | 1115 MachineOperatorBuilder::kFloat64Ceil | |
1079 MachineOperatorBuilder::kFloat64RoundTruncate; | 1116 MachineOperatorBuilder::kFloat64RoundTruncate; |
1080 } | 1117 } |
1081 return flags; | 1118 return flags; |
1082 } | 1119 } |
1083 | 1120 |
1084 } // namespace compiler | 1121 } // namespace compiler |
1085 } // namespace internal | 1122 } // namespace internal |
1086 } // namespace v8 | 1123 } // namespace v8 |
OLD | NEW |