LLVM  5.0.0
HexagonMCShuffler.h
Go to the documentation of this file.
1 //=-- HexagonMCShuffler.h ---------------------------------------------------=//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This declares the shuffling of insns inside a bundle according to the
11 // packet formation rules of the Hexagon ISA.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef HEXAGONMCSHUFFLER_H
16 #define HEXAGONMCSHUFFLER_H
17 
19 
20 namespace llvm {
21 class MCInst;
22 // Insn bundle shuffler.
24 public:
26  MCSubtargetInfo const &STI, MCInst &MCB)
27  : HexagonShuffler(Context, Fatal, MCII, STI) {
28  init(MCB);
29  };
31  MCSubtargetInfo const &STI, MCInst &MCB,
32  MCInst const &AddMI, bool InsertAtFront)
33  : HexagonShuffler(Context, Fatal, MCII, STI) {
34  init(MCB, AddMI, InsertAtFront);
35  };
36 
37  // Copy reordered bundle to another.
38  void copyTo(MCInst &MCB);
39  // Reorder and copy result to another.
40  bool reshuffleTo(MCInst &MCB);
41 
42 private:
43  void init(MCInst &MCB);
44  void init(MCInst &MCB, MCInst const &AddMI, bool InsertAtFront);
45 };
46 
47 // Invocation of the shuffler.
48 bool HexagonMCShuffle(MCContext &Context, bool Fatal, MCInstrInfo const &MCII,
49  MCSubtargetInfo const &STI, MCInst &);
51  MCSubtargetInfo const &STI, MCInst &, MCInst const &,
52  int);
54  MCSubtargetInfo const &STI, MCInst &,
56 } // namespace llvm
57 
58 #endif // HEXAGONMCSHUFFLER_H
LLVMContext & Context
bool reshuffleTo(MCInst &MCB)
Context object for machine code objects.
Definition: MCContext.h:59
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:159
MCSubtargetInfo const & STI
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:24
HexagonMCShuffler(MCContext &Context, bool Fatal, MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst &MCB)
MCInstrInfo const & MCII
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Definition: SmallVector.h:861
bool HexagonMCShuffle(MCContext &Context, bool Fatal, MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst &)
MCSubtargetInfo - Generic base class for all target subtargets.
HexagonMCShuffler(MCContext &Context, bool Fatal, MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst &MCB, MCInst const &AddMI, bool InsertAtFront)