| OLD | NEW |
| 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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 "\t"; | 423 "\t"; |
| 424 RA->emit(Func); | 424 RA->emit(Func); |
| 425 } | 425 } |
| 426 | 426 |
| 427 void InstMIPS32Br::emit(const Cfg *Func) const { | 427 void InstMIPS32Br::emit(const Cfg *Func) const { |
| 428 if (!BuildDefs::dump()) | 428 if (!BuildDefs::dump()) |
| 429 return; | 429 return; |
| 430 Ostream &Str = Func->getContext()->getStrEmit(); | 430 Ostream &Str = Func->getContext()->getStrEmit(); |
| 431 Str << "\t" | 431 Str << "\t" |
| 432 "b" << InstMIPS32CondAttributes[Predicate].EmitString << "\t"; | 432 "b" << InstMIPS32CondAttributes[Predicate].EmitString << "\t"; |
| 433 if (Label) { | 433 if (Label != nullptr) { |
| 434 Str << Label->getLabelName(); | 434 getSrc(0)->emit(Func); |
| 435 Str << ", "; |
| 436 getSrc(1)->emit(Func); |
| 437 Str << ", " << Label->getLabelName(); |
| 435 } else { | 438 } else { |
| 436 if (isUnconditionalBranch()) { | 439 if (isUnconditionalBranch()) { |
| 437 Str << getTargetFalse()->getAsmName(); | 440 Str << getTargetFalse()->getAsmName(); |
| 438 } else { | 441 } else { |
| 439 switch (Predicate) { | 442 switch (Predicate) { |
| 440 default: | 443 default: |
| 441 break; | 444 break; |
| 442 case CondMIPS32::EQ: | 445 case CondMIPS32::EQ: |
| 443 case CondMIPS32::NE: { | 446 case CondMIPS32::NE: { |
| 444 getSrc(0)->emit(Func); | 447 getSrc(0)->emit(Func); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 468 } | 471 } |
| 469 } | 472 } |
| 470 | 473 |
| 471 void InstMIPS32Br::dump(const Cfg *Func) const { | 474 void InstMIPS32Br::dump(const Cfg *Func) const { |
| 472 if (!BuildDefs::dump()) | 475 if (!BuildDefs::dump()) |
| 473 return; | 476 return; |
| 474 Ostream &Str = Func->getContext()->getStrDump(); | 477 Ostream &Str = Func->getContext()->getStrDump(); |
| 475 Str << "\t" | 478 Str << "\t" |
| 476 "b" << InstMIPS32CondAttributes[Predicate].EmitString << "\t"; | 479 "b" << InstMIPS32CondAttributes[Predicate].EmitString << "\t"; |
| 477 | 480 |
| 478 if (Label) { | 481 if (Label != nullptr) { |
| 479 Str << Label->getLabelName(); | 482 getSrc(0)->dump(Func); |
| 483 Str << ", "; |
| 484 getSrc(1)->dump(Func); |
| 485 Str << ", " << Label->getLabelName(); |
| 480 } else { | 486 } else { |
| 481 if (isUnconditionalBranch()) { | 487 if (isUnconditionalBranch()) { |
| 482 Str << getTargetFalse()->getAsmName(); | 488 Str << getTargetFalse()->getAsmName(); |
| 483 } else { | 489 } else { |
| 484 dumpSources(Func); | 490 dumpSources(Func); |
| 485 Str << ", "; | 491 Str << ", "; |
| 486 Str << getTargetFalse()->getAsmName(); | 492 Str << getTargetFalse()->getAsmName(); |
| 487 if (getTargetTrue()) { | 493 if (getTargetTrue()) { |
| 488 Str << "\n\t" | 494 Str << "\n\t" |
| 489 << "b" | 495 << "b" |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 738 getSrc(0)->emit(Func); | 744 getSrc(0)->emit(Func); |
| 739 return; | 745 return; |
| 740 } | 746 } |
| 741 | 747 |
| 742 // stack to stack | 748 // stack to stack |
| 743 llvm::report_fatal_error("mov cant copy stack to stack."); | 749 llvm::report_fatal_error("mov cant copy stack to stack."); |
| 744 } | 750 } |
| 745 | 751 |
| 746 } // end of namespace MIPS32 | 752 } // end of namespace MIPS32 |
| 747 } // end of namespace Ice | 753 } // end of namespace Ice |
| OLD | NEW |