| 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 InstMIPS32Br::InstMIPS32Br(Cfg *Func, const CfgNode *TargetTrue, | 193 InstMIPS32Br::InstMIPS32Br(Cfg *Func, const CfgNode *TargetTrue, |
| 194 const CfgNode *TargetFalse, Operand *Src0, | 194 const CfgNode *TargetFalse, Operand *Src0, |
| 195 Operand *Src1, const InstMIPS32Label *Label, | 195 Operand *Src1, const InstMIPS32Label *Label, |
| 196 CondMIPS32::Cond Cond) | 196 CondMIPS32::Cond Cond) |
| 197 : InstMIPS32(Func, InstMIPS32::Br, 2, nullptr), TargetTrue(TargetTrue), | 197 : InstMIPS32(Func, InstMIPS32::Br, 2, nullptr), TargetTrue(TargetTrue), |
| 198 TargetFalse(TargetFalse), Label(Label), Predicate(Cond) { | 198 TargetFalse(TargetFalse), Label(Label), Predicate(Cond) { |
| 199 addSource(Src0); | 199 addSource(Src0); |
| 200 addSource(Src1); | 200 addSource(Src1); |
| 201 } | 201 } |
| 202 | 202 |
| 203 bool InstMIPS32Br::repointEdges(CfgNode *OldNode, CfgNode *NewNode) { |
| 204 bool Found = false; |
| 205 if (TargetFalse == OldNode) { |
| 206 TargetFalse = NewNode; |
| 207 Found = true; |
| 208 } |
| 209 if (TargetTrue == OldNode) { |
| 210 TargetTrue = NewNode; |
| 211 Found = true; |
| 212 } |
| 213 return Found; |
| 214 } |
| 215 |
| 203 InstMIPS32Label::InstMIPS32Label(Cfg *Func, TargetMIPS32 *Target) | 216 InstMIPS32Label::InstMIPS32Label(Cfg *Func, TargetMIPS32 *Target) |
| 204 : InstMIPS32(Func, InstMIPS32::Label, 0, nullptr), | 217 : InstMIPS32(Func, InstMIPS32::Label, 0, nullptr), |
| 205 Number(Target->makeNextLabelNumber()) { | 218 Number(Target->makeNextLabelNumber()) { |
| 206 if (BuildDefs::dump()) { | 219 if (BuildDefs::dump()) { |
| 207 Name = GlobalString::createWithString( | 220 Name = GlobalString::createWithString( |
| 208 Func->getContext(), | 221 Func->getContext(), |
| 209 ".L" + Func->getFunctionName() + "$local$__" + std::to_string(Number)); | 222 ".L" + Func->getFunctionName() + "$local$__" + std::to_string(Number)); |
| 210 } else { | 223 } else { |
| 211 Name = GlobalString::createWithoutString(Func->getContext()); | 224 Name = GlobalString::createWithoutString(Func->getContext()); |
| 212 } | 225 } |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 getSrc(0)->emit(Func); | 688 getSrc(0)->emit(Func); |
| 676 return; | 689 return; |
| 677 } | 690 } |
| 678 | 691 |
| 679 // stack to stack | 692 // stack to stack |
| 680 llvm::report_fatal_error("mov cant copy stack to stack."); | 693 llvm::report_fatal_error("mov cant copy stack to stack."); |
| 681 } | 694 } |
| 682 | 695 |
| 683 } // end of namespace MIPS32 | 696 } // end of namespace MIPS32 |
| 684 } // end of namespace Ice | 697 } // end of namespace Ice |
| OLD | NEW |