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 "llvm/MC/MCInst.h"
22 class HexagonTargetMachine;
24 class HexagonMCInst : public MCInst {
26 explicit HexagonMCInst(unsigned op);
28 /// 10.6 Instruction Packets
29 bool isPacketBegin() const;
30 /// \brief Is this marked as last in packet.
31 bool isPacketEnd() const;
32 void setPacketBegin(bool Y);
33 /// \brief Mark this as last in packet.
34 void setPacketEnd(bool Y);
35 /// \brief Return the slots used.
36 unsigned getUnits(HexagonTargetMachine const &TM) const;
37 bool isConstExtended() const;
38 /// \brief Return constant extended operand number.
39 unsigned short getCExtOpNum(void) const;
40 /// \brief Return whether this is a new-value consumer.
41 bool isNewValue() const;
42 /// \brief Return whether this is a legal new-value producer.
43 bool hasNewValue() const;
44 /// \brief Return the operand that consumes or produces a new value.
45 MCOperand const &getNewValue() const;
46 /// \brief Return number of bits in the constant extended operand.
47 unsigned getBitCount(void) const;
50 /// \brief Return whether this must be always extended.
51 bool isExtended() const;
52 /// \brief Return true if this may be extended based on the operand value.
53 bool isExtendable() const;
54 /// \brief Return if the operand can be constant extended.
55 bool isOperandExtended(unsigned short const OperandNum) const;
56 /// \brief Return the min value that a constant extendable operand can have
57 /// without being extended.
58 int getMinValue() const;
59 /// \brief Return the max value that a constant extendable operand can have
60 /// without being extended.
61 int getMaxValue() const;
64 MCInstrDesc const &MCID;