summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInst.h
blob: e456aefcefb3728dddcf70166d657ddd98f78f16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//===- HexagonMCInst.h - Hexagon sub-class of MCInst ----------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This class extends MCInst to allow some VLIW annotations.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIB_TARGET_HEXAGON_MCTARGETDESC_HEXAGONMCINST_H
#define LLVM_LIB_TARGET_HEXAGON_MCTARGETDESC_HEXAGONMCINST_H

#include "llvm/MC/MCInst.h"

namespace llvm {
class MCInstrDesc;
class MCOperand;
class HexagonTargetMachine;

class HexagonMCInst : public MCInst {
public:
  explicit HexagonMCInst(unsigned op);

  /// 10.6 Instruction Packets
  bool isPacketBegin() const;
  /// \brief Is this marked as last in packet.
  bool isPacketEnd() const;
  void setPacketBegin(bool Y);
  /// \brief Mark this as last in packet.
  void setPacketEnd(bool Y);
  /// \brief Return the slots used.
  unsigned getUnits(HexagonTargetMachine const &TM) const;
  bool isConstExtended() const;
  /// \brief Return constant extended operand number.
  unsigned short getCExtOpNum(void) const;
  /// \brief Return whether this is a new-value consumer.
  bool isNewValue() const;
  /// \brief Return whether this is a legal new-value producer.
  bool hasNewValue() const;
  /// \brief Return the operand that consumes or produces a new value.
  MCOperand const &getNewValue() const;
  /// \brief Return number of bits in the constant extended operand.
  unsigned getBitCount(void) const;

private:
  /// \brief Return whether this must be always extended.
  bool isExtended() const;
  /// \brief Return true if this may be extended based on the operand value.
  bool isExtendable() const;
  ///  \brief Return if the operand can be constant extended.
  bool isOperandExtended(unsigned short const OperandNum) const;
  /// \brief Return the min value that a constant extendable operand can have
  /// without being extended.
  int getMinValue() const;
  /// \brief Return the max value that a constant extendable operand can have
  /// without being extended.
  int getMaxValue() const;
  bool packetBegin;
  bool packetEnd;
  MCInstrDesc const &MCID;
};
}

#endif
OpenPOWER on IntegriCloud