LLVM  16.0.0git
VEMCTargetDesc.cpp
Go to the documentation of this file.
1 //===-- VEMCTargetDesc.cpp - VE 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 VE specific target descriptions.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "VEMCTargetDesc.h"
15 #include "VEInstPrinter.h"
16 #include "VEMCAsmInfo.h"
17 #include "VETargetStreamer.h"
18 #include "llvm/MC/MCInstrInfo.h"
19 #include "llvm/MC/MCRegisterInfo.h"
21 #include "llvm/MC/TargetRegistry.h"
23 
24 using namespace llvm;
25 
26 #define GET_INSTRINFO_MC_DESC
27 #define ENABLE_INSTR_PREDICATE_VERIFIER
28 #include "VEGenInstrInfo.inc"
29 
30 #define GET_SUBTARGETINFO_MC_DESC
31 #include "VEGenSubtargetInfo.inc"
32 
33 #define GET_REGINFO_MC_DESC
34 #include "VEGenRegisterInfo.inc"
35 
37  const MCTargetOptions &Options) {
38  MCAsmInfo *MAI = new VEELFMCAsmInfo(TT);
39  unsigned Reg = MRI.getDwarfRegNum(VE::SX11, true);
41  MAI->addInitialFrameState(Inst);
42  return MAI;
43 }
44 
46  MCInstrInfo *X = new MCInstrInfo();
47  InitVEMCInstrInfo(X);
48  return X;
49 }
50 
53  InitVEMCRegisterInfo(X, VE::SX10);
54  return X;
55 }
56 
58  StringRef FS) {
59  if (CPU.empty())
60  CPU = "generic";
61  return createVEMCSubtargetInfoImpl(TT, CPU, /*TuneCPU=*/CPU, FS);
62 }
63 
64 static MCTargetStreamer *
66  return new VETargetELFStreamer(S);
67 }
68 
71  MCInstPrinter *InstPrint,
72  bool isVerboseAsm) {
73  return new VETargetAsmStreamer(S, OS);
74 }
75 
77  unsigned SyntaxVariant,
78  const MCAsmInfo &MAI,
79  const MCInstrInfo &MII,
80  const MCRegisterInfo &MRI) {
81  return new VEInstPrinter(MAI, MII, MRI);
82 }
83 
85  // Register the MC asm info.
87 
88  for (Target *T : {&getTheVETarget()}) {
89  // Register the MC instruction info.
91 
92  // Register the MC register info.
94 
95  // Register the MC subtarget info.
97 
98  // Register the MC Code Emitter.
100 
101  // Register the asm backend.
103 
104  // Register the object target streamer.
107 
108  // Register the asm streamer.
110 
111  // Register the MCInstPrinter
113  }
114 }
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
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
createVEMCRegisterInfo
static MCRegisterInfo * createVEMCRegisterInfo(const Triple &TT)
Definition: VEMCTargetDesc.cpp:51
ErrorHandling.h
llvm::X86Disassembler::Reg
Reg
All possible values of the reg field in the ModR/M byte.
Definition: X86DisassemblerDecoder.h:462
createTargetAsmStreamer
static MCTargetStreamer * createTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS, MCInstPrinter *InstPrint, bool isVerboseAsm)
Definition: VEMCTargetDesc.cpp:69
llvm::TargetRegistry::RegisterAsmTargetStreamer
static void RegisterAsmTargetStreamer(Target &T, Target::AsmTargetStreamerCtorTy Fn)
Definition: TargetRegistry.h:1038
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
llvm::X86AS::FS
@ FS
Definition: X86.h:200
T
#define T
Definition: Mips16ISelLowering.cpp:341
llvm::createVEAsmBackend
MCAsmBackend * createVEAsmBackend(const Target &T, const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options)
Definition: VEAsmBackend.cpp:223
llvm::TargetRegistry::RegisterMCInstPrinter
static void RegisterMCInstPrinter(Target &T, Target::MCInstPrinterCtorTy Fn)
RegisterMCInstPrinter - Register a MCInstPrinter implementation for the given target.
Definition: TargetRegistry.h:988
llvm::VEInstPrinter
Definition: VEInstPrinter.h:21
VEInstPrinter.h
llvm::MCStreamer
Streaming machine code generation interface.
Definition: MCStreamer.h:212
LLVMInitializeVETargetMC
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeVETargetMC()
Definition: VEMCTargetDesc.cpp:84
llvm::getTheVETarget
Target & getTheVETarget()
Definition: VETargetInfo.cpp:14
createVEMCInstPrinter
static MCInstPrinter * createVEMCInstPrinter(const Triple &T, unsigned SyntaxVariant, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI)
Definition: VEMCTargetDesc.cpp:76
llvm::VETargetELFStreamer
Definition: VETargetStreamer.h:39
createVEMCAsmInfo
static MCAsmInfo * createVEMCAsmInfo(const MCRegisterInfo &MRI, const Triple &TT, const MCTargetOptions &Options)
Definition: VEMCTargetDesc.cpp:36
MCInstrInfo.h
MCSubtargetInfo.h
Options
const char LLVMTargetMachineRef LLVMPassBuilderOptionsRef Options
Definition: PassBuilderBindings.cpp:48
llvm::MCTargetStreamer
Target specific streamer interface.
Definition: MCStreamer.h:93
llvm::RegisterMCAsmInfoFn
RegisterMCAsmInfoFn - Helper template for registering a target assembly info implementation.
Definition: TargetRegistry.h:1178
createVEMCSubtargetInfo
static MCSubtargetInfo * createVEMCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS)
Definition: VEMCTargetDesc.cpp:57
llvm::MCCFIInstruction
Definition: MCDwarf.h:478
X
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
VEMCTargetDesc.h
llvm::StringRef::empty
constexpr bool empty() const
empty - Check if the string is empty.
Definition: StringRef.h:134
llvm::TargetRegistry::RegisterMCAsmBackend
static void RegisterMCAsmBackend(Target &T, Target::MCAsmBackendCtorTy Fn)
RegisterMCAsmBackend - Register a MCAsmBackend implementation for the given target.
Definition: TargetRegistry.h:935
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
llvm::TargetRegistry::RegisterObjectTargetStreamer
static void RegisterObjectTargetStreamer(Target &T, Target::ObjectTargetStreamerCtorTy Fn)
Definition: TargetRegistry.h:1044
VEMCAsmInfo.h
MCRegisterInfo.h
llvm::VETargetAsmStreamer
Definition: VETargetStreamer.h:29
llvm::VEELFMCAsmInfo
Definition: VEMCAsmInfo.h:22
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::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
VETargetStreamer.h
llvm::TargetRegistry::RegisterMCSubtargetInfo
static void RegisterMCSubtargetInfo(Target &T, Target::MCSubtargetInfoCtorFnTy Fn)
RegisterMCSubtargetInfo - Register a MCSubtargetInfo implementation for the given target.
Definition: TargetRegistry.h:908
llvm::MCTargetOptions
Definition: MCTargetOptions.h:37
llvm::createVEMCCodeEmitter
MCCodeEmitter * createVEMCCodeEmitter(const MCInstrInfo &MCII, MCContext &Ctx)
Definition: VEMCCodeEmitter.cpp:150
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
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
VETargetInfo.h
llvm::TargetRegistry::RegisterMCInstrInfo
static void RegisterMCInstrInfo(Target &T, Target::MCInstrInfoCtorFnTy Fn)
RegisterMCInstrInfo - Register a MCInstrInfo implementation for the given target.
Definition: TargetRegistry.h:875
llvm::TargetRegistry::RegisterMCCodeEmitter
static void RegisterMCCodeEmitter(Target &T, Target::MCCodeEmitterCtorTy Fn)
RegisterMCCodeEmitter - Register a MCCodeEmitter implementation for the given target.
Definition: TargetRegistry.h:1001
llvm::MCInstrInfo
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:26
createObjectTargetStreamer
static MCTargetStreamer * createObjectTargetStreamer(MCStreamer &S, const MCSubtargetInfo &STI)
Definition: VEMCTargetDesc.cpp:65
llvm::TargetRegistry::RegisterMCRegInfo
static void RegisterMCRegInfo(Target &T, Target::MCRegInfoCtorFnTy Fn)
RegisterMCRegInfo - Register a MCRegisterInfo implementation for the given target.
Definition: TargetRegistry.h:895
createVEMCInstrInfo
static MCInstrInfo * createVEMCInstrInfo()
Definition: VEMCTargetDesc.cpp:45
TargetRegistry.h
llvm::MCSubtargetInfo
Generic base class for all target subtargets.
Definition: MCSubtargetInfo.h:76