Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 //===- subzero/src/IceInst.cpp - High-level instruction implementation ----===// | 1 //===- subzero/src/IceInst.cpp - High-level 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 Inst class, primarily the various | 10 // This file implements the Inst class, primarily the various |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 221 addSource(ByteCount); | 221 addSource(ByteCount); |
| 222 } | 222 } |
| 223 | 223 |
| 224 InstArithmetic::InstArithmetic(Cfg *Func, OpKind Op, Variable *Dest, | 224 InstArithmetic::InstArithmetic(Cfg *Func, OpKind Op, Variable *Dest, |
| 225 Operand *Source1, Operand *Source2) | 225 Operand *Source1, Operand *Source2) |
| 226 : Inst(Func, Inst::Arithmetic, 2, Dest), Op(Op) { | 226 : Inst(Func, Inst::Arithmetic, 2, Dest), Op(Op) { |
| 227 addSource(Source1); | 227 addSource(Source1); |
| 228 addSource(Source2); | 228 addSource(Source2); |
| 229 } | 229 } |
| 230 | 230 |
| 231 const char *InstArithmetic::getOpName(OpKind Op) { | |
| 232 size_t OpIndex = static_cast<size_t>(Op); | |
| 233 return OpIndex < InstArithmeticAttributesSize | |
|
Jim Stichnoth
2014/08/01 18:05:33
Instead of "OpIndex < InstArithmeticAttributesSize
Karl
2014/08/25 17:46:53
Done.
| |
| 234 ? InstArithmeticAttributes[OpIndex].DisplayString : "???"; | |
| 235 } | |
| 236 | |
| 231 bool InstArithmetic::isCommutative() const { | 237 bool InstArithmetic::isCommutative() const { |
| 232 return InstArithmeticAttributes[getOp()].IsCommutative; | 238 return InstArithmeticAttributes[getOp()].IsCommutative; |
| 233 } | 239 } |
| 234 | 240 |
| 235 InstAssign::InstAssign(Cfg *Func, Variable *Dest, Operand *Source) | 241 InstAssign::InstAssign(Cfg *Func, Variable *Dest, Operand *Source) |
| 236 : Inst(Func, Inst::Assign, 1, Dest) { | 242 : Inst(Func, Inst::Assign, 1, Dest) { |
| 237 addSource(Source); | 243 addSource(Source); |
| 238 } | 244 } |
| 239 | 245 |
| 240 // If TargetTrue==TargetFalse, we turn it into an unconditional | 246 // If TargetTrue==TargetFalse, we turn it into an unconditional |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 759 | 765 |
| 760 void InstTarget::dump(const Cfg *Func) const { | 766 void InstTarget::dump(const Cfg *Func) const { |
| 761 Ostream &Str = Func->getContext()->getStrDump(); | 767 Ostream &Str = Func->getContext()->getStrDump(); |
| 762 Str << "[TARGET] "; | 768 Str << "[TARGET] "; |
| 763 Inst::dump(Func); | 769 Inst::dump(Func); |
| 764 } | 770 } |
| 765 | 771 |
| 766 void InstTarget::dumpExtras(const Cfg *Func) const { Inst::dumpExtras(Func); } | 772 void InstTarget::dumpExtras(const Cfg *Func) const { Inst::dumpExtras(Func); } |
| 767 | 773 |
| 768 } // end of namespace Ice | 774 } // end of namespace Ice |
| OLD | NEW |