| 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/base/adapters.h" | 5 #include "src/base/adapters.h" |
| 6 #include "src/base/bits.h" | 6 #include "src/base/bits.h" |
| 7 #include "src/compiler/instruction-selector-impl.h" | 7 #include "src/compiler/instruction-selector-impl.h" |
| 8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
| 9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
| 10 | 10 |
| (...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1213 | 1213 |
| 1214 | 1214 |
| 1215 void InstructionSelector::VisitFloat64Mod(Node* node) { | 1215 void InstructionSelector::VisitFloat64Mod(Node* node) { |
| 1216 Mips64OperandGenerator g(this); | 1216 Mips64OperandGenerator g(this); |
| 1217 Emit(kMips64ModD, g.DefineAsFixed(node, f0), | 1217 Emit(kMips64ModD, g.DefineAsFixed(node, f0), |
| 1218 g.UseFixed(node->InputAt(0), f12), | 1218 g.UseFixed(node->InputAt(0), f12), |
| 1219 g.UseFixed(node->InputAt(1), f14))->MarkAsCall(); | 1219 g.UseFixed(node->InputAt(1), f14))->MarkAsCall(); |
| 1220 } | 1220 } |
| 1221 | 1221 |
| 1222 | 1222 |
| 1223 void InstructionSelector::VisitFloat32Max(Node* node) { | |
| 1224 Mips64OperandGenerator g(this); | |
| 1225 if (kArchVariant == kMips64r6) { | |
| 1226 Emit(kMips64Float32Max, g.DefineAsRegister(node), | |
| 1227 g.UseUniqueRegister(node->InputAt(0)), | |
| 1228 g.UseUniqueRegister(node->InputAt(1))); | |
| 1229 | |
| 1230 } else { | |
| 1231 // Reverse operands, and use same reg. for result and right operand. | |
| 1232 Emit(kMips64Float32Max, g.DefineSameAsFirst(node), | |
| 1233 g.UseRegister(node->InputAt(1)), g.UseRegister(node->InputAt(0))); | |
| 1234 } | |
| 1235 } | |
| 1236 | |
| 1237 | |
| 1238 void InstructionSelector::VisitFloat64Max(Node* node) { | 1223 void InstructionSelector::VisitFloat64Max(Node* node) { |
| 1239 Mips64OperandGenerator g(this); | 1224 Mips64OperandGenerator g(this); |
| 1240 if (kArchVariant == kMips64r6) { | 1225 Emit(kMips64Float64Max, g.DefineAsRegister(node), |
| 1241 Emit(kMips64Float64Max, g.DefineAsRegister(node), | 1226 g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1))); |
| 1242 g.UseUniqueRegister(node->InputAt(0)), | |
| 1243 g.UseUniqueRegister(node->InputAt(1))); | |
| 1244 | |
| 1245 } else { | |
| 1246 // Reverse operands, and use same reg. for result and right operand. | |
| 1247 Emit(kMips64Float64Max, g.DefineSameAsFirst(node), | |
| 1248 g.UseRegister(node->InputAt(1)), g.UseRegister(node->InputAt(0))); | |
| 1249 } | |
| 1250 } | |
| 1251 | |
| 1252 | |
| 1253 void InstructionSelector::VisitFloat32Min(Node* node) { | |
| 1254 Mips64OperandGenerator g(this); | |
| 1255 if (kArchVariant == kMips64r6) { | |
| 1256 Emit(kMips64Float32Min, g.DefineAsRegister(node), | |
| 1257 g.UseUniqueRegister(node->InputAt(0)), | |
| 1258 g.UseUniqueRegister(node->InputAt(1))); | |
| 1259 | |
| 1260 } else { | |
| 1261 // Reverse operands, and use same reg. for result and right operand. | |
| 1262 Emit(kMips64Float32Min, g.DefineSameAsFirst(node), | |
| 1263 g.UseRegister(node->InputAt(1)), g.UseRegister(node->InputAt(0))); | |
| 1264 } | |
| 1265 } | 1227 } |
| 1266 | 1228 |
| 1267 | 1229 |
| 1268 void InstructionSelector::VisitFloat64Min(Node* node) { | 1230 void InstructionSelector::VisitFloat64Min(Node* node) { |
| 1269 Mips64OperandGenerator g(this); | 1231 Mips64OperandGenerator g(this); |
| 1270 if (kArchVariant == kMips64r6) { | 1232 Emit(kMips64Float64Min, g.DefineAsRegister(node), |
| 1271 Emit(kMips64Float64Min, g.DefineAsRegister(node), | 1233 g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1))); |
| 1272 g.UseUniqueRegister(node->InputAt(0)), | |
| 1273 g.UseUniqueRegister(node->InputAt(1))); | |
| 1274 | |
| 1275 } else { | |
| 1276 // Reverse operands, and use same reg. for result and right operand. | |
| 1277 Emit(kMips64Float64Min, g.DefineSameAsFirst(node), | |
| 1278 g.UseRegister(node->InputAt(1)), g.UseRegister(node->InputAt(0))); | |
| 1279 } | |
| 1280 } | 1234 } |
| 1281 | 1235 |
| 1282 | 1236 |
| 1283 void InstructionSelector::VisitFloat32Abs(Node* node) { | 1237 void InstructionSelector::VisitFloat32Abs(Node* node) { |
| 1284 VisitRR(this, kMips64AbsS, node); | 1238 VisitRR(this, kMips64AbsS, node); |
| 1285 } | 1239 } |
| 1286 | 1240 |
| 1287 | 1241 |
| 1288 void InstructionSelector::VisitFloat64Abs(Node* node) { | 1242 void InstructionSelector::VisitFloat64Abs(Node* node) { |
| 1289 VisitRR(this, kMips64AbsD, node); | 1243 VisitRR(this, kMips64AbsD, node); |
| (...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2075 // static | 2029 // static |
| 2076 MachineOperatorBuilder::Flags | 2030 MachineOperatorBuilder::Flags |
| 2077 InstructionSelector::SupportedMachineOperatorFlags() { | 2031 InstructionSelector::SupportedMachineOperatorFlags() { |
| 2078 return MachineOperatorBuilder::kWord32Ctz | | 2032 return MachineOperatorBuilder::kWord32Ctz | |
| 2079 MachineOperatorBuilder::kWord64Ctz | | 2033 MachineOperatorBuilder::kWord64Ctz | |
| 2080 MachineOperatorBuilder::kWord32Popcnt | | 2034 MachineOperatorBuilder::kWord32Popcnt | |
| 2081 MachineOperatorBuilder::kWord64Popcnt | | 2035 MachineOperatorBuilder::kWord64Popcnt | |
| 2082 MachineOperatorBuilder::kWord32ShiftIsSafe | | 2036 MachineOperatorBuilder::kWord32ShiftIsSafe | |
| 2083 MachineOperatorBuilder::kInt32DivIsSafe | | 2037 MachineOperatorBuilder::kInt32DivIsSafe | |
| 2084 MachineOperatorBuilder::kUint32DivIsSafe | | 2038 MachineOperatorBuilder::kUint32DivIsSafe | |
| 2085 MachineOperatorBuilder::kFloat64Min | | |
| 2086 MachineOperatorBuilder::kFloat64Max | | |
| 2087 MachineOperatorBuilder::kFloat32Min | | |
| 2088 MachineOperatorBuilder::kFloat32Max | | |
| 2089 MachineOperatorBuilder::kFloat64RoundDown | | 2039 MachineOperatorBuilder::kFloat64RoundDown | |
| 2090 MachineOperatorBuilder::kFloat32RoundDown | | 2040 MachineOperatorBuilder::kFloat32RoundDown | |
| 2091 MachineOperatorBuilder::kFloat64RoundUp | | 2041 MachineOperatorBuilder::kFloat64RoundUp | |
| 2092 MachineOperatorBuilder::kFloat32RoundUp | | 2042 MachineOperatorBuilder::kFloat32RoundUp | |
| 2093 MachineOperatorBuilder::kFloat64RoundTruncate | | 2043 MachineOperatorBuilder::kFloat64RoundTruncate | |
| 2094 MachineOperatorBuilder::kFloat32RoundTruncate | | 2044 MachineOperatorBuilder::kFloat32RoundTruncate | |
| 2095 MachineOperatorBuilder::kFloat64RoundTiesEven | | 2045 MachineOperatorBuilder::kFloat64RoundTiesEven | |
| 2096 MachineOperatorBuilder::kFloat32RoundTiesEven; | 2046 MachineOperatorBuilder::kFloat32RoundTiesEven; |
| 2097 } | 2047 } |
| 2098 | 2048 |
| 2099 // static | 2049 // static |
| 2100 MachineOperatorBuilder::AlignmentRequirements | 2050 MachineOperatorBuilder::AlignmentRequirements |
| 2101 InstructionSelector::AlignmentRequirements() { | 2051 InstructionSelector::AlignmentRequirements() { |
| 2102 if (kArchVariant == kMips64r6) { | 2052 if (kArchVariant == kMips64r6) { |
| 2103 return MachineOperatorBuilder::AlignmentRequirements:: | 2053 return MachineOperatorBuilder::AlignmentRequirements:: |
| 2104 FullUnalignedAccessSupport(); | 2054 FullUnalignedAccessSupport(); |
| 2105 } else { | 2055 } else { |
| 2106 DCHECK(kArchVariant == kMips64r2); | 2056 DCHECK(kArchVariant == kMips64r2); |
| 2107 return MachineOperatorBuilder::AlignmentRequirements:: | 2057 return MachineOperatorBuilder::AlignmentRequirements:: |
| 2108 NoUnalignedAccessSupport(); | 2058 NoUnalignedAccessSupport(); |
| 2109 } | 2059 } |
| 2110 } | 2060 } |
| 2111 | 2061 |
| 2112 } // namespace compiler | 2062 } // namespace compiler |
| 2113 } // namespace internal | 2063 } // namespace internal |
| 2114 } // namespace v8 | 2064 } // namespace v8 |
| OLD | NEW |