Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/lib/Target/Lanai/MCTargetDesc/LanaiBaseInfo.h
Line
Count
Source (jump to first uncovered line)
1
//===-- LanaiBaseInfo.h - Top level definitions for Lanai MC ----*- 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
// This file contains small standalone helper functions and enum definitions for
10
// the Lanai target useful for the compiler back-end and the MC libraries.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_LIB_TARGET_LANAI_MCTARGETDESC_LANAIBASEINFO_H
15
#define LLVM_LIB_TARGET_LANAI_MCTARGETDESC_LANAIBASEINFO_H
16
17
#include "LanaiMCTargetDesc.h"
18
#include "llvm/MC/MCExpr.h"
19
#include "llvm/Support/DataTypes.h"
20
#include "llvm/Support/ErrorHandling.h"
21
22
namespace llvm {
23
24
// LanaiII - This namespace holds all of the target specific flags that
25
// instruction info tracks.
26
namespace LanaiII {
27
// Target Operand Flag enum.
28
enum TOF {
29
  //===------------------------------------------------------------------===//
30
  // Lanai Specific MachineOperand flags.
31
  MO_NO_FLAG,
32
33
  // MO_ABS_HI/LO - Represents the hi or low part of an absolute symbol
34
  // address.
35
  MO_ABS_HI,
36
  MO_ABS_LO,
37
};
38
} // namespace LanaiII
39
40
1.71k
static inline unsigned getLanaiRegisterNumbering(unsigned Reg) {
41
1.71k
  switch (Reg) {
42
1.71k
  case Lanai::R0:
43
13
    return 0;
44
1.71k
  case Lanai::R1:
45
2
    return 1;
46
1.71k
  case Lanai::R2:
47
5
  case Lanai::PC:
48
5
    return 2;
49
8
  case Lanai::R3:
50
8
    return 3;
51
5
  case Lanai::R4:
52
1
  case Lanai::SP:
53
1
    return 4;
54
1
  case Lanai::R5:
55
1
  case Lanai::FP:
56
1
    return 5;
57
32
  case Lanai::R6:
58
32
    return 6;
59
24
  case Lanai::R7:
60
24
    return 7;
61
1
  case Lanai::R8:
62
0
  case Lanai::RV:
63
0
    return 8;
64
32
  case Lanai::R9:
65
32
    return 9;
66
0
  case Lanai::R10:
67
0
  case Lanai::RR1:
68
0
    return 10;
69
0
  case Lanai::R11:
70
0
  case Lanai::RR2:
71
0
    return 11;
72
33
  case Lanai::R12:
73
33
    return 12;
74
3
  case Lanai::R13:
75
3
    return 13;
76
3
  case Lanai::R14:
77
3
    return 14;
78
19
  case Lanai::R15:
79
19
  case Lanai::RCA:
80
19
    return 15;
81
19
  case Lanai::R16:
82
0
    return 16;
83
624
  case Lanai::R17:
84
624
    return 17;
85
264
  case Lanai::R18:
86
264
    return 18;
87
123
  case Lanai::R19:
88
123
    return 19;
89
19
  case Lanai::R20:
90
14
    return 20;
91
516
  case Lanai::R21:
92
516
    return 21;
93
19
  case Lanai::R22:
94
0
    return 22;
95
19
  case Lanai::R23:
96
0
    return 23;
97
19
  case Lanai::R24:
98
0
    return 24;
99
19
  case Lanai::R25:
100
0
    return 25;
101
19
  case Lanai::R26:
102
0
    return 26;
103
19
  case Lanai::R27:
104
0
    return 27;
105
19
  case Lanai::R28:
106
0
    return 28;
107
19
  case Lanai::R29:
108
0
    return 29;
109
19
  case Lanai::R30:
110
1
    return 30;
111
19
  case Lanai::R31:
112
0
    return 31;
113
19
  default:
114
0
    llvm_unreachable("Unknown register number!");
115
1.71k
  }
116
1.71k
}
Unexecuted instantiation: LanaiInstrInfo.cpp:llvm::getLanaiRegisterNumbering(unsigned int)
Unexecuted instantiation: LanaiISelLowering.cpp:llvm::getLanaiRegisterNumbering(unsigned int)
Unexecuted instantiation: LanaiMCInstLower.cpp:llvm::getLanaiRegisterNumbering(unsigned int)
Unexecuted instantiation: LanaiELFObjectWriter.cpp:llvm::getLanaiRegisterNumbering(unsigned int)
LanaiMCCodeEmitter.cpp:llvm::getLanaiRegisterNumbering(unsigned int)
Line
Count
Source
40
1.71k
static inline unsigned getLanaiRegisterNumbering(unsigned Reg) {
41
1.71k
  switch (Reg) {
42
1.71k
  case Lanai::R0:
43
13
    return 0;
44
1.71k
  case Lanai::R1:
45
2
    return 1;
46
1.71k
  case Lanai::R2:
47
5
  case Lanai::PC:
48
5
    return 2;
49
8
  case Lanai::R3:
50
8
    return 3;
51
5
  case Lanai::R4:
52
1
  case Lanai::SP:
53
1
    return 4;
54
1
  case Lanai::R5:
55
1
  case Lanai::FP:
56
1
    return 5;
57
32
  case Lanai::R6:
58
32
    return 6;
59
24
  case Lanai::R7:
60
24
    return 7;
61
1
  case Lanai::R8:
62
0
  case Lanai::RV:
63
0
    return 8;
64
32
  case Lanai::R9:
65
32
    return 9;
66
0
  case Lanai::R10:
67
0
  case Lanai::RR1:
68
0
    return 10;
69
0
  case Lanai::R11:
70
0
  case Lanai::RR2:
71
0
    return 11;
72
33
  case Lanai::R12:
73
33
    return 12;
74
3
  case Lanai::R13:
75
3
    return 13;
76
3
  case Lanai::R14:
77
3
    return 14;
78
19
  case Lanai::R15:
79
19
  case Lanai::RCA:
80
19
    return 15;
81
19
  case Lanai::R16:
82
0
    return 16;
83
624
  case Lanai::R17:
84
624
    return 17;
85
264
  case Lanai::R18:
86
264
    return 18;
87
123
  case Lanai::R19:
88
123
    return 19;
89
19
  case Lanai::R20:
90
14
    return 20;
91
516
  case Lanai::R21:
92
516
    return 21;
93
19
  case Lanai::R22:
94
0
    return 22;
95
19
  case Lanai::R23:
96
0
    return 23;
97
19
  case Lanai::R24:
98
0
    return 24;
99
19
  case Lanai::R25:
100
0
    return 25;
101
19
  case Lanai::R26:
102
0
    return 26;
103
19
  case Lanai::R27:
104
0
    return 27;
105
19
  case Lanai::R28:
106
0
    return 28;
107
19
  case Lanai::R29:
108
0
    return 29;
109
19
  case Lanai::R30:
110
1
    return 30;
111
19
  case Lanai::R31:
112
0
    return 31;
113
19
  default:
114
0
    llvm_unreachable("Unknown register number!");
115
1.71k
  }
116
1.71k
}
117
} // namespace llvm
118
#endif // LLVM_LIB_TARGET_LANAI_MCTARGETDESC_LANAIBASEINFO_H