<feed xmlns='http://www.w3.org/2005/Atom'>
<title>emscripten-fastcomp/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp, branch 1.17.0</title>
<subtitle>LLVM with the emscripten fastcomp javascript backend</subtitle>
<id>https://git.amat.us/emscripten-fastcomp/atom/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp?h=1.17.0</id>
<link rel='self' href='https://git.amat.us/emscripten-fastcomp/atom/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp?h=1.17.0'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/emscripten-fastcomp/'/>
<updated>2013-05-14T18:35:11Z</updated>
<entry>
<title>Merging r181450:</title>
<updated>2013-05-14T18:35:11Z</updated>
<author>
<name>Bill Wendling</name>
<email>isanbard@gmail.com</email>
</author>
<published>2013-05-14T18:35:11Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/emscripten-fastcomp/commit/?id=b1ecefd0b589689cf90b5346678989b997be1de7'/>
<id>urn:sha1:b1ecefd0b589689cf90b5346678989b997be1de7</id>
<content type='text'>
------------------------------------------------------------------------
r181450 | uweigand | 2013-05-08 10:50:07 -0700 (Wed, 08 May 2013) | 16 lines


[PowerPC] Fix regression in generating @ha/@l relocs

The patch I committed as revision 167864 introduced a regression that
causes LLVM to no longer generate appropriate relocs for @ha/@l symbol
references (but fail an assertion instead).

This is fixed here by re-enabling support for the VK_PPC_GAS_HA16/
VK_PPC_GAS_LO16 variant kinds (and their Darwin variants) in
PPCELFObjectWriter.cpp.

Tested by running projects/test-suite in -m32 mode with the integrated
assembler forced on.  A standalone test case will be committed shortly
as well.


------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_33@181816 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
</entry>
<entry>
<title>PowerPC: Support PC-relative fixup_ppc_brcond14.</title>
<updated>2013-04-26T15:38:30Z</updated>
<author>
<name>Ulrich Weigand</name>
<email>ulrich.weigand@de.ibm.com</email>
</author>
<published>2013-04-26T15:38:30Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/emscripten-fastcomp/commit/?id=8ade90930863acf94fbb2ccd91acefcf114c1f3e'/>
<id>urn:sha1:8ade90930863acf94fbb2ccd91acefcf114c1f3e</id>
<content type='text'>
When testing the asm parser, I ran into an error when using a conditional
branch to an external symbol (this doesn't occur in compiler-generated
code) due to missing support in PPCELFObjectWriter::getRelocTypeInner.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180605 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
</entry>
<entry>
<title>PowerPC: Simplify handling of fixups.</title>
<updated>2013-03-26T10:56:47Z</updated>
<author>
<name>Ulrich Weigand</name>
<email>ulrich.weigand@de.ibm.com</email>
</author>
<published>2013-03-26T10:56:47Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/emscripten-fastcomp/commit/?id=65e90c036472380bba160c349412f37128608e1c'/>
<id>urn:sha1:65e90c036472380bba160c349412f37128608e1c</id>
<content type='text'>
MCTargetDesc/PPCMCCodeEmitter.cpp current has code like:

 if (isSVR4ABI() &amp;&amp; is64BitMode())
   Fixups.push_back(MCFixup::Create(0, MO.getExpr(),
                                    (MCFixupKind)PPC::fixup_ppc_toc16));
 else
   Fixups.push_back(MCFixup::Create(0, MO.getExpr(),
                                    (MCFixupKind)PPC::fixup_ppc_lo16));

This is a problem for the asm parser, since it requires knowledge of
the ABI / 64-bit mode to be set up.  However, more fundamentally,
at this point we shouldn't make such distinctions anyway; in an assembler
file, it always ought to be possible to e.g. generate TOC relocations even
when the main ABI is one that doesn't use TOC.

Fortunately, this is actually completely unnecessary; that code was added
to decide whether to generate TOC relocations, but that information is in
fact already encoded in the VariantKind of the underlying symbol.

