Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCCodeEmitter.h
Line
Count
Source (jump to first uncovered line)
1
//===-- AMDGPUCodeEmitter.h - AMDGPU Code Emitter interface -----*- C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
/// \file
10
/// CodeEmitter interface for R600 and SI codegen.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUMCCODEEMITTER_H
15
#define LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUMCCODEEMITTER_H
16
17
#include "llvm/MC/MCCodeEmitter.h"
18
#include "llvm/Support/raw_ostream.h"
19
20
namespace llvm {
21
22
class MCInst;
23
class MCInstrInfo;
24
class MCOperand;
25
class MCSubtargetInfo;
26
class FeatureBitset;
27
28
class AMDGPUMCCodeEmitter : public MCCodeEmitter {
29
  virtual void anchor();
30
31
protected:
32
  const MCInstrInfo &MCII;
33
34
684
  AMDGPUMCCodeEmitter(const MCInstrInfo &mcii) : MCII(mcii) {}
35
36
public:
37
38
  uint64_t getBinaryCodeForInstr(const MCInst &MI,
39
                                 SmallVectorImpl<MCFixup> &Fixups,
40
                                 const MCSubtargetInfo &STI) const;
41
42
  virtual uint64_t getMachineOpValue(const MCInst &MI, const MCOperand &MO,
43
                                     SmallVectorImpl<MCFixup> &Fixups,
44
0
                                     const MCSubtargetInfo &STI) const {
45
0
    return 0;
46
0
  }
47
48
  virtual unsigned getSOPPBrEncoding(const MCInst &MI, unsigned OpNo,
49
                                     SmallVectorImpl<MCFixup> &Fixups,
50
0
                                     const MCSubtargetInfo &STI) const {
51
0
    return 0;
52
0
  }
53
54
  virtual unsigned getSDWASrcEncoding(const MCInst &MI, unsigned OpNo,
55
                                      SmallVectorImpl<MCFixup> &Fixups,
56
0
                                      const MCSubtargetInfo &STI) const {
57
0
    return 0;
58
0
  }
59
60
  virtual unsigned getSDWAVopcDstEncoding(const MCInst &MI, unsigned OpNo,
61
                                          SmallVectorImpl<MCFixup> &Fixups,
62
0
                                          const MCSubtargetInfo &STI) const {
63
0
    return 0;
64
0
  }
65
66
  virtual unsigned getAVOperandEncoding(const MCInst &MI, unsigned OpNo,
67
                                        SmallVectorImpl<MCFixup> &Fixups,
68
0
                                        const MCSubtargetInfo &STI) const {
69
0
    return 0;
70
0
  }
71
72
protected:
73
  FeatureBitset computeAvailableFeatures(const FeatureBitset &FB) const;
74
  void
75
  verifyInstructionPredicates(const MCInst &MI,
76
                              const FeatureBitset &AvailableFeatures) const;
77
};
78
79
} // End namespace llvm
80
81
#endif