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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 break; | 271 break; |
272 case MachineRepresentation::kWord16: | 272 case MachineRepresentation::kWord16: |
273 opcode = load_rep.IsUnsigned() ? kMipsLhu : kMipsLh; | 273 opcode = load_rep.IsUnsigned() ? kMipsLhu : kMipsLh; |
274 break; | 274 break; |
275 case MachineRepresentation::kTaggedSigned: // Fall through. | 275 case MachineRepresentation::kTaggedSigned: // Fall through. |
276 case MachineRepresentation::kTaggedPointer: // Fall through. | 276 case MachineRepresentation::kTaggedPointer: // Fall through. |
277 case MachineRepresentation::kTagged: // Fall through. | 277 case MachineRepresentation::kTagged: // Fall through. |
278 case MachineRepresentation::kWord32: | 278 case MachineRepresentation::kWord32: |
279 opcode = kMipsLw; | 279 opcode = kMipsLw; |
280 break; | 280 break; |
| 281 case MachineRepresentation::kSimd128: |
| 282 opcode = kMipsMsaLd; |
| 283 break; |
281 case MachineRepresentation::kWord64: // Fall through. | 284 case MachineRepresentation::kWord64: // Fall through. |
282 case MachineRepresentation::kSimd128: // Fall through. | |
283 case MachineRepresentation::kSimd1x4: // Fall through. | 285 case MachineRepresentation::kSimd1x4: // Fall through. |
284 case MachineRepresentation::kSimd1x8: // Fall through. | 286 case MachineRepresentation::kSimd1x8: // Fall through. |
285 case MachineRepresentation::kSimd1x16: // Fall through. | 287 case MachineRepresentation::kSimd1x16: // Fall through. |
286 case MachineRepresentation::kNone: | 288 case MachineRepresentation::kNone: |
287 UNREACHABLE(); | 289 UNREACHABLE(); |
288 return; | 290 return; |
289 } | 291 } |
290 | 292 |
291 if (g.CanBeImmediate(index, opcode)) { | 293 if (g.CanBeImmediate(index, opcode)) { |
292 Emit(opcode | AddressingModeField::encode(kMode_MRI), | 294 Emit(opcode | AddressingModeField::encode(kMode_MRI), |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 break; | 361 break; |
360 case MachineRepresentation::kWord16: | 362 case MachineRepresentation::kWord16: |
361 opcode = kMipsSh; | 363 opcode = kMipsSh; |
362 break; | 364 break; |
363 case MachineRepresentation::kTaggedSigned: // Fall through. | 365 case MachineRepresentation::kTaggedSigned: // Fall through. |
364 case MachineRepresentation::kTaggedPointer: // Fall through. | 366 case MachineRepresentation::kTaggedPointer: // Fall through. |
365 case MachineRepresentation::kTagged: // Fall through. | 367 case MachineRepresentation::kTagged: // Fall through. |
366 case MachineRepresentation::kWord32: | 368 case MachineRepresentation::kWord32: |
367 opcode = kMipsSw; | 369 opcode = kMipsSw; |
368 break; | 370 break; |
| 371 case MachineRepresentation::kSimd128: |
| 372 opcode = kMipsMsaSt; |
| 373 break; |
369 case MachineRepresentation::kWord64: // Fall through. | 374 case MachineRepresentation::kWord64: // Fall through. |
370 case MachineRepresentation::kSimd128: // Fall through. | |
371 case MachineRepresentation::kSimd1x4: // Fall through. | 375 case MachineRepresentation::kSimd1x4: // Fall through. |
372 case MachineRepresentation::kSimd1x8: // Fall through. | 376 case MachineRepresentation::kSimd1x8: // Fall through. |
373 case MachineRepresentation::kSimd1x16: // Fall through. | 377 case MachineRepresentation::kSimd1x16: // Fall through. |
374 case MachineRepresentation::kNone: | 378 case MachineRepresentation::kNone: |
375 UNREACHABLE(); | 379 UNREACHABLE(); |
376 return; | 380 return; |
377 } | 381 } |
378 | 382 |
379 if (g.CanBeImmediate(index, opcode)) { | 383 if (g.CanBeImmediate(index, opcode)) { |
380 Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(), | 384 Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(), |
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1211 case MachineRepresentation::kTagged: // Fall through. | 1215 case MachineRepresentation::kTagged: // Fall through. |
1212 case MachineRepresentation::kWord32: | 1216 case MachineRepresentation::kWord32: |
1213 opcode = kMipsUlw; | 1217 opcode = kMipsUlw; |
1214 break; | 1218 break; |
1215 case MachineRepresentation::kFloat32: | 1219 case MachineRepresentation::kFloat32: |
1216 opcode = kMipsUlwc1; | 1220 opcode = kMipsUlwc1; |
1217 break; | 1221 break; |
1218 case MachineRepresentation::kFloat64: | 1222 case MachineRepresentation::kFloat64: |
1219 opcode = kMipsUldc1; | 1223 opcode = kMipsUldc1; |
1220 break; | 1224 break; |
| 1225 case MachineRepresentation::kSimd128: |
| 1226 opcode = kMipsMsaLd; |
| 1227 break; |
1221 case MachineRepresentation::kWord64: // Fall through. | 1228 case MachineRepresentation::kWord64: // Fall through. |
1222 case MachineRepresentation::kSimd128: // Fall through. | |
1223 case MachineRepresentation::kSimd1x4: // Fall through. | 1229 case MachineRepresentation::kSimd1x4: // Fall through. |
1224 case MachineRepresentation::kSimd1x8: // Fall through. | 1230 case MachineRepresentation::kSimd1x8: // Fall through. |
1225 case MachineRepresentation::kSimd1x16: // Fall through. | 1231 case MachineRepresentation::kSimd1x16: // Fall through. |
1226 case MachineRepresentation::kNone: | 1232 case MachineRepresentation::kNone: |
1227 UNREACHABLE(); | 1233 UNREACHABLE(); |
1228 return; | 1234 return; |
1229 } | 1235 } |
1230 | 1236 |
1231 if (g.CanBeImmediate(index, opcode)) { | 1237 if (g.CanBeImmediate(index, opcode)) { |
1232 Emit(opcode | AddressingModeField::encode(kMode_MRI), | 1238 Emit(opcode | AddressingModeField::encode(kMode_MRI), |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1264 break; | 1270 break; |
1265 case MachineRepresentation::kWord16: | 1271 case MachineRepresentation::kWord16: |
1266 opcode = kMipsUsh; | 1272 opcode = kMipsUsh; |
1267 break; | 1273 break; |
1268 case MachineRepresentation::kTaggedSigned: // Fall through. | 1274 case MachineRepresentation::kTaggedSigned: // Fall through. |
1269 case MachineRepresentation::kTaggedPointer: // Fall through. | 1275 case MachineRepresentation::kTaggedPointer: // Fall through. |
1270 case MachineRepresentation::kTagged: // Fall through. | 1276 case MachineRepresentation::kTagged: // Fall through. |
1271 case MachineRepresentation::kWord32: | 1277 case MachineRepresentation::kWord32: |
1272 opcode = kMipsUsw; | 1278 opcode = kMipsUsw; |
1273 break; | 1279 break; |
| 1280 case MachineRepresentation::kSimd128: |
| 1281 opcode = kMipsMsaSt; |
| 1282 break; |
1274 case MachineRepresentation::kWord64: // Fall through. | 1283 case MachineRepresentation::kWord64: // Fall through. |
1275 case MachineRepresentation::kSimd128: // Fall through. | |
1276 case MachineRepresentation::kSimd1x4: // Fall through. | 1284 case MachineRepresentation::kSimd1x4: // Fall through. |
1277 case MachineRepresentation::kSimd1x8: // Fall through. | 1285 case MachineRepresentation::kSimd1x8: // Fall through. |
1278 case MachineRepresentation::kSimd1x16: // Fall through. | 1286 case MachineRepresentation::kSimd1x16: // Fall through. |
1279 case MachineRepresentation::kNone: | 1287 case MachineRepresentation::kNone: |
1280 UNREACHABLE(); | 1288 UNREACHABLE(); |
1281 return; | 1289 return; |
1282 } | 1290 } |
1283 | 1291 |
1284 if (g.CanBeImmediate(index, opcode)) { | 1292 if (g.CanBeImmediate(index, opcode)) { |
1285 Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(), | 1293 Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(), |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1968 } | 1976 } |
1969 | 1977 |
1970 void InstructionSelector::VisitF32x4SConvertI32x4(Node* node) { | 1978 void InstructionSelector::VisitF32x4SConvertI32x4(Node* node) { |
1971 VisitRR(this, kMipsF32x4SConvertI32x4, node); | 1979 VisitRR(this, kMipsF32x4SConvertI32x4, node); |
1972 } | 1980 } |
1973 | 1981 |
1974 void InstructionSelector::VisitF32x4UConvertI32x4(Node* node) { | 1982 void InstructionSelector::VisitF32x4UConvertI32x4(Node* node) { |
1975 VisitRR(this, kMipsF32x4UConvertI32x4, node); | 1983 VisitRR(this, kMipsF32x4UConvertI32x4, node); |
1976 } | 1984 } |
1977 | 1985 |
| 1986 void InstructionSelector::VisitS1x4And(Node* node) { |
| 1987 VisitRRR(this, kMipsS128And, node); |
| 1988 } |
| 1989 |
| 1990 void InstructionSelector::VisitS1x4Or(Node* node) { |
| 1991 VisitRRR(this, kMipsS128Or, node); |
| 1992 } |
| 1993 |
| 1994 void InstructionSelector::VisitS1x4Xor(Node* node) { |
| 1995 VisitRRR(this, kMipsS128Xor, node); |
| 1996 } |
| 1997 |
| 1998 void InstructionSelector::VisitS1x4Not(Node* node) { |
| 1999 VisitRR(this, kMipsS128Not, node); |
| 2000 } |
| 2001 |
| 2002 void InstructionSelector::VisitS1x4AnyTrue(Node* node) { |
| 2003 VisitRR(this, kMipsS1x4AnyTrue, node); |
| 2004 } |
| 2005 |
| 2006 void InstructionSelector::VisitS1x4AllTrue(Node* node) { |
| 2007 VisitRR(this, kMipsS1x4AllTrue, node); |
| 2008 } |
| 2009 |
| 2010 void InstructionSelector::VisitS1x8And(Node* node) { |
| 2011 VisitRRR(this, kMipsS128And, node); |
| 2012 } |
| 2013 |
| 2014 void InstructionSelector::VisitS1x8Or(Node* node) { |
| 2015 VisitRRR(this, kMipsS128Or, node); |
| 2016 } |
| 2017 |
| 2018 void InstructionSelector::VisitS1x8Xor(Node* node) { |
| 2019 VisitRRR(this, kMipsS128Xor, node); |
| 2020 } |
| 2021 |
| 2022 void InstructionSelector::VisitS1x8Not(Node* node) { |
| 2023 VisitRR(this, kMipsS128Not, node); |
| 2024 } |
| 2025 |
| 2026 void InstructionSelector::VisitS1x8AnyTrue(Node* node) { |
| 2027 VisitRR(this, kMipsS1x8AnyTrue, node); |
| 2028 } |
| 2029 |
| 2030 void InstructionSelector::VisitS1x8AllTrue(Node* node) { |
| 2031 VisitRR(this, kMipsS1x8AllTrue, node); |
| 2032 } |
| 2033 |
| 2034 void InstructionSelector::VisitS1x16And(Node* node) { |
| 2035 VisitRRR(this, kMipsS128And, node); |
| 2036 } |
| 2037 |
| 2038 void InstructionSelector::VisitS1x16Or(Node* node) { |
| 2039 VisitRRR(this, kMipsS128Or, node); |
| 2040 } |
| 2041 |
| 2042 void InstructionSelector::VisitS1x16Xor(Node* node) { |
| 2043 VisitRRR(this, kMipsS128Xor, node); |
| 2044 } |
| 2045 |
| 2046 void InstructionSelector::VisitS1x16Not(Node* node) { |
| 2047 VisitRR(this, kMipsS128Not, node); |
| 2048 } |
| 2049 |
| 2050 void InstructionSelector::VisitS1x16AnyTrue(Node* node) { |
| 2051 VisitRR(this, kMipsS1x16AnyTrue, node); |
| 2052 } |
| 2053 |
| 2054 void InstructionSelector::VisitS1x16AllTrue(Node* node) { |
| 2055 VisitRR(this, kMipsS1x16AllTrue, node); |
| 2056 } |
| 2057 |
1978 // static | 2058 // static |
1979 MachineOperatorBuilder::Flags | 2059 MachineOperatorBuilder::Flags |
1980 InstructionSelector::SupportedMachineOperatorFlags() { | 2060 InstructionSelector::SupportedMachineOperatorFlags() { |
1981 MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kNoFlags; | 2061 MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kNoFlags; |
1982 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) && | 2062 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) && |
1983 IsFp64Mode()) { | 2063 IsFp64Mode()) { |
1984 flags |= MachineOperatorBuilder::kFloat64RoundDown | | 2064 flags |= MachineOperatorBuilder::kFloat64RoundDown | |
1985 MachineOperatorBuilder::kFloat64RoundUp | | 2065 MachineOperatorBuilder::kFloat64RoundUp | |
1986 MachineOperatorBuilder::kFloat64RoundTruncate | | 2066 MachineOperatorBuilder::kFloat64RoundTruncate | |
1987 MachineOperatorBuilder::kFloat64RoundTiesEven; | 2067 MachineOperatorBuilder::kFloat64RoundTiesEven; |
(...skipping 22 matching lines...) Expand all Loading... |
2010 DCHECK(IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r1) || | 2090 DCHECK(IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r1) || |
2011 IsMipsArchVariant(kMips32r2)); | 2091 IsMipsArchVariant(kMips32r2)); |
2012 return MachineOperatorBuilder::AlignmentRequirements:: | 2092 return MachineOperatorBuilder::AlignmentRequirements:: |
2013 NoUnalignedAccessSupport(); | 2093 NoUnalignedAccessSupport(); |
2014 } | 2094 } |
2015 } | 2095 } |
2016 | 2096 |
2017 } // namespace compiler | 2097 } // namespace compiler |
2018 } // namespace internal | 2098 } // namespace internal |
2019 } // namespace v8 | 2099 } // namespace v8 |
OLD | NEW |