1 //===- HexagonMCInst.h - Hexagon sub-class of MCInst ----------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This class extends MCInst to allow some VLIW annotations.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_HEXAGON_MCTARGETDESC_HEXAGONMCINST_H
15 #define LLVM_LIB_TARGET_HEXAGON_MCTARGETDESC_HEXAGONMCINST_H
17 #include "HexagonTargetMachine.h"
18 #include "llvm/MC/MCInst.h"
21 extern "C" void LLVMInitializeHexagonTargetMC();
25 class HexagonMCInst : public MCInst {
26 // Used to access TSFlags
27 std::unique_ptr <MCInstrInfo const> MCII;
30 explicit HexagonMCInst();
31 HexagonMCInst(const MCInstrDesc &mcid);
33 static void AppendImplicitOperands(MCInst &MCI);
34 static std::bitset<16> GetImplicitBits(MCInst const &MCI);
35 static void SetImplicitBits(MCInst &MCI, std::bitset<16> Bits);
36 static void SanityCheckImplicitOperands(MCInst const &MCI) {
37 assert(MCI.getNumOperands() >= 2 && "At least the two implicit operands");
38 assert(MCI.getOperand(MCI.getNumOperands() - 1).isInst() &&
39 "Implicit bits and flags");
40 assert(MCI.getOperand(MCI.getNumOperands() - 2).isImm() &&
44 void setPacketBegin(bool Y);
45 bool isPacketBegin() const;
46 static const size_t packetBeginIndex = 0;
47 void setPacketEnd(bool Y);
48 bool isPacketEnd() const;
49 static const size_t packetEndIndex = 1;