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

Side by Side Diff: src/IceInstARM32.h

Issue 1187513006: ARM: Assign "actuals" at call site to the appropriate GPR/stack slot. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: review Created 5 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
« no previous file with comments | « no previous file | src/IceInstARM32.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/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
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
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.
612 class InstARM32AdjustStack : public InstARM32 {
613 InstARM32AdjustStack() = delete;
614 InstARM32AdjustStack(const InstARM32AdjustStack &) = delete;
615 InstARM32AdjustStack &operator=(const InstARM32AdjustStack &) = delete;
616
617 public:
618 // Note: We need both Amount and SrcAmount. If Amount is too large then
619 // it needs to be copied to a register (so SrcAmount could be a register).
620 // However, we also need the numeric Amount for bookkeeping, and it's
621 // hard to pull that from the generic SrcAmount operand.
622 static InstARM32AdjustStack *create(Cfg *Func, Variable *SP, SizeT Amount,
623 Operand *SrcAmount) {
624 return new (Func->allocate<InstARM32AdjustStack>())
625 InstARM32AdjustStack(Func, SP, Amount, SrcAmount);
626 }
627 void emit(const Cfg *Func) const override;
628 void emitIAS(const Cfg *Func) const override;
629 void dump(const Cfg *Func) const override;
630 static bool classof(const Inst *Inst) { return isClassof(Inst, Adjuststack); }
631
632 private:
633 InstARM32AdjustStack(Cfg *Func, Variable *SP, SizeT Amount,
634 Operand *SrcAmount);
635 const SizeT Amount;
636 };
637
609 // Call instruction (bl/blx). Arguments should have already been pushed. 638 // 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 639 // Technically bl and the register form of blx can be predicated, but we'll
611 // leave that out until needed. 640 // leave that out until needed.
612 class InstARM32Call : public InstARM32 { 641 class InstARM32Call : public InstARM32 {
613 InstARM32Call() = delete; 642 InstARM32Call() = delete;
614 InstARM32Call(const InstARM32Call &) = delete; 643 InstARM32Call(const InstARM32Call &) = delete;
615 InstARM32Call &operator=(const InstARM32Call &) = delete; 644 InstARM32Call &operator=(const InstARM32Call &) = delete;
616 645
617 public: 646 public:
618 static InstARM32Call *create(Cfg *Func, Variable *Dest, Operand *CallTarget) { 647 static InstARM32Call *create(Cfg *Func, Variable *Dest, Operand *CallTarget) {
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 // Declare partial template specializations of emit() methods that 857 // Declare partial template specializations of emit() methods that
829 // already have default implementations. Without this, there is the 858 // already have default implementations. Without this, there is the
830 // possibility of ODR violations and link errors. 859 // possibility of ODR violations and link errors.
831 860
832 template <> void InstARM32Movw::emit(const Cfg *Func) const; 861 template <> void InstARM32Movw::emit(const Cfg *Func) const;
833 template <> void InstARM32Movt::emit(const Cfg *Func) const; 862 template <> void InstARM32Movt::emit(const Cfg *Func) const;
834 863
835 } // end of namespace Ice 864 } // end of namespace Ice
836 865
837 #endif // SUBZERO_SRC_ICEINSTARM32_H 866 #endif // SUBZERO_SRC_ICEINSTARM32_H
OLDNEW
« no previous file with comments | « no previous file | src/IceInstARM32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698