to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
78 lines
3.4 KiB
C++
78 lines
3.4 KiB
C++
//==- SystemZInstPrinter.h - Convert SystemZ MCInst to assembly --*- C++ -*-==//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This class prints a SystemZ MCInst to a .s file.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_LIB_TARGET_SYSTEMZ_INSTPRINTER_SYSTEMZINSTPRINTER_H
|
|
#define LLVM_LIB_TARGET_SYSTEMZ_INSTPRINTER_SYSTEMZINSTPRINTER_H
|
|
|
|
#include "llvm/MC/MCInstPrinter.h"
|
|
#include <cstdint>
|
|
|
|
namespace llvm {
|
|
|
|
class MCOperand;
|
|
|
|
class SystemZInstPrinter : public MCInstPrinter {
|
|
public:
|
|
SystemZInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII,
|
|
const MCRegisterInfo &MRI)
|
|
: MCInstPrinter(MAI, MII, MRI) {}
|
|
|
|
// Automatically generated by tblgen.
|
|
void printInstruction(const MCInst *MI, raw_ostream &O);
|
|
static const char *getRegisterName(unsigned RegNo);
|
|
|
|
// Print an address with the given base, displacement and index.
|
|
static void printAddress(unsigned Base, int64_t Disp, unsigned Index,
|
|
raw_ostream &O);
|
|
|
|
// Print the given operand.
|
|
static void printOperand(const MCOperand &MO, const MCAsmInfo *MAI,
|
|
raw_ostream &O);
|
|
|
|
// Override MCInstPrinter.
|
|
void printRegName(raw_ostream &O, unsigned RegNo) const override;
|
|
void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot,
|
|
const MCSubtargetInfo &STI) override;
|
|
|
|
private:
|
|
// Print various types of operand.
|
|
void printOperand(const MCInst *MI, int OpNum, raw_ostream &O);
|
|
void printBDAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O);
|
|
void printBDXAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O);
|
|
void printBDLAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O);
|
|
void printBDRAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O);
|
|
void printBDVAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O);
|
|
void printU1ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
|
|
void printU2ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
|
|
void printU3ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
|
|
void printU4ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
|
|
void printU6ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
|
|
void printS8ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
|
|
void printU8ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
|
|
void printU12ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
|
|
void printS16ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
|
|
void printU16ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
|
|
void printS32ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
|
|
void printU32ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
|
|
void printU48ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O);
|
|
void printPCRelOperand(const MCInst *MI, int OpNum, raw_ostream &O);
|
|
void printPCRelTLSOperand(const MCInst *MI, int OpNum, raw_ostream &O);
|
|
|
|
// Print the mnemonic for a condition-code mask ("ne", "lh", etc.)
|
|
// This forms part of the instruction name rather than the operand list.
|
|
void printCond4Operand(const MCInst *MI, int OpNum, raw_ostream &O);
|
|
};
|
|
|
|
} // end namespace llvm
|
|
|
|
#endif // LLVM_LIB_TARGET_SYSTEMZ_INSTPRINTER_SYSTEMZINSTPRINTER_H
|