LLVM  14.0.0git
SparcInstPrinter.h
Go to the documentation of this file.
1 //===-- SparcInstPrinter.h - Convert Sparc MCInst to assembly syntax ------===//
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 class prints an Sparc MCInst to a .s file.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_LIB_TARGET_SPARC_MCTARGETDESC_SPARCINSTPRINTER_H
14 #define LLVM_LIB_TARGET_SPARC_MCTARGETDESC_SPARCINSTPRINTER_H
15 
16 #include "llvm/MC/MCInstPrinter.h"
17 
18 namespace llvm {
19 
21 public:
23  const MCRegisterInfo &MRI)
24  : MCInstPrinter(MAI, MII, MRI) {}
25 
26  void printRegName(raw_ostream &OS, unsigned RegNo) const override;
27  void printInst(const MCInst *MI, uint64_t Address, StringRef Annot,
28  const MCSubtargetInfo &STI, raw_ostream &O) override;
29  bool printSparcAliasInstr(const MCInst *MI, const MCSubtargetInfo &STI,
30  raw_ostream &OS);
31  bool isV9(const MCSubtargetInfo &STI) const;
32 
33  // Autogenerated by tblgen.
34  std::pair<const char *, uint64_t> getMnemonic(const MCInst *MI) override;
35  void printInstruction(const MCInst *MI, uint64_t Address,
36  const MCSubtargetInfo &STI, raw_ostream &O);
37  bool printAliasInstr(const MCInst *MI, uint64_t Address,
38  const MCSubtargetInfo &STI, raw_ostream &O);
39  void printCustomAliasOperand(const MCInst *MI, uint64_t Address,
40  unsigned OpIdx, unsigned PrintMethodIdx,
41  const MCSubtargetInfo &STI, raw_ostream &O);
42  static const char *getRegisterName(unsigned RegNo);
43 
44  void printOperand(const MCInst *MI, int opNum, const MCSubtargetInfo &STI,
45  raw_ostream &OS);
46  void printMemOperand(const MCInst *MI, int opNum, const MCSubtargetInfo &STI,
47  raw_ostream &OS, const char *Modifier = nullptr);
48  void printCCOperand(const MCInst *MI, int opNum, const MCSubtargetInfo &STI,
49  raw_ostream &OS);
50  bool printGetPCX(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
51  raw_ostream &OS);
52  void printMembarTag(const MCInst *MI, int opNum, const MCSubtargetInfo &STI,
53  raw_ostream &O);
54 };
55 } // end namespace llvm
56 
57 #endif
llvm::SparcInstPrinter::printMembarTag
void printMembarTag(const MCInst *MI, int opNum, const MCSubtargetInfo &STI, raw_ostream &O)
Definition: SparcInstPrinter.cpp:210
llvm::MCInstPrinter::MII
const MCInstrInfo & MII
Definition: MCInstPrinter.h:50
MI
IRTranslator LLVM IR MI
Definition: IRTranslator.cpp:105
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::SparcInstPrinter::printMemOperand
void printMemOperand(const MCInst *MI, int opNum, const MCSubtargetInfo &STI, raw_ostream &OS, const char *Modifier=nullptr)
Definition: SparcInstPrinter.cpp:141
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::SparcInstPrinter::printGetPCX
bool printGetPCX(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &OS)
Definition: SparcInstPrinter.cpp:203
llvm::SparcInstPrinter::printRegName
void printRegName(raw_ostream &OS, unsigned RegNo) const override
Print the assembler register name.
Definition: SparcInstPrinter.cpp:41
llvm::MCInst
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:184
llvm::MCInstPrinter::MRI
const MCRegisterInfo & MRI
Definition: MCInstPrinter.h:51
llvm::SparcInstPrinter::printInstruction
void printInstruction(const MCInst *MI, uint64_t Address, const MCSubtargetInfo &STI, raw_ostream &O)
llvm::SparcInstPrinter::printAliasInstr
bool printAliasInstr(const MCInst *MI, uint64_t Address, const MCSubtargetInfo &STI, raw_ostream &O)
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
llvm::SparcInstPrinter::getRegisterName
static const char * getRegisterName(unsigned RegNo)
llvm::SparcInstPrinter::printInst
void printInst(const MCInst *MI, uint64_t Address, StringRef Annot, const MCSubtargetInfo &STI, raw_ostream &O) override
Print the specified MCInst to the specified raw_ostream.
Definition: SparcInstPrinter.cpp:46
MCInstPrinter.h
llvm::SparcInstPrinter::printSparcAliasInstr
bool printSparcAliasInstr(const MCInst *MI, const MCSubtargetInfo &STI, raw_ostream &OS)
Definition: SparcInstPrinter.cpp:55
llvm::RISCVFenceField::O
@ O
Definition: RISCVBaseInfo.h:197
uint64_t
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::SparcInstPrinter::SparcInstPrinter
SparcInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI)
Definition: SparcInstPrinter.h:22
llvm::SparcInstPrinter::isV9
bool isV9(const MCSubtargetInfo &STI) const
Definition: SparcInstPrinter.cpp:37
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::MCRegisterInfo
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Definition: MCRegisterInfo.h:135
llvm::MCInstrInfo
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:25
llvm::SparcInstPrinter::getMnemonic
std::pair< const char *, uint64_t > getMnemonic(const MCInst *MI) override
Returns a pair containing the mnemonic for MI and the number of bits left for further processing by p...
llvm::SparcInstPrinter::printOperand
void printOperand(const MCInst *MI, int opNum, const MCSubtargetInfo &STI, raw_ostream &OS)
Definition: SparcInstPrinter.cpp:109
llvm::SparcInstPrinter::printCustomAliasOperand
void printCustomAliasOperand(const MCInst *MI, uint64_t Address, unsigned OpIdx, unsigned PrintMethodIdx, const MCSubtargetInfo &STI, raw_ostream &O)
llvm::MCInstPrinter::MAI
const MCAsmInfo & MAI
Definition: MCInstPrinter.h:49
llvm::SparcInstPrinter
Definition: SparcInstPrinter.h:20
llvm::SparcInstPrinter::printCCOperand
void printCCOperand(const MCInst *MI, int opNum, const MCSubtargetInfo &STI, raw_ostream &OS)
Definition: SparcInstPrinter.cpp:174
llvm::MCSubtargetInfo
Generic base class for all target subtargets.
Definition: MCSubtargetInfo.h:75