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

Unified Diff: src/IceInstARM32.cpp

Issue 1159013002: Subzero ARM: addProlog/addEpilogue -- share some code with x86. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: typo Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceInstARM32.h ('k') | src/IceInstARM32.def » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInstARM32.cpp
diff --git a/src/IceInstARM32.cpp b/src/IceInstARM32.cpp
index 713df3a7db596fa28b3fea9d455250c5a9446d99..424acf046aa9d9eb791e795a6a03578e2f95b275 100644
--- a/src/IceInstARM32.cpp
+++ b/src/IceInstARM32.cpp
@@ -260,6 +260,20 @@ InstARM32Mla::InstARM32Mla(Cfg *Func, Variable *Dest, Variable *Src0,
addSource(Acc);
}
+InstARM32Pop::InstARM32Pop(Cfg *Func, const VarList &Dests)
+ : InstARM32(Func, InstARM32::Pop, 0, nullptr), Dests(Dests) {
+ // Track modifications to Dests separately via FakeDefs.
+ // Also, a pop instruction affects the stack pointer and so it should not
+ // be allowed to be automatically dead-code eliminated. This is automatic
+ // since we leave the Dest as nullptr.
+}
+
+InstARM32Push::InstARM32Push(Cfg *Func, const VarList &Srcs)
+ : InstARM32(Func, InstARM32::Push, Srcs.size(), nullptr) {
+ for (Variable *Source : Srcs)
+ addSource(Source);
+}
+
InstARM32Ret::InstARM32Ret(Cfg *Func, Variable *LR, Variable *Source)
: InstARM32(Func, InstARM32::Ret, Source ? 2 : 1, nullptr) {
addSource(LR);
@@ -554,6 +568,66 @@ template <> void InstARM32Movt::emit(const Cfg *Func) const {
}
}
+void InstARM32Pop::emit(const Cfg *Func) const {
+ if (!ALLOW_DUMP)
+ return;
+ assert(Dests.size() > 0);
+ Ostream &Str = Func->getContext()->getStrEmit();
+ Str << "\t"
+ << "pop"
+ << "\t{";
+ for (SizeT I = 0; I < Dests.size(); ++I) {
+ if (I > 0)
+ Str << ", ";
+ Dests[I]->emit(Func);
+ }
+ Str << "}";
+}
+
+void InstARM32Pop::emitIAS(const Cfg *Func) const {
+ (void)Func;
+ llvm_unreachable("Not yet implemented");
+}
+
+void InstARM32Pop::dump(const Cfg *Func) const {
+ if (!ALLOW_DUMP)
+ return;
+ Ostream &Str = Func->getContext()->getStrDump();
+ Str << "pop"
+ << " ";
+ for (SizeT I = 0; I < Dests.size(); ++I) {
+ if (I > 0)
+ Str << ", ";
+ Dests[I]->dump(Func);
+ }
+}
+
+void InstARM32Push::emit(const Cfg *Func) const {
+ if (!ALLOW_DUMP)
+ return;
+ assert(getSrcSize() > 0);
+ Ostream &Str = Func->getContext()->getStrEmit();
+ Str << "\t"
+ << "push"
+ << "\t{";
+ emitSources(Func);
+ Str << "}";
+}
+
+void InstARM32Push::emitIAS(const Cfg *Func) const {
+ (void)Func;
+ llvm_unreachable("Not yet implemented");
+}
+
+void InstARM32Push::dump(const Cfg *Func) const {
+ if (!ALLOW_DUMP)
+ return;
+ Ostream &Str = Func->getContext()->getStrDump();
+ Str << "push"
+ << " ";
+ dumpSources(Func);
+}
+
void InstARM32Ret::emit(const Cfg *Func) const {
if (!ALLOW_DUMP)
return;
@@ -683,7 +757,7 @@ void OperandARM32Mem::dump(const Cfg *Func, Ostream &Str) const {
} else {
getOffset()->dump(Func, Str);
}
- Str << "] AddrMode==" << getAddrMode() << "\n";
+ Str << "] AddrMode==" << getAddrMode();
}
void OperandARM32FlexImm::emit(const Cfg *Func) const {
« no previous file with comments | « src/IceInstARM32.h ('k') | src/IceInstARM32.def » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698