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

Side by Side Diff: src/IceAssemblerARM32.h

Issue 1663053008: Fix vector load/stores in the ARM assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 4 years, 10 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/DartARM32/assembler_arm.h ('k') | src/IceAssemblerARM32.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceAssemblerARM32.h - Assembler for ARM32 ----*- C++ -*-===// 1 //===- subzero/src/IceAssemblerARM32.h - Assembler for ARM32 ----*- C++ -*-===//
2 // 2 //
3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
4 // for details. All rights reserved. Use of this source code is governed by a 4 // for details. All rights reserved. Use of this source code is governed by a
5 // BSD-style license that can be found in the LICENSE file. 5 // BSD-style license that can be found in the LICENSE file.
6 // 6 //
7 // Modified by the Subzero authors. 7 // Modified by the Subzero authors.
8 // 8 //
9 //===----------------------------------------------------------------------===// 9 //===----------------------------------------------------------------------===//
10 // 10 //
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 public: 67 public:
68 // Rotation values. 68 // Rotation values.
69 enum RotationValue { 69 enum RotationValue {
70 kRotateNone, // Omitted 70 kRotateNone, // Omitted
71 kRotate8, // ror #8 71 kRotate8, // ror #8
72 kRotate16, // ror #16 72 kRotate16, // ror #16
73 kRotate24 // ror #24 73 kRotate24 // ror #24
74 }; 74 };
75 75
76 // Encoding of the number of D registers in a list of D registers.
77 enum DRegListSize {
78 DRegListSize1 = 7, // 0b0111
79 DRegListSize2 = 10, // 0b1010
80 DRegListSIze3 = 6, // 0b0110
81 DRegListSize4 = 2 // 0b0010
82 };
83
76 class TargetInfo { 84 class TargetInfo {
77 TargetInfo(const TargetInfo &) = delete; 85 TargetInfo(const TargetInfo &) = delete;
78 TargetInfo &operator=(const TargetInfo &) = delete; 86 TargetInfo &operator=(const TargetInfo &) = delete;
79 87
80 public: 88 public:
81 TargetInfo(bool HasFramePointer, SizeT FrameOrStackReg) 89 TargetInfo(bool HasFramePointer, SizeT FrameOrStackReg)
82 : HasFramePointer(HasFramePointer), FrameOrStackReg(FrameOrStackReg) {} 90 : HasFramePointer(HasFramePointer), FrameOrStackReg(FrameOrStackReg) {}
83 explicit TargetInfo(const TargetLowering *Target) 91 explicit TargetInfo(const TargetLowering *Target)
84 : HasFramePointer(Target->hasFramePointer()), 92 : HasFramePointer(Target->hasFramePointer()),
85 FrameOrStackReg(Target->getFrameOrStackReg()) {} 93 FrameOrStackReg(Target->getFrameOrStackReg()) {}
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 400
393 void vldrs(const Operand *OpSd, const Operand *OpAddress, 401 void vldrs(const Operand *OpSd, const Operand *OpAddress,
394 CondARM32::Cond Cond, const TargetInfo &TInfo); 402 CondARM32::Cond Cond, const TargetInfo &TInfo);
395 403
396 void vldrs(const Operand *OpSd, const Operand *OpAddress, 404 void vldrs(const Operand *OpSd, const Operand *OpAddress,
397 CondARM32::Cond Cond, const TargetLowering *Lowering) { 405 CondARM32::Cond Cond, const TargetLowering *Lowering) {
398 const TargetInfo TInfo(Lowering); 406 const TargetInfo TInfo(Lowering);
399 vldrs(OpSd, OpAddress, Cond, TInfo); 407 vldrs(OpSd, OpAddress, Cond, TInfo);
400 } 408 }
401 409
410 // ElmtSize = #bits in vector element.
411 void vld1qr(size_t ElmtSize, const Operand *OpQd, const Operand *OpRn,
412 const TargetInfo &TInfo);
413
414 void vld1qr(size_t ElmtSize, const Operand *OpQd, const Operand *OpRn,
415 const TargetLowering *Lowering) {
416 const TargetInfo TInfo(Lowering);
417 vld1qr(ElmtSize, OpQd, OpRn, TInfo);
418 }
419
402 void vmovd(const Operand *OpDn, const OperandARM32FlexFpImm *OpFpImm, 420 void vmovd(const Operand *OpDn, const OperandARM32FlexFpImm *OpFpImm,
403 CondARM32::Cond Cond); 421 CondARM32::Cond Cond);
404 422
405 void vmovdd(const Operand *OpDd, const Variable *OpDm, CondARM32::Cond Cond); 423 void vmovdd(const Operand *OpDd, const Variable *OpDm, CondARM32::Cond Cond);
406 424
407 void vmovdrr(const Operand *OpDm, const Operand *OpRt, const Operand *OpRt2, 425 void vmovdrr(const Operand *OpDm, const Operand *OpRt, const Operand *OpRt2,
408 CondARM32::Cond Cond); 426 CondARM32::Cond Cond);
409 427
410 void vmovrrd(const Operand *OpRt, const Operand *OpRt2, const Operand *OpDm, 428 void vmovrrd(const Operand *OpRt, const Operand *OpRt2, const Operand *OpDm,
411 CondARM32::Cond Cond); 429 CondARM32::Cond Cond);
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 488
471 void vstrs(const Operand *OpSd, const Operand *OpAddress, 489 void vstrs(const Operand *OpSd, const Operand *OpAddress,
472 CondARM32::Cond Cond, const TargetInfo &TInfo); 490 CondARM32::Cond Cond, const TargetInfo &TInfo);
473 491
474 void vstrs(const Operand *OpSd, const Operand *OpAddress, 492 void vstrs(const Operand *OpSd, const Operand *OpAddress,
475 CondARM32::Cond Cond, const TargetLowering *Lowering) { 493 CondARM32::Cond Cond, const TargetLowering *Lowering) {
476 const TargetInfo TInfo(Lowering); 494 const TargetInfo TInfo(Lowering);
477 vstrs(OpSd, OpAddress, Cond, TInfo); 495 vstrs(OpSd, OpAddress, Cond, TInfo);
478 } 496 }
479 497
498 // ElmtSize = #bits in vector element.
499 void vst1qr(size_t ElmtSize, const Operand *OpQd, const Operand *OpAddress,
500 const TargetInfo &TInfo);
501
502 void vst1qr(size_t ElmtSize, const Operand *OpQd, const Operand *OpRn,
503 const TargetLowering *Lowering) {
504 const TargetInfo TInfo(Lowering);
505 vst1qr(ElmtSize, OpQd, OpRn, TInfo);
506 }
507
480 void vsubd(const Operand *OpDd, const Operand *OpDn, const Operand *OpDm, 508 void vsubd(const Operand *OpDd, const Operand *OpDn, const Operand *OpDm,
481 CondARM32::Cond Cond); 509 CondARM32::Cond Cond);
482 510
483 // Integer vector subtract. 511 // Integer vector subtract.
484 void vsubqi(Type ElmtTy, const Operand *OpQd, const Operand *OpQm, 512 void vsubqi(Type ElmtTy, const Operand *OpQd, const Operand *OpQm,
485 const Operand *OpQn); 513 const Operand *OpQn);
486 514
487 // Float vector subtract 515 // Float vector subtract
488 void vsubqf(const Operand *OpQd, const Operand *OpQm, const Operand *OpQn); 516 void vsubqf(const Operand *OpQd, const Operand *OpQm, const Operand *OpQn);
489 517
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 const Variable *OpBaseReg, SizeT NumConsecRegs); 622 const Variable *OpBaseReg, SizeT NumConsecRegs);
595 623
596 // Pattern cccc111xxDxxxxxxdddd101xxxMxmmmm where cccc=Cond, ddddD=Sd, 624 // Pattern cccc111xxDxxxxxxdddd101xxxMxmmmm where cccc=Cond, ddddD=Sd,
597 // Mmmmm=Dm, and xx0xxxxxxdddd000xxx0x0000=Opcode. 625 // Mmmmm=Dm, and xx0xxxxxxdddd000xxx0x0000=Opcode.
598 void emitVFPsd(CondARM32::Cond Cond, IValueT Opcode, IValueT Sd, IValueT Dm); 626 void emitVFPsd(CondARM32::Cond Cond, IValueT Opcode, IValueT Sd, IValueT Dm);
599 627
600 // Pattern cccc111xxDxxxxxxdddd101xxxMxmmmm where cccc=Cond, Ddddd=Dd, 628 // Pattern cccc111xxDxxxxxxdddd101xxxMxmmmm where cccc=Cond, Ddddd=Dd,
601 // mmmmM=Sm, and xx0xxxxxxdddd000xxx0x0000=Opcode. 629 // mmmmM=Sm, and xx0xxxxxxdddd000xxx0x0000=Opcode.
602 void emitVFPds(CondARM32::Cond Cond, IValueT Opcode, IValueT Dd, IValueT Sm); 630 void emitVFPds(CondARM32::Cond Cond, IValueT Opcode, IValueT Dd, IValueT Sm);
603 631
632 // Pattern 111100000D00nnnnddddttttssaammmm | Opcode where Ddddd=Dd, nnnn=Rn,
633 // mmmmm=Rm, tttt=NumDRegs, ElmtSize in {8, 16, 32, 64) and defines ss, and
634 // aa=Align.
635 void emitVMem1Op(IValueT Opcode, IValueT Dd, IValueT Rn, IValueT Rm,
636 DRegListSize NumDRegs, size_t ElmtSize, IValueT Align,
637 const char *InstName);
638
604 // Pattern cccc011100x1dddd1111mmmm0001nnn where cccc=Cond, 639 // Pattern cccc011100x1dddd1111mmmm0001nnn where cccc=Cond,
605 // x=Opcode, dddd=Rd, nnnn=Rn, mmmm=Rm. 640 // x=Opcode, dddd=Rd, nnnn=Rn, mmmm=Rm.
606 void emitDivOp(CondARM32::Cond Cond, IValueT Opcode, IValueT Rd, IValueT Rn, 641 void emitDivOp(CondARM32::Cond Cond, IValueT Opcode, IValueT Rd, IValueT Rn,
607 IValueT Rm); 642 IValueT Rm);
608 643
609 // Pattern ccccxxxxxxxfnnnnddddssss1001mmmm where cccc=Cond, dddd=Rd, nnnn=Rn, 644 // Pattern ccccxxxxxxxfnnnnddddssss1001mmmm where cccc=Cond, dddd=Rd, nnnn=Rn,
610 // mmmm=Rm, ssss=Rs, f=SetFlags and xxxxxxx=Opcode. 645 // mmmm=Rm, ssss=Rs, f=SetFlags and xxxxxxx=Opcode.
611 void emitMulOp(CondARM32::Cond Cond, IValueT Opcode, IValueT Rd, IValueT Rn, 646 void emitMulOp(CondARM32::Cond Cond, IValueT Opcode, IValueT Rd, IValueT Rn,
612 IValueT Rm, IValueT Rs, bool SetFlags); 647 IValueT Rm, IValueT Rs, bool SetFlags);
613 648
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 705
671 void emitVFPsss(CondARM32::Cond Cond, IValueT Opcode, const Operand *OpSd, 706 void emitVFPsss(CondARM32::Cond Cond, IValueT Opcode, const Operand *OpSd,
672 const Operand *OpSn, const Operand *OpSm, 707 const Operand *OpSn, const Operand *OpSm,
673 const char *InstName); 708 const char *InstName);
674 }; 709 };
675 710
676 } // end of namespace ARM32 711 } // end of namespace ARM32
677 } // end of namespace Ice 712 } // end of namespace Ice
678 713
679 #endif // SUBZERO_SRC_ICEASSEMBLERARM32_H 714 #endif // SUBZERO_SRC_ICEASSEMBLERARM32_H
OLDNEW
« no previous file with comments | « src/DartARM32/assembler_arm.h ('k') | src/IceAssemblerARM32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698