Coverage Report

Created: 2024-09-08 06:22

/src/capstonenext/arch/Mips/MipsCP0RegisterMap.h
Line
Count
Source (jump to first uncovered line)
1
//===- MipsCP0RegisterMap.h - Co-processor register names for Mips/nanoMIPS -===//
2
// This has been created by hand.
3
4
#ifndef LLVM_LIB_TARGET_MIPS_NANOMIPSCP0REGMAP_H
5
#define LLVM_LIB_TARGET_MIPS_NANOMIPSCP0REGMAP_H
6
7
struct CP0SelRegister_t {
8
  const char *Name;
9
  int RegNum;
10
  int Select;
11
  int Index;
12
};
13
14
static const struct CP0SelRegister_t CP0SelRegs[] = {
15
  {"index", 0, 0},
16
  {"mvpcontrol", 0, 1},
17
  {"mvpconf0", 0, 2},
18
  {"mvpconf1", 0, 3},
19
  {"vpcontrol", 0, 4},
20
  {"random", 1, 0},
21
  {"vpecontrol", 1, 1},
22
  {"vpeconf0", 1, 2},
23
  {"vpeconf1", 1, 3},
24
  {"yqmask", 1, 4},
25
  {"vpeschedule", 1, 5},
26
  {"vpeschefback", 1, 6},
27
  {"vpeopt", 1, 7},
28
  {"entrylo0", 2, 0},
29
  {"tcstatus", 2, 1},
30
  {"tcbind", 2, 2},
31
  {"tcrestart", 2, 3},
32
  {"tchalt", 2, 4},
33
  {"tccontext", 2, 5},
34
  {"tcschedule", 2, 6},
35
  {"tcschefback", 2, 7},
36
  {"entrylo1", 3, 0},
37
  {"globalnumber", 3, 1},
38
  {"tcopt", 3, 7},
39
  {"context", 4, 0},
40
  {"contextconfig", 4, 1},
41
  {"userlocal", 4, 2},
42
  {"xcontextconfig", 4, 3},
43
  {"debugcontextid", 4, 4},
44
  {"memorymapid", 4, 5},
45
  {"pagemask", 5, 0},
46
  {"pagegrain", 5, 1},
47
  {"segctl0", 5, 2},
48
  {"segctl1", 5, 3},
49
  {"segctl2", 5, 4},
50
  {"pwbase", 5, 5},
51
  {"pwfield", 5, 6},
52
  {"pwsize", 5, 7},
53
  {"wired", 6, 0},
54
  {"srsconf0", 6, 1},
55
  {"srsconf1", 6, 2},
56
  {"srsconf2", 6, 3},
57
  {"srsconf3", 6, 4},
58
  {"srsconf4", 6, 5},
59
  {"pwctl", 6, 6},
60
  {"hwrena", 7, 0},
61
  {"badvaddr", 8, 0},
62
  {"badinst", 8, 1},
63
  {"badinstrp", 8, 2},
64
  {"badinstrx", 8, 3},
65
  {"count", 9, 0},
66
  {"entryhi", 10, 0},
67
  {"guestctl1", 10, 4},
68
  {"guestctl2", 10, 5},
69
  {"guestctl3", 10, 6},
70
  {"compare", 11, 0},
71
  {"guestctl0ext", 11, 4},
72
  {"status", 12, 0},
73
  {"intctl", 12, 1},
74
  {"srsctl", 12, 2},
75
  {"srsmap", 12, 3},
76
  {"view_ipl", 12, 4},
77
  {"srsmap2", 12, 5},
78
  {"guestctl0", 12, 6},
79
  {"gtoffset", 12, 7},
80
  {"cause", 13, 0},
81
  {"view_ripl", 13, 4},
82
  {"nestedexc", 13, 5},
83
  {"epc", 14, 0},
84
  {"nestedepc", 14, 2},
85
  {"prid", 15, 0},
86
  {"ebase", 15, 1},
87
  {"cdmmbase", 15, 2},
88
  {"cmgcrbase", 15, 3},
89
  {"bevva", 15, 4},
90
  {"config", 16, 0},
91
  {"config1", 16, 1},
92
  {"config2", 16, 2},
93
  {"config3", 16, 3},
94
  {"config4", 16, 4},
95
  {"config5", 16, 5},
96
  {"lladdr", 17, 0},
97
  {"maar", 17, 1},
98
  {"maari", 17, 2},
99
  {"watchlo0", 18, 0},
100
  {"watchlo1", 18, 1},
101
  {"watchlo2", 18, 2},
102
  {"watchlo3", 18, 3},
103
  {"watchlo4", 18, 4},
104
  {"watchlo5", 18, 5},
105
  {"watchlo6", 18, 6},
106
  {"watchlo7", 18, 7},
107
  {"watchlo8", 18, 8},
108
  {"watchlo9", 18, 9},
109
  {"watchlo10", 18,10},
110
  {"watchlo11", 18,11},
111
  {"watchlo12", 18,12},
112
  {"watchlo13", 18,13},
113
  {"watchlo14", 18,14},
114
  {"watchlo15", 18,15},
115
  {"watchhi0", 19, 0},
116
  {"watchhi1", 19, 1},
117
  {"watchhi2", 19, 2},
118
  {"watchhi3", 19, 3},
119
  {"watchhi4", 19, 4},
120
  {"watchhi5", 19, 5},
121
  {"watchhi6", 19, 6},
122
  {"watchhi7", 19, 7},
123
  {"watchhi8", 19, 8},
124
  {"watchhi9", 19, 9},
125
  {"watchhi10", 19,10},
126
  {"watchhi11", 19,11},
127
  {"watchhi12", 19,12},
128
  {"watchhi13", 19,13},
129
  {"watchhi14", 19,14},
130
  {"watchhi15", 19,15},
131
  {"xcontext", 20, 0},
132
  {"debug", 23, 0},
133
  {"tracecontrol", 23, 1},
134
  {"tracecontrol2", 23, 2},
135
  {"usertracedata1", 23, 3},
136
  {"traceibpc", 23, 4},
137
  {"tracedbpc", 23, 5},
138
  {"debug2", 23, 6},
139
  {"depc", 24, 0},
140
  {"tracecontrol3", 24, 2},
141
  {"usertracedata2", 24, 3},
142
  {"perfctl0", 25, 0},
143
  {"perfcnt0", 25, 1},
144
  {"perfctl1", 25, 2},
145
  {"perfcnt1", 25, 3},
146
  {"perfctl2", 25, 4},
147
  {"perfcnt2", 25, 5},
148
  {"perfctl3", 25, 6},
149
  {"perfcnt3", 25, 7},
150
  {"perfctl4", 25, 8},
151
  {"perfcnt4", 25, 9},
152
  {"perfctl5", 25,10},
153
  {"perfcnt5", 25,11},
154
  {"perfctl6", 25,12},
155
  {"perfcnt6", 25,13},
156
  {"perfctl7", 25,14},
157
  {"perfcnt7", 25,15},
158
  {"errctl", 26, 0},
159
  {"cacheerr", 27, 0},
160
  {"itaglo", 28, 0},
161
  {"idatalo", 28, 1},
162
  {"dtaglo", 28, 2},
163
  {"ddatalo", 28, 3},
164
  {"itaghi", 29, 0},
165
  {"idatahi", 29, 1},
166
  {"dtaghi", 29, 2},
167
  {"ddatahi", 29, 3},
168
  {"errorepc", 30, 0},
169
  {"desave", 31, 0},
170
  {"kscratch1", 31, 2},
171
  {"kscratch2", 31, 3},
172
  {"kscratch3", 31, 4},
173
  {"kscratch4", 31, 5},
174
  {"kscratch5", 31, 6},
175
  {"kscratch6", 31, 7}
176
};
177
178
inline static int COP0Map_getEncIndexMap(int RegNo)
179
0
{
180
0
  int i;
181
0
  for (i = 0; i < (sizeof(CP0SelRegs) / sizeof(CP0SelRegs[0])); ++i) {
182
0
    unsigned RegEnc = (CP0SelRegs[i].RegNum << 5) | CP0SelRegs[i].Select;
183
0
    if (RegEnc == RegNo) {
184
0
      return i;
185
0
    }
186
0
  }
187
0
  return -1;
188
0
}
189
190
#endif // LLVM_LIB_TARGET_MIPS_NANOMIPSCP0REGMAP_H