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

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

Issue 2849463003: [wasm] Implement Generic S128 Load/Store, logical ops and Horizontal add (Closed)
Patch Set: Zvi's review Created 3 years, 7 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
« no previous file with comments | « src/compiler/x64/instruction-scheduler-x64.cc ('k') | src/x64/sse-instr.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <algorithm> 5 #include <algorithm>
6 6
7 #include "src/base/adapters.h" 7 #include "src/base/adapters.h"
8 #include "src/compiler/instruction-selector-impl.h" 8 #include "src/compiler/instruction-selector-impl.h"
9 #include "src/compiler/node-matchers.h" 9 #include "src/compiler/node-matchers.h"
10 #include "src/compiler/node-properties.h" 10 #include "src/compiler/node-properties.h"
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 case MachineRepresentation::kWord32: 224 case MachineRepresentation::kWord32:
225 opcode = kX64Movl; 225 opcode = kX64Movl;
226 break; 226 break;
227 case MachineRepresentation::kTaggedSigned: // Fall through. 227 case MachineRepresentation::kTaggedSigned: // Fall through.
228 case MachineRepresentation::kTaggedPointer: // Fall through. 228 case MachineRepresentation::kTaggedPointer: // Fall through.
229 case MachineRepresentation::kTagged: // Fall through. 229 case MachineRepresentation::kTagged: // Fall through.
230 case MachineRepresentation::kWord64: 230 case MachineRepresentation::kWord64:
231 opcode = kX64Movq; 231 opcode = kX64Movq;
232 break; 232 break;
233 case MachineRepresentation::kSimd128: // Fall through. 233 case MachineRepresentation::kSimd128: // Fall through.
234 opcode = kX64Movdqu;
235 break;
234 case MachineRepresentation::kSimd1x4: // Fall through. 236 case MachineRepresentation::kSimd1x4: // Fall through.
235 case MachineRepresentation::kSimd1x8: // Fall through. 237 case MachineRepresentation::kSimd1x8: // Fall through.
236 case MachineRepresentation::kSimd1x16: // Fall through. 238 case MachineRepresentation::kSimd1x16: // Fall through.
237 case MachineRepresentation::kNone: 239 case MachineRepresentation::kNone:
238 UNREACHABLE(); 240 UNREACHABLE();
239 break; 241 break;
240 } 242 }
241 return opcode; 243 return opcode;
242 } 244 }
243 245
(...skipping 15 matching lines...) Expand all
259 case MachineRepresentation::kWord32: 261 case MachineRepresentation::kWord32:
260 return kX64Movl; 262 return kX64Movl;
261 break; 263 break;
262 case MachineRepresentation::kTaggedSigned: // Fall through. 264 case MachineRepresentation::kTaggedSigned: // Fall through.
263 case MachineRepresentation::kTaggedPointer: // Fall through. 265 case MachineRepresentation::kTaggedPointer: // Fall through.
264 case MachineRepresentation::kTagged: // Fall through. 266 case MachineRepresentation::kTagged: // Fall through.
265 case MachineRepresentation::kWord64: 267 case MachineRepresentation::kWord64:
266 return kX64Movq; 268 return kX64Movq;
267 break; 269 break;
268 case MachineRepresentation::kSimd128: // Fall through. 270 case MachineRepresentation::kSimd128: // Fall through.
271 return kX64Movdqu;
272 break;
269 case MachineRepresentation::kSimd1x4: // Fall through. 273 case MachineRepresentation::kSimd1x4: // Fall through.
270 case MachineRepresentation::kSimd1x8: // Fall through. 274 case MachineRepresentation::kSimd1x8: // Fall through.
271 case MachineRepresentation::kSimd1x16: // Fall through. 275 case MachineRepresentation::kSimd1x16: // Fall through.
272 case MachineRepresentation::kNone: 276 case MachineRepresentation::kNone:
273 UNREACHABLE(); 277 UNREACHABLE();
274 return kArchNop; 278 return kArchNop;
275 } 279 }
276 UNREACHABLE(); 280 UNREACHABLE();
277 return kArchNop; 281 return kArchNop;
278 } 282 }
(...skipping 2171 matching lines...) Expand 10 before | Expand all | Expand 10 after
2450 V(8x16) 2454 V(8x16)
2451 2455
2452 #define SIMD_ZERO_OP_LIST(V) \ 2456 #define SIMD_ZERO_OP_LIST(V) \
2453 V(S128Zero) \ 2457 V(S128Zero) \
2454 V(S1x4Zero) \ 2458 V(S1x4Zero) \
2455 V(S1x8Zero) \ 2459 V(S1x8Zero) \
2456 V(S1x16Zero) 2460 V(S1x16Zero)
2457 2461
2458 #define SIMD_BINOP_LIST(V) \ 2462 #define SIMD_BINOP_LIST(V) \
2459 V(I32x4Add) \ 2463 V(I32x4Add) \
2464 V(I32x4AddHoriz) \
2460 V(I32x4Sub) \ 2465 V(I32x4Sub) \
2461 V(I32x4Mul) \ 2466 V(I32x4Mul) \
2462 V(I32x4MinS) \ 2467 V(I32x4MinS) \
2463 V(I32x4MaxS) \ 2468 V(I32x4MaxS) \
2464 V(I32x4Eq) \ 2469 V(I32x4Eq) \
2465 V(I32x4Ne) \ 2470 V(I32x4Ne) \
2466 V(I32x4MinU) \ 2471 V(I32x4MinU) \
2467 V(I32x4MaxU) \ 2472 V(I32x4MaxU) \
2468 V(I16x8Add) \ 2473 V(I16x8Add) \
2469 V(I16x8AddSaturateS) \ 2474 V(I16x8AddSaturateS) \
2475 V(I16x8AddHoriz) \
2470 V(I16x8Sub) \ 2476 V(I16x8Sub) \
2471 V(I16x8SubSaturateS) \ 2477 V(I16x8SubSaturateS) \
2472 V(I16x8Mul) \ 2478 V(I16x8Mul) \
2473 V(I16x8MinS) \ 2479 V(I16x8MinS) \
2474 V(I16x8MaxS) \ 2480 V(I16x8MaxS) \
2475 V(I16x8Eq) \ 2481 V(I16x8Eq) \
2476 V(I16x8Ne) \ 2482 V(I16x8Ne) \
2477 V(I16x8AddSaturateU) \ 2483 V(I16x8AddSaturateU) \
2478 V(I16x8SubSaturateU) \ 2484 V(I16x8SubSaturateU) \
2479 V(I16x8MinU) \ 2485 V(I16x8MinU) \
2480 V(I16x8MaxU) \ 2486 V(I16x8MaxU) \
2481 V(I8x16Add) \ 2487 V(I8x16Add) \
2482 V(I8x16AddSaturateS) \ 2488 V(I8x16AddSaturateS) \
2483 V(I8x16Sub) \ 2489 V(I8x16Sub) \
2484 V(I8x16SubSaturateS) \ 2490 V(I8x16SubSaturateS) \
2485 V(I8x16MinS) \ 2491 V(I8x16MinS) \
2486 V(I8x16MaxS) \ 2492 V(I8x16MaxS) \
2487 V(I8x16Eq) \ 2493 V(I8x16Eq) \
2488 V(I8x16Ne) \ 2494 V(I8x16Ne) \
2489 V(I8x16AddSaturateU) \ 2495 V(I8x16AddSaturateU) \
2490 V(I8x16SubSaturateU) \ 2496 V(I8x16SubSaturateU) \
2491 V(I8x16MinU) \ 2497 V(I8x16MinU) \
2492 V(I8x16MaxU) 2498 V(I8x16MaxU) \
2499 V(S128And) \
2500 V(S128Or) \
2501 V(S128Xor)
2502
2503 #define SIMD_UNOP_LIST(V) V(S128Not)
2493 2504
2494 #define SIMD_SHIFT_OPCODES(V) \ 2505 #define SIMD_SHIFT_OPCODES(V) \
2495 V(I32x4Shl) \ 2506 V(I32x4Shl) \
2496 V(I32x4ShrS) \ 2507 V(I32x4ShrS) \
2497 V(I32x4ShrU) \ 2508 V(I32x4ShrU) \
2498 V(I16x8Shl) \ 2509 V(I16x8Shl) \
2499 V(I16x8ShrS) \ 2510 V(I16x8ShrS) \
2500 V(I16x8ShrU) 2511 V(I16x8ShrU)
2501 2512
2502 #define VISIT_SIMD_SPLAT(Type) \ 2513 #define VISIT_SIMD_SPLAT(Type) \
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
2540 #define VISIT_SIMD_SHIFT(Opcode) \ 2551 #define VISIT_SIMD_SHIFT(Opcode) \
2541 void InstructionSelector::Visit##Opcode(Node* node) { \ 2552 void InstructionSelector::Visit##Opcode(Node* node) { \
2542 X64OperandGenerator g(this); \ 2553 X64OperandGenerator g(this); \
2543 int32_t value = OpParameter<int32_t>(node); \ 2554 int32_t value = OpParameter<int32_t>(node); \
2544 Emit(kX64##Opcode, g.DefineSameAsFirst(node), \ 2555 Emit(kX64##Opcode, g.DefineSameAsFirst(node), \
2545 g.UseRegister(node->InputAt(0)), g.UseImmediate(value)); \ 2556 g.UseRegister(node->InputAt(0)), g.UseImmediate(value)); \
2546 } 2557 }
2547 SIMD_SHIFT_OPCODES(VISIT_SIMD_SHIFT) 2558 SIMD_SHIFT_OPCODES(VISIT_SIMD_SHIFT)
2548 #undef VISIT_SIMD_SHIFT 2559 #undef VISIT_SIMD_SHIFT
2549 2560
2561 #define VISIT_SIMD_UNOP(Opcode) \
2562 void InstructionSelector::Visit##Opcode(Node* node) { \
2563 X64OperandGenerator g(this); \
2564 Emit(kX64##Opcode, g.DefineAsRegister(node), \
2565 g.UseRegister(node->InputAt(0))); \
2566 }
2567 SIMD_UNOP_LIST(VISIT_SIMD_UNOP)
2568 #undef VISIT_SIMD_UNOP
2569
2550 #define VISIT_SIMD_BINOP(Opcode) \ 2570 #define VISIT_SIMD_BINOP(Opcode) \
2551 void InstructionSelector::Visit##Opcode(Node* node) { \ 2571 void InstructionSelector::Visit##Opcode(Node* node) { \
2552 X64OperandGenerator g(this); \ 2572 X64OperandGenerator g(this); \
2553 Emit(kX64##Opcode, g.DefineSameAsFirst(node), \ 2573 Emit(kX64##Opcode, g.DefineSameAsFirst(node), \
2554 g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1))); \ 2574 g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1))); \
2555 } 2575 }
2556 SIMD_BINOP_LIST(VISIT_SIMD_BINOP) 2576 SIMD_BINOP_LIST(VISIT_SIMD_BINOP)
2557 #undef VISIT_SIMD_BINOP 2577 #undef VISIT_SIMD_BINOP
2558 2578
2559 #define SIMD_VISIT_SELECT_OP(format) \ 2579 #define SIMD_VISIT_SELECT_OP(format) \
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
2600 // static 2620 // static
2601 MachineOperatorBuilder::AlignmentRequirements 2621 MachineOperatorBuilder::AlignmentRequirements
2602 InstructionSelector::AlignmentRequirements() { 2622 InstructionSelector::AlignmentRequirements() {
2603 return MachineOperatorBuilder::AlignmentRequirements:: 2623 return MachineOperatorBuilder::AlignmentRequirements::
2604 FullUnalignedAccessSupport(); 2624 FullUnalignedAccessSupport();
2605 } 2625 }
2606 2626
2607 } // namespace compiler 2627 } // namespace compiler
2608 } // namespace internal 2628 } // namespace internal
2609 } // namespace v8 2629 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/x64/instruction-scheduler-x64.cc ('k') | src/x64/sse-instr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698