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

Side by Side 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: Fix patch to synch to master Created 5 years, 5 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
OLDNEW
(Empty)
1 //===- subzero/src/IceInstARM32.cpp - ARM32 instruction implementation ----===//
jvoung (off chromium) 2015/07/07 18:02:35 ARM32 -> MIPS32 in two places
reed.kotler 2015/07/07 21:54:54 Done.
2 //
3 // The Subzero Code Generator
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file implements the InstARM32 and OperandARM32 classes,
jvoung (off chromium) 2015/07/07 18:02:34 MIPS32 Also, for doxygen do: """ //===--- /// //
reed.kotler 2015/07/07 21:54:54 Done.
11 // primarily the constructors and the dump()/emit() methods.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #include "IceAssemblerMIPS32.h"
16 #include "IceCfg.h"
17 #include "IceCfgNode.h"
18 #include "IceInst.h"
19 #include "IceInstMIPS32.h"
20 #include "IceOperand.h"
21 #include "IceRegistersMIPS32.h"
22 #include "IceTargetLoweringMIPS32.h"
23
24 namespace Ice {
25
26 namespace {}
jvoung (off chromium) 2015/07/07 18:02:34 Jim had a comment about removing this stray namesp
reed.kotler 2015/07/07 21:54:54 Done.
27
28 InstMIPS32Ret::InstMIPS32Ret(Cfg *Func, Variable *LR, Variable *Source)
jvoung (off chromium) 2015/07/07 18:02:34 LR -> RA
reed.kotler 2015/07/07 21:54:54 Done.
29 : InstMIPS32(Func, InstMIPS32::Ret, Source ? 2 : 1, nullptr) {
30 addSource(LR);
31 if (Source)
32 addSource(Source);
33 }
34
35 void InstMIPS32Ret::emit(const Cfg *Func) const {
36 if (!ALLOW_DUMP)
37 return;
38 assert(getSrcSize() > 0);
39 Variable *LR = llvm::cast<Variable>(getSrc(0));
40 assert(LR->hasReg());
41 assert(LR->getRegNum() == RegMIPS32::Reg_RA);
jvoung (off chromium) 2015/07/07 18:02:34 LR -> RA
reed.kotler 2015/07/07 21:54:54 Done.
42 Ostream &Str = Func->getContext()->getStrEmit();
43 Str << "\t"
44 << "jr $ra"
jvoung (off chromium) 2015/07/07 18:02:34 no need to print "$ra" here as part of "jr $ra" --
reed.kotler 2015/07/07 21:54:54 This is needed for now because emitVariable is not
jvoung (off chromium) 2015/07/08 00:39:11 Okay.
45 << "\t";
46 LR->emit(Func);
47 }
48
49 void InstMIPS32Ret::emitIAS(const Cfg *Func) const {
50 (void)Func;
51 llvm_unreachable("Not yet implemented");
52 }
53
54 void InstMIPS32Ret::dump(const Cfg *Func) const {
55 if (!ALLOW_DUMP)
56 return;
57 Ostream &Str = Func->getContext()->getStrDump();
58 Type Ty = (getSrcSize() == 1 ? IceType_void : getSrc(0)->getType());
59 Str << "ret." << Ty << " ";
60 dumpSources(Func);
61 }
62 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698