LLVM  3.7.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 
22 class MCInst;
23 
24 // Insn bundle shuffler.
26  bool immext_present;
27  bool duplex_present;
28 
29 public:
31  MCInst &MCB)
32  : HexagonShuffler(MCII, STI) {
33  init(MCB);
34  };
36  MCInst &MCB, const MCInst *AddMI,
37  bool bInsertAtFront = false)
38  : HexagonShuffler(MCII, STI) {
39  init(MCB, AddMI, bInsertAtFront);
40  };
41 
42  // Copy reordered bundle to another.
43  void copyTo(MCInst &MCB);
44  // Reorder and copy result to another.
45  bool reshuffleTo(MCInst &MCB);
46 
47  bool immextPresent() const { return immext_present; };
48  bool duplexPresent() const { return duplex_present; };
49 
50 private:
51  void init(MCInst &MCB);
52  void init(MCInst &MCB, const MCInst *AddMI, bool bInsertAtFront = false);
53 };
54 
55 // Invocation of the shuffler.
56 bool HexagonMCShuffle(MCInstrInfo const &MCII, MCSubtargetInfo const &STI,
57  MCInst &);
58 bool HexagonMCShuffle(MCInstrInfo const &MCII, MCSubtargetInfo const &STI,
59  MCInst &, const MCInst *, int);
60 unsigned HexagonMCShuffle(MCInstrInfo const &MCII, MCSubtargetInfo const &STI,
61  MCContext &Context, MCInst &,
63 }
64 
65 #endif // HEXAGONMCSHUFFLER_H
HexagonMCShuffler(MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst &MCB)
bool reshuffleTo(MCInst &MCB)
HexagonMCShuffler(MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst &MCB, const MCInst *AddMI, bool bInsertAtFront=false)
Context object for machine code objects.
Definition: MCContext.h:48
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:150
MCSubtargetInfo const & STI
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:24
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(MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst &)
MCSubtargetInfo - Generic base class for all target subtargets.