LLVM  3.7.0
AMDGPUMCTargetDesc.cpp
Go to the documentation of this file.
1 //===-- AMDGPUMCTargetDesc.cpp - AMDGPU Target Descriptions ---------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 /// \file
11 /// \brief This file provides AMDGPU specific target descriptions.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #include "AMDGPUMCTargetDesc.h"
16 #include "AMDGPUMCAsmInfo.h"
17 #include "AMDGPUTargetStreamer.h"
19 #include "SIDefines.h"
20 #include "llvm/MC/MCCodeGenInfo.h"
21 #include "llvm/MC/MCContext.h"
22 #include "llvm/MC/MCInstrInfo.h"
23 #include "llvm/MC/MCRegisterInfo.h"
24 #include "llvm/MC/MCStreamer.h"
29 
30 using namespace llvm;
31 
32 #define GET_INSTRINFO_MC_DESC
33 #include "AMDGPUGenInstrInfo.inc"
34 
35 #define GET_SUBTARGETINFO_MC_DESC
36 #include "AMDGPUGenSubtargetInfo.inc"
37 
38 #define GET_REGINFO_MC_DESC
39 #include "AMDGPUGenRegisterInfo.inc"
40 
42  MCInstrInfo *X = new MCInstrInfo();
43  InitAMDGPUMCInstrInfo(X);
44  return X;
45 }
46 
49  InitAMDGPUMCRegisterInfo(X, 0);
50  return X;
51 }
52 
53 static MCSubtargetInfo *
55  return createAMDGPUMCSubtargetInfoImpl(TT, CPU, FS);
56 }
57 
61  CodeGenOpt::Level OL) {
62  MCCodeGenInfo *X = new MCCodeGenInfo();
63  X->initMCCodeGenInfo(RM, CM, OL);
64  return X;
65 }
66 
68  unsigned SyntaxVariant,
69  const MCAsmInfo &MAI,
70  const MCInstrInfo &MII,
71  const MCRegisterInfo &MRI) {
72  return new AMDGPUInstPrinter(MAI, MII, MRI);
73 }
74 
77  MCInstPrinter *InstPrint,
78  bool isVerboseAsm) {
79  return new AMDGPUTargetAsmStreamer(S, OS);
80 }
81 
83  MCStreamer &S,
84  const MCSubtargetInfo &STI) {
85  return new AMDGPUTargetELFStreamer(S);
86 }
87 
88 extern "C" void LLVMInitializeAMDGPUTargetMC() {
89  for (Target *T : {&TheAMDGPUTarget, &TheGCNTarget}) {
91 
98  }
99 
100  // R600 specific registration
103 
104  // GCN specific registration
106 
111 }
MCCodeEmitter * createSIMCCodeEmitter(const MCInstrInfo &MCII, const MCRegisterInfo &MRI, MCContext &Ctx)
Target TheGCNTarget
The target for GCN GPUs.
formatted_raw_ostream - A raw_ostream that wraps another one and keeps track of line and column posit...
Target specific streamer interface.
Definition: MCStreamer.h:73
static MCInstrInfo * createAMDGPUMCInstrInfo()
static void RegisterMCInstPrinter(Target &T, Target::MCInstPrinterCtorTy Fn)
RegisterMCInstPrinter - Register a MCInstPrinter implementation for the given target.
static void RegisterAsmTargetStreamer(Target &T, Target::AsmTargetStreamerCtorTy Fn)
Target TheAMDGPUTarget
The target which suports all AMD GPUs.
static MCSubtargetInfo * createAMDGPUMCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS)
MCCodeEmitter * createR600MCCodeEmitter(const MCInstrInfo &MCII, const MCRegisterInfo &MRI, MCContext &Ctx)
static MCRegisterInfo * createAMDGPUMCRegisterInfo(const Triple &TT)
void LLVMInitializeAMDGPUTargetMC()
static MCInstPrinter * createAMDGPUMCInstPrinter(const Triple &T, unsigned SyntaxVariant, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI)
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:58
MCAsmBackend * createAMDGPUAsmBackend(const Target &T, const MCRegisterInfo &MRI, const Triple &TT, StringRef CPU)
static void RegisterMCAsmBackend(Target &T, Target::MCAsmBackendCtorTy Fn)
RegisterMCAsmBackend - Register a MCAsmBackend implementation for the given target.
Streaming machine code generation interface.
Definition: MCStreamer.h:157
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:24
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
static void RegisterMCCodeGenInfo(Target &T, Target::MCCodeGenInfoCtorFnTy Fn)
RegisterMCCodeGenInfo - Register a MCCodeGenInfo implementation for the given target.
static void RegisterMCSubtargetInfo(Target &T, Target::MCSubtargetInfoCtorFnTy Fn)
RegisterMCSubtargetInfo - Register a MCSubtargetInfo implementation for the given target...
static void RegisterObjectTargetStreamer(Target &T, Target::ObjectTargetStreamerCtorTy Fn)
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
RegisterMCAsmInfo - Helper template for registering a target assembly info implementation.
static void RegisterMCCodeEmitter(Target &T, Target::MCCodeEmitterCtorTy Fn)
RegisterMCCodeEmitter - Register a MCCodeEmitter implementation for the given target.
static MCTargetStreamer * createAMDGPUAsmTargetStreamer(MCStreamer &S, formatted_raw_ostream &OS, MCInstPrinter *InstPrint, bool isVerboseAsm)
static void RegisterMCRegInfo(Target &T, Target::MCRegInfoCtorFnTy Fn)
RegisterMCRegInfo - Register a MCRegisterInfo implementation for the given target.
Target - Wrapper for Target specific information.
static MCTargetStreamer * createAMDGPUObjectTargetStreamer(MCStreamer &S, const MCSubtargetInfo &STI)
Provides AMDGPU specific target descriptions.
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
Definition: MCInstPrinter.h:38
void initMCCodeGenInfo(Reloc::Model RM=Reloc::Default, CodeModel::Model CM=CodeModel::Default, CodeGenOpt::Level OL=CodeGenOpt::Default)
static void RegisterMCInstrInfo(Target &T, Target::MCInstrInfoCtorFnTy Fn)
RegisterMCInstrInfo - Register a MCInstrInfo implementation for the given target. ...
MCSubtargetInfo - Generic base class for all target subtargets.
static MCCodeGenInfo * createAMDGPUMCCodeGenInfo(const Triple &TT, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL)
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:40