| 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::VisitFloat64ExtractWord32(Node* node) { |
| 1072 IA32OperandGenerator g(this); |
| 1073 InstructionCode opcode = (OpParameter<int>(node) == 0) |
| 1074 ? kSSEFloat64ExtractLowWord32 |
| 1075 : kSSEFloat64ExtractHighWord32; |
| 1076 Emit(opcode, g.DefineAsRegister(node), g.Use(node->InputAt(0))); |
| 1077 } |
| 1078 |
| 1079 |
| 1080 void InstructionSelector::VisitFloat64InsertWord32(Node* node) { |
| 1081 IA32OperandGenerator g(this); |
| 1082 Node* left = node->InputAt(0); |
| 1083 Node* right = node->InputAt(1); |
| 1084 InstructionCode opcode; |
| 1085 switch (OpParameter<int>(node)) { |
| 1086 case 0: { |
| 1087 Float64Matcher mleft(left); |
| 1088 if (mleft.HasValue() && (bit_cast<uint64_t>(mleft.Value()) >> 32) == 0u) { |
| 1089 Emit(kSSEFloat64LoadLowWord32, g.DefineAsRegister(node), g.Use(right)); |
| 1090 return; |
| 1091 } |
| 1092 opcode = kSSEFloat64InsertLowWord32; |
| 1093 break; |
| 1094 } |
| 1095 case 1: |
| 1096 opcode = kSSEFloat64InsertHighWord32; |
| 1097 break; |
| 1098 default: |
| 1099 UNREACHABLE(); |
| 1100 return; |
| 1101 } |
| 1102 Emit(opcode, g.DefineSameAsFirst(node), g.UseRegister(left), g.Use(right)); |
| 1103 } |
| 1104 |
| 1105 |
| 1071 // static | 1106 // static |
| 1072 MachineOperatorBuilder::Flags | 1107 MachineOperatorBuilder::Flags |
| 1073 InstructionSelector::SupportedMachineOperatorFlags() { | 1108 InstructionSelector::SupportedMachineOperatorFlags() { |
| 1074 MachineOperatorBuilder::Flags flags = | 1109 MachineOperatorBuilder::Flags flags = |
| 1075 MachineOperatorBuilder::kWord32ShiftIsSafe; | 1110 MachineOperatorBuilder::kWord32ShiftIsSafe; |
| 1076 if (CpuFeatures::IsSupported(SSE4_1)) { | 1111 if (CpuFeatures::IsSupported(SSE4_1)) { |
| 1077 flags |= MachineOperatorBuilder::kFloat64Floor | | 1112 flags |= MachineOperatorBuilder::kFloat64Floor | |
| 1078 MachineOperatorBuilder::kFloat64Ceil | | 1113 MachineOperatorBuilder::kFloat64Ceil | |
| 1079 MachineOperatorBuilder::kFloat64RoundTruncate; | 1114 MachineOperatorBuilder::kFloat64RoundTruncate; |
| 1080 } | 1115 } |
| 1081 return flags; | 1116 return flags; |
| 1082 } | 1117 } |
| 1083 | 1118 |
| 1084 } // namespace compiler | 1119 } // namespace compiler |
| 1085 } // namespace internal | 1120 } // namespace internal |
| 1086 } // namespace v8 | 1121 } // namespace v8 |
| OLD | NEW |