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

Unified Diff: src/IceInstMIPS32.cpp

Issue 1176133004: implement the null function for the Mips32 subzero compiler (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Run clang format 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 side-by-side diff with in-line comments
Download patch
Index: src/IceInstMIPS32.cpp
diff --git a/src/IceInstMIPS32.cpp b/src/IceInstMIPS32.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..4b6e6267bc2c57df2d607a1a601a3104792a9ac2
--- /dev/null
+++ b/src/IceInstMIPS32.cpp
@@ -0,0 +1,62 @@
+//===- subzero/src/IceInstARM32.cpp - ARM32 instruction implementation ----===//
Jim Stichnoth 2015/06/12 18:03:14 MIPS
+//
+// The Subzero Code Generator
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the InstARM32 and OperandARM32 classes,
Jim Stichnoth 2015/06/12 18:03:14 MIPS
+// primarily the constructors and the dump()/emit() methods.
+//
+//===----------------------------------------------------------------------===//
+
+#include "IceAssemblerMIPS32.h"
+#include "IceCfg.h"
+#include "IceCfgNode.h"
+#include "IceInst.h"
+#include "IceInstMIPS32.h"
+#include "IceOperand.h"
+#include "IceRegistersMIPS32.h"
+#include "IceTargetLoweringMIPS32.h"
+
+namespace Ice {
+
+namespace {}
Jim Stichnoth 2015/06/12 18:03:14 remove this?
+
+InstMIPS32Ret::InstMIPS32Ret(Cfg *Func, Variable *LR, Variable *Source)
jvoung (off chromium) 2015/06/12 19:39:12 s/LR/RA/
+ : InstMIPS32(Func, InstMIPS32::Ret, Source ? 2 : 1, nullptr) {
+ addSource(LR);
+ if (Source)
+ addSource(Source);
+}
+
+void InstMIPS32Ret::emit(const Cfg *Func) const {
+ if (!ALLOW_DUMP)
+ return;
+ assert(getSrcSize() > 0);
+ Variable *LR = llvm::cast<Variable>(getSrc(0));
jvoung (off chromium) 2015/06/12 19:39:12 s/LR/RA/
+ assert(LR->hasReg());
+ assert(LR->getRegNum() == RegMIPS32::Reg_RA);
+ Ostream &Str = Func->getContext()->getStrEmit();
+ Str << "\t"
+ << "jr $ra"
+ << "\t";
+ LR->emit(Func);
+}
+
+void InstMIPS32Ret::emitIAS(const Cfg *Func) const {
+ (void)Func;
+ llvm_unreachable("Not yet implemented");
+}
+
+void InstMIPS32Ret::dump(const Cfg *Func) const {
+ if (!ALLOW_DUMP)
+ return;
+ Ostream &Str = Func->getContext()->getStrDump();
+ Type Ty = (getSrcSize() == 1 ? IceType_void : getSrc(0)->getType());
+ Str << "ret." << Ty << " ";
+ dumpSources(Func);
+}
+}
Jim Stichnoth 2015/06/12 18:03:14 // end of namespace Ice (maybe an extra blank line

Powered by Google App Engine
This is Rietveld 408576698