[llvm] r197878 - Use r2 when encoding tls on ppc32. Fixes PR18305.
Roman Divacky
rdivacky at freebsd.org
Sun Dec 22 02:45:37 PST 2013
Author: rdivacky
Date: Sun Dec 22 04:45:37 2013
New Revision: 197878
URL: http://llvm.org/viewvc/llvm-project?rev=197878&view=rev
Log:
Use r2 when encoding tls on ppc32. Fixes PR18305.
Modified:
llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp
Modified: llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp?rev=197878&r1=197877&r2=197878&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp Sun Dec 22 04:45:37 2013
@@ -217,7 +217,8 @@ unsigned PPCMCCodeEmitter::getTLSRegEnco
// 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,
More information about the llvm-commits
mailing list