LLVM 20.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 "NVPTXMCTargetDesc.h"
14#include "NVPTXInstPrinter.h"
15#include "NVPTXMCAsmInfo.h"
16#include "NVPTXTargetStreamer.h"
18#include "llvm/MC/MCInstrInfo.h"
22
23using namespace llvm;
24
25#define GET_INSTRINFO_MC_DESC
26#define ENABLE_INSTR_PREDICATE_VERIFIER
27#include "NVPTXGenInstrInfo.inc"
28
29#define GET_SUBTARGETINFO_MC_DESC
30#include "NVPTXGenSubtargetInfo.inc"
31
32#define GET_REGINFO_MC_DESC
33#include "NVPTXGenRegisterInfo.inc"
34
36 MCInstrInfo *X = new MCInstrInfo();
37 InitNVPTXMCInstrInfo(X);
38 return X;
39}
40
43 // PTX does not have a return address register.
44 InitNVPTXMCRegisterInfo(X, 0);
45 return X;
46}
47
48static MCSubtargetInfo *
50 return createNVPTXMCSubtargetInfoImpl(TT, CPU, /*TuneCPU*/ CPU, FS);
51}
52
54 unsigned SyntaxVariant,
55 const MCAsmInfo &MAI,
56 const MCInstrInfo &MII,
57 const MCRegisterInfo &MRI) {
58 if (SyntaxVariant == 0)
59 return new NVPTXInstPrinter(MAI, MII, MRI);
60 return nullptr;
61}
62
65 MCInstPrinter *) {
66 return new NVPTXAsmTargetStreamer(S);
67}
68
70 return new NVPTXTargetStreamer(S);
71}
72
73// Force static initialization.
76 // Register the MC asm info.
78
79 // Register the MC instruction info.
81
82 // Register the MC register info.
84
85 // Register the MC subtarget info.
87
88 // Register the MCInstPrinter.
90
91 // Register the MCTargetStreamer.
93
94 // Register the MCTargetStreamer.
96 }
97}
unsigned const MachineRegisterInfo * MRI
#define LLVM_EXTERNAL_VISIBILITY
Definition: Compiler.h:128
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
static MCSubtargetInfo * createNVPTXMCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS)
static MCTargetStreamer * createTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &, MCInstPrinter *)
static MCRegisterInfo * createNVPTXMCRegisterInfo(const Triple &TT)
static MCTargetStreamer * createNullTargetStreamer(MCStreamer &S)
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeNVPTXTargetMC()
static MCInstPrinter * createNVPTXMCInstPrinter(const Triple &T, unsigned SyntaxVariant, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI)
static MCInstrInfo * createNVPTXMCInstrInfo()
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:56
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
Definition: MCInstPrinter.h:46
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:26
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Streaming machine code generation interface.
Definition: MCStreamer.h:213
Generic base class for all target subtargets.
Target specific streamer interface.
Definition: MCStreamer.h:94
Implments NVPTX-specific streamer.
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:51
Target - Wrapper for Target specific information.
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
formatted_raw_ostream - A raw_ostream that wraps another one and keeps track of line and column posit...
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
Target & getTheNVPTXTarget64()
Target & getTheNVPTXTarget32()
RegisterMCAsmInfo - Helper template for registering a target assembly info implementation.
static void RegisterMCRegInfo(Target &T, Target::MCRegInfoCtorFnTy Fn)
RegisterMCRegInfo - Register a MCRegisterInfo implementation for the given target.
static void RegisterMCSubtargetInfo(Target &T, Target::MCSubtargetInfoCtorFnTy Fn)
RegisterMCSubtargetInfo - Register a MCSubtargetInfo implementation for the given target.
static void RegisterNullTargetStreamer(Target &T, Target::NullTargetStreamerCtorTy Fn)
static void RegisterMCInstPrinter(Target &T, Target::MCInstPrinterCtorTy Fn)
RegisterMCInstPrinter - Register a MCInstPrinter implementation for the given target.
static void RegisterMCInstrInfo(Target &T, Target::MCInstrInfoCtorFnTy Fn)
RegisterMCInstrInfo - Register a MCInstrInfo implementation for the given target.
static void RegisterAsmTargetStreamer(Target &T, Target::AsmTargetStreamerCtorTy Fn)