| OLD | NEW |
| 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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 CondARM32::Cond Cond); | 317 CondARM32::Cond Cond); |
| 318 | 318 |
| 319 void umull(const Operand *OpRdLo, const Operand *OpRdHi, const Operand *OpRn, | 319 void umull(const Operand *OpRdLo, const Operand *OpRdHi, const Operand *OpRn, |
| 320 const Operand *OpRm, CondARM32::Cond Cond); | 320 const Operand *OpRm, CondARM32::Cond Cond); |
| 321 | 321 |
| 322 // Implements uxtb/uxth depending on type of OpSrc0. | 322 // Implements uxtb/uxth depending on type of OpSrc0. |
| 323 void uxt(const Operand *OpRd, const Operand *OpSrc0, CondARM32::Cond Cond); | 323 void uxt(const Operand *OpRd, const Operand *OpSrc0, CondARM32::Cond Cond); |
| 324 | 324 |
| 325 void vabss(const Operand *OpSd, const Operand *OpSm, CondARM32::Cond Cond); | 325 void vabss(const Operand *OpSd, const Operand *OpSm, CondARM32::Cond Cond); |
| 326 | 326 |
| 327 void vabsd(const Operand *OpSd, const Operand *OpSm, CondARM32::Cond Cond); | 327 void vabsd(const Operand *OpDd, const Operand *OpDm, CondARM32::Cond Cond); |
| 328 |
| 329 void vabsq(const Operand *OpQd, const Operand *OpQm); |
| 328 | 330 |
| 329 void vaddd(const Operand *OpDd, const Operand *OpDn, const Operand *OpDm, | 331 void vaddd(const Operand *OpDd, const Operand *OpDn, const Operand *OpDm, |
| 330 CondARM32::Cond Cond); | 332 CondARM32::Cond Cond); |
| 331 | 333 |
| 332 void vadds(const Operand *OpSd, const Operand *OpSn, const Operand *OpSm, | 334 void vadds(const Operand *OpSd, const Operand *OpSn, const Operand *OpSm, |
| 333 CondARM32::Cond Cond); | 335 CondARM32::Cond Cond); |
| 334 | 336 |
| 335 // Integer vector add. | 337 // Integer vector add. |
| 336 void vaddqi(Type ElmtTy, const Operand *OpQd, const Operand *OpQm, | 338 void vaddqi(Type ElmtTy, const Operand *OpQd, const Operand *OpQm, |
| 337 const Operand *OpQn); | 339 const Operand *OpQn); |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 DA_W = (0 | 0 | 1) << 21, // decrement after with writeback to base | 574 DA_W = (0 | 0 | 1) << 21, // decrement after with writeback to base |
| 573 IA_W = (0 | 4 | 1) << 21, // increment after with writeback to base | 575 IA_W = (0 | 4 | 1) << 21, // increment after with writeback to base |
| 574 DB_W = (8 | 0 | 1) << 21, // decrement before with writeback to base | 576 DB_W = (8 | 0 | 1) << 21, // decrement before with writeback to base |
| 575 IB_W = (8 | 4 | 1) << 21 // increment before with writeback to base | 577 IB_W = (8 | 4 | 1) << 21 // increment before with writeback to base |
| 576 }; | 578 }; |
| 577 | 579 |
| 578 Label *getOrCreateLabel(SizeT Number, LabelVector &Labels); | 580 Label *getOrCreateLabel(SizeT Number, LabelVector &Labels); |
| 579 | 581 |
| 580 void bindCfgNodeLabel(const CfgNode *Node) override; | 582 void bindCfgNodeLabel(const CfgNode *Node) override; |
| 581 | 583 |
| 584 // SIMD encoding for the vector ElmtTy. |
| 585 static IValueT encodeElmtType(Type ElmtTy); |
| 586 |
| 582 void emitInst(IValueT Value) { | 587 void emitInst(IValueT Value) { |
| 583 AssemblerBuffer::EnsureCapacity _(&Buffer); | 588 AssemblerBuffer::EnsureCapacity _(&Buffer); |
| 584 Buffer.emit<IValueT>(Value); | 589 Buffer.emit<IValueT>(Value); |
| 585 } | 590 } |
| 586 | 591 |
| 587 // List of possible checks to apply when calling emitType01() (below). | 592 // List of possible checks to apply when calling emitType01() (below). |
| 588 enum EmitChecks { NoChecks, RdIsPcAndSetFlags }; | 593 enum EmitChecks { NoChecks, RdIsPcAndSetFlags }; |
| 589 | 594 |
| 590 // Pattern cccctttoooosnnnnddddiiiiiiiiiiii where cccc=Cond, ttt=InstType, | 595 // Pattern cccctttoooosnnnnddddiiiiiiiiiiii where cccc=Cond, ttt=InstType, |
| 591 // s=SetFlags, oooo=Opcode, nnnn=Rn, dddd=Rd, iiiiiiiiiiii=imm12 (See ARM | 596 // s=SetFlags, oooo=Opcode, nnnn=Rn, dddd=Rd, iiiiiiiiiiii=imm12 (See ARM |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 const Operand *OpRm, const Operand *OpSrc1, | 696 const Operand *OpRm, const Operand *OpSrc1, |
| 692 const bool SetFlags, const char *InstName); | 697 const bool SetFlags, const char *InstName); |
| 693 | 698 |
| 694 // Implements various forms of signed/unsigned extend value, using pattern | 699 // Implements various forms of signed/unsigned extend value, using pattern |
| 695 // ccccxxxxxxxxnnnnddddrr000111mmmm where cccc=Cond, xxxxxxxx<<20=Opcode, | 700 // ccccxxxxxxxxnnnnddddrr000111mmmm where cccc=Cond, xxxxxxxx<<20=Opcode, |
| 696 // nnnn=Rn, dddd=Rd, rr=Rotation, and mmmm=Rm. | 701 // nnnn=Rn, dddd=Rd, rr=Rotation, and mmmm=Rm. |
| 697 void emitSignExtend(CondARM32::Cond, IValueT Opcode, const Operand *OpRd, | 702 void emitSignExtend(CondARM32::Cond, IValueT Opcode, const Operand *OpRd, |
| 698 const Operand *OpSrc0, const char *InstName); | 703 const Operand *OpSrc0, const char *InstName); |
| 699 | 704 |
| 700 // Implements various forms of vector (SIMD) operations. Implements pattern | 705 // Implements various forms of vector (SIMD) operations. Implements pattern |
| 701 // 111100100Dssnnnndddn0000NQM0mmmm where ss=encodeElmtType(ElmtTy), Dddd=Dd, | 706 // 111100100D00nnnndddn00F0NQM0mmmm where Dddd=Dd, Nnnn=Dn, Mmmm=Dm, |
| 702 // Nnnn=Dn, Mmmm=Dm, Q=UseQRegs, and Opcode is unioned into the pattern. | 707 // Q=UseQRegs, F=IsFloatTy, and Opcode is unioned into the pattern. |
| 708 void emitSIMDBase(IValueT Opcode, IValueT Dd, IValueT Dn, IValueT Dm, |
| 709 bool UseQRegs, bool IsFloatTy); |
| 710 |
| 711 // Same as emitSIMDBase above, except ElmtShift=20 and ElmtSize is computed |
| 712 // from ElmtTy. |
| 703 void emitSIMD(IValueT Opcode, Type ElmtTy, IValueT Dd, IValueT Dn, IValueT Dm, | 713 void emitSIMD(IValueT Opcode, Type ElmtTy, IValueT Dd, IValueT Dn, IValueT Dm, |
| 704 bool UseQRegs); | 714 bool UseQRegs); |
| 705 | 715 |
| 706 // Implements various integer forms of vector (SIMD) operations using Q | 716 // Implements various integer forms of vector (SIMD) operations using Q |
| 707 // registers. Implements pattern 111100100Dssnnn0ddd00000N1M0mmm0 where | 717 // registers. Implements pattern 111100100D00nnn0ddd000F0N1M0mmm0 where |
| 708 // ss=encodeElmtType(ElmtTy), Dddd=Qd, Nnnn=Qn, Mmmm=Qm, and Opcode is unioned | 718 // Dddd=Qd, Nnnn=Qn, Mmmm=Qm, F=IsFloatTy, and Opcode is unioned into the |
| 709 // into the pattern. | 719 // pattern. |
| 720 void emitSIMDqqqBase(IValueT Opcode, const Operand *OpQd, const Operand *OpQn, |
| 721 const Operand *OpQm, bool IsFloatTy, |
| 722 const char *OpcodeName); |
| 723 |
| 724 // Same as emitSIMD above, except ElmtShift=20 and ElmtSize is computed from |
| 725 // ElmtTy. |
| 710 void emitSIMDqqq(IValueT Opcode, Type ElmtTy, const Operand *OpQd, | 726 void emitSIMDqqq(IValueT Opcode, Type ElmtTy, const Operand *OpQd, |
| 711 const Operand *OpQn, const Operand *OpQm, | 727 const Operand *OpQn, const Operand *OpQm, |
| 712 const char *OpcodeName); | 728 const char *OpcodeName); |
| 713 | 729 |
| 714 // Pattern cccctttxxxxnnnn0000iiiiiiiiiiii where cccc=Cond, nnnn=Rn, | 730 // Pattern cccctttxxxxnnnn0000iiiiiiiiiiii where cccc=Cond, nnnn=Rn, |
| 715 // ttt=Instruction type (derived from OpSrc1), iiiiiiiiiiii is derived from | 731 // ttt=Instruction type (derived from OpSrc1), iiiiiiiiiiii is derived from |
| 716 // OpSrc1, and xxxx=Opcode. | 732 // OpSrc1, and xxxx=Opcode. |
| 717 void emitCompareOp(CondARM32::Cond Cond, IValueT Opcode, const Operand *OpRn, | 733 void emitCompareOp(CondARM32::Cond Cond, IValueT Opcode, const Operand *OpRn, |
| 718 const Operand *OpSrc1, const char *CmpName); | 734 const Operand *OpSrc1, const char *CmpName); |
| 719 | 735 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 742 | 758 |
| 743 void emitVFPsss(CondARM32::Cond Cond, IValueT Opcode, const Operand *OpSd, | 759 void emitVFPsss(CondARM32::Cond Cond, IValueT Opcode, const Operand *OpSd, |
| 744 const Operand *OpSn, const Operand *OpSm, | 760 const Operand *OpSn, const Operand *OpSm, |
| 745 const char *InstName); | 761 const char *InstName); |
| 746 }; | 762 }; |
| 747 | 763 |
| 748 } // end of namespace ARM32 | 764 } // end of namespace ARM32 |
| 749 } // end of namespace Ice | 765 } // end of namespace Ice |
| 750 | 766 |
| 751 #endif // SUBZERO_SRC_ICEASSEMBLERARM32_H | 767 #endif // SUBZERO_SRC_ICEASSEMBLERARM32_H |
| OLD | NEW |