Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 //===- subzero/src/IceInstARM32.h - ARM32 machine instructions --*- C++ -*-===// | 1 //===- subzero/src/IceInstARM32.h - ARM32 machine instructions --*- C++ -*-===// |
| 2 // | 2 // |
| 3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 // |
| 10 // This file declares the InstARM32 and OperandARM32 classes and | 10 // This file declares the InstARM32 and OperandARM32 classes and |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 251 class InstARM32 : public InstTarget { | 251 class InstARM32 : public InstTarget { |
| 252 InstARM32() = delete; | 252 InstARM32() = delete; |
| 253 InstARM32(const InstARM32 &) = delete; | 253 InstARM32(const InstARM32 &) = delete; |
| 254 InstARM32 &operator=(const InstARM32 &) = delete; | 254 InstARM32 &operator=(const InstARM32 &) = delete; |
| 255 | 255 |
| 256 public: | 256 public: |
| 257 enum InstKindARM32 { | 257 enum InstKindARM32 { |
| 258 k__Start = Inst::Target, | 258 k__Start = Inst::Target, |
| 259 Adc, | 259 Adc, |
| 260 Add, | 260 Add, |
| 261 Adjuststack, | |
| 261 And, | 262 And, |
| 262 Asr, | 263 Asr, |
| 263 Bic, | 264 Bic, |
| 264 Br, | 265 Br, |
| 265 Call, | 266 Call, |
| 266 Cmp, | 267 Cmp, |
| 267 Eor, | 268 Eor, |
| 268 Ldr, | 269 Ldr, |
| 269 Lsl, | 270 Lsl, |
| 270 Lsr, | 271 Lsr, |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 599 static bool classof(const Inst *Inst) { return isClassof(Inst, Br); } | 600 static bool classof(const Inst *Inst) { return isClassof(Inst, Br); } |
| 600 | 601 |
| 601 private: | 602 private: |
| 602 InstARM32Br(Cfg *Func, const CfgNode *TargetTrue, const CfgNode *TargetFalse, | 603 InstARM32Br(Cfg *Func, const CfgNode *TargetTrue, const CfgNode *TargetFalse, |
| 603 CondARM32::Cond Predicate); | 604 CondARM32::Cond Predicate); |
| 604 ~InstARM32Br() override {} | 605 ~InstARM32Br() override {} |
| 605 const CfgNode *TargetTrue; | 606 const CfgNode *TargetTrue; |
| 606 const CfgNode *TargetFalse; | 607 const CfgNode *TargetFalse; |
| 607 }; | 608 }; |
| 608 | 609 |
| 610 // AdjustStack instruction - subtracts SP by the given amount and | |
| 611 // updates the stack offset during code emission. | |
|
Jim Stichnoth
2015/06/18 19:47:33
It would be helpful to document what appears at fi
jvoung (off chromium)
2015/06/18 21:18:30
Yep -- okay done.
| |
| 612 class InstARM32AdjustStack : public InstARM32 { | |
| 613 InstARM32AdjustStack() = delete; | |
| 614 InstARM32AdjustStack(const InstARM32AdjustStack &) = delete; | |
| 615 InstARM32AdjustStack &operator=(const InstARM32AdjustStack &) = delete; | |
| 616 | |
| 617 public: | |
| 618 static InstARM32AdjustStack *create(Cfg *Func, Variable *SP, SizeT Amount, | |
| 619 Operand *SrcAmount) { | |
| 620 return new (Func->allocate<InstARM32AdjustStack>()) | |
| 621 InstARM32AdjustStack(Func, SP, Amount, SrcAmount); | |
| 622 } | |
| 623 void emit(const Cfg *Func) const override; | |
| 624 void emitIAS(const Cfg *Func) const override; | |
| 625 void dump(const Cfg *Func) const override; | |
| 626 static bool classof(const Inst *Inst) { return isClassof(Inst, Adjuststack); } | |
| 627 | |
| 628 private: | |
| 629 InstARM32AdjustStack(Cfg *Func, Variable *SP, SizeT Amount, | |
| 630 Operand *SrcAmount); | |
| 631 SizeT Amount; | |
|
Jim Stichnoth
2015/06/18 19:47:33
const?
jvoung (off chromium)
2015/06/18 21:18:30
Done.
| |
| 632 }; | |
| 633 | |
| 609 // Call instruction (bl/blx). Arguments should have already been pushed. | 634 // Call instruction (bl/blx). Arguments should have already been pushed. |
| 610 // Technically bl and the register form of blx can be predicated, but we'll | 635 // Technically bl and the register form of blx can be predicated, but we'll |
| 611 // leave that out until needed. | 636 // leave that out until needed. |
| 612 class InstARM32Call : public InstARM32 { | 637 class InstARM32Call : public InstARM32 { |
| 613 InstARM32Call() = delete; | 638 InstARM32Call() = delete; |
| 614 InstARM32Call(const InstARM32Call &) = delete; | 639 InstARM32Call(const InstARM32Call &) = delete; |
| 615 InstARM32Call &operator=(const InstARM32Call &) = delete; | 640 InstARM32Call &operator=(const InstARM32Call &) = delete; |
| 616 | 641 |
| 617 public: | 642 public: |
| 618 static InstARM32Call *create(Cfg *Func, Variable *Dest, Operand *CallTarget) { | 643 static InstARM32Call *create(Cfg *Func, Variable *Dest, Operand *CallTarget) { |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 828 // Declare partial template specializations of emit() methods that | 853 // Declare partial template specializations of emit() methods that |
| 829 // already have default implementations. Without this, there is the | 854 // already have default implementations. Without this, there is the |
| 830 // possibility of ODR violations and link errors. | 855 // possibility of ODR violations and link errors. |
| 831 | 856 |
| 832 template <> void InstARM32Movw::emit(const Cfg *Func) const; | 857 template <> void InstARM32Movw::emit(const Cfg *Func) const; |
| 833 template <> void InstARM32Movt::emit(const Cfg *Func) const; | 858 template <> void InstARM32Movt::emit(const Cfg *Func) const; |
| 834 | 859 |
| 835 } // end of namespace Ice | 860 } // end of namespace Ice |
| 836 | 861 |
| 837 #endif // SUBZERO_SRC_ICEINSTARM32_H | 862 #endif // SUBZERO_SRC_ICEINSTARM32_H |
| OLD | NEW |