| OLD | NEW |
| 1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===// | 1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===// |
| 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 TargetLoweringX8632 class, which | 10 // This file implements the TargetLoweringX8632 class, which |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 void TargetX8632::initNodeForLowering(CfgNode *Node) { | 396 void TargetX8632::initNodeForLowering(CfgNode *Node) { |
| 397 FoldingInfo.init(Node); | 397 FoldingInfo.init(Node); |
| 398 FoldingInfo.dump(Func); | 398 FoldingInfo.dump(Func); |
| 399 } | 399 } |
| 400 | 400 |
| 401 TargetX8632::TargetX8632(Cfg *Func) | 401 TargetX8632::TargetX8632(Cfg *Func) |
| 402 : TargetLowering(Func), | 402 : TargetLowering(Func), |
| 403 InstructionSet(static_cast<X86InstructionSet>( | 403 InstructionSet(static_cast<X86InstructionSet>( |
| 404 Func->getContext()->getFlags().getTargetInstructionSet() - | 404 Func->getContext()->getFlags().getTargetInstructionSet() - |
| 405 TargetInstructionSet::X86InstructionSet_Begin)), | 405 TargetInstructionSet::X86InstructionSet_Begin)), |
| 406 IsEbpBasedFrame(false), NeedsStackAlignment(false), FrameSizeLocals(0), | 406 IsEbpBasedFrame(false), NeedsStackAlignment(false), |
| 407 SpillAreaSizeBytes(0) { | 407 SpillAreaSizeBytes(0) { |
| 408 static_assert((X86InstructionSet::End - X86InstructionSet::Begin) == | 408 static_assert((X86InstructionSet::End - X86InstructionSet::Begin) == |
| 409 (TargetInstructionSet::X86InstructionSet_End - | 409 (TargetInstructionSet::X86InstructionSet_End - |
| 410 TargetInstructionSet::X86InstructionSet_Begin), | 410 TargetInstructionSet::X86InstructionSet_Begin), |
| 411 "X86InstructionSet range different from TargetInstructionSet"); | 411 "X86InstructionSet range different from TargetInstructionSet"); |
| 412 // TODO: Don't initialize IntegerRegisters and friends every time. | 412 // TODO: Don't initialize IntegerRegisters and friends every time. |
| 413 // Instead, initialize in some sort of static initializer for the | 413 // Instead, initialize in some sort of static initializer for the |
| 414 // class. | 414 // class. |
| 415 llvm::SmallBitVector IntegerRegisters(RegX8632::Reg_NUM); | 415 llvm::SmallBitVector IntegerRegisters(RegX8632::Reg_NUM); |
| 416 llvm::SmallBitVector IntegerRegistersI8(RegX8632::Reg_NUM); | 416 llvm::SmallBitVector IntegerRegistersI8(RegX8632::Reg_NUM); |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1016 LocalsSize[NodeIndex]; | 1016 LocalsSize[NodeIndex]; |
| 1017 } | 1017 } |
| 1018 } else { | 1018 } else { |
| 1019 NextStackOffset += Increment; | 1019 NextStackOffset += Increment; |
| 1020 } | 1020 } |
| 1021 if (IsEbpBasedFrame) | 1021 if (IsEbpBasedFrame) |
| 1022 Var->setStackOffset(-NextStackOffset); | 1022 Var->setStackOffset(-NextStackOffset); |
| 1023 else | 1023 else |
| 1024 Var->setStackOffset(SpillAreaSizeBytes - NextStackOffset); | 1024 Var->setStackOffset(SpillAreaSizeBytes - NextStackOffset); |
| 1025 } | 1025 } |
| 1026 this->FrameSizeLocals = NextStackOffset - SpillAreaPaddingBytes; | |
| 1027 this->HasComputedFrame = true; | 1026 this->HasComputedFrame = true; |
| 1028 | 1027 |
| 1029 // Assign stack offsets to variables that have been linked to spilled | 1028 // Assign stack offsets to variables that have been linked to spilled |
| 1030 // variables. | 1029 // variables. |
| 1031 for (Variable *Var : VariablesLinkedToSpillSlots) { | 1030 for (Variable *Var : VariablesLinkedToSpillSlots) { |
| 1032 Variable *Linked = (llvm::cast<SpillVariable>(Var))->getLinkedTo(); | 1031 Variable *Linked = (llvm::cast<SpillVariable>(Var))->getLinkedTo(); |
| 1033 Var->setStackOffset(Linked->getStackOffset()); | 1032 Var->setStackOffset(Linked->getStackOffset()); |
| 1034 } | 1033 } |
| 1035 | 1034 |
| 1036 if (ALLOW_DUMP && Func->isVerbose(IceV_Frame)) { | 1035 if (ALLOW_DUMP && Func->isVerbose(IceV_Frame)) { |
| (...skipping 3996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5033 case FT_Asm: | 5032 case FT_Asm: |
| 5034 case FT_Iasm: { | 5033 case FT_Iasm: { |
| 5035 OstreamLocker L(Ctx); | 5034 OstreamLocker L(Ctx); |
| 5036 emitConstantPool<PoolTypeConverter<float>>(Ctx); | 5035 emitConstantPool<PoolTypeConverter<float>>(Ctx); |
| 5037 emitConstantPool<PoolTypeConverter<double>>(Ctx); | 5036 emitConstantPool<PoolTypeConverter<double>>(Ctx); |
| 5038 } break; | 5037 } break; |
| 5039 } | 5038 } |
| 5040 } | 5039 } |
| 5041 | 5040 |
| 5042 } // end of namespace Ice | 5041 } // end of namespace Ice |
| OLD | NEW |