[llvm] r197878 - Use r2 when encoding tls on ppc32. Fixes PR18305.
Rafael EspĂndola
rafael.espindola at gmail.com
Thu Jan 9 12:30:14 PST 2014
testcase?
On 22 December 2013 05:45, Roman Divacky <rdivacky at freebsd.org> wrote:
> 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,
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list