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

Side by Side Diff: src/IceInstMIPS32.cpp

Issue 2143243003: SubZero: Correct parenthesis for mem operands with labels in MIPS32 (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 4 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
« no previous file with comments | « src/IceInstMIPS32.h ('k') | no next file » | 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/IceInstMips32.cpp - Mips32 instruction implementation --===// 1 //===- subzero/src/IceInstMips32.cpp - Mips32 instruction implementation --===//
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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 Str << "[MIPS32] "; 274 Str << "[MIPS32] ";
275 Inst::dump(Func); 275 Inst::dump(Func);
276 } 276 }
277 277
278 void OperandMIPS32Mem::emit(const Cfg *Func) const { 278 void OperandMIPS32Mem::emit(const Cfg *Func) const {
279 if (!BuildDefs::dump()) 279 if (!BuildDefs::dump())
280 return; 280 return;
281 Ostream &Str = Func->getContext()->getStrEmit(); 281 Ostream &Str = Func->getContext()->getStrEmit();
282 Operand *Offset = getOffset(); 282 Operand *Offset = getOffset();
283 if (auto *CR = llvm::dyn_cast<ConstantRelocatable>(Offset)) { 283 if (auto *CR = llvm::dyn_cast<ConstantRelocatable>(Offset)) {
284 Str << "(";
284 CR->emitWithoutPrefix(Func->getTarget()); 285 CR->emitWithoutPrefix(Func->getTarget());
286 Str << ")";
285 } else 287 } else
286 Offset->emit(Func); 288 Offset->emit(Func);
287 Str << "("; 289 Str << "(";
288 getBase()->emit(Func); 290 getBase()->emit(Func);
289 Str << ")"; 291 Str << ")";
290 } 292 }
291 293
292 void InstMIPS32::emitUnaryopGPR(const char *Opcode, const InstMIPS32 *Inst, 294 void InstMIPS32::emitUnaryopGPR(const char *Opcode, const InstMIPS32 *Inst,
293 const Cfg *Func) { 295 const Cfg *Func) {
294 if (!BuildDefs::dump()) 296 if (!BuildDefs::dump())
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 getSrc(0)->emit(Func); 675 getSrc(0)->emit(Func);
674 return; 676 return;
675 } 677 }
676 678
677 // stack to stack 679 // stack to stack
678 llvm::report_fatal_error("mov cant copy stack to stack."); 680 llvm::report_fatal_error("mov cant copy stack to stack.");
679 } 681 }
680 682
681 } // end of namespace MIPS32 683 } // end of namespace MIPS32
682 } // end of namespace Ice 684 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceInstMIPS32.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698