1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
//! The RISC-V registers
use crateregidx;
use BitVector;
/// The type of general purpose registers
pub type GeneralRegister = regidx;
/// The X0 register.
///
/// This register is hardwired to zero.
pub const X0: regidx = Regidx;
/// The ZERO (X0) register.
///
/// This register is hardwired to zero.
pub const ZERO: regidx = X0;
/// The X1 (RA) register.
///
/// Used for the return address in the RISC-V ABI.
pub const X1: regidx = Regidx;
/// The RA (X1) register.
///
/// Used for the return address in the RISC-V ABI.
pub const RA: regidx = X1;
/// The X2 (SP) register.
///
/// Used for the stack pointer in the RISC-V ABI.
pub const X2: regidx = Regidx;
/// The SP (X2) register.
///
/// Used for the stack pointer in the RISC-V ABI.
pub const SP: regidx = X2;
/// The X3 (GP) register.
///
/// Used for the global pointer in the RISC-V ABI.
pub const X3: regidx = Regidx;
/// The GP (X3) register.
///
/// Used for the global pointer in the RISC-V ABI.
pub const GP: regidx = X3;
/// The X4 (TP) register.
///
/// Used for the thread pointer in the RISC-V ABI.
pub const X4: regidx = Regidx;
/// The TP (X4) register.
///
/// Used for the thread pointer in the RISC-V ABI.
pub const TP: regidx = X4;
/// The X5 (T0) register.
///
/// Temporary register in the RISC-V ABI.
pub const X5: regidx = Regidx;
/// The T0 (X5) register.
///
/// Temporary register in the RISC-V ABI.
pub const T0: regidx = X5;
/// The X6 (T1) register.
///
/// Temporary register in the RISC-V ABI.
pub const X6: regidx = Regidx;
/// The T1 (X6) register.
///
/// Temporary register in the RISC-V ABI.
pub const T1: regidx = X6;
/// The X7 (T2) register.
///
/// Temporary register in the RISC-V ABI.
pub const X7: regidx = Regidx;
/// The T2 (X7) register.
///
/// Temporary register in the RISC-V ABI.
pub const T2: regidx = X7;
/// The X8 (S0/FP) register.
///
/// Saved register 0 / Frame pointer in the RISC-V ABI.
pub const X8: regidx = Regidx;
/// The S0 (X8) register.
///
/// Saved register 0 / Frame pointer in the RISC-V ABI.
pub const S0: regidx = X8;
/// The FP (X8) register.
///
/// Frame pointer in the RISC-V ABI.
pub const FP: regidx = X8;
/// The X9 (S1) register.
///
/// Saved register 1 in the RISC-V ABI.
pub const X9: regidx = Regidx;
/// The S1 (X9) register.
///
/// Saved register 1 in the RISC-V ABI.
pub const S1: regidx = X9;
/// The X10 (A0) register.
///
/// Function argument / Return value in the RISC-V ABI.
pub const X10: regidx = Regidx;
/// The A0 (X10) register.
///
/// Function argument / Return value in the RISC-V ABI.
pub const A0: regidx = X10;
/// The X11 (A1) register.
///
/// Function argument / Return value in the RISC-V ABI.
pub const X11: regidx = Regidx;
/// The A1 (X11) register.
///
/// Function argument / Return value in the RISC-V ABI.
pub const A1: regidx = X11;
/// The X12 (A2) register.
///
/// Function argument in the RISC-V ABI.
pub const X12: regidx = Regidx;
/// The A2 (X12) register.
///
/// Function argument in the RISC-V ABI.
pub const A2: regidx = X12;
/// The X13 (A3) register.
///
/// Function argument in the RISC-V ABI.
pub const X13: regidx = Regidx;
/// The A3 (X13) register.
///
/// Function argument in the RISC-V ABI.
pub const A3: regidx = X13;
/// The X14 (A4) register.
///
/// Function argument in the RISC-V ABI.
pub const X14: regidx = Regidx;
/// The A4 (X14) register.
///
/// Function argument in the RISC-V ABI.
pub const A4: regidx = X14;
/// The X15 (A5) register.
///
/// Function argument in the RISC-V ABI.
pub const X15: regidx = Regidx;
/// The A5 (X15) register.
///
/// Function argument in the RISC-V ABI.
pub const A5: regidx = X15;
/// The X16 (A6) register.
///
/// Function argument in the RISC-V ABI.
pub const X16: regidx = Regidx;
/// The A6 (X16) register.
///
/// Function argument in the RISC-V ABI.
pub const A6: regidx = X16;
/// The X17 (A7) register.
///
/// Function argument in the RISC-V ABI.
pub const X17: regidx = Regidx;
/// The A7 (X17) register.
///
/// Function argument in the RISC-V ABI.
pub const A7: regidx = X17;
/// The X18 (S2) register.
///
/// Saved register 2 in the RISC-V ABI.
pub const X18: regidx = Regidx;
/// The S2 (X18) register.
///
/// Saved register 2 in the RISC-V ABI.
pub const S2: regidx = X18;
/// The X19 (S3) register.
///
/// Saved register 3 in the RISC-V ABI.
pub const X19: regidx = Regidx;
/// The S3 (X19) register.
///
/// Saved register 3 in the RISC-V ABI.
pub const S3: regidx = X19;
/// The X20 (S4) register.
///
/// Saved register 4 in the RISC-V ABI.
pub const X20: regidx = Regidx;
/// The S4 (X20) register.
///
/// Saved register 4 in the RISC-V ABI.
pub const S4: regidx = X20;
/// The X21 (S5) register.
///
/// Saved register 5 in the RISC-V ABI.
pub const X21: regidx = Regidx;
/// The S5 (X21) register.
///
/// Saved register 5 in the RISC-V ABI.
pub const S5: regidx = X21;
/// The X22 (S6) register.
///
/// Saved register 6 in the RISC-V ABI.
pub const X22: regidx = Regidx;
/// The S6 (X22) register.
///
/// Saved register 6 in the RISC-V ABI.
pub const S6: regidx = X22;
/// The X23 (S7) register.
///
/// Saved register 7 in the RISC-V ABI.
pub const X23: regidx = Regidx;
/// The S7 (X23) register.
///
/// Saved register 7 in the RISC-V ABI.
pub const S7: regidx = X23;
/// The X24 (S8) register.
///
/// Saved register 8 in the RISC-V ABI.
pub const X24: regidx = Regidx;
/// The S8 (X24) register.
///
/// Saved register 8 in the RISC-V ABI.
pub const S8: regidx = X24;
/// The X25 (S9) register.
///
/// Saved register 9 in the RISC-V ABI.
pub const X25: regidx = Regidx;
/// The S9 (X25) register.
///
/// Saved register 9 in the RISC-V ABI.
pub const S9: regidx = X25;
/// The X26 (S10) register.
///
/// Saved register 10 in the RISC-V ABI.
pub const X26: regidx = Regidx;
/// The S10 (X26) register.
///
/// Saved register 10 in the RISC-V ABI.
pub const S10: regidx = X26;
/// The X27 (S11) register.
///
/// Saved register 11 in the RISC-V ABI.
pub const X27: regidx = Regidx;
/// The S11 (X27) register.
///
/// Saved register 11 in the RISC-V ABI.
pub const S11: regidx = X27;
/// The X28 (T3) register.
///
/// Temporary register in the RISC-V ABI.
pub const X28: regidx = Regidx;
/// The T3 (X28) register.
///
/// Temporary register in the RISC-V ABI.
pub const T3: regidx = X28;
/// The X29 (T4) register.
///
/// Temporary register in the RISC-V ABI.
pub const X29: regidx = Regidx;
/// The T4 (X29) register.
///
/// Temporary register in the RISC-V ABI.
pub const T4: regidx = X29;
/// The X30 (T5) register.
///
/// Temporary register in the RISC-V ABI.
pub const X30: regidx = Regidx;
/// The T5 (X30) register.
///
/// Temporary register in the RISC-V ABI.
pub const T5: regidx = X30;
/// The X31 (T6) register.
///
/// Temporary register in the RISC-V ABI.
pub const X31: regidx = Regidx;
/// The T6 (X31) register.
///
/// Temporary register in the RISC-V ABI.
pub const T6: regidx = X31;