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

Side by Side Diff: src/compiler/mips/instruction-selector-mips.cc

Issue 2801683003: MIPS[64]: Support for some SIMD operations (8) (Closed)
Patch Set: Rebase Created 3 years, 6 months 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
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/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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 break; 287 break;
288 case MachineRepresentation::kWord16: 288 case MachineRepresentation::kWord16:
289 opcode = load_rep.IsUnsigned() ? kMipsLhu : kMipsLh; 289 opcode = load_rep.IsUnsigned() ? kMipsLhu : kMipsLh;
290 break; 290 break;
291 case MachineRepresentation::kTaggedSigned: // Fall through. 291 case MachineRepresentation::kTaggedSigned: // Fall through.
292 case MachineRepresentation::kTaggedPointer: // Fall through. 292 case MachineRepresentation::kTaggedPointer: // Fall through.
293 case MachineRepresentation::kTagged: // Fall through. 293 case MachineRepresentation::kTagged: // Fall through.
294 case MachineRepresentation::kWord32: 294 case MachineRepresentation::kWord32:
295 opcode = kMipsLw; 295 opcode = kMipsLw;
296 break; 296 break;
297 case MachineRepresentation::kSimd128:
298 opcode = kMipsMsaLd;
299 break;
297 case MachineRepresentation::kWord64: // Fall through. 300 case MachineRepresentation::kWord64: // Fall through.
298 case MachineRepresentation::kSimd128: // Fall through.
299 case MachineRepresentation::kSimd1x4: // Fall through. 301 case MachineRepresentation::kSimd1x4: // Fall through.
300 case MachineRepresentation::kSimd1x8: // Fall through. 302 case MachineRepresentation::kSimd1x8: // Fall through.
301 case MachineRepresentation::kSimd1x16: // Fall through. 303 case MachineRepresentation::kSimd1x16: // Fall through.
302 case MachineRepresentation::kNone: 304 case MachineRepresentation::kNone:
303 UNREACHABLE(); 305 UNREACHABLE();
304 return; 306 return;
305 } 307 }
306 308
307 if (g.CanBeImmediate(index, opcode)) { 309 if (g.CanBeImmediate(index, opcode)) {
308 Emit(opcode | AddressingModeField::encode(kMode_MRI), 310 Emit(opcode | AddressingModeField::encode(kMode_MRI),
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 break; 377 break;
376 case MachineRepresentation::kWord16: 378 case MachineRepresentation::kWord16:
377 opcode = kMipsSh; 379 opcode = kMipsSh;
378 break; 380 break;
379 case MachineRepresentation::kTaggedSigned: // Fall through. 381 case MachineRepresentation::kTaggedSigned: // Fall through.
380 case MachineRepresentation::kTaggedPointer: // Fall through. 382 case MachineRepresentation::kTaggedPointer: // Fall through.
381 case MachineRepresentation::kTagged: // Fall through. 383 case MachineRepresentation::kTagged: // Fall through.
382 case MachineRepresentation::kWord32: 384 case MachineRepresentation::kWord32:
383 opcode = kMipsSw; 385 opcode = kMipsSw;
384 break; 386 break;
387 case MachineRepresentation::kSimd128:
388 opcode = kMipsMsaSt;
389 break;
385 case MachineRepresentation::kWord64: // Fall through. 390 case MachineRepresentation::kWord64: // Fall through.
386 case MachineRepresentation::kSimd128: // Fall through.
387 case MachineRepresentation::kSimd1x4: // Fall through. 391 case MachineRepresentation::kSimd1x4: // Fall through.
388 case MachineRepresentation::kSimd1x8: // Fall through. 392 case MachineRepresentation::kSimd1x8: // Fall through.
389 case MachineRepresentation::kSimd1x16: // Fall through. 393 case MachineRepresentation::kSimd1x16: // Fall through.
390 case MachineRepresentation::kNone: 394 case MachineRepresentation::kNone:
391 UNREACHABLE(); 395 UNREACHABLE();
392 return; 396 return;
393 } 397 }
394 398
395 if (g.CanBeImmediate(index, opcode)) { 399 if (g.CanBeImmediate(index, opcode)) {
396 Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(), 400 Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(),
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
1227 case MachineRepresentation::kTagged: // Fall through. 1231 case MachineRepresentation::kTagged: // Fall through.
1228 case MachineRepresentation::kWord32: 1232 case MachineRepresentation::kWord32:
1229 opcode = kMipsUlw; 1233 opcode = kMipsUlw;
1230 break; 1234 break;
1231 case MachineRepresentation::kFloat32: 1235 case MachineRepresentation::kFloat32:
1232 opcode = kMipsUlwc1; 1236 opcode = kMipsUlwc1;
1233 break; 1237 break;
1234 case MachineRepresentation::kFloat64: 1238 case MachineRepresentation::kFloat64:
1235 opcode = kMipsUldc1; 1239 opcode = kMipsUldc1;
1236 break; 1240 break;
1241 case MachineRepresentation::kSimd128:
1242 opcode = kMipsMsaLd;
1243 break;
1237 case MachineRepresentation::kWord64: // Fall through. 1244 case MachineRepresentation::kWord64: // Fall through.
1238 case MachineRepresentation::kSimd128: // Fall through.
1239 case MachineRepresentation::kSimd1x4: // Fall through. 1245 case MachineRepresentation::kSimd1x4: // Fall through.
1240 case MachineRepresentation::kSimd1x8: // Fall through. 1246 case MachineRepresentation::kSimd1x8: // Fall through.
1241 case MachineRepresentation::kSimd1x16: // Fall through. 1247 case MachineRepresentation::kSimd1x16: // Fall through.
1242 case MachineRepresentation::kNone: 1248 case MachineRepresentation::kNone:
1243 UNREACHABLE(); 1249 UNREACHABLE();
1244 return; 1250 return;
1245 } 1251 }
1246 1252
1247 if (g.CanBeImmediate(index, opcode)) { 1253 if (g.CanBeImmediate(index, opcode)) {
1248 Emit(opcode | AddressingModeField::encode(kMode_MRI), 1254 Emit(opcode | AddressingModeField::encode(kMode_MRI),
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1280 break; 1286 break;
1281 case MachineRepresentation::kWord16: 1287 case MachineRepresentation::kWord16:
1282 opcode = kMipsUsh; 1288 opcode = kMipsUsh;
1283 break; 1289 break;
1284 case MachineRepresentation::kTaggedSigned: // Fall through. 1290 case MachineRepresentation::kTaggedSigned: // Fall through.
1285 case MachineRepresentation::kTaggedPointer: // Fall through. 1291 case MachineRepresentation::kTaggedPointer: // Fall through.
1286 case MachineRepresentation::kTagged: // Fall through. 1292 case MachineRepresentation::kTagged: // Fall through.
1287 case MachineRepresentation::kWord32: 1293 case MachineRepresentation::kWord32:
1288 opcode = kMipsUsw; 1294 opcode = kMipsUsw;
1289 break; 1295 break;
1296 case MachineRepresentation::kSimd128:
1297 opcode = kMipsMsaSt;
1298 break;
1290 case MachineRepresentation::kWord64: // Fall through. 1299 case MachineRepresentation::kWord64: // Fall through.
1291 case MachineRepresentation::kSimd128: // Fall through.
1292 case MachineRepresentation::kSimd1x4: // Fall through. 1300 case MachineRepresentation::kSimd1x4: // Fall through.
1293 case MachineRepresentation::kSimd1x8: // Fall through. 1301 case MachineRepresentation::kSimd1x8: // Fall through.
1294 case MachineRepresentation::kSimd1x16: // Fall through. 1302 case MachineRepresentation::kSimd1x16: // Fall through.
1295 case MachineRepresentation::kNone: 1303 case MachineRepresentation::kNone:
1296 UNREACHABLE(); 1304 UNREACHABLE();
1297 return; 1305 return;
1298 } 1306 }
1299 1307
1300 if (g.CanBeImmediate(index, opcode)) { 1308 if (g.CanBeImmediate(index, opcode)) {
1301 Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(), 1309 Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(),
(...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after
2334 } 2342 }
2335 2343
2336 void InstructionSelector::VisitS128Xor(Node* node) { 2344 void InstructionSelector::VisitS128Xor(Node* node) {
2337 VisitRRR(this, kMipsS128Xor, node); 2345 VisitRRR(this, kMipsS128Xor, node);
2338 } 2346 }
2339 2347
2340 void InstructionSelector::VisitS128Not(Node* node) { 2348 void InstructionSelector::VisitS128Not(Node* node) {
2341 VisitRR(this, kMipsS128Not, node); 2349 VisitRR(this, kMipsS128Not, node);
2342 } 2350 }
2343 2351
2352 void InstructionSelector::VisitS1x4And(Node* node) {
2353 VisitRRR(this, kMipsS128And, node);
2354 }
2355
2356 void InstructionSelector::VisitS1x4Or(Node* node) {
2357 VisitRRR(this, kMipsS128Or, node);
2358 }
2359
2360 void InstructionSelector::VisitS1x4Xor(Node* node) {
2361 VisitRRR(this, kMipsS128Xor, node);
2362 }
2363
2364 void InstructionSelector::VisitS1x4Not(Node* node) {
2365 VisitRR(this, kMipsS128Not, node);
2366 }
2367
2368 void InstructionSelector::VisitS1x4AnyTrue(Node* node) {
2369 VisitRR(this, kMipsS1x4AnyTrue, node);
2370 }
2371
2372 void InstructionSelector::VisitS1x4AllTrue(Node* node) {
2373 VisitRR(this, kMipsS1x4AllTrue, node);
2374 }
2375
2376 void InstructionSelector::VisitS1x8And(Node* node) {
2377 VisitRRR(this, kMipsS128And, node);
2378 }
2379
2380 void InstructionSelector::VisitS1x8Or(Node* node) {
2381 VisitRRR(this, kMipsS128Or, node);
2382 }
2383
2384 void InstructionSelector::VisitS1x8Xor(Node* node) {
2385 VisitRRR(this, kMipsS128Xor, node);
2386 }
2387
2388 void InstructionSelector::VisitS1x8Not(Node* node) {
2389 VisitRR(this, kMipsS128Not, node);
2390 }
2391
2392 void InstructionSelector::VisitS1x8AnyTrue(Node* node) {
2393 VisitRR(this, kMipsS1x8AnyTrue, node);
2394 }
2395
2396 void InstructionSelector::VisitS1x8AllTrue(Node* node) {
2397 VisitRR(this, kMipsS1x8AllTrue, node);
2398 }
2399
2400 void InstructionSelector::VisitS1x16And(Node* node) {
2401 VisitRRR(this, kMipsS128And, node);
2402 }
2403
2404 void InstructionSelector::VisitS1x16Or(Node* node) {
2405 VisitRRR(this, kMipsS128Or, node);
2406 }
2407
2408 void InstructionSelector::VisitS1x16Xor(Node* node) {
2409 VisitRRR(this, kMipsS128Xor, node);
2410 }
2411
2412 void InstructionSelector::VisitS1x16Not(Node* node) {
2413 VisitRR(this, kMipsS128Not, node);
2414 }
2415
2416 void InstructionSelector::VisitS1x16AnyTrue(Node* node) {
2417 VisitRR(this, kMipsS1x16AnyTrue, node);
2418 }
2419
2420 void InstructionSelector::VisitS1x16AllTrue(Node* node) {
2421 VisitRR(this, kMipsS1x16AllTrue, node);
2422 }
2423
2344 // static 2424 // static
2345 MachineOperatorBuilder::Flags 2425 MachineOperatorBuilder::Flags
2346 InstructionSelector::SupportedMachineOperatorFlags() { 2426 InstructionSelector::SupportedMachineOperatorFlags() {
2347 MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kNoFlags; 2427 MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kNoFlags;
2348 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) && 2428 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) &&
2349 IsFp64Mode()) { 2429 IsFp64Mode()) {
2350 flags |= MachineOperatorBuilder::kFloat64RoundDown | 2430 flags |= MachineOperatorBuilder::kFloat64RoundDown |
2351 MachineOperatorBuilder::kFloat64RoundUp | 2431 MachineOperatorBuilder::kFloat64RoundUp |
2352 MachineOperatorBuilder::kFloat64RoundTruncate | 2432 MachineOperatorBuilder::kFloat64RoundTruncate |
2353 MachineOperatorBuilder::kFloat64RoundTiesEven; 2433 MachineOperatorBuilder::kFloat64RoundTiesEven;
(...skipping 22 matching lines...) Expand all
2376 DCHECK(IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r1) || 2456 DCHECK(IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r1) ||
2377 IsMipsArchVariant(kMips32r2)); 2457 IsMipsArchVariant(kMips32r2));
2378 return MachineOperatorBuilder::AlignmentRequirements:: 2458 return MachineOperatorBuilder::AlignmentRequirements::
2379 NoUnalignedAccessSupport(); 2459 NoUnalignedAccessSupport();
2380 } 2460 }
2381 } 2461 }
2382 2462
2383 } // namespace compiler 2463 } // namespace compiler
2384 } // namespace internal 2464 } // namespace internal
2385 } // namespace v8 2465 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/mips/instruction-codes-mips.h ('k') | src/compiler/mips64/code-generator-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698