Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 //===- subzero/src/IceTargetLoweringX86BaseImpl.h - x86 lowering -*- C++ -*-==// | 1 //===- subzero/src/IceTargetLoweringX86BaseImpl.h - x86 lowering -*- C++ -*-==// |
| 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 5835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5846 } | 5846 } |
| 5847 | 5847 |
| 5848 InstJumpTable *JumpTable = Case.getJumpTable(); | 5848 InstJumpTable *JumpTable = Case.getJumpTable(); |
| 5849 Context.insert(JumpTable); | 5849 Context.insert(JumpTable); |
| 5850 | 5850 |
| 5851 // Make sure the index is a register of the same width as the base | 5851 // Make sure the index is a register of the same width as the base |
| 5852 Variable *Index; | 5852 Variable *Index; |
| 5853 const Type PointerType = getPointerType(); | 5853 const Type PointerType = getPointerType(); |
| 5854 if (RangeIndex->getType() != PointerType) { | 5854 if (RangeIndex->getType() != PointerType) { |
| 5855 Index = makeReg(PointerType); | 5855 Index = makeReg(PointerType); |
| 5856 _movzx(Index, RangeIndex); | 5856 if (RangeIndex->getType() == IceType_i64) { |
|
John
2016/02/29 15:34:09
How do you feel about:
if (typeSizeInByes(Pointer
| |
| 5857 assert(Traits::Is64Bit); | |
| 5858 _mov(Index, RangeIndex); // trunc | |
| 5859 } else { | |
| 5860 _movzx(Index, RangeIndex); | |
| 5861 } | |
| 5857 } else { | 5862 } else { |
| 5858 Index = legalizeToReg(RangeIndex); | 5863 Index = legalizeToReg(RangeIndex); |
| 5859 } | 5864 } |
| 5860 | 5865 |
| 5861 constexpr RelocOffsetT RelocOffset = 0; | 5866 constexpr RelocOffsetT RelocOffset = 0; |
| 5862 constexpr bool SuppressMangling = true; | 5867 constexpr bool SuppressMangling = true; |
| 5863 IceString MangledName = Ctx->mangleName(Func->getFunctionName()); | 5868 IceString MangledName = Ctx->mangleName(Func->getFunctionName()); |
| 5864 constexpr Variable *NoBase = nullptr; | 5869 constexpr Variable *NoBase = nullptr; |
| 5865 Constant *Offset = Ctx->getConstantSym( | 5870 Constant *Offset = Ctx->getConstantSym( |
| 5866 RelocOffset, InstJumpTable::makeName(MangledName, JumpTable->getId()), | 5871 RelocOffset, InstJumpTable::makeName(MangledName, JumpTable->getId()), |
| (...skipping 1536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7403 emitGlobal(*Var, SectionSuffix); | 7408 emitGlobal(*Var, SectionSuffix); |
| 7404 } | 7409 } |
| 7405 } | 7410 } |
| 7406 } break; | 7411 } break; |
| 7407 } | 7412 } |
| 7408 } | 7413 } |
| 7409 } // end of namespace X86NAMESPACE | 7414 } // end of namespace X86NAMESPACE |
| 7410 } // end of namespace Ice | 7415 } // end of namespace Ice |
| 7411 | 7416 |
| 7412 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H | 7417 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H |
| OLD | NEW |