| OLD | NEW |
| 1 //===- subzero/src/IceInstX8632.cpp - X86-32 instruction implementation ---===// | 1 //===- subzero/src/IceInstX8632.cpp - X86-32 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 // This file implements the InstX8632 and OperandX8632 classes, | 10 // This file implements the InstX8632 and OperandX8632 classes, |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 addSource(Dest); | 129 addSource(Dest); |
| 130 addSource(Source1); | 130 addSource(Source1); |
| 131 addSource(Source2); | 131 addSource(Source2); |
| 132 } | 132 } |
| 133 | 133 |
| 134 InstX8632Label::InstX8632Label(Cfg *Func, TargetX8632 *Target) | 134 InstX8632Label::InstX8632Label(Cfg *Func, TargetX8632 *Target) |
| 135 : InstX8632(Func, InstX8632::Label, 0, NULL), | 135 : InstX8632(Func, InstX8632::Label, 0, NULL), |
| 136 Number(Target->makeNextLabelNumber()) {} | 136 Number(Target->makeNextLabelNumber()) {} |
| 137 | 137 |
| 138 IceString InstX8632Label::getName(const Cfg *Func) const { | 138 IceString InstX8632Label::getName(const Cfg *Func) const { |
| 139 char buf[30]; | 139 return ".L" + Func->getFunctionName() + "$local$__" + std::to_string(Number); |
| 140 snprintf(buf, llvm::array_lengthof(buf), "%u", Number); | |
| 141 return ".L" + Func->getFunctionName() + "$local$__" + buf; | |
| 142 } | 140 } |
| 143 | 141 |
| 144 InstX8632Br::InstX8632Br(Cfg *Func, const CfgNode *TargetTrue, | 142 InstX8632Br::InstX8632Br(Cfg *Func, const CfgNode *TargetTrue, |
| 145 const CfgNode *TargetFalse, | 143 const CfgNode *TargetFalse, |
| 146 const InstX8632Label *Label, CondX86::BrCond Condition) | 144 const InstX8632Label *Label, CondX86::BrCond Condition) |
| 147 : InstX8632(Func, InstX8632::Br, 0, NULL), Condition(Condition), | 145 : InstX8632(Func, InstX8632::Br, 0, NULL), Condition(Condition), |
| 148 TargetTrue(TargetTrue), TargetFalse(TargetFalse), Label(Label) {} | 146 TargetTrue(TargetTrue), TargetFalse(TargetFalse), Label(Label) {} |
| 149 | 147 |
| 150 bool InstX8632Br::optimizeBranch(const CfgNode *NextNode) { | 148 bool InstX8632Br::optimizeBranch(const CfgNode *NextNode) { |
| 151 // If there is no next block, then there can be no fallthrough to | 149 // If there is no next block, then there can be no fallthrough to |
| (...skipping 2724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2876 } | 2874 } |
| 2877 Str << "("; | 2875 Str << "("; |
| 2878 if (Func) | 2876 if (Func) |
| 2879 Var->dump(Func); | 2877 Var->dump(Func); |
| 2880 else | 2878 else |
| 2881 Var->dump(Str); | 2879 Var->dump(Str); |
| 2882 Str << ")"; | 2880 Str << ")"; |
| 2883 } | 2881 } |
| 2884 | 2882 |
| 2885 } // end of namespace Ice | 2883 } // end of namespace Ice |
| OLD | NEW |