LLVM 23.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"
23
24using namespace llvm;
25
26#define GET_INSTRINFO_MC_DESC
27#define GET_INSTRINFO_NAMED_OPS
28#define ENABLE_INSTR_PREDICATE_VERIFIER
29#include "NVPTXGenInstrInfo.inc"
30
31#define GET_SUBTARGETINFO_MC_DESC
32#include "NVPTXGenSubtargetInfo.inc"
33
34#define GET_REGINFO_MC_DESC
35#include "NVPTXGenRegisterInfo.inc"
36
38 MCInstrInfo *X = new MCInstrInfo();
39 InitNVPTXMCInstrInfo(X);
40 return X;
41}
42
45 // PTX does not have a return address register.
46 InitNVPTXMCRegisterInfo(X, 0);
47 return X;
48}
49
50static MCSubtargetInfo *
52 return createNVPTXMCSubtargetInfoImpl(TT, CPU, /*TuneCPU*/ CPU, FS);
53}
54
56 unsigned SyntaxVariant,
57 const MCAsmInfo &MAI,
58 const MCInstrInfo &MII,
59 const MCRegisterInfo &MRI) {
60 if (SyntaxVariant == 0)
61 return new NVPTXInstPrinter(MAI, MII, MRI);
62 return nullptr;
63}
64
70
74
75// Force static initialization.
79 // Register the MC asm info.
81
82 // Register the MC instruction info.
84
85 // Register the MC register info.
87
88 // Register the MC subtarget info.
90
91 // Register the MCInstPrinter.
93
94 // Register the MCTargetStreamer.
96
97 // Register the MCTargetStreamer.
99 }
100}
static MCTargetStreamer * createTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS, MCInstPrinter *InstPrint)
#define X(NUM, ENUM, NAME)
Definition ELF.h:856
#define LLVM_ABI
Definition Compiler.h:215
#define LLVM_EXTERNAL_VISIBILITY
Definition Compiler.h:132
#define T
static MCSubtargetInfo * createNVPTXMCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS)
static MCTargetStreamer * createTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS, MCInstPrinter *)
LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeNVPTXTargetMC()
static MCRegisterInfo * createNVPTXMCRegisterInfo(const Triple &TT)
static MCTargetStreamer * createNullTargetStreamer(MCStreamer &S)
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:66
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
Interface to description of machine instruction set.
Definition MCInstrInfo.h:27
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Streaming machine code generation interface.
Definition MCStreamer.h:222
Generic base class for all target subtargets.
Target specific streamer interface.
Definition MCStreamer.h:95
Implments NVPTX-specific streamer.
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
Target - Wrapper for Target specific information.
Triple - Helper class for working with autoconf configuration names.
Definition Triple.h:47
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.
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)