llvm-6502/include/llvm/MC
Bill Schmidt d7802bf0dd This patch introduces initial-exec model support for thread-local storage
on 64-bit PowerPC ELF.

The patch includes code to handle external assembly and MC output with the
integrated assembler.  It intentionally does not support the "old" JIT.

For the initial-exec TLS model, the ABI requires the following to calculate
the address of external thread-local variable x:

 Code sequence            Relocation                  Symbol
  ld 9,x@got@tprel(2)      R_PPC64_GOT_TPREL16_DS      x
  add 9,9,x@tls            R_PPC64_TLS                 x

The register 9 is arbitrary here.  The linker will replace x@got@tprel
with the offset relative to the thread pointer to the generated GOT
entry for symbol x.  It will replace x@tls with the thread-pointer
register (13).

The two test cases verify correct assembly output and relocation output
as just described.

PowerPC-specific selection node variants are added for the two
instructions above:  LD_GOT_TPREL and ADD_TLS.  These are inserted
when an initial-exec global variable is encountered by
PPCTargetLowering::LowerGlobalTLSAddress(), and later lowered to
machine instructions LDgotTPREL and ADD8TLS.  LDgotTPREL is a pseudo
that uses the same LDrs support added for medium code model's LDtocL,
with a different relocation type.

The rest of the processing is straightforward.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169281 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-04 16:18:08 +00:00
..
MCParser Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
EDInstInfo.h Tidy up. Trailing whitespace. 2012-05-11 01:39:13 +00:00
MachineLocation.h Tidy up. Trailing whitespace. 2012-05-11 01:39:13 +00:00
MCAsmBackend.h MachO: direct-to-object attribute for data-in-code markers. 2012-10-01 22:20:54 +00:00
MCAsmInfo.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
MCAsmInfoCOFF.h Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch 2011-12-20 02:50:00 +00:00
MCAsmInfoDarwin.h Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch 2011-12-20 02:50:00 +00:00
MCAsmLayout.h Make headers standalone. 2011-11-14 17:45:03 +00:00
MCAssembler.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
MCAtom.h MCAtom extending methods need to extend the range of the atom as well. 2011-10-10 18:09:38 +00:00
MCCodeEmitter.h Fix Doxygen issues: 2012-09-14 14:57:36 +00:00
MCCodeGenInfo.h Fix typo in comment. 2012-02-17 16:39:47 +00:00
MCContext.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
MCDirectives.h Refactor data-in-code annotations. 2012-05-18 19:12:01 +00:00
MCDisassembler.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
MCDwarf.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
MCELFObjectWriter.h Add 'const' qualifier on member functions not changing its fields. 2012-10-25 18:35:04 +00:00
MCELFSymbolFlags.h sets bit 0 of the function address of thumb function in .symtab 2011-05-16 16:17:21 +00:00
MCExpr.h This patch introduces initial-exec model support for thread-local storage 2012-12-04 16:18:08 +00:00
MCFixedLenDisassembler.h Switch the fixed-length disassembler to be table-driven. 2012-08-14 19:06:05 +00:00
MCFixup.h Convert assert(0) to llvm_unreachable 2012-02-05 22:14:15 +00:00
MCFixupKindInfo.h Tidy up. Trailing whitespace. 2012-05-11 01:39:13 +00:00
MCInst.h Fix Doxygen issues: 2012-09-14 14:57:36 +00:00
MCInstBuilder.h Decouple MCInstBuilder from the streamer per Eli's request. 2012-11-26 18:05:52 +00:00
MCInstPrinter.h Make branch heavy code for generating marked up disassembly simpler 2012-10-23 22:52:52 +00:00
MCInstrAnalysis.h Use the correct predicate for determining if a branch is conditional or not. 2011-10-17 21:21:44 +00:00
MCInstrDesc.h Typo. 2012-09-24 23:04:25 +00:00
MCInstrInfo.h Revert r152202: "Use uint16_t to store InstrNameIndices in MCInstrInfo." 2012-03-15 18:05:57 +00:00
MCInstrItineraries.h I'm introducing a new machine model to simultaneously allow simple 2012-07-07 04:00:00 +00:00
MCLabel.h Fix Doxygen issues: 2012-09-14 14:57:36 +00:00
MCMachObjectWriter.h Fix Doxygen issues: 2012-09-14 14:57:36 +00:00
MCMachOSymbolFlags.h MC/Mach-O/Thumb: Set the thumb bit in the symbol table. 2010-12-29 14:14:06 +00:00
MCModule.h Start stubbing out MCModule and MCAtom, which provide an API for accessing the rich disassembly of a complete object or executable. 2011-09-22 22:32:22 +00:00
MCObjectFileInfo.h Add the rest of the experimental fission sections to MC. 2012-11-30 06:47:06 +00:00
MCObjectStreamer.h Hoist some grossly duplicated code from the COFF/ELF/MachO streamers into MCObjectStreamer. 2012-10-04 13:12:43 +00:00
MCObjectWriter.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
MCRegisterInfo.h Add an MCPhysReg typedef to replace naked uint16_t. 2012-11-29 02:39:28 +00:00
MCSchedule.h misched: TargetSchedule interface for machine resources. 2012-11-06 07:10:38 +00:00
MCSection.h Remove unnecessary classof()'s 2012-10-11 23:30:49 +00:00
MCSectionCOFF.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
MCSectionELF.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
MCSectionMachO.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
MCStreamer.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
MCSubtargetInfo.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
MCSymbol.h Fix Doxygen issues: 2012-09-14 14:57:36 +00:00
MCTargetAsmLexer.h Fix Doxygen issues: 2012-09-14 14:57:36 +00:00
MCTargetAsmParser.h [ms-inline asm] Add support for the TYPE operator. 2012-10-26 18:04:20 +00:00
MCValue.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
MCWin64EH.h Add a parameter to the Win64 EH section getters to get a section with a 2011-05-27 19:09:24 +00:00
MCWinCOFFObjectWriter.h Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
SectionKind.h Trailing whitespace. 2010-07-01 01:00:22 +00:00
SubtargetFeature.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00