blob: c8c52b59ca4ae9a9a5385a0ec11eecf2240c3c6b [file] [log] [blame]
Venkatraman Govindaraju0b938652013-12-25 23:43:39 +00001//===-- SparcInstPrinter.h - Convert Sparc MCInst to assembly syntax ------===//
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// 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
Venkatraman Govindaraju0b938652013-12-25 23:43:39 +00006//
7//===----------------------------------------------------------------------===//
8//
9// This class prints an Sparc MCInst to a .s file.
10//
11//===----------------------------------------------------------------------===//
12
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000013#ifndef LLVM_LIB_TARGET_SPARC_INSTPRINTER_SPARCINSTPRINTER_H
14#define LLVM_LIB_TARGET_SPARC_INSTPRINTER_SPARCINSTPRINTER_H
Venkatraman Govindaraju0b938652013-12-25 23:43:39 +000015
16#include "llvm/MC/MCInstPrinter.h"
17
18namespace llvm {
19
Venkatraman Govindaraju0b938652013-12-25 23:43:39 +000020class SparcInstPrinter : public MCInstPrinter {
21public:
Eric Christopherd639cdf2015-03-30 22:09:43 +000022 SparcInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII,
23 const MCRegisterInfo &MRI)
24 : MCInstPrinter(MAI, MII, MRI) {}
Venkatraman Govindaraju0b938652013-12-25 23:43:39 +000025
Craig Topperb0c941b2014-04-29 07:57:13 +000026 void printRegName(raw_ostream &OS, unsigned RegNo) const override;
Akira Hatanakab46d0232015-03-27 20:36:02 +000027 void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot,
28 const MCSubtargetInfo &STI) override;
Akira Hatanaka725657b2015-03-28 04:03:51 +000029 bool printSparcAliasInstr(const MCInst *MI, const MCSubtargetInfo &STI,
30 raw_ostream &OS);
31 bool isV9(const MCSubtargetInfo &STI) const;
Venkatraman Govindaraju0b938652013-12-25 23:43:39 +000032
33 // Autogenerated by tblgen.
Akira Hatanaka725657b2015-03-28 04:03:51 +000034 void printInstruction(const MCInst *MI, const MCSubtargetInfo &STI,
35 raw_ostream &O);
36 bool printAliasInstr(const MCInst *MI, const MCSubtargetInfo &STI,
37 raw_ostream &O);
Tim Northoveree20caa2014-05-12 18:04:06 +000038 void printCustomAliasOperand(const MCInst *MI, unsigned OpIdx,
Akira Hatanaka725657b2015-03-28 04:03:51 +000039 unsigned PrintMethodIdx,
40 const MCSubtargetInfo &STI, raw_ostream &O);
Venkatraman Govindaraju0b938652013-12-25 23:43:39 +000041 static const char *getRegisterName(unsigned RegNo);
42
Akira Hatanaka725657b2015-03-28 04:03:51 +000043 void printOperand(const MCInst *MI, int opNum, const MCSubtargetInfo &STI,
44 raw_ostream &OS);
45 void printMemOperand(const MCInst *MI, int opNum, const MCSubtargetInfo &STI,
46 raw_ostream &OS, const char *Modifier = nullptr);
47 void printCCOperand(const MCInst *MI, int opNum, const MCSubtargetInfo &STI,
48 raw_ostream &OS);
49 bool printGetPCX(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
50 raw_ostream &OS);
Daniel Cederman77611422018-12-13 15:29:12 +000051 void printMembarTag(const MCInst *MI, int opNum, const MCSubtargetInfo &STI,
52 raw_ostream &O);
Venkatraman Govindaraju0b938652013-12-25 23:43:39 +000053};
54} // end namespace llvm
55
56#endif