1 //===-- HexagonInstPrinter.h - Convert Hexagon MCInst to assembly syntax --===//
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
7 //===----------------------------------------------------------------------===//
10 //===----------------------------------------------------------------------===//
12 #ifndef LLVM_LIB_TARGET_HEXAGON_INSTPRINTER_HEXAGONINSTPRINTER_H
13 #define LLVM_LIB_TARGET_HEXAGON_INSTPRINTER_HEXAGONINSTPRINTER_H
15 #include "llvm/MC/MCInstPrinter.h"
18 /// Prints bundles as a newline separated list of individual instructions
19 /// Duplexes are separated by a vertical tab \v character
20 /// A trailing line includes bundle properties such as endloop0/1
23 /// r0 = #0 \v jump 0x0
24 /// :endloop0 :endloop1
25 class HexagonInstPrinter
: public MCInstPrinter
{
27 explicit HexagonInstPrinter(MCAsmInfo
const &MAI
, MCInstrInfo
const &MII
,
28 MCRegisterInfo
const &MRI
)
29 : MCInstPrinter(MAI
, MII
, MRI
), MII(MII
) {}
31 void printInst(MCInst
const *MI
, raw_ostream
&O
, StringRef Annot
,
32 const MCSubtargetInfo
&STI
) override
;
33 void printRegName(raw_ostream
&O
, unsigned RegNo
) const override
;
35 static char const *getRegisterName(unsigned RegNo
);
37 void printInstruction(MCInst
const *MI
, raw_ostream
&O
);
38 void printOperand(MCInst
const *MI
, unsigned OpNo
, raw_ostream
&O
) const;
39 void printBrtarget(MCInst
const *MI
, unsigned OpNo
, raw_ostream
&O
) const;
41 MCAsmInfo
const &getMAI() const { return MAI
; }
42 MCInstrInfo
const &getMII() const { return MII
; }
45 MCInstrInfo
const &MII
;
46 bool HasExtender
= false;
49 } // end namespace llvm