| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 Vars = Func->allocateArrayOf<Variable *>(NumVars); | 88 Vars = Func->allocateArrayOf<Variable *>(NumVars); |
| 89 SizeT I = 0; | 89 SizeT I = 0; |
| 90 if (Base) | 90 if (Base) |
| 91 Vars[I++] = Base; | 91 Vars[I++] = Base; |
| 92 if (Index) | 92 if (Index) |
| 93 Vars[I++] = Index; | 93 Vars[I++] = Index; |
| 94 assert(I == NumVars); | 94 assert(I == NumVars); |
| 95 } | 95 } |
| 96 } | 96 } |
| 97 | 97 |
| 98 InstX8632AdjustStack::InstX8632AdjustStack(Cfg *Func, SizeT Amount) | 98 InstX8632AdjustStack::InstX8632AdjustStack(Cfg *Func, SizeT Amount, |
| 99 : InstX8632(Func, InstX8632::Adjuststack, 0, NULL), Amount(Amount) {} | 99 Variable *Esp) |
| 100 : InstX8632(Func, InstX8632::Adjuststack, 1, Esp), Amount(Amount) { |
| 101 addSource(Esp); |
| 102 } |
| 100 | 103 |
| 101 InstX8632Mul::InstX8632Mul(Cfg *Func, Variable *Dest, Variable *Source1, | 104 InstX8632Mul::InstX8632Mul(Cfg *Func, Variable *Dest, Variable *Source1, |
| 102 Operand *Source2) | 105 Operand *Source2) |
| 103 : InstX8632(Func, InstX8632::Mul, 2, Dest) { | 106 : InstX8632(Func, InstX8632::Mul, 2, Dest) { |
| 104 addSource(Source1); | 107 addSource(Source1); |
| 105 addSource(Source2); | 108 addSource(Source2); |
| 106 } | 109 } |
| 107 | 110 |
| 108 InstX8632Shld::InstX8632Shld(Cfg *Func, Variable *Dest, Variable *Source1, | 111 InstX8632Shld::InstX8632Shld(Cfg *Func, Variable *Dest, Variable *Source1, |
| 109 Variable *Source2) | 112 Variable *Source2) |
| (...skipping 1380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1490 } | 1493 } |
| 1491 } else { | 1494 } else { |
| 1492 // There is only the offset. | 1495 // There is only the offset. |
| 1493 Offset->dump(Func, Str); | 1496 Offset->dump(Func, Str); |
| 1494 } | 1497 } |
| 1495 Str << "]"; | 1498 Str << "]"; |
| 1496 } | 1499 } |
| 1497 | 1500 |
| 1498 void VariableSplit::emit(const Cfg *Func) const { | 1501 void VariableSplit::emit(const Cfg *Func) const { |
| 1499 Ostream &Str = Func->getContext()->getStrEmit(); | 1502 Ostream &Str = Func->getContext()->getStrEmit(); |
| 1500 assert(Var->getLocalUseNode() == NULL || | |
| 1501 Var->getLocalUseNode() == Func->getCurrentNode()); | |
| 1502 assert(!Var->hasReg()); | 1503 assert(!Var->hasReg()); |
| 1503 // The following is copied/adapted from TargetX8632::emitVariable(). | 1504 // The following is copied/adapted from TargetX8632::emitVariable(). |
| 1504 const TargetLowering *Target = Func->getTarget(); | 1505 const TargetLowering *Target = Func->getTarget(); |
| 1505 const Type Ty = IceType_i32; | 1506 const Type Ty = IceType_i32; |
| 1506 Str << TypeX8632Attributes[Ty].WidthString << " [" | 1507 Str << TypeX8632Attributes[Ty].WidthString << " [" |
| 1507 << Target->getRegName(Target->getFrameOrStackReg(), Ty); | 1508 << Target->getRegName(Target->getFrameOrStackReg(), Ty); |
| 1508 int32_t Offset = Var->getStackOffset() + Target->getStackAdjustment(); | 1509 int32_t Offset = Var->getStackOffset() + Target->getStackAdjustment(); |
| 1509 if (Part == High) | 1510 if (Part == High) |
| 1510 Offset += 4; | 1511 Offset += 4; |
| 1511 if (Offset) { | 1512 if (Offset) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1530 } | 1531 } |
| 1531 Str << "("; | 1532 Str << "("; |
| 1532 if (Func) | 1533 if (Func) |
| 1533 Var->dump(Func); | 1534 Var->dump(Func); |
| 1534 else | 1535 else |
| 1535 Var->dump(Str); | 1536 Var->dump(Str); |
| 1536 Str << ")"; | 1537 Str << ")"; |
| 1537 } | 1538 } |
| 1538 | 1539 |
| 1539 } // end of namespace Ice | 1540 } // end of namespace Ice |
| OLD | NEW |