LLVM  16.0.0git
PPCMCTargetDesc.cpp
Go to the documentation of this file.
1 //===-- PPCMCTargetDesc.cpp - PowerPC Target Descriptions -----------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file provides PowerPC specific target descriptions.
10 //
11 //===----------------------------------------------------------------------===//
12 
16 #include "PPCELFStreamer.h"
17 #include "PPCTargetStreamer.h"
18 #include "PPCXCOFFStreamer.h"
20 #include "llvm/ADT/SmallPtrSet.h"
21 #include "llvm/ADT/StringRef.h"
22 #include "llvm/ADT/Triple.h"
23 #include "llvm/BinaryFormat/ELF.h"
24 #include "llvm/MC/MCAsmBackend.h"
25 #include "llvm/MC/MCAssembler.h"
26 #include "llvm/MC/MCCodeEmitter.h"
27 #include "llvm/MC/MCContext.h"
28 #include "llvm/MC/MCDwarf.h"
29 #include "llvm/MC/MCELFStreamer.h"
30 #include "llvm/MC/MCExpr.h"
32 #include "llvm/MC/MCInstrInfo.h"
33 #include "llvm/MC/MCObjectWriter.h"
34 #include "llvm/MC/MCRegisterInfo.h"
35 #include "llvm/MC/MCSectionXCOFF.h"
36 #include "llvm/MC/MCStreamer.h"
38 #include "llvm/MC/MCSymbol.h"
39 #include "llvm/MC/MCSymbolELF.h"
40 #include "llvm/MC/MCSymbolXCOFF.h"
41 #include "llvm/MC/TargetRegistry.h"
42 #include "llvm/Support/Casting.h"
43 #include "llvm/Support/CodeGen.h"
47 
48 using namespace llvm;
49 
50 #define GET_INSTRINFO_MC_DESC
51 #define ENABLE_INSTR_PREDICATE_VERIFIER
52 #include "PPCGenInstrInfo.inc"
53 
54 #define GET_SUBTARGETINFO_MC_DESC
55 #include "PPCGenSubtargetInfo.inc"
56 
57 #define GET_REGINFO_MC_DESC
58 #include "PPCGenRegisterInfo.inc"
59 
61 
62 // Pin the vtable to this file.
64 
66  MCInstrInfo *X = new MCInstrInfo();
67  InitPPCMCInstrInfo(X);
68  return X;
69 }
70 
72  bool isPPC64 =
73  (TT.getArch() == Triple::ppc64 || TT.getArch() == Triple::ppc64le);
74  unsigned Flavour = isPPC64 ? 0 : 1;
75  unsigned RA = isPPC64 ? PPC::LR8 : PPC::LR;
76 
78  InitPPCMCRegisterInfo(X, RA, Flavour, Flavour);
79  return X;
80 }
81 
83  StringRef CPU, StringRef FS) {
84  // Set some default feature to MC layer.
85  std::string FullFS = std::string(FS);
86 
87  if (TT.isOSAIX()) {
88  if (!FullFS.empty())
89  FullFS = "+aix," + FullFS;
90  else
91  FullFS = "+aix";
92  }
93 
94  return createPPCMCSubtargetInfoImpl(TT, CPU, /*TuneCPU*/ CPU, FullFS);
95 }
96 
98  const Triple &TheTriple,
99  const MCTargetOptions &Options) {
100  bool isPPC64 = (TheTriple.getArch() == Triple::ppc64 ||
101  TheTriple.getArch() == Triple::ppc64le);
102 
103  MCAsmInfo *MAI;
104  if (TheTriple.isOSBinFormatXCOFF())
105  MAI = new PPCXCOFFMCAsmInfo(isPPC64, TheTriple);
106  else
107  MAI = new PPCELFMCAsmInfo(isPPC64, TheTriple);
108 
109  // Initial state of the frame pointer is R1.
110  unsigned Reg = isPPC64 ? PPC::X1 : PPC::R1;
111  MCCFIInstruction Inst =
112  MCCFIInstruction::cfiDefCfa(nullptr, MRI.getDwarfRegNum(Reg, true), 0);
113  MAI->addInitialFrameState(Inst);
114 
115  return MAI;
116 }
117 
118 static MCStreamer *
120  std::unique_ptr<MCAsmBackend> &&MAB,
121  std::unique_ptr<MCObjectWriter> &&OW,
122  std::unique_ptr<MCCodeEmitter> &&Emitter, bool RelaxAll) {
124  std::move(Emitter));
125 }
126 
128  const Triple &T, MCContext &Context, std::unique_ptr<MCAsmBackend> &&MAB,
129  std::unique_ptr<MCObjectWriter> &&OW,
130  std::unique_ptr<MCCodeEmitter> &&Emitter, bool RelaxAll) {
132  std::move(Emitter));
133 }
134 
135 namespace {
136 
137 class PPCTargetAsmStreamer : public PPCTargetStreamer {
139 
140 public:
141  PPCTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS)
142  : PPCTargetStreamer(S), OS(OS) {}
143 
144  void emitTCEntry(const MCSymbol &S,
145  MCSymbolRefExpr::VariantKind Kind) override {
146  if (const MCSymbolXCOFF *XSym = dyn_cast<MCSymbolXCOFF>(&S)) {
147  MCSymbolXCOFF *TCSym =
148  cast<MCSectionXCOFF>(Streamer.getCurrentSectionOnly())
149  ->getQualNameSymbol();
150  // If the variant kind is VK_PPC_AIX_TLSGDM the entry represents the
151  // region handle for the symbol, we add the relocation specifier @m.
152  // If the variant kind is VK_PPC_AIX_TLSGD the entry represents the
153  // variable offset for the symbol, we add the relocation specifier @gd.
154  if (Kind == MCSymbolRefExpr::VariantKind::VK_PPC_AIX_TLSGD ||
155  Kind == MCSymbolRefExpr::VariantKind::VK_PPC_AIX_TLSGDM)
156  OS << "\t.tc " << TCSym->getName() << "," << XSym->getName() << "@"
157  << MCSymbolRefExpr::getVariantKindName(Kind) << '\n';
158  else
159  OS << "\t.tc " << TCSym->getName() << "," << XSym->getName() << '\n';
160 
161  if (TCSym->hasRename())
162  Streamer.emitXCOFFRenameDirective(TCSym, TCSym->getSymbolTableName());
163  return;
164  }
165 
166  OS << "\t.tc " << S.getName() << "[TC]," << S.getName() << '\n';
167  }
168 
169  void emitMachine(StringRef CPU) override {
170  OS << "\t.machine " << CPU << '\n';
171  }
172 
173  void emitAbiVersion(int AbiVersion) override {
174  OS << "\t.abiversion " << AbiVersion << '\n';
175  }
176 
177  void emitLocalEntry(MCSymbolELF *S, const MCExpr *LocalOffset) override {
178  const MCAsmInfo *MAI = Streamer.getContext().getAsmInfo();
179 
180  OS << "\t.localentry\t";
181  S->print(OS, MAI);
182  OS << ", ";
183  LocalOffset->print(OS, MAI);
184  OS << '\n';
185  }
186 };
187 
188 class PPCTargetELFStreamer : public PPCTargetStreamer {
189 public:
190  PPCTargetELFStreamer(MCStreamer &S) : PPCTargetStreamer(S) {}
191 
192  MCELFStreamer &getStreamer() {
193  return static_cast<MCELFStreamer &>(Streamer);
194  }
195 
196  void emitTCEntry(const MCSymbol &S,
197  MCSymbolRefExpr::VariantKind Kind) override {
198  // Creates a R_PPC64_TOC relocation
199  Streamer.emitValueToAlignment(Align(8));
200  Streamer.emitSymbolValue(&S, 8);
201  }
202 
203  void emitMachine(StringRef CPU) override {
204  // FIXME: Is there anything to do in here or does this directive only
205  // limit the parser?
206  }
207 
208  void emitAbiVersion(int AbiVersion) override {
209  MCAssembler &MCA = getStreamer().getAssembler();
210  unsigned Flags = MCA.getELFHeaderEFlags();
212  Flags |= (AbiVersion & ELF::EF_PPC64_ABI);
213  MCA.setELFHeaderEFlags(Flags);
214  }
215 
216  void emitLocalEntry(MCSymbolELF *S, const MCExpr *LocalOffset) override {
217  MCAssembler &MCA = getStreamer().getAssembler();
218 
219  // encodePPC64LocalEntryOffset will report an error if it cannot
220  // encode LocalOffset.
221  unsigned Encoded = encodePPC64LocalEntryOffset(LocalOffset);
222 
223  unsigned Other = S->getOther();
225  Other |= Encoded;
226  S->setOther(Other);
227 
228  // For GAS compatibility, unless we already saw a .abiversion directive,
229  // set e_flags to indicate ELFv2 ABI.
230  unsigned Flags = MCA.getELFHeaderEFlags();
231  if ((Flags & ELF::EF_PPC64_ABI) == 0)
232  MCA.setELFHeaderEFlags(Flags | 2);
233  }
234 
235  void emitAssignment(MCSymbol *S, const MCExpr *Value) override {
236  auto *Symbol = cast<MCSymbolELF>(S);
237 
238  // When encoding an assignment to set symbol A to symbol B, also copy
239  // the st_other bits encoding the local entry point offset.
240  if (copyLocalEntry(Symbol, Value))
241  UpdateOther.insert(Symbol);
242  else
243  UpdateOther.erase(Symbol);
244  }
245 
246  void finish() override {
247  for (auto *Sym : UpdateOther)
248  if (Sym->isVariable())
249  copyLocalEntry(Sym, Sym->getVariableValue());
250 
251  // Clear the set of symbols that needs to be updated so the streamer can
252  // be reused without issues.
253  UpdateOther.clear();
254  }
255 
256 private:
257  SmallPtrSet<MCSymbolELF *, 32> UpdateOther;
258 
259  bool copyLocalEntry(MCSymbolELF *D, const MCExpr *S) {
260  auto *Ref = dyn_cast<const MCSymbolRefExpr>(S);
261  if (!Ref)
262  return false;
263  const auto &RhsSym = cast<MCSymbolELF>(Ref->getSymbol());
264  unsigned Other = D->getOther();
266  Other |= RhsSym.getOther() & ELF::STO_PPC64_LOCAL_MASK;
267  D->setOther(Other);
268  return true;
269  }
270 
271  unsigned encodePPC64LocalEntryOffset(const MCExpr *LocalOffset) {
272  MCAssembler &MCA = getStreamer().getAssembler();
273  int64_t Offset;
274  if (!LocalOffset->evaluateAsAbsolute(Offset, MCA))
275  MCA.getContext().reportError(LocalOffset->getLoc(),
276  ".localentry expression must be absolute");
277 
278  switch (Offset) {
279  default:
280  MCA.getContext().reportError(
281  LocalOffset->getLoc(), ".localentry expression must be a power of 2");
282  return 0;
283  case 0:
284  return 0;
285  case 1:
286  return 1 << ELF::STO_PPC64_LOCAL_BIT;
287  case 4:
288  case 8:
289  case 16:
290  case 32:
291  case 64:
292  return Log2_32(Offset) << ELF::STO_PPC64_LOCAL_BIT;
293  }
294  }
295 };
296 
297 class PPCTargetMachOStreamer : public PPCTargetStreamer {
298 public:
299  PPCTargetMachOStreamer(MCStreamer &S) : PPCTargetStreamer(S) {}
300 
301  void emitTCEntry(const MCSymbol &S,
302  MCSymbolRefExpr::VariantKind Kind) override {
303  llvm_unreachable("Unknown pseudo-op: .tc");
304  }
305 
306  void emitMachine(StringRef CPU) override {
307  // FIXME: We should update the CPUType, CPUSubType in the Object file if
308  // the new values are different from the defaults.
309  }
310 
311  void emitAbiVersion(int AbiVersion) override {
312  llvm_unreachable("Unknown pseudo-op: .abiversion");
313  }
314 
315  void emitLocalEntry(MCSymbolELF *S, const MCExpr *LocalOffset) override {
316  llvm_unreachable("Unknown pseudo-op: .localentry");
317  }
318 };
319 
320 class PPCTargetXCOFFStreamer : public PPCTargetStreamer {
321 public:
322  PPCTargetXCOFFStreamer(MCStreamer &S) : PPCTargetStreamer(S) {}
323 
324  void emitTCEntry(const MCSymbol &S,
325  MCSymbolRefExpr::VariantKind Kind) override {
326  const MCAsmInfo *MAI = Streamer.getContext().getAsmInfo();
327  const unsigned PointerSize = MAI->getCodePointerSize();
328  Streamer.emitValueToAlignment(Align(PointerSize));
329  Streamer.emitValue(MCSymbolRefExpr::create(&S, Kind, Streamer.getContext()),
330  PointerSize);
331  }
332 
333  void emitMachine(StringRef CPU) override {
334  llvm_unreachable("Machine pseudo-ops are invalid for XCOFF.");
335  }
336 
337  void emitAbiVersion(int AbiVersion) override {
338  llvm_unreachable("ABI-version pseudo-ops are invalid for XCOFF.");
339  }
340 
341  void emitLocalEntry(MCSymbolELF *S, const MCExpr *LocalOffset) override {
342  llvm_unreachable("Local-entry pseudo-ops are invalid for XCOFF.");
343  }
344 };
345 
346 } // end anonymous namespace
347 
350  MCInstPrinter *InstPrint,
351  bool isVerboseAsm) {
352  return new PPCTargetAsmStreamer(S, OS);
353 }
354 
355 static MCTargetStreamer *
357  const Triple &TT = STI.getTargetTriple();
358  if (TT.isOSBinFormatELF())
359  return new PPCTargetELFStreamer(S);
360  if (TT.isOSBinFormatXCOFF())
361  return new PPCTargetXCOFFStreamer(S);
362  return new PPCTargetMachOStreamer(S);
363 }
364 
366  unsigned SyntaxVariant,
367  const MCAsmInfo &MAI,
368  const MCInstrInfo &MII,
369  const MCRegisterInfo &MRI) {
370  return new PPCInstPrinter(MAI, MII, MRI, T);
371 }
372 
373 namespace {
374 
375 class PPCMCInstrAnalysis : public MCInstrAnalysis {
376 public:
377  explicit PPCMCInstrAnalysis(const MCInstrInfo *Info)
378  : MCInstrAnalysis(Info) {}
379 
380  bool evaluateBranch(const MCInst &Inst, uint64_t Addr, uint64_t Size,
381  uint64_t &Target) const override {
382  unsigned NumOps = Inst.getNumOperands();
383  if (NumOps == 0 ||
384  Info->get(Inst.getOpcode()).OpInfo[NumOps - 1].OperandType !=
386  return false;
387  Target = Addr + Inst.getOperand(NumOps - 1).getImm() * Size;
388  return true;
389  }
390 };
391 
392 } // end anonymous namespace
393 
395  return new PPCMCInstrAnalysis(Info);
396 }
397 
401  // Register the MC asm info.
403 
404  // Register the MC instruction info.
406 
407  // Register the MC register info.
409 
410  // Register the MC subtarget info.
412 
413  // Register the MC instruction analyzer.
415 
416  // Register the MC Code Emitter
418 
419  // Register the asm backend.
421 
422  // Register the elf streamer.
424 
425  // Register the XCOFF streamer.
427 
428  // Register the object target streamer.
431 
432  // Register the asm target streamer.
434 
435  // Register the MCInstPrinter.
437  }
438 }
llvm::Check::Size
@ Size
Definition: FileCheck.h:77
llvm::MCAssembler::getELFHeaderEFlags
unsigned getELFHeaderEFlags() const
ELF e_header flags.
Definition: MCAssembler.h:276
llvm::ELF::STO_PPC64_LOCAL_BIT
@ STO_PPC64_LOCAL_BIT
Definition: ELF.h:408
llvm::PPCXCOFFMCAsmInfo
Definition: PPCMCAsmInfo.h:29
MCDwarf.h
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
PPCELFStreamer.h
createPPCMCInstrAnalysis
static MCInstrAnalysis * createPPCMCInstrAnalysis(const MCInstrInfo *Info)
Definition: PPCMCTargetDesc.cpp:394
T
llvm::MCContext
Context object for machine code objects.
Definition: MCContext.h:76
StringRef.h
llvm::MCSymbolXCOFF::getSymbolTableName
StringRef getSymbolTableName() const
Definition: MCSymbolXCOFF.h:60
MCCodeEmitter.h
llvm::Target
Target - Wrapper for Target specific information.
Definition: TargetRegistry.h:149
llvm::MCAsmInfo
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:56
ErrorHandling.h
llvm::X86Disassembler::Reg
Reg
All possible values of the reg field in the ModR/M byte.
Definition: X86DisassemblerDecoder.h:462
llvm::TargetRegistry::RegisterAsmTargetStreamer
static void RegisterAsmTargetStreamer(Target &T, Target::AsmTargetStreamerCtorTy Fn)
Definition: TargetRegistry.h:1037
llvm::TargetRegistry::RegisterMCInstrAnalysis
static void RegisterMCInstrAnalysis(Target &T, Target::MCInstrAnalysisCtorFnTy Fn)
RegisterMCInstrAnalysis - Register a MCInstrAnalysis implementation for the given target.
Definition: TargetRegistry.h:880
llvm::PPCTargetStreamer::~PPCTargetStreamer
~PPCTargetStreamer() override
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
MCAssembler.h
llvm::ELF::EF_PPC64_ABI
@ EF_PPC64_ABI
Definition: ELF.h:403
llvm::Triple::isOSBinFormatXCOFF
bool isOSBinFormatXCOFF() const
Tests whether the OS uses the XCOFF binary format.
Definition: Triple.h:696
llvm::MCAsmInfo::getCodePointerSize
unsigned getCodePointerSize() const
Get the code pointer size in bytes.
Definition: MCAsmInfo.h:550
llvm::SmallPtrSet
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
Definition: SmallPtrSet.h:450
PPCMCAsmInfo.h
llvm::MCInst
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:184
PPCMCTargetDesc.h
llvm::TargetRegistry::RegisterMCInstPrinter
static void RegisterMCInstPrinter(Target &T, Target::MCInstPrinterCtorTy Fn)
RegisterMCInstPrinter - Register a MCInstPrinter implementation for the given target.
Definition: TargetRegistry.h:987
llvm::MCInst::getNumOperands
unsigned getNumOperands() const
Definition: MCInst.h:208
llvm::createPPCXCOFFStreamer
MCXCOFFStreamer * createPPCXCOFFStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > MAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter)
Definition: PPCXCOFFStreamer.cpp:72
MCELFStreamer.h
llvm::MCSymbolELF
Definition: MCSymbolELF.h:14
Context
LLVMContext & Context
Definition: NVVMIntrRange.cpp:66
PPCInstPrinter.h
FormattedStream.h
llvm::getThePPC64LETarget
Target & getThePPC64LETarget()
Definition: PowerPCTargetInfo.cpp:25
llvm::MCStreamer
Streaming machine code generation interface.
Definition: MCStreamer.h:212
Emitter
dxil DXContainer Global Emitter
Definition: DXContainerGlobals.cpp:67
ELF.h
llvm::MCELFStreamer
Definition: MCELFStreamer.h:31
MCAsmBackend.h
llvm::ModRefInfo::Ref
@ Ref
The access may reference the value stored in memory.
llvm::PPCELFMCAsmInfo
Definition: PPCMCAsmInfo.h:22
llvm::MCAssembler::getContext
MCContext & getContext() const
Definition: MCAssembler.h:321
llvm::PPCInstPrinter
Definition: PPCInstPrinter.h:21
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
createPPCMCInstrInfo
static MCInstrInfo * createPPCMCInstrInfo()
Definition: PPCMCTargetDesc.cpp:65
llvm::MCSubtargetInfo::getTargetTriple
const Triple & getTargetTriple() const
Definition: MCSubtargetInfo.h:109
MCSymbolELF.h
MCContext.h
MCInstrInfo.h
llvm::MCOperand::getImm
int64_t getImm() const
Definition: MCInst.h:80
MCSymbol.h
llvm::MCSymbolXCOFF::hasRename
bool hasRename() const
Definition: MCSymbolXCOFF.h:56
llvm::logicalview::LVAttributeKind::Encoded
@ Encoded
llvm::Log2_32
unsigned Log2_32(uint32_t Value)
Return the floor log base 2 of the specified value, -1 if the value is zero.
Definition: MathExtras.h:547
llvm::MCInstrAnalysis
Definition: MCInstrAnalysis.h:30
llvm::Triple::ppc64
@ ppc64
Definition: Triple.h:71
MCSubtargetInfo.h
Options
const char LLVMTargetMachineRef LLVMPassBuilderOptionsRef Options
Definition: PassBuilderBindings.cpp:48
llvm::X86AS::FS
@ FS
Definition: X86.h:200
llvm::MCTargetStreamer
Target specific streamer interface.
Definition: MCStreamer.h:93
SmallPtrSet.h
Info
Analysis containing CSE Info
Definition: CSEInfo.cpp:27
llvm::MCSymbol::getName
StringRef getName() const
getName - Get the symbol name.
Definition: MCSymbol.h:198
llvm::MCOI::OPERAND_PCREL
@ OPERAND_PCREL
Definition: MCInstrDesc.h:62
Align
uint64_t Align
Definition: ELFObjHandler.cpp:82
llvm::Triple::getArch
ArchType getArch() const
Get the parsed architecture type of this triple.
Definition: Triple.h:354
MCSectionXCOFF.h
llvm::RegisterMCAsmInfoFn
RegisterMCAsmInfoFn - Helper template for registering a target assembly info implementation.
Definition: TargetRegistry.h:1177
llvm::MCCFIInstruction
Definition: MCDwarf.h:478
X
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
llvm::MCELFStreamer::emitValueToAlignment
void emitValueToAlignment(Align, int64_t, unsigned, unsigned) override
Emit some number of copies of Value until the byte alignment ByteAlignment is reached.
Definition: MCELFStreamer.cpp:371
createObjectTargetStreamer
static MCTargetStreamer * createObjectTargetStreamer(MCStreamer &S, const MCSubtargetInfo &STI)
Definition: PPCMCTargetDesc.cpp:356
llvm::Triple::ppc64le
@ ppc64le
Definition: Triple.h:72
createPPCMCInstPrinter
static MCInstPrinter * createPPCMCInstPrinter(const Triple &T, unsigned SyntaxVariant, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI)
Definition: PPCMCTargetDesc.cpp:365
llvm::MCAssembler
Definition: MCAssembler.h:73
llvm::TargetRegistry::RegisterMCAsmBackend
static void RegisterMCAsmBackend(Target &T, Target::MCAsmBackendCtorTy Fn)
RegisterMCAsmBackend - Register a MCAsmBackend implementation for the given target.
Definition: TargetRegistry.h:934
llvm::AMDGPU::Hwreg::Offset
Offset
Definition: SIDefines.h:416
llvm::MCSymbolRefExpr::VariantKind
VariantKind
Definition: MCExpr.h:194
uint64_t
D
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
createPPCMCSubtargetInfo
static MCSubtargetInfo * createPPCMCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS)
Definition: PPCMCTargetDesc.cpp:82
llvm::MCInstPrinter
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
Definition: MCInstPrinter.h:43
LLVM_EXTERNAL_VISIBILITY
#define LLVM_EXTERNAL_VISIBILITY
Definition: Compiler.h:127
Addr
uint64_t Addr
Definition: ELFObjHandler.cpp:79
move
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition: README.txt:546
MCSymbolXCOFF.h
PowerPCTargetInfo.h
llvm::TargetRegistry::RegisterObjectTargetStreamer
static void RegisterObjectTargetStreamer(Target &T, Target::ObjectTargetStreamerCtorTy Fn)
Definition: TargetRegistry.h:1043
MCRegisterInfo.h
llvm::MCAssembler::setELFHeaderEFlags
void setELFHeaderEFlags(unsigned Flags)
Definition: MCAssembler.h:277
llvm::formatted_raw_ostream
formatted_raw_ostream - A raw_ostream that wraps another one and keeps track of line and column posit...
Definition: FormattedStream.h:30
PPCXCOFFStreamer.h
llvm::MCContext::reportError
void reportError(SMLoc L, const Twine &Msg)
Definition: MCContext.cpp:1056
llvm::MCCFIInstruction::cfiDefCfa
static MCCFIInstruction cfiDefCfa(MCSymbol *L, unsigned Register, int Offset)
.cfi_def_cfa defines a rule for computing CFA as: take address from Register and add Offset to it.
Definition: MCDwarf.h:532
llvm::MCAsmInfo::addInitialFrameState
void addInitialFrameState(const MCCFIInstruction &Inst)
Definition: MCAsmInfo.cpp:86
RA
SI optimize exec mask operations pre RA
Definition: SIOptimizeExecMaskingPreRA.cpp:71
llvm::TargetRegistry::RegisterMCSubtargetInfo
static void RegisterMCSubtargetInfo(Target &T, Target::MCSubtargetInfoCtorFnTy Fn)
RegisterMCSubtargetInfo - Register a MCSubtargetInfo implementation for the given target.
Definition: TargetRegistry.h:907
llvm::MCTargetOptions
Definition: MCTargetOptions.h:37
llvm::createPPCMCCodeEmitter
MCCodeEmitter * createPPCMCCodeEmitter(const MCInstrInfo &MCII, MCContext &Ctx)
Definition: PPCMCCodeEmitter.cpp:36
Triple.h
llvm::logicalview::LVBinaryType::ELF
@ ELF
MCInstrAnalysis.h
llvm::createPPCELFStreamer
MCELFStreamer * createPPCELFStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > MAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter)
Definition: PPCELFStreamer.cpp:222
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:143
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::MCRegisterInfo
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Definition: MCRegisterInfo.h:135
llvm::PPCTargetStreamer::PPCTargetStreamer
PPCTargetStreamer(MCStreamer &S)
Definition: PPCMCTargetDesc.cpp:60
MRI
unsigned const MachineRegisterInfo * MRI
Definition: AArch64AdvSIMDScalarPass.cpp:105
llvm::ELF::STO_PPC64_LOCAL_MASK
@ STO_PPC64_LOCAL_MASK
Definition: ELF.h:409
llvm::getThePPC64Target
Target & getThePPC64Target()
Definition: PowerPCTargetInfo.cpp:21
MCObjectWriter.h
llvm::TargetRegistry::RegisterMCInstrInfo
static void RegisterMCInstrInfo(Target &T, Target::MCInstrInfoCtorFnTy Fn)
RegisterMCInstrInfo - Register a MCInstrInfo implementation for the given target.
Definition: TargetRegistry.h:874
llvm::TargetRegistry::RegisterMCCodeEmitter
static void RegisterMCCodeEmitter(Target &T, Target::MCCodeEmitterCtorTy Fn)
RegisterMCCodeEmitter - Register a MCCodeEmitter implementation for the given target.
Definition: TargetRegistry.h:1000
llvm::MCInstrInfo
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:26
llvm::TargetRegistry::RegisterMCRegInfo
static void RegisterMCRegInfo(Target &T, Target::MCRegInfoCtorFnTy Fn)
RegisterMCRegInfo - Register a MCRegisterInfo implementation for the given target.
Definition: TargetRegistry.h:894
llvm::TargetRegistry::RegisterELFStreamer
static void RegisterELFStreamer(Target &T, Target::ELFStreamerCtorTy Fn)
Definition: TargetRegistry.h:1012
Casting.h
LLVMInitializePowerPCTargetMC
LLVM_EXTERNAL_VISIBILITY void LLVMInitializePowerPCTargetMC()
Definition: PPCMCTargetDesc.cpp:398
llvm::MCInst::getOpcode
unsigned getOpcode() const
Definition: MCInst.h:198
PPCTargetStreamer.h
llvm::MCSymbolRefExpr::create
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
Definition: MCExpr.h:386
llvm::MCSymbolRefExpr::getVariantKindName
static StringRef getVariantKindName(VariantKind Kind)
Definition: MCExpr.cpp:221
llvm::TargetRegistry::RegisterXCOFFStreamer
static void RegisterXCOFFStreamer(Target &T, Target::XCOFFStreamerCtorTy Fn)
Definition: TargetRegistry.h:1028
llvm::getThePPC32LETarget
Target & getThePPC32LETarget()
Definition: PowerPCTargetInfo.cpp:17
llvm::ARMBuildAttrs::Symbol
@ Symbol
Definition: ARMBuildAttributes.h:83
createPPCMCRegisterInfo
static MCRegisterInfo * createPPCMCRegisterInfo(const Triple &TT)
Definition: PPCMCTargetDesc.cpp:71
CodeGen.h
createPPCMCAsmInfo
static MCAsmInfo * createPPCMCAsmInfo(const MCRegisterInfo &MRI, const Triple &TheTriple, const MCTargetOptions &Options)
Definition: PPCMCTargetDesc.cpp:97
llvm::MCExpr::print
void print(raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const
Definition: MCExpr.cpp:41
llvm::MCSymbolXCOFF
Definition: MCSymbolXCOFF.h:20
llvm::createPPCAsmBackend
MCAsmBackend * createPPCAsmBackend(const Target &T, const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options)
Definition: PPCAsmBackend.cpp:274
MCStreamer.h
llvm::MCInst::getOperand
const MCOperand & getOperand(unsigned i) const
Definition: MCInst.h:206
createAsmTargetStreamer
static MCTargetStreamer * createAsmTargetStreamer(MCStreamer &S, formatted_raw_ostream &OS, MCInstPrinter *InstPrint, bool isVerboseAsm)
Definition: PPCMCTargetDesc.cpp:348
llvm::omp::RTLDependInfoFields::Flags
@ Flags
raw_ostream.h
TargetRegistry.h
MCExpr.h
llvm::PPCTargetStreamer
Definition: PPCTargetStreamer.h:22
llvm::MCSubtargetInfo
Generic base class for all target subtargets.
Definition: MCSubtargetInfo.h:77
llvm::Value
LLVM Value Representation.
Definition: Value.h:74
llvm::MCExpr
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:35
Other
Optional< std::vector< StOtherPiece > > Other
Definition: ELFYAML.cpp:1251
llvm::MCExpr::getLoc
SMLoc getLoc() const
Definition: MCExpr.h:82
llvm::getThePPC32Target
Target & getThePPC32Target()
Definition: PowerPCTargetInfo.cpp:13