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
MachineLocation.h
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
MCAsmInfoDarwin.h
MCAsmLayout.h
MCAssembler.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
MCAtom.h
MCCodeEmitter.h
MCCodeGenInfo.h
MCContext.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
MCDirectives.h
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
MCExpr.h This patch introduces initial-exec model support for thread-local storage 2012-12-04 16:18:08 +00:00
MCFixedLenDisassembler.h
MCFixup.h
MCFixupKindInfo.h
MCInst.h
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
MCInstrDesc.h
MCInstrInfo.h
MCInstrItineraries.h
MCLabel.h
MCMachObjectWriter.h
MCMachOSymbolFlags.h
MCModule.h
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
MCTargetAsmLexer.h
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
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
SubtargetFeature.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00