| 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 /// \file | 10 /// \file |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 ICEINSTICMP_TABLE | 70 ICEINSTICMP_TABLE |
| 71 #undef X | 71 #undef X |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 } // end of anonymous namespace | 74 } // end of anonymous namespace |
| 75 | 75 |
| 76 Inst::Inst(Cfg *Func, InstKind Kind, SizeT MaxSrcs, Variable *Dest) | 76 Inst::Inst(Cfg *Func, InstKind Kind, SizeT MaxSrcs, Variable *Dest) |
| 77 : Kind(Kind), Number(Func->newInstNumber()), Dest(Dest), MaxSrcs(MaxSrcs), | 77 : Kind(Kind), Number(Func->newInstNumber()), Dest(Dest), MaxSrcs(MaxSrcs), |
| 78 Srcs(Func->allocateArrayOf<Operand *>(MaxSrcs)), LiveRangesEnded(0) {} | 78 Srcs(Func->allocateArrayOf<Operand *>(MaxSrcs)), LiveRangesEnded(0) {} |
| 79 | 79 |
| 80 IceString Inst::getInstName() const { | 80 const char *Inst::getInstName() const { |
| 81 if (!BuildDefs::dump()) | 81 if (!BuildDefs::dump()) |
| 82 return "???"; | 82 return "???"; |
| 83 | 83 |
| 84 switch (Kind) { | 84 switch (Kind) { |
| 85 #define X(InstrKind, name) \ | 85 #define X(InstrKind, name) \ |
| 86 case InstrKind: \ | 86 case InstrKind: \ |
| 87 return name | 87 return name |
| 88 X(Unreachable, "unreachable"); | 88 X(Unreachable, "unreachable"); |
| 89 X(Alloca, "alloca"); | 89 X(Alloca, "alloca"); |
| 90 X(Arithmetic, "arithmetic"); | 90 X(Arithmetic, "arithmetic"); |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 addSource(ByteCount); | 265 addSource(ByteCount); |
| 266 } | 266 } |
| 267 | 267 |
| 268 InstArithmetic::InstArithmetic(Cfg *Func, OpKind Op, Variable *Dest, | 268 InstArithmetic::InstArithmetic(Cfg *Func, OpKind Op, Variable *Dest, |
| 269 Operand *Source1, Operand *Source2) | 269 Operand *Source1, Operand *Source2) |
| 270 : InstHighLevel(Func, Inst::Arithmetic, 2, Dest), Op(Op) { | 270 : InstHighLevel(Func, Inst::Arithmetic, 2, Dest), Op(Op) { |
| 271 addSource(Source1); | 271 addSource(Source1); |
| 272 addSource(Source2); | 272 addSource(Source2); |
| 273 } | 273 } |
| 274 | 274 |
| 275 IceString InstArithmetic::getInstName() const { | 275 const char *InstArithmetic::getInstName() const { |
| 276 if (!BuildDefs::dump()) | 276 if (!BuildDefs::dump()) |
| 277 return "???"; | 277 return "???"; |
| 278 | 278 |
| 279 return InstArithmeticAttributes[getOp()].DisplayString; | 279 return InstArithmeticAttributes[getOp()].DisplayString; |
| 280 } | 280 } |
| 281 | 281 |
| 282 const char *InstArithmetic::getOpName(OpKind Op) { | 282 const char *InstArithmetic::getOpName(OpKind Op) { |
| 283 return Op < InstArithmetic::_num ? InstArithmeticAttributes[Op].DisplayString | 283 return Op < InstArithmetic::_num ? InstArithmeticAttributes[Op].DisplayString |
| 284 : "???"; | 284 : "???"; |
| 285 } | 285 } |
| (...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1011 // upper 32 bits of rax. We need to recognize and preserve these. | 1011 // upper 32 bits of rax. We need to recognize and preserve these. |
| 1012 return true; | 1012 return true; |
| 1013 } | 1013 } |
| 1014 if (!Dest->hasReg() && !SrcVar->hasReg() && | 1014 if (!Dest->hasReg() && !SrcVar->hasReg() && |
| 1015 Dest->getStackOffset() == SrcVar->getStackOffset()) | 1015 Dest->getStackOffset() == SrcVar->getStackOffset()) |
| 1016 return true; | 1016 return true; |
| 1017 return false; | 1017 return false; |
| 1018 } | 1018 } |
| 1019 | 1019 |
| 1020 } // end of namespace Ice | 1020 } // end of namespace Ice |
| OLD | NEW |