LLVM  14.0.0git
NVPTXMCTargetDesc.cpp
Go to the documentation of this file.
1 //===-- NVPTXMCTargetDesc.cpp - NVPTX Target Descriptions -------*- C++ -*-===//
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 NVPTX specific target descriptions.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "NVPTXInstPrinter.h"
14 #include "NVPTXMCAsmInfo.h"
15 #include "NVPTXMCTargetDesc.h"
16 #include "NVPTXTargetStreamer.h"
18 #include "llvm/MC/MCInstrInfo.h"
19 #include "llvm/MC/MCRegisterInfo.h"
22 
23 using namespace llvm;
24 
25 #define GET_INSTRINFO_MC_DESC
26 #include "NVPTXGenInstrInfo.inc"
27 
28 #define GET_SUBTARGETINFO_MC_DESC
29 #include "NVPTXGenSubtargetInfo.inc"
30 
31 #define GET_REGINFO_MC_DESC
32 #include "NVPTXGenRegisterInfo.inc"
33 
35  MCInstrInfo *X = new MCInstrInfo();
36  InitNVPTXMCInstrInfo(X);
37  return X;
38 }
39 
42  // PTX does not have a return address register.
43  InitNVPTXMCRegisterInfo(X, 0);
44  return X;
45 }
46 
47 static MCSubtargetInfo *
49  return createNVPTXMCSubtargetInfoImpl(TT, CPU, /*TuneCPU*/ CPU, FS);
50 }
51 
53  unsigned SyntaxVariant,
54  const MCAsmInfo &MAI,
55  const MCInstrInfo &MII,
56  const MCRegisterInfo &MRI) {
57  if (SyntaxVariant == 0)
58  return new NVPTXInstPrinter(MAI, MII, MRI);
59  return nullptr;
60 }
61 
64  MCInstPrinter *, bool) {
65  return new NVPTXTargetStreamer(S);
66 }
67 
68 // Force static initialization.
71  // Register the MC asm info.
73 
74  // Register the MC instruction info.
76 
77  // Register the MC register info.
79 
80  // Register the MC subtarget info.
82 
83  // Register the MCInstPrinter.
85 
86  // Register the MCTargetStreamer.
88  }
89 }
NVPTXInstPrinter.h
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::Target
Target - Wrapper for Target specific information.
Definition: TargetRegistry.h:137
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
llvm::TargetRegistry::RegisterAsmTargetStreamer
static void RegisterAsmTargetStreamer(Target &T, Target::AsmTargetStreamerCtorTy Fn)
Definition: TargetRegistry.h:972
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:45
NVPTXMCAsmInfo.h
T
#define T
Definition: Mips16ISelLowering.cpp:341
createNVPTXMCInstrInfo
static MCInstrInfo * createNVPTXMCInstrInfo()
Definition: NVPTXMCTargetDesc.cpp:34
NVPTXTargetStreamer.h
llvm::TargetRegistry::RegisterMCInstPrinter
static void RegisterMCInstPrinter(Target &T, Target::MCInstPrinterCtorTy Fn)
RegisterMCInstPrinter - Register a MCInstPrinter implementation for the given target.
Definition: TargetRegistry.h:930
createNVPTXMCSubtargetInfo
static MCSubtargetInfo * createNVPTXMCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS)
Definition: NVPTXMCTargetDesc.cpp:48
NVPTXTargetInfo.h
llvm::MCStreamer
Streaming machine code generation interface.
Definition: MCStreamer.h:199
LLVMInitializeNVPTXTargetMC
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeNVPTXTargetMC()
Definition: NVPTXMCTargetDesc.cpp:69
MCInstrInfo.h
MCSubtargetInfo.h
llvm::MCTargetStreamer
Target specific streamer interface.
Definition: MCStreamer.h:91
llvm::NVPTXInstPrinter
Definition: NVPTXInstPrinter.h:22
X
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
llvm::getTheNVPTXTarget64
Target & getTheNVPTXTarget64()
Definition: NVPTXTargetInfo.cpp:17
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:132
createTargetAsmStreamer
static MCTargetStreamer * createTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &, MCInstPrinter *, bool)
Definition: NVPTXMCTargetDesc.cpp:62
MCRegisterInfo.h
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
llvm::X86AS::FS
@ FS
Definition: X86.h:188
llvm::TargetRegistry::RegisterMCSubtargetInfo
static void RegisterMCSubtargetInfo(Target &T, Target::MCSubtargetInfoCtorFnTy Fn)
RegisterMCSubtargetInfo - Register a MCSubtargetInfo implementation for the given target.
Definition: TargetRegistry.h:850
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::RegisterMCAsmInfo
RegisterMCAsmInfo - Helper template for registering a target assembly info implementation.
Definition: TargetRegistry.h:1077
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
MRI
unsigned const MachineRegisterInfo * MRI
Definition: AArch64AdvSIMDScalarPass.cpp:105
llvm::NVPTXTargetStreamer
Implments NVPTX-specific streamer.
Definition: NVPTXTargetStreamer.h:18
llvm::TargetRegistry::RegisterMCInstrInfo
static void RegisterMCInstrInfo(Target &T, Target::MCInstrInfoCtorFnTy Fn)
RegisterMCInstrInfo - Register a MCInstrInfo implementation for the given target.
Definition: TargetRegistry.h:817
llvm::MCInstrInfo
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:25
llvm::TargetRegistry::RegisterMCRegInfo
static void RegisterMCRegInfo(Target &T, Target::MCRegInfoCtorFnTy Fn)
RegisterMCRegInfo - Register a MCRegisterInfo implementation for the given target.
Definition: TargetRegistry.h:837
NVPTXMCTargetDesc.h
createNVPTXMCRegisterInfo
static MCRegisterInfo * createNVPTXMCRegisterInfo(const Triple &TT)
Definition: NVPTXMCTargetDesc.cpp:40
createNVPTXMCInstPrinter
static MCInstPrinter * createNVPTXMCInstPrinter(const Triple &T, unsigned SyntaxVariant, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI)
Definition: NVPTXMCTargetDesc.cpp:52
TargetRegistry.h
llvm::MCSubtargetInfo
Generic base class for all target subtargets.
Definition: MCSubtargetInfo.h:75
llvm::getTheNVPTXTarget32
Target & getTheNVPTXTarget32()
Definition: NVPTXTargetInfo.cpp:13