OpenOCD
opcodes.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #ifndef OPENOCD_TARGET_RISCV_OPCODES_H
4 #define OPENOCD_TARGET_RISCV_OPCODES_H
5 
6 #include "encoding.h"
7 #include <assert.h>
8 #include <stdbool.h>
9 #include <stdint.h>
10 
11 #define ZERO 0
12 #define T0 5
13 #define S0 8
14 #define S1 9
15 
16 #define MAX_GPR_NUM 31
17 #define MAX_FPR_NUM 31
18 #define MAX_VREG_NUM 31
19 #define MAX_CSR_NUM 4095
20 
21 #define MIN_INT12 (-0x800)
22 #define MAX_INT12 0x7ff
23 
24 #define MIN_INT13 (-0x1000)
25 #define MAX_INT13 0xfff
26 
27 #define MIN_INT21 (-0x100000)
28 #define MAX_INT21 0xfffff
29 
30 #define MAX_UINT5 0x1f
31 #define MAX_UINT11 0x7ff
32 #define MAX_UINT12 0xfff
33 
34 static uint32_t bits(uint32_t value, unsigned int hi, unsigned int lo)
35 {
36  return (value >> lo) & (((uint32_t)1 << (hi + 1 - lo)) - 1);
37 }
38 
39 static uint32_t bit(uint32_t value, unsigned int b)
40 {
41  return (value >> b) & 1;
42 }
43 
44 static uint32_t inst_rd(uint32_t r) __attribute__ ((unused));
45 static uint32_t inst_rd(uint32_t r)
46 {
47  return bits(r, 4, 0) << 7;
48 }
49 
50 static uint32_t inst_rs1(uint32_t r) __attribute__ ((unused));
51 static uint32_t inst_rs1(uint32_t r)
52 {
53  return bits(r, 4, 0) << 15;
54 }
55 
56 static uint32_t inst_rs2(uint32_t r) __attribute__ ((unused));
57 static uint32_t inst_rs2(uint32_t r)
58 {
59  return bits(r, 4, 0) << 20;
60 }
61 
62 static uint32_t imm_i(uint32_t imm) __attribute__ ((unused));
63 static uint32_t imm_i(uint32_t imm)
64 {
65  return bits(imm, 11, 0) << 20;
66 }
67 
68 static uint32_t imm_s(uint32_t imm) __attribute__ ((unused));
69 static uint32_t imm_s(uint32_t imm)
70 {
71  return (bits(imm, 4, 0) << 7) | (bits(imm, 11, 5) << 25);
72 }
73 
74 static uint32_t imm_b(uint32_t imm) __attribute__ ((unused));
75 static uint32_t imm_b(uint32_t imm)
76 {
77  return (bit(imm, 11) << 7) | (bits(imm, 4, 1) << 8) | (bits(imm, 10, 5) << 25) | (bit(imm, 12) << 31);
78 }
79 
80 static uint32_t imm_u(uint32_t imm) __attribute__ ((unused));
81 static uint32_t imm_u(uint32_t imm)
82 {
83  return bits(imm, 31, 12) << 12;
84 }
85 
86 static uint32_t imm_j(uint32_t imm) __attribute__ ((unused));
87 static uint32_t imm_j(uint32_t imm)
88 {
89  return (bits(imm, 19, 12) << 12) | (bit(imm, 11) << 20) | (bits(imm, 10, 1) << 21) | (bit(imm, 20) << 31);
90 }
91 
92 static uint32_t jal(unsigned int rd, int32_t imm) __attribute__ ((unused));
93 static uint32_t jal(unsigned int rd, int32_t imm)
94 {
95  assert(rd <= MAX_GPR_NUM);
96  assert((imm >= MIN_INT21) && (imm <= MAX_INT21));
97  assert((imm & 1) == 0);
98 
99  return imm_j((uint32_t)imm) | inst_rd(rd) | MATCH_JAL;
100 }
101 
102 static uint32_t csrsi(unsigned int csr, uint8_t imm) __attribute__ ((unused));
103 static uint32_t csrsi(unsigned int csr, uint8_t imm)
104 {
105  assert(csr <= MAX_CSR_NUM);
106  assert(imm <= MAX_UINT5);
107 
108  return imm_i(csr) | inst_rs1(imm) | MATCH_CSRRSI;
109 }
110 
111 static uint32_t sw(unsigned int src, unsigned int base, int16_t offset) __attribute__ ((unused));
112 static uint32_t sw(unsigned int src, unsigned int base, int16_t offset)
113 {
114  assert(src <= MAX_GPR_NUM);
115  assert(base <= MAX_GPR_NUM);
116  assert((offset >= MIN_INT12) && (offset <= MAX_INT12));
117 
118  return imm_s((uint16_t)offset) | inst_rs2(src) | inst_rs1(base) | MATCH_SW;
119 }
120 
121 static uint32_t sd(unsigned int src, unsigned int base, int16_t offset) __attribute__ ((unused));
122 static uint32_t sd(unsigned int src, unsigned int base, int16_t offset)
123 {
124  assert(src <= MAX_GPR_NUM);
125  assert(base <= MAX_GPR_NUM);
126  assert((offset >= MIN_INT12) && (offset <= MAX_INT12));
127 
128  return imm_s((uint16_t)offset) | inst_rs2(src) | inst_rs1(base) | MATCH_SD;
129 }
130 
131 static uint32_t sh(unsigned int src, unsigned int base, int16_t offset) __attribute__ ((unused));
132 static uint32_t sh(unsigned int src, unsigned int base, int16_t offset)
133 {
134  assert(src <= MAX_GPR_NUM);
135  assert(base <= MAX_GPR_NUM);
136  assert((offset >= MIN_INT12) && (offset <= MAX_INT12));
137 
138  return imm_s((uint16_t)offset) | inst_rs2(src) | inst_rs1(base) | MATCH_SH;
139 }
140 
141 static uint32_t sb(unsigned int src, unsigned int base, int16_t offset) __attribute__ ((unused));
142 static uint32_t sb(unsigned int src, unsigned int base, int16_t offset)
143 {
144  assert(src <= MAX_GPR_NUM);
145  assert(base <= MAX_GPR_NUM);
146  assert((offset >= MIN_INT12) && (offset <= MAX_INT12));
147 
148  return imm_s((uint16_t)offset) | inst_rs2(src) | inst_rs1(base) | MATCH_SB;
149 }
150 
151 static uint32_t ld(unsigned int rd, unsigned int base, int16_t offset) __attribute__ ((unused));
152 static uint32_t ld(unsigned int rd, unsigned int base, int16_t offset)
153 {
154  assert(rd <= MAX_GPR_NUM);
155  assert(base <= MAX_GPR_NUM);
156  assert((offset >= MIN_INT12) && (offset <= MAX_INT12));
157 
158  return imm_i((uint16_t)offset) | inst_rs1(base) | inst_rd(rd) | MATCH_LD;
159 }
160 
161 static uint32_t lw(unsigned int rd, unsigned int base, int16_t offset) __attribute__ ((unused));
162 static uint32_t lw(unsigned int rd, unsigned int base, int16_t offset)
163 {
164  assert(rd <= MAX_GPR_NUM);
165  assert(base <= MAX_GPR_NUM);
166  assert((offset >= MIN_INT12) && (offset <= MAX_INT12));
167 
168  return imm_i((uint16_t)offset) | inst_rs1(base) | inst_rd(rd) | MATCH_LW;
169 }
170 
171 static uint32_t lh(unsigned int rd, unsigned int base, int16_t offset) __attribute__ ((unused));
172 static uint32_t lh(unsigned int rd, unsigned int base, int16_t offset)
173 {
174  assert(rd <= MAX_GPR_NUM);
175  assert(base <= MAX_GPR_NUM);
176  assert((offset >= MIN_INT12) && (offset <= MAX_INT12));
177 
178  return imm_i((uint16_t)offset) | inst_rs1(base) | inst_rd(rd) | MATCH_LH;
179 }
180 
181 static uint32_t lb(unsigned int rd, unsigned int base, int16_t offset) __attribute__ ((unused));
182 static uint32_t lb(unsigned int rd, unsigned int base, int16_t offset)
183 {
184  assert(rd <= MAX_GPR_NUM);
185  assert(base <= MAX_GPR_NUM);
186  assert((offset >= MIN_INT12) && (offset <= MAX_INT12));
187 
188  return imm_i((uint16_t)offset) | inst_rs1(base) | inst_rd(rd) | MATCH_LB;
189 }
190 
191 static uint32_t csrw(unsigned int source, unsigned int csr) __attribute__ ((unused));
192 static uint32_t csrw(unsigned int source, unsigned int csr)
193 {
194  assert(source <= MAX_GPR_NUM);
195  assert(csr <= MAX_CSR_NUM);
196 
197  return imm_i(csr) | inst_rs1(source) | MATCH_CSRRW;
198 }
199 
200 static uint32_t addi(unsigned int dest, unsigned int src, int16_t imm) __attribute__ ((unused));
201 static uint32_t addi(unsigned int dest, unsigned int src, int16_t imm)
202 {
203  assert(dest <= MAX_GPR_NUM);
204  assert(src <= MAX_GPR_NUM);
205  assert((imm >= MIN_INT12) && (imm <= MAX_INT12));
206 
207  return imm_i((uint16_t)imm) | inst_rs1(src) | inst_rd(dest) | MATCH_ADDI;
208 }
209 
210 static uint32_t csrr(unsigned int rd, unsigned int csr) __attribute__ ((unused));
211 static uint32_t csrr(unsigned int rd, unsigned int csr)
212 {
213  assert(rd <= MAX_GPR_NUM);
214  assert(csr <= MAX_CSR_NUM);
215 
216  return imm_i(csr) | inst_rd(rd) | MATCH_CSRRS;
217 }
218 
219 static uint32_t csrrs(unsigned int rd, unsigned int rs, unsigned int csr) __attribute__ ((unused));
220 static uint32_t csrrs(unsigned int rd, unsigned int rs, unsigned int csr)
221 {
222  assert(rd <= MAX_GPR_NUM);
223  assert(rs <= MAX_GPR_NUM);
224  assert(csr <= MAX_CSR_NUM);
225 
226  return imm_i(csr) | inst_rs1(rs) | inst_rd(rd) | MATCH_CSRRS;
227 }
228 
229 static uint32_t csrrw(unsigned int rd, unsigned int rs, unsigned int csr) __attribute__ ((unused));
230 static uint32_t csrrw(unsigned int rd, unsigned int rs, unsigned int csr)
231 {
232  assert(rd <= MAX_GPR_NUM);
233  assert(rs <= MAX_GPR_NUM);
234  assert(csr <= MAX_CSR_NUM);
235 
236  return imm_i(csr) | inst_rs1(rs) | inst_rd(rd) | MATCH_CSRRW;
237 }
238 
239 static uint32_t csrrci(unsigned int rd, uint8_t zimm, unsigned int csr) __attribute__ ((unused));
240 static uint32_t csrrci(unsigned int rd, uint8_t zimm, unsigned int csr)
241 {
242  assert(rd <= MAX_GPR_NUM);
243  assert(zimm <= MAX_UINT5);
244  assert(csr <= MAX_CSR_NUM);
245 
246  return imm_i(csr) | inst_rs1(zimm) | inst_rd(rd) | MATCH_CSRRCI;
247 }
248 
249 static uint32_t csrrsi(unsigned int rd, uint8_t zimm, unsigned int csr) __attribute__ ((unused));
250 static uint32_t csrrsi(unsigned int rd, uint8_t zimm, unsigned int csr)
251 {
252  assert(rd <= MAX_GPR_NUM);
253  assert(zimm <= MAX_UINT5);
254  assert(csr <= MAX_CSR_NUM);
255 
256  return imm_i(csr) | inst_rs1(zimm) | inst_rd(rd) | MATCH_CSRRSI;
257 }
258 
259 static uint32_t fsw(unsigned int src, unsigned int base, int16_t offset) __attribute__ ((unused));
260 static uint32_t fsw(unsigned int src, unsigned int base, int16_t offset)
261 {
262  assert(src <= MAX_FPR_NUM);
263  assert(base <= MAX_GPR_NUM);
264  assert((offset >= MIN_INT12) && (offset <= MAX_INT12));
265 
266  return imm_s((uint16_t)offset) | inst_rs2(src) | inst_rs1(base) | MATCH_FSW;
267 }
268 
269 static uint32_t fsd(unsigned int src, unsigned int base, int16_t offset) __attribute__ ((unused));
270 static uint32_t fsd(unsigned int src, unsigned int base, int16_t offset)
271 {
272  assert(src <= MAX_FPR_NUM);
273  assert(base <= MAX_GPR_NUM);
274  assert((offset >= MIN_INT12) && (offset <= MAX_INT12));
275 
276  return imm_s((uint16_t)offset) | inst_rs2(src) | inst_rs1(base) | MATCH_FSD;
277 }
278 
279 static uint32_t flw(unsigned int dest, unsigned int base, int16_t offset) __attribute__ ((unused));
280 static uint32_t flw(unsigned int dest, unsigned int base, int16_t offset)
281 {
282  assert(dest <= MAX_FPR_NUM);
283  assert(base <= MAX_GPR_NUM);
284  assert((offset >= MIN_INT12) && (offset <= MAX_INT12));
285 
286  return imm_i((uint16_t)offset) | inst_rs1(base) | inst_rd(dest) | MATCH_FLW;
287 }
288 
289 static uint32_t fld(unsigned int dest, unsigned int base, int16_t offset) __attribute__ ((unused));
290 static uint32_t fld(unsigned int dest, unsigned int base, int16_t offset)
291 {
292  assert(dest <= MAX_FPR_NUM);
293  assert(base <= MAX_GPR_NUM);
294  assert((offset >= MIN_INT12) && (offset <= MAX_INT12));
295 
296  return imm_i((uint16_t)offset) | inst_rs1(base) | inst_rd(dest) | MATCH_FLD;
297 }
298 
299 static uint32_t fmv_x_w(unsigned int dest, unsigned int src) __attribute__ ((unused));
300 static uint32_t fmv_x_w(unsigned int dest, unsigned int src)
301 {
302  assert(dest <= MAX_GPR_NUM);
303  assert(src <= MAX_FPR_NUM);
304 
305  return inst_rs1(src) | inst_rd(dest) | MATCH_FMV_X_W;
306 }
307 
308 static uint32_t fmv_x_d(unsigned int dest, unsigned int src) __attribute__ ((unused));
309 static uint32_t fmv_x_d(unsigned int dest, unsigned int src)
310 {
311  assert(dest <= MAX_GPR_NUM);
312  assert(src <= MAX_FPR_NUM);
313 
314  return inst_rs1(src) | inst_rd(dest) | MATCH_FMV_X_D;
315 }
316 
317 static uint32_t fmv_w_x(unsigned int dest, unsigned int src) __attribute__ ((unused));
318 static uint32_t fmv_w_x(unsigned int dest, unsigned int src)
319 {
320  assert(dest <= MAX_FPR_NUM);
321  assert(src <= MAX_GPR_NUM);
322 
323  return inst_rs1(src) | inst_rd(dest) | MATCH_FMV_W_X;
324 }
325 
326 static uint32_t fmv_d_x(unsigned int dest, unsigned int src) __attribute__ ((unused));
327 static uint32_t fmv_d_x(unsigned int dest, unsigned int src)
328 {
329  assert(dest <= MAX_FPR_NUM);
330  assert(src <= MAX_GPR_NUM);
331 
332  return inst_rs1(src) | inst_rd(dest) | MATCH_FMV_D_X;
333 }
334 
335 static uint32_t ebreak(void) __attribute__ ((unused));
336 static uint32_t ebreak(void)
337 {
338  return MATCH_EBREAK;
339 }
340 static uint32_t ebreak_c(void) __attribute__ ((unused));
341 static uint32_t ebreak_c(void)
342 {
343  return MATCH_C_EBREAK;
344 }
345 
346 static uint32_t wfi(void) __attribute__ ((unused));
347 static uint32_t wfi(void) { return MATCH_WFI; }
348 
349 static uint32_t fence_i(void) __attribute__ ((unused));
350 static uint32_t fence_i(void)
351 {
352  return MATCH_FENCE_I;
353 }
354 
355 static uint32_t lui(unsigned int dest, uint32_t imm) __attribute__ ((unused));
356 static uint32_t lui(unsigned int dest, uint32_t imm)
357 {
358  assert(dest <= MAX_GPR_NUM);
359  assert(bits(imm, 11, 0) == 0);
360 
361  return imm_u(imm) | inst_rd(dest) | MATCH_LUI;
362 }
363 
364 static uint32_t xori(unsigned int dest, unsigned int src, int16_t imm) __attribute__ ((unused));
365 static uint32_t xori(unsigned int dest, unsigned int src, int16_t imm)
366 {
367  assert(dest <= MAX_GPR_NUM);
368  assert(src <= MAX_GPR_NUM);
369  assert((imm >= MIN_INT12) && (imm <= MAX_INT12));
370 
371  return imm_i((uint16_t)imm) | inst_rs1(src) | inst_rd(dest) | MATCH_XORI;
372 }
373 
374 static uint32_t srli(unsigned int dest, unsigned int src, uint8_t shamt) __attribute__ ((unused));
375 static uint32_t srli(unsigned int dest, unsigned int src, uint8_t shamt)
376 {
377  assert(dest <= MAX_GPR_NUM);
378  assert(src <= MAX_GPR_NUM);
379  assert(shamt <= MAX_UINT5);
380 
381  return inst_rs2(shamt) | inst_rs1(src) | inst_rd(dest) | MATCH_SRLI;
382 }
383 
384 static uint32_t fence_rw_rw(void) __attribute__((unused));
385 static uint32_t fence_rw_rw(void)
386 {
387  /* fence rw,rw */
388  return MATCH_FENCE | 0x3300000;
389 }
390 
391 static uint32_t auipc(unsigned int dest) __attribute__((unused));
392 static uint32_t auipc(unsigned int dest)
393 {
394  assert(dest <= MAX_GPR_NUM);
395 
396  return MATCH_AUIPC | inst_rd(dest);
397 }
398 
399 static uint32_t vsetvli(unsigned int dest, unsigned int src, uint16_t vtypei) __attribute__((unused));
400 static uint32_t vsetvli(unsigned int dest, unsigned int src, uint16_t vtypei)
401 {
402  assert(dest <= MAX_GPR_NUM);
403  assert(src <= MAX_GPR_NUM);
404  assert(vtypei <= MAX_UINT11);
405 
406  return (bits(vtypei, 10, 0) << 20) | inst_rs1(src) | inst_rd(dest) | MATCH_VSETVLI;
407 }
408 
409 static uint32_t vsetvl(unsigned int rd, unsigned int rs1, unsigned int rs2) __attribute__((unused));
410 static uint32_t vsetvl(unsigned int rd, unsigned int rs1, unsigned int rs2)
411 {
412  assert(rd <= MAX_GPR_NUM);
413  assert(rs1 <= MAX_GPR_NUM);
414  assert(rs2 <= MAX_GPR_NUM);
415 
416  return inst_rd(rd) | inst_rs1(rs1) | inst_rs2(rs2) | MATCH_VSETVL;
417 }
418 
419 static uint32_t vmv_x_s(unsigned int rd, unsigned int vs2) __attribute__((unused));
420 static uint32_t vmv_x_s(unsigned int rd, unsigned int vs2)
421 {
422  assert(rd <= MAX_GPR_NUM);
423  assert(vs2 <= MAX_VREG_NUM);
424 
425  return inst_rs2(vs2) | inst_rd(rd) | MATCH_VMV_X_S;
426 }
427 
428 static uint32_t vmv_s_x(unsigned int vd, unsigned int rs2) __attribute__((unused));
429 static uint32_t vmv_s_x(unsigned int vd, unsigned int rs2)
430 {
431  assert(vd <= MAX_VREG_NUM);
432  assert(rs2 <= MAX_GPR_NUM);
433 
434  return inst_rs1(rs2) | inst_rd(vd) | MATCH_VMV_S_X;
435 }
436 
437 static uint32_t vslide1down_vx(unsigned int vd, unsigned int vs2,
438  unsigned int rs1, bool vm) __attribute__((unused));
439 static uint32_t vslide1down_vx(unsigned int vd, unsigned int vs2,
440  unsigned int rs1, bool vm)
441 {
442  assert(vd <= MAX_VREG_NUM);
443  assert(vs2 <= MAX_VREG_NUM);
444  assert(rs1 <= MAX_GPR_NUM);
445 
446  return (vm ? (1u << 25) : 0u) | inst_rs2(vs2) | inst_rs1(rs1) | inst_rd(vd) | MATCH_VSLIDE1DOWN_VX;
447 }
448 
449 #endif /* OPENOCD_TARGET_RISCV_OPCODES_H */
const char * rs
Definition: ecos.c:480
#define MATCH_LH
Definition: encoding.h:1270
#define MATCH_LUI
Definition: encoding.h:1278
#define MATCH_CSRRW
Definition: encoding.h:696
#define MATCH_VSETVL
Definition: encoding.h:2566
#define MATCH_JAL
Definition: encoding.h:1050
#define MATCH_WFI
Definition: encoding.h:2758
#define MATCH_AUIPC
Definition: encoding.h:450
#define MATCH_VMV_S_X
Definition: encoding.h:2436
#define MATCH_CSRRCI
Definition: encoding.h:690
#define MATCH_FMV_X_W
Definition: encoding.h:920
#define MATCH_FSD
Definition: encoding.h:938
#define MATCH_FMV_D_X
Definition: encoding.h:910
#define MATCH_C_EBREAK
Definition: encoding.h:520
#define MATCH_FLW
Definition: encoding.h:868
#define MATCH_CSRRS
Definition: encoding.h:692
#define MATCH_LW
Definition: encoding.h:1280
#define MATCH_SH
Definition: encoding.h:1440
#define MATCH_LB
Definition: encoding.h:1264
#define MATCH_EBREAK
Definition: encoding.h:718
#define MATCH_FMV_W_X
Definition: encoding.h:914
#define MATCH_FENCE_I
Definition: encoding.h:836
#define MATCH_FENCE
Definition: encoding.h:834
#define MATCH_SB
Definition: encoding.h:1408
#define MATCH_VSETVLI
Definition: encoding.h:2568
#define MATCH_FLD
Definition: encoding.h:846
#define MATCH_VMV_X_S
Definition: encoding.h:2444
#define MATCH_SRLI
Definition: encoding.h:1678
#define MATCH_VSLIDE1DOWN_VX
Definition: encoding.h:2576
#define MATCH_SW
Definition: encoding.h:1736
#define MATCH_SD
Definition: encoding.h:1428
#define MATCH_CSRRSI
Definition: encoding.h:694
#define MATCH_FMV_X_D
Definition: encoding.h:916
#define MATCH_FSW
Definition: encoding.h:996
#define MATCH_XORI
Definition: encoding.h:2768
#define MATCH_ADDI
Definition: encoding.h:380
#define MATCH_LD
Definition: encoding.h:1268
uint8_t csr
Definition: esirisc.c:136
static uint32_t inst_rd(uint32_t r) __attribute__((unused))
Definition: opcodes.h:45
static uint32_t fence_rw_rw(void) __attribute__((unused))
Definition: opcodes.h:385
static uint32_t imm_i(uint32_t imm) __attribute__((unused))
Definition: opcodes.h:63
static uint32_t bits(uint32_t value, unsigned int hi, unsigned int lo)
Definition: opcodes.h:34
static uint32_t csrrw(unsigned int rd, unsigned int rs, unsigned int csr) __attribute__((unused))
Definition: opcodes.h:230
static uint32_t bit(uint32_t value, unsigned int b)
Definition: opcodes.h:39
static uint32_t sb(unsigned int src, unsigned int base, int16_t offset) __attribute__((unused))
Definition: opcodes.h:142
static uint32_t fmv_d_x(unsigned int dest, unsigned int src) __attribute__((unused))
Definition: opcodes.h:327
static uint32_t wfi(void) __attribute__((unused))
Definition: opcodes.h:347
static uint32_t sd(unsigned int src, unsigned int base, int16_t offset) __attribute__((unused))
Definition: opcodes.h:122
static uint32_t csrw(unsigned int source, unsigned int csr) __attribute__((unused))
Definition: opcodes.h:192
static uint32_t csrrs(unsigned int rd, unsigned int rs, unsigned int csr) __attribute__((unused))
Definition: opcodes.h:220
static uint32_t inst_rs2(uint32_t r) __attribute__((unused))
Definition: opcodes.h:57
static uint32_t ld(unsigned int rd, unsigned int base, int16_t offset) __attribute__((unused))
Definition: opcodes.h:152
static uint32_t fence_i(void) __attribute__((unused))
Definition: opcodes.h:350
#define MAX_UINT11
Definition: opcodes.h:31
static uint32_t fsw(unsigned int src, unsigned int base, int16_t offset) __attribute__((unused))
Definition: opcodes.h:260
static uint32_t lw(unsigned int rd, unsigned int base, int16_t offset) __attribute__((unused))
Definition: opcodes.h:162
static uint32_t lh(unsigned int rd, unsigned int base, int16_t offset) __attribute__((unused))
Definition: opcodes.h:172
static uint32_t imm_s(uint32_t imm) __attribute__((unused))
Definition: opcodes.h:69
#define MAX_INT12
Definition: opcodes.h:22
static uint32_t csrr(unsigned int rd, unsigned int csr) __attribute__((unused))
Definition: opcodes.h:211
static uint32_t imm_b(uint32_t imm) __attribute__((unused))
Definition: opcodes.h:75
#define MAX_VREG_NUM
Definition: opcodes.h:18
#define MAX_CSR_NUM
Definition: opcodes.h:19
static uint32_t ebreak(void) __attribute__((unused))
Definition: opcodes.h:336
static uint32_t csrsi(unsigned int csr, uint8_t imm) __attribute__((unused))
Definition: opcodes.h:103
static uint32_t vsetvl(unsigned int rd, unsigned int rs1, unsigned int rs2) __attribute__((unused))
Definition: opcodes.h:410
static uint32_t flw(unsigned int dest, unsigned int base, int16_t offset) __attribute__((unused))
Definition: opcodes.h:280
#define MAX_UINT5
Definition: opcodes.h:30
static uint32_t vmv_s_x(unsigned int vd, unsigned int rs2) __attribute__((unused))
Definition: opcodes.h:429
static uint32_t lui(unsigned int dest, uint32_t imm) __attribute__((unused))
Definition: opcodes.h:356
static uint32_t vmv_x_s(unsigned int rd, unsigned int vs2) __attribute__((unused))
Definition: opcodes.h:420
static uint32_t fsd(unsigned int src, unsigned int base, int16_t offset) __attribute__((unused))
Definition: opcodes.h:270
#define MIN_INT21
Definition: opcodes.h:27
static uint32_t srli(unsigned int dest, unsigned int src, uint8_t shamt) __attribute__((unused))
Definition: opcodes.h:375
static uint32_t fmv_x_w(unsigned int dest, unsigned int src) __attribute__((unused))
Definition: opcodes.h:300
static uint32_t fmv_w_x(unsigned int dest, unsigned int src) __attribute__((unused))
Definition: opcodes.h:318
static uint32_t jal(unsigned int rd, int32_t imm) __attribute__((unused))
Definition: opcodes.h:93
static uint32_t inst_rs1(uint32_t r) __attribute__((unused))
Definition: opcodes.h:51
static uint32_t vslide1down_vx(unsigned int vd, unsigned int vs2, unsigned int rs1, bool vm) __attribute__((unused))
Definition: opcodes.h:439
#define MIN_INT12
Definition: opcodes.h:21
static uint32_t csrrsi(unsigned int rd, uint8_t zimm, unsigned int csr) __attribute__((unused))
Definition: opcodes.h:250
static uint32_t imm_j(uint32_t imm) __attribute__((unused))
Definition: opcodes.h:87
static uint32_t xori(unsigned int dest, unsigned int src, int16_t imm) __attribute__((unused))
Definition: opcodes.h:365
static uint32_t csrrci(unsigned int rd, uint8_t zimm, unsigned int csr) __attribute__((unused))
Definition: opcodes.h:240
static uint32_t sh(unsigned int src, unsigned int base, int16_t offset) __attribute__((unused))
Definition: opcodes.h:132
static uint32_t addi(unsigned int dest, unsigned int src, int16_t imm) __attribute__((unused))
Definition: opcodes.h:201
static uint32_t auipc(unsigned int dest) __attribute__((unused))
Definition: opcodes.h:392
#define MAX_INT21
Definition: opcodes.h:28
#define MAX_FPR_NUM
Definition: opcodes.h:17
static uint32_t sw(unsigned int src, unsigned int base, int16_t offset) __attribute__((unused))
Definition: opcodes.h:112
static uint32_t ebreak_c(void) __attribute__((unused))
Definition: opcodes.h:341
static uint32_t lb(unsigned int rd, unsigned int base, int16_t offset) __attribute__((unused))
Definition: opcodes.h:182
static uint32_t fmv_x_d(unsigned int dest, unsigned int src) __attribute__((unused))
Definition: opcodes.h:309
static uint32_t imm_u(uint32_t imm) __attribute__((unused))
Definition: opcodes.h:81
static uint32_t fld(unsigned int dest, unsigned int base, int16_t offset) __attribute__((unused))
Definition: opcodes.h:290
static uint32_t vsetvli(unsigned int dest, unsigned int src, uint16_t vtypei) __attribute__((unused))
Definition: opcodes.h:400
#define MAX_GPR_NUM
Definition: opcodes.h:16
struct qn908x_flash_bank __attribute__
Definition: armv8.c:1054
struct rtt_source source
Definition: rtt/rtt.c:23
uint8_t offset[4]
Definition: vdebug.c:9