llvm-6502/test
Bill Schmidt 57ac1f458a This patch implements the general dynamic TLS model for 64-bit PowerPC.
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
  <use address in r3>

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
2012-12-11 20:30:11 +00:00
..
Analysis Optimistically analyse Phi cycles 2012-12-10 23:02:41 +00:00
Archive
Assembler Fast-math test case for bitcode and textual reading/writing 2012-11-27 00:45:08 +00:00
Bindings/Ocaml Move TargetData to DataLayout. 2012-10-08 16:39:34 +00:00
Bitcode Change encoding of instruction operands in bitcode binaries to be relative 2012-10-11 20:20:40 +00:00
BugPoint Fix unexpected passes. These test do work with LTO on linux. I tested both 2012-10-26 02:19:02 +00:00
CodeGen This patch implements the general dynamic TLS model for 64-bit PowerPC. 2012-12-11 20:30:11 +00:00
DebugInfo Refactor out the abbreviation handling into a separate class that 2012-12-10 23:34:43 +00:00
ExecutionEngine llvm/test/ExecutionEngine/MCJIT/lit.local.cfg: ppc32-elf is not ready. 2012-11-20 10:49:01 +00:00
Feature Remove the dependent libraries feature. 2012-11-27 09:55:56 +00:00
FileCheck Fix a bug in FileCheck that wouldn't let define variables as follows: 2012-12-02 16:02:41 +00:00
Instrumentation [msan] Do not store origin for clean values. 2012-12-06 11:41:03 +00:00
Integer Remove the dependent libraries feature. 2012-11-27 09:55:56 +00:00
JitListener Use the 'count' attribute to calculate the upper bound of an array. 2012-12-04 21:34:03 +00:00
Linker Remove the dependent libraries feature. 2012-11-27 09:55:56 +00:00
MC revert the test change 2012-12-11 06:25:18 +00:00
Object numerically sort the symbols, so that the testcase result is uniform 2012-11-13 21:01:11 +00:00
Other Using "not grep" is brittle as the test passes if llvm-as fails. 2012-11-21 14:17:23 +00:00
Scripts Added program header emission 2012-11-16 20:51:32 +00:00
TableGen llvm/test/TableGen: Remove XFAIL:vg_leak in dozen of tests, according to llvm-x86_64-linux-vg_leak. 2012-12-11 13:14:16 +00:00
tools PR10867: Analogue of r169441 for when using external 'sh'. And actually run the test! 2012-12-05 23:15:33 +00:00
Transforms Loop Vectorize: optimize the vectorization of trunc(induction_var). The truncation is now done on scalars. 2012-12-11 18:58:10 +00:00
Unit
Verifier
YAMLParser
CMakeLists.txt Adding tests for the Intel JIT event listener's MCJIT support. 2012-11-21 20:38:26 +00:00
lit.cfg Adding tests for the Intel JIT event listener's MCJIT support. 2012-11-21 20:38:26 +00:00
lit.site.cfg.in Adding tests for the Intel JIT event listener's MCJIT support. 2012-11-21 20:38:26 +00:00
Makefile Drop the address space limit for tests in the makefile build. 2012-12-09 10:34:22 +00:00
Makefile.tests
TestRunner.sh