Skip to content

Commit

Permalink
Use r2 when encoding tls on ppc32. Fixes PR18305.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197878 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
rdivacky committed Dec 22, 2013
1 parent d1469e0 commit 1a7ebaa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ unsigned PPCMCCodeEmitter::getTLSRegEncoding(const MCInst &MI, unsigned OpNo,
// Return the thread-pointer register's encoding.
Fixups.push_back(MCFixup::Create(0, MO.getExpr(),
(MCFixupKind)PPC::fixup_ppc_nofixup));
return CTX.getRegisterInfo()->getEncodingValue(PPC::X13);
bool isPPC64 = TT.getArch() == Triple::ppc64 || TT.getArch() == Triple::ppc64le;
return CTX.getRegisterInfo()->getEncodingValue(isPPC64 ? PPC::X13 : PPC::R2);
}

unsigned PPCMCCodeEmitter::getTLSCallEncoding(const MCInst &MI, unsigned OpNo,
Expand Down

0 comments on commit 1a7ebaa

Please sign in to comment.