This commit therefore merges those fixup types into one, and then decides
which relocation to use based on the VariantKind.

No changes in generated code.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178007 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
</entry>
<entry>
<title>Fix missing relocation for TLS addressing peephole optimization.</title>
<updated>2013-02-25T16:44:35Z</updated>
<author>
<name>Bill Schmidt</name>
<email>wschmidt@linux.vnet.ibm.com</email>
</author>
<published>2013-02-25T16:44:35Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/emscripten-fastcomp/commit/?id=fc7695a653323071ec141aee994e4188592ad1f5'/>
<id>urn:sha1:fc7695a653323071ec141aee994e4188592ad1f5</id>
<content type='text'>
Report and fix due to Kai Nacke.  Testcase update by me.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176029 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
</entry>
<entry>
<title>Relocation enablement for PPC DAG postprocessing pass</title>
<updated>2013-02-21T00:05:29Z</updated>
<author>
<name>Bill Schmidt</name>
<email>wschmidt@linux.vnet.ibm.com</email>
</author>
<published>2013-02-21T00:05:29Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/emscripten-fastcomp/commit/?id=06ab2c828a5605abec36eb0d6749940fa6eb7391'/>
<id>urn:sha1:06ab2c828a5605abec36eb0d6749940fa6eb7391</id>
<content type='text'>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175693 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
</entry>
<entry>
<title>PowerPC: Fix eh_frame relocation for PIC </title>
<updated>2013-01-04T19:08:13Z</updated>
<author>
<name>Adhemerval Zanella</name>
<email>azanella@linux.vnet.ibm.com</email>
</author>
<published>2013-01-04T19:08:13Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/emscripten-fastcomp/commit/?id=7b449889e7886b263718b5103538970f287bc37e'/>
<id>urn:sha1:7b449889e7886b263718b5103538970f287bc37e</id>
<content type='text'>
This patch fixes the PPC eh_frame definitions for the personality and 
frame unwinding for PIC objects. It makes PIC build correctly creates
relative relocations in the '.rela.eh_frame' segments and thus avoiding
a text relocation that generates a DT_TEXTREL segments in link phase.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171506 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
</entry>
<entry>
<title>This patch removes some nondeterminism from direct object file output</title>
<updated>2012-12-14T20:28:38Z</updated>
<author>
<name>Bill Schmidt</name>
<email>wschmidt@linux.vnet.ibm.com</email>
</author>
<published>2012-12-14T20:28:38Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/emscripten-fastcomp/commit/?id=d3eb4f46f011f5880e09862559c17f03e38bef39'/>
<id>urn:sha1:d3eb4f46f011f5880e09862559c17f03e38bef39</id>
<content type='text'>
for TLS dynamic models on 64-bit PowerPC ELF.  The default sort routine
for relocations only sorts on the r_offset field; but with TLS, there
can be two relocations with the same r_offset.  For PowerPC, this patch
sorts secondarily on descending r_type, which matches the behavior
expected by the linker.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170237 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
</entry>
<entry>
<title>This patch improves the 64-bit PowerPC InitialExec TLS support by providing</title>
<updated>2012-12-14T17:02:38Z</updated>
<author>
<name>Bill Schmidt</name>
<email>wschmidt@linux.vnet.ibm.com</email>
</author>
<published>2012-12-14T17:02:38Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/emscripten-fastcomp/commit/?id=b453e16855f347e300f1dc0cd0dfbdd65c27b0d2'/>
<id>urn:sha1:b453e16855f347e300f1dc0cd0dfbdd65c27b0d2</id>
<content type='text'>
for a wider range of GOT entries that can hold thread-relative offsets.
This matches the behavior of GCC, which was not documented in the PPC64 TLS
ABI.  The ABI will be updated with the new code sequence.

Former sequence:

  ld 9,x@got@tprel(2)
  add 9,9,x@tls

