1 //=-- HexagonMCShuffler.h ---------------------------------------------------=//
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 declares the shuffling of insns inside a bundle according to the
11 // packet formation rules of the Hexagon ISA.
13 //===----------------------------------------------------------------------===//
15 #ifndef HEXAGONMCSHUFFLER_H
16 #define HEXAGONMCSHUFFLER_H
18 #include "MCTargetDesc/HexagonShuffler.h"
24 // Insn bundle shuffler.
25 class HexagonMCShuffler : public HexagonShuffler {
30 HexagonMCShuffler(MCInstrInfo const &MCII, MCSubtargetInfo const &STI,
32 : HexagonShuffler(MCII, STI) {
35 HexagonMCShuffler(MCInstrInfo const &MCII, MCSubtargetInfo const &STI,
36 MCInst &MCB, const MCInst *AddMI,
37 bool bInsertAtFront = false)
38 : HexagonShuffler(MCII, STI) {
39 init(MCB, AddMI, bInsertAtFront);
42 // Copy reordered bundle to another.
43 void copyTo(MCInst &MCB);
44 // Reorder and copy result to another.
45 bool reshuffleTo(MCInst &MCB);
47 bool immextPresent() const { return immext_present; };
48 bool duplexPresent() const { return duplex_present; };
51 void init(MCInst &MCB);
52 void init(MCInst &MCB, const MCInst *AddMI, bool bInsertAtFront = false);
55 // Invocation of the shuffler.
56 bool HexagonMCShuffle(MCInstrInfo const &MCII, MCSubtargetInfo const &STI,
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 &,
62 SmallVector<DuplexCandidate, 8>);
65 #endif // HEXAGONMCSHUFFLER_H