2 * QEMU disassembler -- RISC-V specific header.
4 * SPDX-License-Identifier: GPL-2.0-or-later
10 #include "target/riscv/cpu_cfg.h"
14 typedef uint64_t rv_inst
;
15 typedef uint16_t rv_opcode
;
159 rv_codec_zcmp_cm_pushpop
,
167 rv_codec_r2_imm2_imm5
,
175 const rvc_constraint
*constraints
;
179 const char * const name
;
180 const rv_codec codec
;
181 const char * const format
;
182 const rv_comp_data
*pseudo
;
183 const short decomp_rv32
;
184 const short decomp_rv64
;
185 const short decomp_rv128
;
186 const short decomp_data
;
193 const rv_opcode_data
*opcode_data
;
222 /* instruction formats */
224 #define rv_fmt_none "O\t"
225 #define rv_fmt_rs1 "O\t1"
226 #define rv_fmt_offset "O\to"
227 #define rv_fmt_pred_succ "O\tp,s"
228 #define rv_fmt_rs1_rs2 "O\t1,2"
229 #define rv_fmt_rd_imm "O\t0,i"
230 #define rv_fmt_rd_uimm "O\t0,Ui"
231 #define rv_fmt_rd_offset "O\t0,o"
232 #define rv_fmt_rd_uoffset "O\t0,Uo"
233 #define rv_fmt_rd_rs1_rs2 "O\t0,1,2"
234 #define rv_fmt_frd_rs1 "O\t3,1"
235 #define rv_fmt_frd_rs1_rs2 "O\t3,1,2"
236 #define rv_fmt_frd_frs1 "O\t3,4"
237 #define rv_fmt_rd_frs1 "O\t0,4"
238 #define rv_fmt_rd_frs1_frs2 "O\t0,4,5"
239 #define rv_fmt_frd_frs1_frs2 "O\t3,4,5"
240 #define rv_fmt_rm_frd_frs1 "O\tr,3,4"
241 #define rv_fmt_rm_frd_rs1 "O\tr,3,1"
242 #define rv_fmt_rm_rd_frs1 "O\tr,0,4"
243 #define rv_fmt_rm_frd_frs1_frs2 "O\tr,3,4,5"
244 #define rv_fmt_rm_frd_frs1_frs2_frs3 "O\tr,3,4,5,6"
245 #define rv_fmt_rd_rs1_imm "O\t0,1,i"
246 #define rv_fmt_rd_rs1_offset "O\t0,1,i"
247 #define rv_fmt_rd_offset_rs1 "O\t0,i(1)"
248 #define rv_fmt_frd_offset_rs1 "O\t3,i(1)"
249 #define rv_fmt_rd_csr_rs1 "O\t0,c,1"
250 #define rv_fmt_rd_csr_zimm "O\t0,c,7"
251 #define rv_fmt_rs2_offset_rs1 "O\t2,i(1)"
252 #define rv_fmt_frs2_offset_rs1 "O\t5,i(1)"
253 #define rv_fmt_rs1_rs2_offset "O\t1,2,o"
254 #define rv_fmt_rs2_rs1_offset "O\t2,1,o"
255 #define rv_fmt_aqrl_rd_rs2_rs1 "OAR\t0,2,(1)"
256 #define rv_fmt_aqrl_rd_rs1 "OAR\t0,(1)"
257 #define rv_fmt_rd "O\t0"
258 #define rv_fmt_rd_zimm "O\t0,7"
259 #define rv_fmt_rd_rs1 "O\t0,1"
260 #define rv_fmt_rd_rs2 "O\t0,2"
261 #define rv_fmt_rs1_offset "O\t1,o"
262 #define rv_fmt_rs2_offset "O\t2,o"
263 #define rv_fmt_rs1_rs2_bs "O\t1,2,b"
264 #define rv_fmt_rd_rs1_rnum "O\t0,1,n"
265 #define rv_fmt_ldst_vd_rs1_vm "O\tD,(1)m"
266 #define rv_fmt_ldst_vd_rs1_rs2_vm "O\tD,(1),2m"
267 #define rv_fmt_ldst_vd_rs1_vs2_vm "O\tD,(1),Fm"
268 #define rv_fmt_vd_vs2_vs1 "O\tD,F,E"
269 #define rv_fmt_vd_vs2_vs1_vl "O\tD,F,El"
270 #define rv_fmt_vd_vs2_vs1_vm "O\tD,F,Em"
271 #define rv_fmt_vd_vs2_rs1_vl "O\tD,F,1l"
272 #define rv_fmt_vd_vs2_fs1_vl "O\tD,F,4l"
273 #define rv_fmt_vd_vs2_rs1_vm "O\tD,F,1m"
274 #define rv_fmt_vd_vs2_fs1_vm "O\tD,F,4m"
275 #define rv_fmt_vd_vs2_imm_vl "O\tD,F,il"
276 #define rv_fmt_vd_vs2_imm_vm "O\tD,F,im"
277 #define rv_fmt_vd_vs2_uimm "O\tD,F,u"
278 #define rv_fmt_vd_vs2_uimm_vm "O\tD,F,um"
279 #define rv_fmt_vd_vs1_vs2_vm "O\tD,E,Fm"
280 #define rv_fmt_vd_rs1_vs2_vm "O\tD,1,Fm"
281 #define rv_fmt_vd_fs1_vs2_vm "O\tD,4,Fm"
282 #define rv_fmt_vd_vs1 "O\tD,E"
283 #define rv_fmt_vd_rs1 "O\tD,1"
284 #define rv_fmt_vd_fs1 "O\tD,4"
285 #define rv_fmt_vd_imm "O\tD,i"
286 #define rv_fmt_vd_vs2 "O\tD,F"
287 #define rv_fmt_vd_vs2_vm "O\tD,Fm"
288 #define rv_fmt_rd_vs2_vm "O\t0,Fm"
289 #define rv_fmt_rd_vs2 "O\t0,F"
290 #define rv_fmt_fd_vs2 "O\t3,F"
291 #define rv_fmt_vd_vm "O\tDm"
292 #define rv_fmt_vsetvli "O\t0,1,v"
293 #define rv_fmt_vsetivli "O\t0,u,v"
294 #define rv_fmt_rs1_rs2_zce_ldst "O\t2,i(1)"
295 #define rv_fmt_push_rlist "O\tx,-i"
296 #define rv_fmt_pop_rlist "O\tx,i"
297 #define rv_fmt_zcmt_index "O\ti"
298 #define rv_fmt_rd_rs1_rs2_imm "O\t0,1,2,i"
299 #define rv_fmt_frd_rs1_rs2_imm "O\t3,1,2,i"
300 #define rv_fmt_rd_rs1_immh_imml "O\t0,1,i,j"
301 #define rv_fmt_rd_rs1_immh_imml_addr "O\t0,(1),i,j"
302 #define rv_fmt_rd2_imm "O\t0,2,(1),i"
303 #define rv_fmt_fli "O\t3,h"
305 #endif /* DISAS_RISCV_H */