Coverage Report

Created: 2026-02-07 06:11

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/keystone/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCShuffler.h
Line
Count
Source
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
18
#include "MCTargetDesc/HexagonShuffler.h"
19
20
namespace llvm_ks {
21
22
class MCInst;
23
24
// Insn bundle shuffler.
25
class HexagonMCShuffler : public HexagonShuffler {
26
  bool immext_present;
27
  bool duplex_present;
28
29
public:
30
  HexagonMCShuffler(MCInstrInfo const &MCII, MCSubtargetInfo const &STI,
31
                    MCInst &MCB)
32
17.9k
      : HexagonShuffler(MCII, STI) {
33
17.9k
    init(MCB);
34
17.9k
  };
35
  HexagonMCShuffler(MCInstrInfo const &MCII, MCSubtargetInfo const &STI,
36
                    MCInst &MCB, const MCInst *AddMI,
37
                    bool bInsertAtFront = false)
38
0
      : HexagonShuffler(MCII, STI) {
39
0
    init(MCB, AddMI, bInsertAtFront);
40
0
  };
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
0
  bool immextPresent() const { return immext_present; };
48
0
  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 &,
62
                          SmallVector<DuplexCandidate, 8>);
63
}
64
65
#endif // HEXAGONMCSHUFFLER_H