LLVM 24.0.0git
PISAMCTargetDesc.cpp
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
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/// \file
10/// This file implements the PISA MC target descriptions.
11///
12//===----------------------------------------------------------------------===//
13
14#include "PISAMCTargetDesc.h"
15#include "PISAInstPrinter.h"
16#include "PISAMCAsmInfo.h"
18#include "llvm/MC/MCInstrInfo.h"
22
23#define GET_INSTRINFO_MC_DESC
24#define ENABLE_INSTR_PREDICATE_VERIFIER
25#include "PISAGenInstrInfo.inc"
26
27#define GET_SUBTARGETINFO_MC_DESC
28#include "PISAGenSubtargetInfo.inc"
29
30#define GET_REGINFO_MC_DESC
31#include "PISAGenRegisterInfo.inc"
32
33using namespace llvm;
34
36 MCInstrInfo *X = new MCInstrInfo();
37 InitPISAMCInstrInfo(X);
38 return X;
39}
40
43 InitPISAMCRegisterInfo(X, 0);
44 return X;
45}
46
48 StringRef CPU, StringRef FS) {
49 return createPISAMCSubtargetInfoImpl(TT, CPU, /*TuneCPU=*/CPU, FS);
50}
51
53 unsigned SyntaxVariant,
54 const MCAsmInfo &MAI,
55 const MCInstrInfo &MII,
56 const MCRegisterInfo &MRI) {
57 assert(SyntaxVariant == 0);
58 return new PISAInstPrinter(MAI, MII, MRI);
59}
60
61// NOLINTNEXTLINE(readability-identifier-naming)
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
#define X(NUM, ENUM, NAME)
Definition ELF.h:665
#define LLVM_EXTERNAL_VISIBILITY
Definition Compiler.h:132
#define T
This file declares the PISA MCInst printer.
This file declares the assembly properties for the PISA target.
static MCInstPrinter * createPISAMCInstPrinter(const Triple &T, unsigned SyntaxVariant, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI)
static MCSubtargetInfo * createPISAMCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS)
static MCRegisterInfo * createPISAMCRegisterInfo(const Triple &TT)
LLVM_EXTERNAL_VISIBILITY void LLVMInitializePISATargetMC()
static MCInstrInfo * createPISAMCInstrInfo()
This file declares the PISA MC target descriptions.
This file declares the PISA target registration interface.
MachineRegisterInfo & MRI
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition MCAsmInfo.h:69
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...
Generic base class for all target subtargets.
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:48
This is an optimization pass for GlobalISel generic memory operations.
Target & getThePISATarget()
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 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.