Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Side by Side Diff: src/IceTargetLoweringX86BaseImpl.h

Issue 1743133002: Subzero: Fix JumpTable lowering on x86-64. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Clean up the test a bit Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | tests_lit/llvm2ice_tests/adv-switch-opt.ll » ('j') | tests_lit/llvm2ice_tests/adv-switch-opt.ll » ('J')

Powered by Google App Engine
This is Rietveld 408576698