New sequence:

  addis 9,2,x@got@tprel@ha
  ld 9,x@got@tprel@l(9)
  add 9,9,x@tls

Note that a linker optimization exists to transform the new sequence into
the shorter sequence when appropriate, by replacing the addis with a nop
and modifying the base register and relocation type of the ld.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170209 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
</entry>
<entry>
<title>This patch implements local-dynamic TLS model support for the 64-bit</title>
<updated>2012-12-12T19:29:35Z</updated>
<author>
<name>Bill Schmidt</name>
<email>wschmidt@linux.vnet.ibm.com</email>
</author>
<published>2012-12-12T19:29:35Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/emscripten-fastcomp/commit/?id=349c2787cf9e174c8aa955bf8e3b09a405b2aece'/>
<id>urn:sha1:349c2787cf9e174c8aa955bf8e3b09a405b2aece</id>
<content type='text'>
PowerPC target.  This is the last of the four models, so we now have 
full TLS support.

This is mostly a straightforward extension of the general dynamic model.
I had to use an additional Chain operand to tie ADDIS_DTPREL_HA to the
register copy following ADDI_TLSLD_L; otherwise everything above the
ADDIS_DTPREL_HA appeared dead and was removed.

As before, there are new test cases to test the assembly generation, and
the relocations output during integrated assembly.  The expected code
gen sequence can be read in test/CodeGen/PowerPC/tls-ld.ll.

There are a couple of things I think can be done more efficiently in the
overall TLS code, so there will likely be a clean-up patch forthcoming;
but for now I want to be sure the functionality is in place.

Bill


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170003 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
</entry>
<entry>
<title>This patch implements the general dynamic TLS model for 64-bit PowerPC.</title>
<updated>2012-12-11T20:30:11Z</updated>
<author>
<name>Bill Schmidt</name>
<email>wschmidt@linux.vnet.ibm.com</email>
</author>
<published>2012-12-11T20:30:11Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/emscripten-fastcomp/commit/?id=57ac1f458a754f30cf500410b438fb260f9b8fe5'/>
<id>urn:sha1:57ac1f458a754f30cf500410b438fb260f9b8fe5</id>
<content type='text'>
Given a thread-local symbol x with global-dynamic access, the generated
code to obtain x's address is:

     Instruction                            Relocation            Symbol
  addis ra,r2,x@got@tlsgd@ha           R_PPC64_GOT_TLSGD16_HA       x
  addi  r3,ra,x@got@tlsgd@l            R_PPC64_GOT_TLSGD16_L        x
  bl __tls_get_addr(x@tlsgd)           R_PPC64_TLSGD                x
                                       R_PPC64_REL24           __tls_get_addr
  nop
  &lt;use address in r3&gt;

The implementation borrows from the medium code model work for introducing
special forms of ADDIS and ADDI into the DAG representation.  This is made
slightly more complicated by having to introduce a call to the external
function __tls_get_addr.  Using the full call machinery is overkill and,
more importantly, makes it difficult to add a special relocation.  So I've
introduced another opcode GET_TLS_ADDR to represent the function call, and
surrounded it with register copies to set up the parameter and return value.

Most of the code is pretty straightforward.  I ran into one peculiarity
when I introduced a new PPC opcode BL8_NOP_ELF_TLSGD, which is just like
BL8_NOP_ELF except that it takes another parameter to represent the symbol
("x" above) that requires a relocation on the call.  Something in the 
TblGen machinery causes BL8_NOP_ELF and BL8_NOP_ELF_TLSGD to be treated
identically during the emit phase, so this second operand was never
visited to generate relocations.  This is the reason for the slightly
messy workaround in PPCMCCodeEmitter.cpp:getDirectBrEncoding().

Two new tests are included to demonstrate correct external assembly and
correct generation of relocations using the integrated assembler.

Comments welcome!

Thanks,
Bill


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169910 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
</entry>
</feed>
