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

Side by Side Diff: src/IceInstARM32.h

Issue 1535233002: Refactor PUSH/POP in ARM assemblers. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Remove "#if 0' Created 5 years 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
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 /// \file 10 /// \file
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 Vsqrt, 421 Vsqrt,
422 Vsub 422 Vsub
423 }; 423 };
424 424
425 static constexpr size_t InstSize = sizeof(uint32_t); 425 static constexpr size_t InstSize = sizeof(uint32_t);
426 426
427 static const char *getWidthString(Type Ty); 427 static const char *getWidthString(Type Ty);
428 static const char *getVecWidthString(Type Ty); 428 static const char *getVecWidthString(Type Ty);
429 static CondARM32::Cond getOppositeCondition(CondARM32::Cond Cond); 429 static CondARM32::Cond getOppositeCondition(CondARM32::Cond Cond);
430 430
431 template <AssemblyOutputForm> void startNextAsmInst(const Cfg *Func) const;
432
431 /// Called inside derived methods emit() to communicate that multiple 433 /// Called inside derived methods emit() to communicate that multiple
432 /// instructions are being generated. Used by emitIAS() methods to 434 /// instructions are being generated. Used by emitIAS() methods to
433 /// generate textual fixups for instructions that are not yet 435 /// generate textual fixups for instructions that are not yet
434 /// implemented. 436 /// implemented.
435 void startNextInst(const Cfg *Func) const; 437 void startNextInst(const Cfg *Func) const;
436 438
437 /// Shared emit routines for common forms of instructions. 439 /// Shared emit routines for common forms of instructions.
438 static void emitThreeAddrFP(const char *Opcode, const InstARM32 *Inst, 440 static void emitThreeAddrFP(const char *Opcode, const InstARM32 *Inst,
439 const Cfg *Func); 441 const Cfg *Func);
440 static void emitFourAddrFP(const char *Opcode, const InstARM32 *Inst, 442 static void emitFourAddrFP(const char *Opcode, const InstARM32 *Inst,
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
1058 /// regs, but not both. In any case, the list must be sorted. 1060 /// regs, but not both. In any case, the list must be sorted.
1059 class InstARM32Pop : public InstARM32 { 1061 class InstARM32Pop : public InstARM32 {
1060 InstARM32Pop() = delete; 1062 InstARM32Pop() = delete;
1061 InstARM32Pop(const InstARM32Pop &) = delete; 1063 InstARM32Pop(const InstARM32Pop &) = delete;
1062 InstARM32Pop &operator=(const InstARM32Pop &) = delete; 1064 InstARM32Pop &operator=(const InstARM32Pop &) = delete;
1063 1065
1064 public: 1066 public:
1065 static InstARM32Pop *create(Cfg *Func, const VarList &Dests) { 1067 static InstARM32Pop *create(Cfg *Func, const VarList &Dests) {
1066 return new (Func->allocate<InstARM32Pop>()) InstARM32Pop(Func, Dests); 1068 return new (Func->allocate<InstARM32Pop>()) InstARM32Pop(Func, Dests);
1067 } 1069 }
1068 void emit(const Cfg *Func) const override; 1070 void emit(const Cfg *Func) const override { assemble<TextualAssembly>(Func); }
1069 void emitIAS(const Cfg *Func) const override; 1071 void emitIAS(const Cfg *Func) const override {
1072 assemble<BinaryAssembly>(Func);
1073 }
1074 template <AssemblyOutputForm> void assemble(const Cfg *Func) const;
1070 void dump(const Cfg *Func) const override; 1075 void dump(const Cfg *Func) const override;
1071 static bool classof(const Inst *Inst) { return isClassof(Inst, Pop); } 1076 static bool classof(const Inst *Inst) { return isClassof(Inst, Pop); }
1072 1077
1073 private: 1078 private:
1074 InstARM32Pop(Cfg *Func, const VarList &Dests); 1079 InstARM32Pop(Cfg *Func, const VarList &Dests);
1075 1080
1076 VarList Dests; 1081 VarList Dests;
1077 }; 1082 };
1078 1083
1079 /// Pushes a list of registers. Just like Pop (see above), the list may be of 1084 /// Pushes a list of registers. Just like Pop (see above), the list may be of
1080 /// GPRs, or VFP "s" registers, but not both. 1085 /// GPRs, or VFP "s" registers, but not both.
1081 class InstARM32Push : public InstARM32 { 1086 class InstARM32Push : public InstARM32 {
1082 InstARM32Push() = delete; 1087 InstARM32Push() = delete;
1083 InstARM32Push(const InstARM32Push &) = delete; 1088 InstARM32Push(const InstARM32Push &) = delete;
1084 InstARM32Push &operator=(const InstARM32Push &) = delete; 1089 InstARM32Push &operator=(const InstARM32Push &) = delete;
1085 1090
1086 public: 1091 public:
1087 static InstARM32Push *create(Cfg *Func, const VarList &Srcs) { 1092 static InstARM32Push *create(Cfg *Func, const VarList &Srcs) {
1088 return new (Func->allocate<InstARM32Push>()) InstARM32Push(Func, Srcs); 1093 return new (Func->allocate<InstARM32Push>()) InstARM32Push(Func, Srcs);
1089 } 1094 }
1090 void emit(const Cfg *Func) const override; 1095 void emit(const Cfg *Func) const override { assemble<TextualAssembly>(Func); }
1091 void emitIAS(const Cfg *Func) const override; 1096 void emitIAS(const Cfg *Func) const override {
1097 assemble<BinaryAssembly>(Func);
1098 }
1099 template <AssemblyOutputForm> void assemble(const Cfg *Func) const;
1092 void dump(const Cfg *Func) const override; 1100 void dump(const Cfg *Func) const override;
1093 static bool classof(const Inst *Inst) { return isClassof(Inst, Push); } 1101 static bool classof(const Inst *Inst) { return isClassof(Inst, Push); }
1094 1102
1095 private: 1103 private:
1096 InstARM32Push(Cfg *Func, const VarList &Srcs); 1104 InstARM32Push(Cfg *Func, const VarList &Srcs);
1097 }; 1105 };
1098 1106
1099 /// Ret pseudo-instruction. This is actually a "bx" instruction with an "lr" 1107 /// Ret pseudo-instruction. This is actually a "bx" instruction with an "lr"
1100 /// register operand, but epilogue lowering will search for a Ret instead of a 1108 /// register operand, but epilogue lowering will search for a Ret instead of a
1101 /// generic "bx". This instruction also takes a Source operand (for non-void 1109 /// generic "bx". This instruction also takes a Source operand (for non-void
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
1372 // default implementations. Without this, there is the possibility of ODR 1380 // default implementations. Without this, there is the possibility of ODR
1373 // violations and link errors. 1381 // violations and link errors.
1374 1382
1375 template <> void InstARM32Ldr::emit(const Cfg *Func) const; 1383 template <> void InstARM32Ldr::emit(const Cfg *Func) const;
1376 template <> void InstARM32Movw::emit(const Cfg *Func) const; 1384 template <> void InstARM32Movw::emit(const Cfg *Func) const;
1377 template <> void InstARM32Movt::emit(const Cfg *Func) const; 1385 template <> void InstARM32Movt::emit(const Cfg *Func) const;
1378 1386
1379 } // end of namespace Ice 1387 } // end of namespace Ice
1380 1388
1381 #endif // SUBZERO_SRC_ICEINSTARM32_H 1389 #endif // SUBZERO_SRC_ICEINSTARM32_H
OLDNEW
« src/IceAssemblerARM32.h ('K') | « src/IceAssemblerARM32.cpp ('k') | src/IceInstARM32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698