From eff6b64850967154cc3583d2c932ae115951950b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D9=85=D8=B5=D8=B7=D9=81=D9=8A=20=D9=85=D8=AD=D9=85=D9=88?= =?UTF-8?q?=D8=AF=20=D9=83=D9=85=D8=A7=D9=84=20=D8=A7=D9=84=D8=AF=D9=8A?= =?UTF-8?q?=D9=86?= <48567303+moste00@users.noreply.github.com> Date: Wed, 11 Dec 2024 23:43:08 +0200 Subject: [PATCH] fixed printer (hack), added compressed instruction, no longer includes in riscv.h, changed name to reflect other archs conventio --- CMakeLists.txt | 17 +- .../{riscv_ast.gen.inc => RISCVAst.gen.inc} | 25 +- arch/RISCV/RISCVAst2Str.gen.inc | 3188 ++++++ arch/RISCV/RISCVAst2StrTbls.gen.inc | 2522 +++++ ...scv_decode.gen.inc => RISCVDecode.gen.inc} | 28 +- ....gen.inc => RISCVDecodeCompressed.gen.inc} | 28 +- arch/RISCV/RISCVDetails.c | 15 +- arch/RISCV/RISCVDetails.h | 2 +- arch/RISCV/RISCVDisassembler.c | 43 +- ...elpers_ast2str.h => RISCVHelpersAst2Str.h} | 110 +- ..._helpers_rvconf.h => RISCVHelpersRVConf.h} | 0 .../RISCV/RISCVInsn.gen.inc | 25 +- arch/RISCV/RISCVInsnMappings.gen.inc | 654 ++ arch/RISCV/RISCVPrinter.c | 17 +- arch/RISCV/RISCVPrinter.h | 2 - arch/RISCV/riscv_ast2str.gen.inc | 9907 ----------------- arch/RISCV/riscv_ast2str_tbls.gen.inc | 3054 ----- arch/RISCV/riscv_insn_mapping.gen.inc | 608 - include/capstone/riscv.h | 985 +- 19 files changed, 7493 insertions(+), 13737 deletions(-) rename arch/RISCV/{riscv_ast.gen.inc => RISCVAst.gen.inc} (99%) create mode 100644 arch/RISCV/RISCVAst2Str.gen.inc create mode 100644 arch/RISCV/RISCVAst2StrTbls.gen.inc rename arch/RISCV/{riscv_decode.gen.inc => RISCVDecode.gen.inc} (99%) rename arch/RISCV/{riscv_decode_compressed.gen.inc => RISCVDecodeCompressed.gen.inc} (98%) rename arch/RISCV/{riscv_helpers_ast2str.h => RISCVHelpersAst2Str.h} (54%) rename arch/RISCV/{riscv_helpers_rvconf.h => RISCVHelpersRVConf.h} (100%) rename include/capstone/riscv_insn.gen.inc => arch/RISCV/RISCVInsn.gen.inc (98%) create mode 100644 arch/RISCV/RISCVInsnMappings.gen.inc delete mode 100644 arch/RISCV/riscv_ast2str.gen.inc delete mode 100644 arch/RISCV/riscv_ast2str_tbls.gen.inc delete mode 100644 arch/RISCV/riscv_insn_mapping.gen.inc diff --git a/CMakeLists.txt b/CMakeLists.txt index e40e7ad9b0..eebac0fd7a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -580,17 +580,18 @@ if(CAPSTONE_RISCV_SUPPORT) arch/RISCV/RISCVPrinter.c ) set(HEADERS_RISCV - arch/RISCV/riscv_ast.gen.inc - arch/RISCV/riscv_decode.gen.inc - arch/RISCV/riscv_ast2str.gen.inc - arch/RISCV/riscv_ast2str_tbls.gen.inc - "include/capstone/riscv_insn.gen.inc" - arch/RISCV/riscv_insn_mapping.gen.inc + arch/RISCV/RISCVAst.gen.inc + arch/RISCV/RISCVDecode.gen.inc + arch/RISCV/RISCVDecodeCompressed.gen.inc + arch/RISCV/RISCVAst2Str.gen.inc + arch/RISCV/RISCVAst2StrTbls.gen.inc + arch/RISCV/RISCVInsn.gen.inc + arch/RISCV/RISCVInsnMappings.gen.inc arch/RISCV/RISCVDetails.h arch/RISCV/RISCVDisassembler.h - arch/RISCV/riscv_helpers_ast2str.h - arch/RISCV/riscv_helpers_rvconf.h + arch/RISCV/RISCVHelpersAst2Str.h + arch/RISCV/RISCVHelpersRVConf.h arch/RISCV/RISCVModule.h arch/RISCV/RISCVPrinter.h ) diff --git a/arch/RISCV/riscv_ast.gen.inc b/arch/RISCV/RISCVAst.gen.inc similarity index 99% rename from arch/RISCV/riscv_ast.gen.inc rename to arch/RISCV/RISCVAst.gen.inc index 44491d30ed..5e8a6ebe6a 100644 --- a/arch/RISCV/riscv_ast.gen.inc +++ b/arch/RISCV/RISCVAst.gen.inc @@ -1,19 +1,19 @@ /*=======================================================================*/ -/*This code was generated by the tool riscv_disasm_from_sail (see - * https://github.com/moste00/riscv_disasm_from_sail)*/ -/*from the sail model of RISC-V (see https://github.com/riscv/sail-riscv) @ - * version 0b9c639f19da48734cbf14b61f6ad200b7c70de9.*/ -/*DO NOT MODIFY THIS CODE MANUALLY.*/ -/* */ -/*SPDX-License-Identifier: BSD-3-Clause*/ +/* This code was generated by the tool auto-sync-sail*/ +/* (see https://github.com/rizinorg/capstone-autosync-sail)*/ +/* from the sail model of RISC-V*/ +/* (see https://github.com/riscv/sail-riscv) @ version + * 0b9c639f19da48734cbf14b61f6ad200b7c70de9.*/ +/* DO NOT MODIFY THIS CODE MANUALLY. ANY MANUAL EDITS ARE OVERWRITTEN.*/ +/* ------------------------------------------------------------------- */ +/* Copyright © 2024 moste00 */ +/* SPDX-License-Identifier: BSD-3-Clause*/ /*=======================================================================*/ -#ifndef __Riscv_ast_gen_inc__ -#define __Riscv_ast_gen_inc__ -#include - +#ifndef __RISCVAST_GEN_INC__ +#define __RISCVAST_GEN_INC__ #include - +#include #include enum { RISCV_false = 0, RISCV_true = 1 }; @@ -2227,5 +2227,4 @@ struct ast { uint8_t riscv_zicboz /* bits : 5 */; } ast_node; }; - #endif diff --git a/arch/RISCV/RISCVAst2Str.gen.inc b/arch/RISCV/RISCVAst2Str.gen.inc new file mode 100644 index 0000000000..983078ca3f --- /dev/null +++ b/arch/RISCV/RISCVAst2Str.gen.inc @@ -0,0 +1,3188 @@ +/*=======================================================================*/ +/* This code was generated by the tool auto-sync-sail*/ +/* (see https://github.com/rizinorg/capstone-autosync-sail)*/ +/* from the sail model of RISC-V*/ +/* (see https://github.com/riscv/sail-riscv) @ version + * 0b9c639f19da48734cbf14b61f6ad200b7c70de9.*/ +/* DO NOT MODIFY THIS CODE MANUALLY. ANY MANUAL EDITS ARE OVERWRITTEN.*/ +/* ------------------------------------------------------------------- */ +/* Copyright © 2024 moste00 */ +/* SPDX-License-Identifier: BSD-3-Clause*/ +/*=======================================================================*/ + +#ifndef __RISCVAST2STR_GEN_INC__ +#define __RISCVAST2STR_GEN_INC__ +#include +#include +#include + +#include "RISCVAst.gen.inc" +#include "RISCVAst2StrTbls.gen.inc" +#include "RISCVHelpersAst2Str.h" +#include "../../SStream.h" + +static void ast2str(struct ast *tree, SStream *ss, riscv_conf *conf) { + switch (tree->ast_node_type) { + case RISCV_UTYPE: + utype_mnemonic(tree->ast_node.utype.op, ss); + spc(ss, conf); + reg_name(tree->ast_node.utype.rd, ss); + sep(ss, conf); + hex_bits_signed_20(tree->ast_node.utype.imm, ss, conf); + break; + case RISCV_JAL: + SStream_concat(ss, "jal"); + spc(ss, conf); + reg_name(tree->ast_node.riscv_jal.rd, ss); + sep(ss, conf); + hex_bits_signed_21(tree->ast_node.riscv_jal.imm, ss, conf); + break; + case RISCV_JALR: + SStream_concat(ss, "jalr"); + spc(ss, conf); + reg_name(tree->ast_node.riscv_jalr.rd, ss); + sep(ss, conf); + hex_bits_signed_12(tree->ast_node.riscv_jalr.imm, ss, conf); + SStream_concat(ss, "("); + reg_name(tree->ast_node.riscv_jalr.rs1, ss); + SStream_concat(ss, ")"); + break; + case RISCV_BTYPE: + btype_mnemonic(tree->ast_node.btype.op, ss); + spc(ss, conf); + reg_name(tree->ast_node.btype.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.btype.rs2, ss); + sep(ss, conf); + hex_bits_signed_13(tree->ast_node.btype.imm, ss, conf); + break; + case RISCV_ITYPE: + itype_mnemonic(tree->ast_node.itype.op, ss); + spc(ss, conf); + reg_name(tree->ast_node.itype.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.itype.rs1, ss); + sep(ss, conf); + hex_bits_signed_12(tree->ast_node.itype.imm, ss, conf); + break; + case RISCV_SHIFTIOP: + shiftiop_mnemonic(tree->ast_node.shiftiop.op, ss); + spc(ss, conf); + reg_name(tree->ast_node.shiftiop.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.shiftiop.rs1, ss); + sep(ss, conf); + hex_bits_6(tree->ast_node.shiftiop.shamt, ss, conf); + break; + case RISCV_RTYPE: + rtype_mnemonic(tree->ast_node.rtype.op, ss); + spc(ss, conf); + reg_name(tree->ast_node.rtype.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.rtype.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.rtype.rs2, ss); + break; + case RISCV_LOAD: + SStream_concat(ss, "l"); + size_mnemonic(tree->ast_node.load.width, ss); + if (tree->ast_node.load.is_unsigned) { + SStream_concat(ss, "u"); + } else { + SStream_concat(ss, ""); + } + if (tree->ast_node.load.aq) { + SStream_concat(ss, ".aq"); + } else { + SStream_concat(ss, ""); + } + if (tree->ast_node.load.rl) { + SStream_concat(ss, ".rl"); + } else { + SStream_concat(ss, ""); + } + spc(ss, conf); + reg_name(tree->ast_node.load.rd, ss); + sep(ss, conf); + hex_bits_signed_12(tree->ast_node.load.imm, ss, conf); + SStream_concat(ss, "("); + reg_name(tree->ast_node.load.rs1, ss); + SStream_concat(ss, ")"); + break; + case RISCV_STORE: + SStream_concat(ss, "s"); + size_mnemonic(tree->ast_node.store.width, ss); + if (tree->ast_node.store.aq) { + SStream_concat(ss, ".aq"); + } else { + SStream_concat(ss, ""); + } + if (tree->ast_node.store.rl) { + SStream_concat(ss, ".rl"); + } else { + SStream_concat(ss, ""); + } + spc(ss, conf); + reg_name(tree->ast_node.store.rs2, ss); + sep(ss, conf); + hex_bits_signed_12(tree->ast_node.store.imm, ss, conf); + opt_spc(ss, conf); + SStream_concat(ss, "("); + opt_spc(ss, conf); + reg_name(tree->ast_node.store.rs1, ss); + opt_spc(ss, conf); + SStream_concat(ss, ")"); + break; + case RISCV_ADDIW: + SStream_concat(ss, "addiw"); + spc(ss, conf); + reg_name(tree->ast_node.addiw.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.addiw.rs1, ss); + sep(ss, conf); + hex_bits_signed_12(tree->ast_node.addiw.imm, ss, conf); + break; + case RISCV_RTYPEW: + rtypew_mnemonic(tree->ast_node.rtypew.op, ss); + spc(ss, conf); + reg_name(tree->ast_node.rtypew.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.rtypew.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.rtypew.rs2, ss); + break; + case RISCV_SHIFTIWOP: + shiftiwop_mnemonic(tree->ast_node.shiftiwop.op, ss); + spc(ss, conf); + reg_name(tree->ast_node.shiftiwop.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.shiftiwop.rs1, ss); + sep(ss, conf); + hex_bits_5(tree->ast_node.shiftiwop.shamt, ss, conf); + break; + case RISCV_FENCE: + SStream_concat(ss, "fence"); + spc(ss, conf); + fence_bits(tree->ast_node.fence.pred, ss, conf); + sep(ss, conf); + fence_bits(tree->ast_node.fence.succ, ss, conf); + break; + case RISCV_FENCE_TSO: + SStream_concat(ss, "fence.tso"); + spc(ss, conf); + fence_bits(tree->ast_node.fence_tso.pred, ss, conf); + sep(ss, conf); + fence_bits(tree->ast_node.fence_tso.succ, ss, conf); + break; + case RISCV_ECALL: + SStream_concat(ss, "ecall"); + break; + case RISCV_MRET: + SStream_concat(ss, "mret"); + break; + case RISCV_SRET: + SStream_concat(ss, "sret"); + break; + case RISCV_EBREAK: + SStream_concat(ss, "ebreak"); + break; + case RISCV_WFI: + SStream_concat(ss, "wfi"); + break; + case RISCV_SFENCE_VMA: + SStream_concat(ss, "sfence.vma"); + spc(ss, conf); + reg_name(tree->ast_node.sfence_vma.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.sfence_vma.rs2, ss); + break; + case RISCV_FENCEI: + SStream_concat(ss, "fence.i"); + break; + case RISCV_LOADRES: + SStream_concat(ss, "lr."); + size_mnemonic(tree->ast_node.loadres.width, ss); + if (tree->ast_node.loadres.aq) { + SStream_concat(ss, ".aq"); + } else { + SStream_concat(ss, ""); + } + if (tree->ast_node.loadres.rl) { + SStream_concat(ss, ".rl"); + } else { + SStream_concat(ss, ""); + } + spc(ss, conf); + reg_name(tree->ast_node.loadres.rd, ss); + sep(ss, conf); + SStream_concat(ss, "("); + reg_name(tree->ast_node.loadres.rs1, ss); + SStream_concat(ss, ")"); + break; + case RISCV_STORECON: + SStream_concat(ss, "sc."); + size_mnemonic(tree->ast_node.storecon.width, ss); + if (tree->ast_node.storecon.aq) { + SStream_concat(ss, ".aq"); + } else { + SStream_concat(ss, ""); + } + if (tree->ast_node.storecon.rl) { + SStream_concat(ss, ".rl"); + } else { + SStream_concat(ss, ""); + } + spc(ss, conf); + reg_name(tree->ast_node.storecon.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.storecon.rs2, ss); + sep(ss, conf); + SStream_concat(ss, "("); + reg_name(tree->ast_node.storecon.rs1, ss); + SStream_concat(ss, ")"); + break; + case RISCV_AMO: + amo_mnemonic(tree->ast_node.amo.op, ss); + SStream_concat(ss, "."); + size_mnemonic(tree->ast_node.amo.width, ss); + if (tree->ast_node.amo.aq) { + SStream_concat(ss, ".aq"); + } else { + SStream_concat(ss, ""); + } + if (tree->ast_node.amo.rl) { + SStream_concat(ss, ".rl"); + } else { + SStream_concat(ss, ""); + } + spc(ss, conf); + reg_name(tree->ast_node.amo.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.amo.rs2, ss); + sep(ss, conf); + SStream_concat(ss, "("); + reg_name(tree->ast_node.amo.rs1, ss); + SStream_concat(ss, ")"); + break; + case RISCV_C_NOP: + SStream_concat(ss, "c.nop"); + break; + case RISCV_C_ADDI4SPN: + SStream_concat(ss, "c.addi4spn"); + spc(ss, conf); + creg_name(tree->ast_node.c_addi4spn.rdc, ss); + sep(ss, conf); + hex_bits_10(tree->ast_node.c_addi4spn.nzimm << 2 | 0x0 << 0, ss, conf); + break; + case RISCV_C_LW: + SStream_concat(ss, "c.lw"); + spc(ss, conf); + creg_name(tree->ast_node.c_lw.rdc, ss); + sep(ss, conf); + creg_name(tree->ast_node.c_lw.rsc, ss); + sep(ss, conf); + hex_bits_7(tree->ast_node.c_lw.uimm << 2 | 0x0 << 0, ss, conf); + break; + case RISCV_C_LD: + SStream_concat(ss, "c.ld"); + spc(ss, conf); + creg_name(tree->ast_node.c_ld.rdc, ss); + sep(ss, conf); + creg_name(tree->ast_node.c_ld.rsc, ss); + sep(ss, conf); + hex_bits_8(tree->ast_node.c_ld.uimm << 3 | 0x0 << 0, ss, conf); + break; + case RISCV_C_SW: + SStream_concat(ss, "c.sw"); + spc(ss, conf); + creg_name(tree->ast_node.c_sw.rsc1, ss); + sep(ss, conf); + creg_name(tree->ast_node.c_sw.rsc2, ss); + sep(ss, conf); + hex_bits_7(tree->ast_node.c_sw.uimm << 2 | 0x0 << 0, ss, conf); + break; + case RISCV_C_SD: + SStream_concat(ss, "c.sd"); + spc(ss, conf); + creg_name(tree->ast_node.c_sd.rsc1, ss); + sep(ss, conf); + creg_name(tree->ast_node.c_sd.rsc2, ss); + sep(ss, conf); + hex_bits_8(tree->ast_node.c_sd.uimm << 3 | 0x0 << 0, ss, conf); + break; + case RISCV_C_ADDI: + SStream_concat(ss, "c.addi"); + spc(ss, conf); + reg_name(tree->ast_node.c_addi.rsd, ss); + sep(ss, conf); + hex_bits_signed_6(tree->ast_node.c_addi.nzi, ss, conf); + break; + case RISCV_C_JAL: + SStream_concat(ss, "c.jal"); + spc(ss, conf); + hex_bits_signed_12(tree->ast_node.c_jal << 1 | 0x0 << 0, ss, conf); + break; + case RISCV_C_ADDIW: + SStream_concat(ss, "c.addiw"); + spc(ss, conf); + reg_name(tree->ast_node.c_addiw.rsd, ss); + sep(ss, conf); + hex_bits_signed_6(tree->ast_node.c_addiw.imm, ss, conf); + break; + case RISCV_C_LI: + SStream_concat(ss, "c.li"); + spc(ss, conf); + reg_name(tree->ast_node.c_li.rd, ss); + sep(ss, conf); + hex_bits_signed_6(tree->ast_node.c_li.imm, ss, conf); + break; + case RISCV_C_ADDI16SP: + SStream_concat(ss, "c.addi16sp"); + spc(ss, conf); + hex_bits_signed_6(tree->ast_node.c_addi16sp, ss, conf); + break; + case RISCV_C_LUI: + SStream_concat(ss, "c.lui"); + spc(ss, conf); + reg_name(tree->ast_node.c_lui.rd, ss); + sep(ss, conf); + hex_bits_signed_6(tree->ast_node.c_lui.imm, ss, conf); + break; + case RISCV_C_SRLI: + SStream_concat(ss, "c.srli"); + spc(ss, conf); + creg_name(tree->ast_node.c_srli.rsd, ss); + sep(ss, conf); + hex_bits_6(tree->ast_node.c_srli.shamt, ss, conf); + break; + case RISCV_C_SRAI: + SStream_concat(ss, "c.srai"); + spc(ss, conf); + creg_name(tree->ast_node.c_srai.rsd, ss); + sep(ss, conf); + hex_bits_6(tree->ast_node.c_srai.shamt, ss, conf); + break; + case RISCV_C_ANDI: + SStream_concat(ss, "c.andi"); + spc(ss, conf); + creg_name(tree->ast_node.c_andi.rsd, ss); + sep(ss, conf); + hex_bits_signed_6(tree->ast_node.c_andi.imm, ss, conf); + break; + case RISCV_C_SUB: + SStream_concat(ss, "c.sub"); + spc(ss, conf); + creg_name(tree->ast_node.c_sub.rsd, ss); + sep(ss, conf); + creg_name(tree->ast_node.c_sub.rs2, ss); + break; + case RISCV_C_XOR: + SStream_concat(ss, "c.xor"); + spc(ss, conf); + creg_name(tree->ast_node.c_xor.rsd, ss); + sep(ss, conf); + creg_name(tree->ast_node.c_xor.rs2, ss); + break; + case RISCV_C_OR: + SStream_concat(ss, "c.or"); + spc(ss, conf); + creg_name(tree->ast_node.c_or.rsd, ss); + sep(ss, conf); + creg_name(tree->ast_node.c_or.rs2, ss); + break; + case RISCV_C_AND: + SStream_concat(ss, "c.and"); + spc(ss, conf); + creg_name(tree->ast_node.c_and.rsd, ss); + sep(ss, conf); + creg_name(tree->ast_node.c_and.rs2, ss); + break; + case RISCV_C_SUBW: + SStream_concat(ss, "c.subw"); + spc(ss, conf); + creg_name(tree->ast_node.c_subw.rsd, ss); + sep(ss, conf); + creg_name(tree->ast_node.c_subw.rs2, ss); + break; + case RISCV_C_ADDW: + SStream_concat(ss, "c.addw"); + spc(ss, conf); + creg_name(tree->ast_node.c_addw.rsd, ss); + sep(ss, conf); + creg_name(tree->ast_node.c_addw.rs2, ss); + break; + case RISCV_C_J: + SStream_concat(ss, "c.j"); + spc(ss, conf); + hex_bits_signed_12(tree->ast_node.c_j << 1 | 0x0 << 0, ss, conf); + break; + case RISCV_C_BEQZ: + SStream_concat(ss, "c.beqz"); + spc(ss, conf); + creg_name(tree->ast_node.c_beqz.rs, ss); + sep(ss, conf); + hex_bits_signed_8(tree->ast_node.c_beqz.imm, ss, conf); + break; + case RISCV_C_BNEZ: + SStream_concat(ss, "c.bnez"); + spc(ss, conf); + creg_name(tree->ast_node.c_bnez.rs, ss); + sep(ss, conf); + hex_bits_signed_8(tree->ast_node.c_bnez.imm, ss, conf); + break; + case RISCV_C_SLLI: + SStream_concat(ss, "c.slli"); + spc(ss, conf); + reg_name(tree->ast_node.c_slli.rsd, ss); + sep(ss, conf); + hex_bits_6(tree->ast_node.c_slli.shamt, ss, conf); + break; + case RISCV_C_LWSP: + SStream_concat(ss, "c.lwsp"); + spc(ss, conf); + reg_name(tree->ast_node.c_lwsp.rd, ss); + sep(ss, conf); + hex_bits_6(tree->ast_node.c_lwsp.uimm, ss, conf); + break; + case RISCV_C_LDSP: + SStream_concat(ss, "c.ldsp"); + spc(ss, conf); + reg_name(tree->ast_node.c_ldsp.rd, ss); + sep(ss, conf); + hex_bits_6(tree->ast_node.c_ldsp.uimm, ss, conf); + break; + case RISCV_C_SWSP: + SStream_concat(ss, "c.swsp"); + spc(ss, conf); + reg_name(tree->ast_node.c_swsp.rs2, ss); + sep(ss, conf); + hex_bits_6(tree->ast_node.c_swsp.uimm, ss, conf); + break; + case RISCV_C_SDSP: + SStream_concat(ss, "c.sdsp"); + spc(ss, conf); + reg_name(tree->ast_node.c_sdsp.rs2, ss); + sep(ss, conf); + hex_bits_6(tree->ast_node.c_sdsp.uimm, ss, conf); + break; + case RISCV_C_JR: + SStream_concat(ss, "c.jr"); + spc(ss, conf); + reg_name(tree->ast_node.c_jr, ss); + break; + case RISCV_C_JALR: + SStream_concat(ss, "c.jalr"); + spc(ss, conf); + reg_name(tree->ast_node.c_jalr, ss); + break; + case RISCV_C_MV: + SStream_concat(ss, "c.mv"); + spc(ss, conf); + reg_name(tree->ast_node.c_mv.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.c_mv.rs2, ss); + break; + case RISCV_C_EBREAK: + SStream_concat(ss, "c.ebreak"); + break; + case RISCV_C_ADD: + SStream_concat(ss, "c.add"); + spc(ss, conf); + reg_name(tree->ast_node.c_add.rsd, ss); + sep(ss, conf); + reg_name(tree->ast_node.c_add.rs2, ss); + break; + case RISCV_MUL: + if ((tree->ast_node.mul.mul_op.high == 1) && + (tree->ast_node.mul.mul_op.signed_rs1 == 1) && + (tree->ast_node.mul.mul_op.signed_rs2 == 1)) { + SStream_concat(ss, "mulh"); + } else if ((tree->ast_node.mul.mul_op.high == 1) && + (tree->ast_node.mul.mul_op.signed_rs1 == 0) && + (tree->ast_node.mul.mul_op.signed_rs2 == 0)) { + SStream_concat(ss, "mulhu"); + } else if ((tree->ast_node.mul.mul_op.high == 1) && + (tree->ast_node.mul.mul_op.signed_rs1 == 1) && + (tree->ast_node.mul.mul_op.signed_rs2 == 0)) { + SStream_concat(ss, "mulhsu"); + } else if ((tree->ast_node.mul.mul_op.high == 0) && + (tree->ast_node.mul.mul_op.signed_rs1 == 1) && + (tree->ast_node.mul.mul_op.signed_rs2 == 1)) { + SStream_concat(ss, "mul"); + } else + ; + spc(ss, conf); + reg_name(tree->ast_node.mul.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.mul.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.mul.rs2, ss); + break; + case RISCV_DIV: + SStream_concat(ss, "div"); + if (tree->ast_node.div.s) { + SStream_concat(ss, ""); + } else { + SStream_concat(ss, "u"); + } + spc(ss, conf); + reg_name(tree->ast_node.div.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.div.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.div.rs2, ss); + break; + case RISCV_REM: + SStream_concat(ss, "rem"); + if (tree->ast_node.rem.s) { + SStream_concat(ss, ""); + } else { + SStream_concat(ss, "u"); + } + spc(ss, conf); + reg_name(tree->ast_node.rem.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.rem.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.rem.rs2, ss); + break; + case RISCV_MULW: + SStream_concat(ss, "mulw"); + spc(ss, conf); + reg_name(tree->ast_node.mulw.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.mulw.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.mulw.rs2, ss); + break; + case RISCV_DIVW: + SStream_concat(ss, "div"); + if (tree->ast_node.divw.s) { + SStream_concat(ss, ""); + } else { + SStream_concat(ss, "u"); + } + SStream_concat(ss, "w"); + spc(ss, conf); + reg_name(tree->ast_node.divw.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.divw.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.divw.rs2, ss); + break; + case RISCV_REMW: + SStream_concat(ss, "rem"); + if (tree->ast_node.remw.s) { + SStream_concat(ss, ""); + } else { + SStream_concat(ss, "u"); + } + SStream_concat(ss, "w"); + spc(ss, conf); + reg_name(tree->ast_node.remw.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.remw.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.remw.rs2, ss); + break; + case RISCV_CSR: + if (tree->ast_node.csr.is_imm == RISCV_true) { + csr_mnemonic(tree->ast_node.csr.op, ss); + SStream_concat(ss, "i"); + spc(ss, conf); + reg_name(tree->ast_node.csr.rd, ss); + sep(ss, conf); + csr_name_map(tree->ast_node.csr.csr, ss, conf); + sep(ss, conf); + hex_bits_5(tree->ast_node.csr.rs1, ss, conf); + } + if (tree->ast_node.csr.is_imm == RISCV_false) { + csr_mnemonic(tree->ast_node.csr.op, ss); + spc(ss, conf); + reg_name(tree->ast_node.csr.rd, ss); + sep(ss, conf); + csr_name_map(tree->ast_node.csr.csr, ss, conf); + sep(ss, conf); + reg_name(tree->ast_node.csr.rs1, ss); + } + break; + case RISCV_C_NOP_HINT: + SStream_concat(ss, "c.nop.hint."); + hex_bits_6(tree->ast_node.c_nop_hint, ss, conf); + break; + case RISCV_C_ADDI_HINT: + SStream_concat(ss, "c.addi.hint."); + reg_name(tree->ast_node.c_addi_hint, ss); + break; + case RISCV_C_LI_HINT: + SStream_concat(ss, "c.li.hint."); + hex_bits_6(tree->ast_node.c_li_hint, ss, conf); + break; + case RISCV_C_LUI_HINT: + SStream_concat(ss, "c.lui.hint."); + hex_bits_6(tree->ast_node.c_lui_hint, ss, conf); + break; + case RISCV_C_MV_HINT: + SStream_concat(ss, "c.mv.hint."); + reg_name(tree->ast_node.c_mv_hint, ss); + break; + case RISCV_C_ADD_HINT: + SStream_concat(ss, "c.add.hint."); + reg_name(tree->ast_node.c_add_hint, ss); + break; + case RISCV_C_SLLI_HINT: + SStream_concat(ss, "c.slli.hint."); + reg_name(tree->ast_node.c_slli_hint.rsd, ss); + SStream_concat(ss, "."); + hex_bits_6(tree->ast_node.c_slli_hint.shamt, ss, conf); + break; + case RISCV_C_SRLI_HINT: + SStream_concat(ss, "c.srli.hint."); + creg_name(tree->ast_node.c_srli_hint, ss); + break; + case RISCV_C_SRAI_HINT: + SStream_concat(ss, "c.srai.hint."); + creg_name(tree->ast_node.c_srai_hint, ss); + break; + case RISCV_FENCE_RESERVED: + SStream_concat(ss, "fence.reserved."); + fence_bits(tree->ast_node.fence_reserved.pred, ss, conf); + SStream_concat(ss, "."); + fence_bits(tree->ast_node.fence_reserved.succ, ss, conf); + SStream_concat(ss, "."); + reg_name(tree->ast_node.fence_reserved.rs, ss); + SStream_concat(ss, "."); + reg_name(tree->ast_node.fence_reserved.rd, ss); + SStream_concat(ss, "."); + hex_bits_4(tree->ast_node.fence_reserved.fm, ss, conf); + break; + case RISCV_FENCEI_RESERVED: + SStream_concat(ss, "fence.i.reserved."); + reg_name(tree->ast_node.fencei_reserved.rd, ss); + SStream_concat(ss, "."); + reg_name(tree->ast_node.fencei_reserved.rs, ss); + SStream_concat(ss, "."); + hex_bits_12(tree->ast_node.fencei_reserved.imm, ss, conf); + break; + case RISCV_LOAD_FP: + SStream_concat(ss, "fl"); + size_mnemonic(tree->ast_node.load_fp.width, ss); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.load_fp.rd, ss, conf); + sep(ss, conf); + hex_bits_signed_12(tree->ast_node.load_fp.imm, ss, conf); + opt_spc(ss, conf); + SStream_concat(ss, "("); + opt_spc(ss, conf); + reg_name(tree->ast_node.load_fp.rs1, ss); + opt_spc(ss, conf); + SStream_concat(ss, ")"); + break; + case RISCV_STORE_FP: + SStream_concat(ss, "fs"); + size_mnemonic(tree->ast_node.store_fp.width, ss); + spc(ss, conf); + freg_name(tree->ast_node.store_fp.rs2, ss); + sep(ss, conf); + hex_bits_signed_12(tree->ast_node.store_fp.imm, ss, conf); + opt_spc(ss, conf); + SStream_concat(ss, "("); + opt_spc(ss, conf); + reg_name(tree->ast_node.store_fp.rs1, ss); + opt_spc(ss, conf); + SStream_concat(ss, ")"); + break; + case RISCV_F_MADD_TYPE_S: + f_madd_type_mnemonic_S(tree->ast_node.f_madd_type_s.op, ss); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_madd_type_s.rd, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_madd_type_s.rs1, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_madd_type_s.rs2, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_madd_type_s.rs3, ss, conf); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_madd_type_s.rm, ss); + break; + case RISCV_F_BIN_RM_TYPE_S: + f_bin_rm_type_mnemonic_S(tree->ast_node.f_bin_rm_type_s.op, ss); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_rm_type_s.rd, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_rm_type_s.rs1, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_rm_type_s.rs2, ss, conf); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_bin_rm_type_s.rm, ss); + break; + case RISCV_F_UN_RM_TYPE_S: + if (tree->ast_node.f_un_rm_type_s.fcvt_s_lu == RISCV_FSQRT_S) { + SStream_concat(ss, "fsqrt.s"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_s.rd, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_s.rs1, ss, conf); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_s.rm, ss); + } + if (tree->ast_node.f_un_rm_type_s.fcvt_s_lu == RISCV_FCVT_W_S) { + SStream_concat(ss, "fcvt.w.s"); + spc(ss, conf); + reg_name(tree->ast_node.f_un_rm_type_s.rd, ss); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_s.rs1, ss, conf); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_s.rm, ss); + } + if (tree->ast_node.f_un_rm_type_s.fcvt_s_lu == RISCV_FCVT_WU_S) { + SStream_concat(ss, "fcvt.wu.s"); + spc(ss, conf); + reg_name(tree->ast_node.f_un_rm_type_s.rd, ss); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_s.rs1, ss, conf); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_s.rm, ss); + } + if (tree->ast_node.f_un_rm_type_s.fcvt_s_lu == RISCV_FCVT_S_W) { + SStream_concat(ss, "fcvt.s.w"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_s.rd, ss, conf); + sep(ss, conf); + reg_name(tree->ast_node.f_un_rm_type_s.rs1, ss); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_s.rm, ss); + } + if (tree->ast_node.f_un_rm_type_s.fcvt_s_lu == RISCV_FCVT_S_WU) { + SStream_concat(ss, "fcvt.s.wu"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_s.rd, ss, conf); + sep(ss, conf); + reg_name(tree->ast_node.f_un_rm_type_s.rs1, ss); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_s.rm, ss); + } + if (tree->ast_node.f_un_rm_type_s.fcvt_s_lu == RISCV_FCVT_L_S) { + SStream_concat(ss, "fcvt.l.s"); + spc(ss, conf); + reg_name(tree->ast_node.f_un_rm_type_s.rd, ss); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_s.rs1, ss, conf); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_s.rm, ss); + } + if (tree->ast_node.f_un_rm_type_s.fcvt_s_lu == RISCV_FCVT_LU_S) { + SStream_concat(ss, "fcvt.lu.s"); + spc(ss, conf); + reg_name(tree->ast_node.f_un_rm_type_s.rd, ss); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_s.rs1, ss, conf); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_s.rm, ss); + } + if (tree->ast_node.f_un_rm_type_s.fcvt_s_lu == RISCV_FCVT_S_L) { + SStream_concat(ss, "fcvt.s.l"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_s.rd, ss, conf); + sep(ss, conf); + reg_name(tree->ast_node.f_un_rm_type_s.rs1, ss); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_s.rm, ss); + } + if (tree->ast_node.f_un_rm_type_s.fcvt_s_lu == RISCV_FCVT_S_LU) { + SStream_concat(ss, "fcvt.s.lu"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_s.rd, ss, conf); + sep(ss, conf); + reg_name(tree->ast_node.f_un_rm_type_s.rs1, ss); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_s.rm, ss); + } + break; + case RISCV_F_BIN_TYPE_S: + if (tree->ast_node.f_bin_type_s.fle_s == RISCV_FSGNJ_S) { + SStream_concat(ss, "fsgnj.s"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_s.rd, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_s.rs1, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_s.rs2, ss, conf); + } + if (tree->ast_node.f_bin_type_s.fle_s == RISCV_FSGNJN_S) { + SStream_concat(ss, "fsgnjn.s"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_s.rd, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_s.rs1, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_s.rs2, ss, conf); + } + if (tree->ast_node.f_bin_type_s.fle_s == RISCV_FSGNJX_S) { + SStream_concat(ss, "fsgnjx.s"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_s.rd, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_s.rs1, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_s.rs2, ss, conf); + } + if (tree->ast_node.f_bin_type_s.fle_s == RISCV_FMIN_S) { + SStream_concat(ss, "fmin.s"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_s.rd, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_s.rs1, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_s.rs2, ss, conf); + } + if (tree->ast_node.f_bin_type_s.fle_s == RISCV_FMAX_S) { + SStream_concat(ss, "fmax.s"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_s.rd, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_s.rs1, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_s.rs2, ss, conf); + } + if (tree->ast_node.f_bin_type_s.fle_s == RISCV_FEQ_S) { + SStream_concat(ss, "feq.s"); + spc(ss, conf); + reg_name(tree->ast_node.f_bin_type_s.rd, ss); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_s.rs1, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_s.rs2, ss, conf); + } + if (tree->ast_node.f_bin_type_s.fle_s == RISCV_FLT_S) { + SStream_concat(ss, "flt.s"); + spc(ss, conf); + reg_name(tree->ast_node.f_bin_type_s.rd, ss); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_s.rs1, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_s.rs2, ss, conf); + } + if (tree->ast_node.f_bin_type_s.fle_s == RISCV_FLE_S) { + SStream_concat(ss, "fle.s"); + spc(ss, conf); + reg_name(tree->ast_node.f_bin_type_s.rd, ss); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_s.rs1, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_s.rs2, ss, conf); + } + break; + case RISCV_F_UN_TYPE_S: + if (tree->ast_node.f_un_type_s.fmv_w_x == RISCV_FMV_X_W) { + SStream_concat(ss, "fmv.x.w"); + spc(ss, conf); + reg_name(tree->ast_node.f_un_type_s.rd, ss); + sep(ss, conf); + freg_name(tree->ast_node.f_un_type_s.rs1, ss); + } + if (tree->ast_node.f_un_type_s.fmv_w_x == RISCV_FMV_W_X) { + SStream_concat(ss, "fmv.w.x"); + spc(ss, conf); + freg_name(tree->ast_node.f_un_type_s.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.f_un_type_s.rs1, ss); + } + if (tree->ast_node.f_un_type_s.fmv_w_x == RISCV_FCLASS_S) { + SStream_concat(ss, "fclass.s"); + spc(ss, conf); + reg_name(tree->ast_node.f_un_type_s.rd, ss); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_type_s.rs1, ss, conf); + } + break; + case RISCV_C_FLWSP: + SStream_concat(ss, "c.flwsp"); + spc(ss, conf); + reg_name(tree->ast_node.c_flwsp.rd, ss); + sep(ss, conf); + hex_bits_6(tree->ast_node.c_flwsp.imm, ss, conf); + break; + case RISCV_C_FSWSP: + SStream_concat(ss, "c.fswsp"); + spc(ss, conf); + reg_name(tree->ast_node.c_fswsp.rs2, ss); + sep(ss, conf); + hex_bits_6(tree->ast_node.c_fswsp.uimm, ss, conf); + break; + case RISCV_C_FLW: + SStream_concat(ss, "c.flw"); + spc(ss, conf); + creg_name(tree->ast_node.c_flw.rdc, ss); + sep(ss, conf); + creg_name(tree->ast_node.c_flw.rsc, ss); + sep(ss, conf); + hex_bits_7(tree->ast_node.c_flw.uimm << 2 | 0x0 << 0, ss, conf); + break; + case RISCV_C_FSW: + SStream_concat(ss, "c.fsw"); + spc(ss, conf); + creg_name(tree->ast_node.c_fsw.rsc1, ss); + sep(ss, conf); + creg_name(tree->ast_node.c_fsw.rsc2, ss); + sep(ss, conf); + hex_bits_7(tree->ast_node.c_fsw.uimm << 2 | 0x0 << 0, ss, conf); + break; + case RISCV_F_MADD_TYPE_D: + f_madd_type_mnemonic_D(tree->ast_node.f_madd_type_d.op, ss); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_madd_type_d.rd, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_madd_type_d.rs1, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_madd_type_d.rs2, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_madd_type_d.rs3, ss, conf); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_madd_type_d.rm, ss); + break; + case RISCV_F_BIN_RM_TYPE_D: + f_bin_rm_type_mnemonic_D(tree->ast_node.f_bin_rm_type_d.op, ss); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_rm_type_d.rd, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_rm_type_d.rs1, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_rm_type_d.rs2, ss, conf); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_bin_rm_type_d.rm, ss); + break; + case RISCV_F_UN_RM_TYPE_D: + if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FSQRT_D) { + SStream_concat(ss, "fsqrt.d"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rd, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rs1, ss, conf); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_d.rm, ss); + } + if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FCVT_W_D) { + SStream_concat(ss, "fcvt.w.d"); + spc(ss, conf); + reg_name(tree->ast_node.f_un_rm_type_d.rd, ss); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rs1, ss, conf); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_d.rm, ss); + } + if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FCVT_WU_D) { + SStream_concat(ss, "fcvt.wu.d"); + spc(ss, conf); + reg_name(tree->ast_node.f_un_rm_type_d.rd, ss); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rs1, ss, conf); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_d.rm, ss); + } + if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FCVT_D_W) { + SStream_concat(ss, "fcvt.d.w"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rd, ss, conf); + sep(ss, conf); + reg_name(tree->ast_node.f_un_rm_type_d.rs1, ss); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_d.rm, ss); + } + if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FCVT_D_WU) { + SStream_concat(ss, "fcvt.d.wu"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rd, ss, conf); + sep(ss, conf); + reg_name(tree->ast_node.f_un_rm_type_d.rs1, ss); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_d.rm, ss); + } + if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FCVT_L_D) { + SStream_concat(ss, "fcvt.l.d"); + spc(ss, conf); + reg_name(tree->ast_node.f_un_rm_type_d.rd, ss); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rs1, ss, conf); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_d.rm, ss); + } + if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FCVT_LU_D) { + SStream_concat(ss, "fcvt.lu.d"); + spc(ss, conf); + reg_name(tree->ast_node.f_un_rm_type_d.rd, ss); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rs1, ss, conf); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_d.rm, ss); + } + if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FCVT_D_L) { + SStream_concat(ss, "fcvt.d.l"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rd, ss, conf); + sep(ss, conf); + reg_name(tree->ast_node.f_un_rm_type_d.rs1, ss); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_d.rm, ss); + } + if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FCVT_D_LU) { + SStream_concat(ss, "fcvt.d.lu"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rd, ss, conf); + sep(ss, conf); + reg_name(tree->ast_node.f_un_rm_type_d.rs1, ss); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_d.rm, ss); + } + if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FCVT_S_D) { + SStream_concat(ss, "fcvt.s.d"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rd, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rs1, ss, conf); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_d.rm, ss); + } + if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FCVT_D_S) { + SStream_concat(ss, "fcvt.d.s"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rd, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rs1, ss, conf); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_d.rm, ss); + } + break; + case RISCV_F_BIN_TYPE_D: + if (tree->ast_node.f_bin_type_d.fle_d == RISCV_FSGNJ_D) { + SStream_concat(ss, "fsgnj.d"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_d.rd, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_d.rs1, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_d.rs2, ss, conf); + } + if (tree->ast_node.f_bin_type_d.fle_d == RISCV_FSGNJN_D) { + SStream_concat(ss, "fsgnjn.d"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_d.rd, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_d.rs1, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_d.rs2, ss, conf); + } + if (tree->ast_node.f_bin_type_d.fle_d == RISCV_FSGNJX_D) { + SStream_concat(ss, "fsgnjx.d"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_d.rd, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_d.rs1, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_d.rs2, ss, conf); + } + if (tree->ast_node.f_bin_type_d.fle_d == RISCV_FMIN_D) { + SStream_concat(ss, "fmin.d"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_d.rd, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_d.rs1, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_d.rs2, ss, conf); + } + if (tree->ast_node.f_bin_type_d.fle_d == RISCV_FMAX_D) { + SStream_concat(ss, "fmax.d"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_d.rd, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_d.rs1, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_d.rs2, ss, conf); + } + if (tree->ast_node.f_bin_type_d.fle_d == RISCV_FEQ_D) { + SStream_concat(ss, "feq.d"); + spc(ss, conf); + reg_name(tree->ast_node.f_bin_type_d.rd, ss); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_d.rs1, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_d.rs2, ss, conf); + } + if (tree->ast_node.f_bin_type_d.fle_d == RISCV_FLT_D) { + SStream_concat(ss, "flt.d"); + spc(ss, conf); + reg_name(tree->ast_node.f_bin_type_d.rd, ss); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_d.rs1, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_d.rs2, ss, conf); + } + if (tree->ast_node.f_bin_type_d.fle_d == RISCV_FLE_D) { + SStream_concat(ss, "fle.d"); + spc(ss, conf); + reg_name(tree->ast_node.f_bin_type_d.rd, ss); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_d.rs1, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_d.rs2, ss, conf); + } + break; + case RISCV_F_UN_TYPE_D: + if (tree->ast_node.f_un_type_d.fmv_d_x == RISCV_FMV_X_D) { + SStream_concat(ss, "fmv.x.d"); + spc(ss, conf); + reg_name(tree->ast_node.f_un_type_d.rd, ss); + sep(ss, conf); + freg_name(tree->ast_node.f_un_type_d.rs1, ss); + } + if (tree->ast_node.f_un_type_d.fmv_d_x == RISCV_FMV_D_X) { + SStream_concat(ss, "fmv.d.x"); + spc(ss, conf); + freg_name(tree->ast_node.f_un_type_d.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.f_un_type_d.rs1, ss); + } + if (tree->ast_node.f_un_type_d.fmv_d_x == RISCV_FCLASS_D) { + SStream_concat(ss, "fclass.d"); + spc(ss, conf); + reg_name(tree->ast_node.f_un_type_d.rd, ss); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_type_d.rs1, ss, conf); + } + break; + case RISCV_C_FLDSP: + SStream_concat(ss, "c.fldsp"); + spc(ss, conf); + reg_name(tree->ast_node.c_fldsp.rd, ss); + sep(ss, conf); + hex_bits_6(tree->ast_node.c_fldsp.uimm, ss, conf); + break; + case RISCV_C_FSDSP: + SStream_concat(ss, "c.fsdsp"); + spc(ss, conf); + reg_name(tree->ast_node.c_fsdsp.rs2, ss); + sep(ss, conf); + hex_bits_6(tree->ast_node.c_fsdsp.uimm, ss, conf); + break; + case RISCV_C_FLD: + SStream_concat(ss, "c.fld"); + spc(ss, conf); + creg_name(tree->ast_node.c_fld.rdc, ss); + sep(ss, conf); + creg_name(tree->ast_node.c_fld.rsc, ss); + sep(ss, conf); + hex_bits_8(tree->ast_node.c_fld.uimm << 3 | 0x0 << 0, ss, conf); + break; + case RISCV_C_FSD: + SStream_concat(ss, "c.fsd"); + spc(ss, conf); + creg_name(tree->ast_node.c_fsd.rsc1, ss); + sep(ss, conf); + creg_name(tree->ast_node.c_fsd.rsc2, ss); + sep(ss, conf); + hex_bits_8(tree->ast_node.c_fsd.uimm << 3 | 0x0 << 0, ss, conf); + break; + case RISCV_SINVAL_VMA: + SStream_concat(ss, "sinval.vma"); + spc(ss, conf); + reg_name(tree->ast_node.sinval_vma.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.sinval_vma.rs2, ss); + break; + case RISCV_SFENCE_W_INVAL: + SStream_concat(ss, "sfence.w.inval"); + break; + case RISCV_SFENCE_INVAL_IR: + SStream_concat(ss, "sfence.inval.ir"); + break; + case RISCV_SLLIUW: + SStream_concat(ss, "slli.uw"); + spc(ss, conf); + reg_name(tree->ast_node.riscv_slliuw.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.riscv_slliuw.rs1, ss); + sep(ss, conf); + hex_bits_6(tree->ast_node.riscv_slliuw.shamt, ss, conf); + break; + case RISCV_ZBA_RTYPEUW: + zba_rtypeuw_mnemonic(tree->ast_node.zba_rtypeuw.op, ss); + spc(ss, conf); + reg_name(tree->ast_node.zba_rtypeuw.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.zba_rtypeuw.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.zba_rtypeuw.rs2, ss); + break; + case RISCV_ZBA_RTYPE: + zba_rtype_mnemonic(tree->ast_node.zba_rtype.op, ss); + spc(ss, conf); + reg_name(tree->ast_node.zba_rtype.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.zba_rtype.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.zba_rtype.rs2, ss); + break; + case RISCV_RORIW: + SStream_concat(ss, "roriw"); + spc(ss, conf); + reg_name(tree->ast_node.riscv_roriw.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.riscv_roriw.rs1, ss); + sep(ss, conf); + hex_bits_5(tree->ast_node.riscv_roriw.shamt, ss, conf); + break; + case RISCV_RORI: + SStream_concat(ss, "rori"); + spc(ss, conf); + reg_name(tree->ast_node.riscv_rori.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.riscv_rori.rs1, ss); + sep(ss, conf); + hex_bits_6(tree->ast_node.riscv_rori.shamt, ss, conf); + break; + case RISCV_ZBB_RTYPEW: + zbb_rtypew_mnemonic(tree->ast_node.zbb_rtypew.op, ss); + spc(ss, conf); + reg_name(tree->ast_node.zbb_rtypew.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.zbb_rtypew.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.zbb_rtypew.rs2, ss); + break; + case RISCV_ZBB_RTYPE: + zbb_rtype_mnemonic(tree->ast_node.zbb_rtype.op, ss); + spc(ss, conf); + reg_name(tree->ast_node.zbb_rtype.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.zbb_rtype.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.zbb_rtype.rs2, ss); + break; + case RISCV_ZBB_EXTOP: + zbb_extop_mnemonic(tree->ast_node.zbb_extop.op, ss); + spc(ss, conf); + reg_name(tree->ast_node.zbb_extop.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.zbb_extop.rs1, ss); + break; + case RISCV_REV8: + SStream_concat(ss, "rev8"); + spc(ss, conf); + reg_name(tree->ast_node.riscv_rev8.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.riscv_rev8.rs1, ss); + break; + case RISCV_ORCB: + SStream_concat(ss, "orc.b"); + spc(ss, conf); + reg_name(tree->ast_node.riscv_orcb.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.riscv_orcb.rs1, ss); + break; + case RISCV_CPOP: + SStream_concat(ss, "cpop"); + spc(ss, conf); + reg_name(tree->ast_node.riscv_cpop.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.riscv_cpop.rs1, ss); + break; + case RISCV_CPOPW: + SStream_concat(ss, "cpopw"); + spc(ss, conf); + reg_name(tree->ast_node.riscv_cpopw.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.riscv_cpopw.rs1, ss); + break; + case RISCV_CLZ: + SStream_concat(ss, "clz"); + spc(ss, conf); + reg_name(tree->ast_node.riscv_clz.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.riscv_clz.rs1, ss); + break; + case RISCV_CLZW: + SStream_concat(ss, "clzw"); + spc(ss, conf); + reg_name(tree->ast_node.riscv_clzw.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.riscv_clzw.rs1, ss); + break; + case RISCV_CTZ: + SStream_concat(ss, "ctz"); + spc(ss, conf); + reg_name(tree->ast_node.riscv_ctz.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.riscv_ctz.rs1, ss); + break; + case RISCV_CTZW: + SStream_concat(ss, "ctzw"); + spc(ss, conf); + reg_name(tree->ast_node.riscv_ctzw.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.riscv_ctzw.rs1, ss); + break; + case RISCV_CLMUL: + SStream_concat(ss, "clmul"); + spc(ss, conf); + reg_name(tree->ast_node.riscv_clmul.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.riscv_clmul.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.riscv_clmul.rs2, ss); + break; + case RISCV_CLMULH: + SStream_concat(ss, "clmulh"); + spc(ss, conf); + reg_name(tree->ast_node.riscv_clmulh.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.riscv_clmulh.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.riscv_clmulh.rs2, ss); + break; + case RISCV_CLMULR: + SStream_concat(ss, "clmulr"); + spc(ss, conf); + reg_name(tree->ast_node.riscv_clmulr.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.riscv_clmulr.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.riscv_clmulr.rs2, ss); + break; + case RISCV_ZBS_IOP: + zbs_iop_mnemonic(tree->ast_node.zbs_iop.op, ss); + spc(ss, conf); + reg_name(tree->ast_node.zbs_iop.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.zbs_iop.rs1, ss); + sep(ss, conf); + hex_bits_6(tree->ast_node.zbs_iop.shamt, ss, conf); + break; + case RISCV_ZBS_RTYPE: + zbs_rtype_mnemonic(tree->ast_node.zbs_rtype.op, ss); + spc(ss, conf); + reg_name(tree->ast_node.zbs_rtype.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.zbs_rtype.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.zbs_rtype.rs2, ss); + break; + case RISCV_C_LBU: + SStream_concat(ss, "c.lbu"); + spc(ss, conf); + creg_name(tree->ast_node.c_lbu.rdc, ss); + sep(ss, conf); + hex_bits_2(tree->ast_node.c_lbu.uimm, ss, conf); + opt_spc(ss, conf); + SStream_concat(ss, "("); + opt_spc(ss, conf); + creg_name(tree->ast_node.c_lbu.rs1c, ss); + opt_spc(ss, conf); + SStream_concat(ss, ")"); + break; + case RISCV_C_LHU: + SStream_concat(ss, "c.lhu"); + spc(ss, conf); + creg_name(tree->ast_node.c_lhu.rdc, ss); + sep(ss, conf); + hex_bits_2(tree->ast_node.c_lhu.uimm, ss, conf); + opt_spc(ss, conf); + SStream_concat(ss, "("); + opt_spc(ss, conf); + creg_name(tree->ast_node.c_lhu.rs1c, ss); + opt_spc(ss, conf); + SStream_concat(ss, ")"); + break; + case RISCV_C_LH: + SStream_concat(ss, "c.lh"); + spc(ss, conf); + creg_name(tree->ast_node.c_lh.rdc, ss); + sep(ss, conf); + hex_bits_2(tree->ast_node.c_lh.uimm, ss, conf); + opt_spc(ss, conf); + SStream_concat(ss, "("); + opt_spc(ss, conf); + creg_name(tree->ast_node.c_lh.rs1c, ss); + opt_spc(ss, conf); + SStream_concat(ss, ")"); + break; + case RISCV_C_SB: + SStream_concat(ss, "c.sb"); + spc(ss, conf); + creg_name(tree->ast_node.c_sb.rs2c, ss); + sep(ss, conf); + hex_bits_2(tree->ast_node.c_sb.uimm, ss, conf); + opt_spc(ss, conf); + SStream_concat(ss, "("); + opt_spc(ss, conf); + creg_name(tree->ast_node.c_sb.rs1c, ss); + opt_spc(ss, conf); + SStream_concat(ss, ")"); + break; + case RISCV_C_SH: + SStream_concat(ss, "c.sh"); + spc(ss, conf); + creg_name(tree->ast_node.c_sh.rs1c, ss); + sep(ss, conf); + hex_bits_2(tree->ast_node.c_sh.uimm, ss, conf); + opt_spc(ss, conf); + SStream_concat(ss, "("); + opt_spc(ss, conf); + creg_name(tree->ast_node.c_sh.rs2c, ss); + opt_spc(ss, conf); + SStream_concat(ss, ")"); + break; + case RISCV_C_ZEXT_B: + SStream_concat(ss, "c.zext.b"); + spc(ss, conf); + creg_name(tree->ast_node.c_zext_b, ss); + break; + case RISCV_C_SEXT_B: + SStream_concat(ss, "c.sext.b"); + spc(ss, conf); + creg_name(tree->ast_node.c_sext_b, ss); + break; + case RISCV_C_ZEXT_H: + SStream_concat(ss, "c.zext.h"); + spc(ss, conf); + creg_name(tree->ast_node.c_zext_h, ss); + break; + case RISCV_C_SEXT_H: + SStream_concat(ss, "c.sext.h"); + spc(ss, conf); + creg_name(tree->ast_node.c_sext_h, ss); + break; + case RISCV_C_ZEXT_W: + SStream_concat(ss, "c.zext.w"); + spc(ss, conf); + creg_name(tree->ast_node.c_zext_w, ss); + break; + case RISCV_C_NOT: + SStream_concat(ss, "c.not"); + spc(ss, conf); + creg_name(tree->ast_node.c_not, ss); + break; + case RISCV_C_MUL: + SStream_concat(ss, "c.mul"); + spc(ss, conf); + creg_name(tree->ast_node.c_mul.rsdc, ss); + sep(ss, conf); + creg_name(tree->ast_node.c_mul.rs2c, ss); + break; + case RISCV_F_BIN_RM_TYPE_H: + f_bin_rm_type_mnemonic_H(tree->ast_node.f_bin_rm_type_h.op, ss); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_rm_type_h.rd, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_rm_type_h.rs1, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_rm_type_h.rs2, ss, conf); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_bin_rm_type_h.rm, ss); + break; + case RISCV_F_MADD_TYPE_H: + f_madd_type_mnemonic_H(tree->ast_node.f_madd_type_h.op, ss); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_madd_type_h.rd, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_madd_type_h.rs1, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_madd_type_h.rs2, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_madd_type_h.rs3, ss, conf); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_madd_type_h.rm, ss); + break; + case RISCV_F_BIN_TYPE_H: + if (tree->ast_node.f_bin_type_h.fle_h == RISCV_FSGNJ_H) { + SStream_concat(ss, "fsgnj.h"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_h.rd, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_h.rs1, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_h.rs2, ss, conf); + } + if (tree->ast_node.f_bin_type_h.fle_h == RISCV_FSGNJN_H) { + SStream_concat(ss, "fsgnjn.h"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_h.rd, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_h.rs1, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_h.rs2, ss, conf); + } + if (tree->ast_node.f_bin_type_h.fle_h == RISCV_FSGNJX_H) { + SStream_concat(ss, "fsgnjx.h"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_h.rd, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_h.rs1, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_h.rs2, ss, conf); + } + if (tree->ast_node.f_bin_type_h.fle_h == RISCV_FMIN_H) { + SStream_concat(ss, "fmin.h"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_h.rd, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_h.rs1, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_h.rs2, ss, conf); + } + if (tree->ast_node.f_bin_type_h.fle_h == RISCV_FMAX_H) { + SStream_concat(ss, "fmax.h"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_h.rd, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_h.rs1, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_h.rs2, ss, conf); + } + if (tree->ast_node.f_bin_type_h.fle_h == RISCV_FEQ_H) { + SStream_concat(ss, "feq.h"); + spc(ss, conf); + reg_name(tree->ast_node.f_bin_type_h.rd, ss); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_h.rs1, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_h.rs2, ss, conf); + } + if (tree->ast_node.f_bin_type_h.fle_h == RISCV_FLT_H) { + SStream_concat(ss, "flt.h"); + spc(ss, conf); + reg_name(tree->ast_node.f_bin_type_h.rd, ss); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_h.rs1, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_h.rs2, ss, conf); + } + if (tree->ast_node.f_bin_type_h.fle_h == RISCV_FLE_H) { + SStream_concat(ss, "fle.h"); + spc(ss, conf); + reg_name(tree->ast_node.f_bin_type_h.rd, ss); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_h.rs1, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_bin_type_h.rs2, ss, conf); + } + break; + case RISCV_F_UN_RM_TYPE_H: + if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FSQRT_H) { + SStream_concat(ss, "fsqrt.h"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rd, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rs1, ss, conf); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_h.rm, ss); + } + if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_W_H) { + SStream_concat(ss, "fcvt.w.h"); + spc(ss, conf); + reg_name(tree->ast_node.f_un_rm_type_h.rd, ss); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rs1, ss, conf); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_h.rm, ss); + } + if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_WU_H) { + SStream_concat(ss, "fcvt.wu.h"); + spc(ss, conf); + reg_name(tree->ast_node.f_un_rm_type_h.rd, ss); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rs1, ss, conf); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_h.rm, ss); + } + if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_H_W) { + SStream_concat(ss, "fcvt.h.w"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rd, ss, conf); + sep(ss, conf); + reg_name(tree->ast_node.f_un_rm_type_h.rs1, ss); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_h.rm, ss); + } + if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_H_WU) { + SStream_concat(ss, "fcvt.h.wu"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rd, ss, conf); + sep(ss, conf); + reg_name(tree->ast_node.f_un_rm_type_h.rs1, ss); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_h.rm, ss); + } + if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_L_H) { + SStream_concat(ss, "fcvt.l.h"); + spc(ss, conf); + reg_name(tree->ast_node.f_un_rm_type_h.rd, ss); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rs1, ss, conf); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_h.rm, ss); + } + if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_LU_H) { + SStream_concat(ss, "fcvt.lu.h"); + spc(ss, conf); + reg_name(tree->ast_node.f_un_rm_type_h.rd, ss); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rs1, ss, conf); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_h.rm, ss); + } + if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_H_L) { + SStream_concat(ss, "fcvt.h.l"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rd, ss, conf); + sep(ss, conf); + reg_name(tree->ast_node.f_un_rm_type_h.rs1, ss); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_h.rm, ss); + } + if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_H_LU) { + SStream_concat(ss, "fcvt.h.lu"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rd, ss, conf); + sep(ss, conf); + reg_name(tree->ast_node.f_un_rm_type_h.rs1, ss); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_h.rm, ss); + } + if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_H_S) { + SStream_concat(ss, "fcvt.h.s"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rd, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rs1, ss, conf); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_h.rm, ss); + } + if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_H_D) { + SStream_concat(ss, "fcvt.h.d"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rd, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rs1, ss, conf); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_h.rm, ss); + } + if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_S_H) { + SStream_concat(ss, "fcvt.s.h"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rd, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rs1, ss, conf); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_h.rm, ss); + } + if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_D_H) { + SStream_concat(ss, "fcvt.d.h"); + spc(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rd, ss, conf); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rs1, ss, conf); + sep(ss, conf); + frm_mnemonic(tree->ast_node.f_un_rm_type_h.rm, ss); + } + break; + case RISCV_F_UN_TYPE_H: + if (tree->ast_node.f_un_type_h.fmv_h_x == RISCV_FMV_X_H) { + SStream_concat(ss, "fmv.x.h"); + spc(ss, conf); + reg_name(tree->ast_node.f_un_type_h.rd, ss); + sep(ss, conf); + freg_name(tree->ast_node.f_un_type_h.rs1, ss); + } + if (tree->ast_node.f_un_type_h.fmv_h_x == RISCV_FMV_H_X) { + SStream_concat(ss, "fmv.h.x"); + spc(ss, conf); + freg_name(tree->ast_node.f_un_type_h.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.f_un_type_h.rs1, ss); + } + if (tree->ast_node.f_un_type_h.fmv_h_x == RISCV_FCLASS_H) { + SStream_concat(ss, "fclass.h"); + spc(ss, conf); + reg_name(tree->ast_node.f_un_type_h.rd, ss); + sep(ss, conf); + freg_or_reg_name(tree->ast_node.f_un_type_h.rs1, ss, conf); + } + break; + case RISCV_FLI_H: + SStream_concat(ss, "fli.h"); + spc(ss, conf); + freg_name(tree->ast_node.riscv_fli_h.rd, ss); + sep(ss, conf); + hex_bits_5(tree->ast_node.riscv_fli_h.constantidx, ss, conf); + break; + case RISCV_FLI_S: + SStream_concat(ss, "fli.s"); + spc(ss, conf); + freg_name(tree->ast_node.riscv_fli_s.rd, ss); + sep(ss, conf); + hex_bits_5(tree->ast_node.riscv_fli_s.constantidx, ss, conf); + break; + case RISCV_FLI_D: + SStream_concat(ss, "fli.d"); + spc(ss, conf); + freg_name(tree->ast_node.riscv_fli_d.rd, ss); + sep(ss, conf); + hex_bits_5(tree->ast_node.riscv_fli_d.constantidx, ss, conf); + break; + case RISCV_FMINM_H: + SStream_concat(ss, "fminm.h"); + spc(ss, conf); + freg_name(tree->ast_node.riscv_fminm_h.rd, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_fminm_h.rs1, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_fminm_h.rs2, ss); + break; + case RISCV_FMAXM_H: + SStream_concat(ss, "fmaxm.h"); + spc(ss, conf); + freg_name(tree->ast_node.riscv_fmaxm_h.rd, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_fmaxm_h.rs1, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_fmaxm_h.rs2, ss); + break; + case RISCV_FMINM_S: + SStream_concat(ss, "fminm.s"); + spc(ss, conf); + freg_name(tree->ast_node.riscv_fminm_s.rd, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_fminm_s.rs1, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_fminm_s.rs2, ss); + break; + case RISCV_FMAXM_S: + SStream_concat(ss, "fmaxm.s"); + spc(ss, conf); + freg_name(tree->ast_node.riscv_fmaxm_s.rd, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_fmaxm_s.rs1, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_fmaxm_s.rs2, ss); + break; + case RISCV_FMINM_D: + SStream_concat(ss, "fminm.d"); + spc(ss, conf); + freg_name(tree->ast_node.riscv_fminm_d.rd, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_fminm_d.rs1, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_fminm_d.rs2, ss); + break; + case RISCV_FMAXM_D: + SStream_concat(ss, "fmaxm.d"); + spc(ss, conf); + freg_name(tree->ast_node.riscv_fmaxm_d.rd, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_fmaxm_d.rs1, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_fmaxm_d.rs2, ss); + break; + case RISCV_FROUND_H: + SStream_concat(ss, "fround.h"); + spc(ss, conf); + freg_name(tree->ast_node.riscv_fround_h.rd, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_fround_h.rs1, ss); + sep(ss, conf); + frm_mnemonic(tree->ast_node.riscv_fround_h.rm, ss); + break; + case RISCV_FROUNDNX_H: + SStream_concat(ss, "froundnx.h"); + spc(ss, conf); + freg_name(tree->ast_node.riscv_froundnx_h.rd, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_froundnx_h.rs1, ss); + sep(ss, conf); + frm_mnemonic(tree->ast_node.riscv_froundnx_h.rm, ss); + break; + case RISCV_FROUND_S: + SStream_concat(ss, "fround.s"); + spc(ss, conf); + freg_name(tree->ast_node.riscv_fround_s.rd, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_fround_s.rs1, ss); + sep(ss, conf); + frm_mnemonic(tree->ast_node.riscv_fround_s.rm, ss); + break; + case RISCV_FROUNDNX_S: + SStream_concat(ss, "froundnx.s"); + spc(ss, conf); + freg_name(tree->ast_node.riscv_froundnx_s.rd, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_froundnx_s.rs1, ss); + sep(ss, conf); + frm_mnemonic(tree->ast_node.riscv_froundnx_s.rm, ss); + break; + case RISCV_FROUND_D: + SStream_concat(ss, "fround.d"); + spc(ss, conf); + freg_name(tree->ast_node.riscv_fround_d.rd, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_fround_d.rs1, ss); + sep(ss, conf); + frm_mnemonic(tree->ast_node.riscv_fround_d.rm, ss); + break; + case RISCV_FROUNDNX_D: + SStream_concat(ss, "froundnx.d"); + spc(ss, conf); + freg_name(tree->ast_node.riscv_froundnx_d.rd, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_froundnx_d.rs1, ss); + sep(ss, conf); + frm_mnemonic(tree->ast_node.riscv_froundnx_d.rm, ss); + break; + case RISCV_FMVH_X_D: + SStream_concat(ss, "fmvh.x.d"); + spc(ss, conf); + reg_name(tree->ast_node.riscv_fmvh_x_d.rd, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_fmvh_x_d.rs1, ss); + break; + case RISCV_FMVP_D_X: + SStream_concat(ss, "fmvp.d.x"); + spc(ss, conf); + freg_name(tree->ast_node.riscv_fmvp_d_x.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.riscv_fmvp_d_x.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.riscv_fmvp_d_x.rs2, ss); + break; + case RISCV_FLEQ_H: + SStream_concat(ss, "fleq.h"); + spc(ss, conf); + freg_name(tree->ast_node.riscv_fleq_h.rd, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_fleq_h.rs1, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_fleq_h.rs2, ss); + break; + case RISCV_FLTQ_H: + SStream_concat(ss, "fltq.h"); + spc(ss, conf); + freg_name(tree->ast_node.riscv_fltq_h.rd, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_fltq_h.rs1, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_fltq_h.rs2, ss); + break; + case RISCV_FLEQ_S: + SStream_concat(ss, "fleq.s"); + spc(ss, conf); + freg_name(tree->ast_node.riscv_fleq_s.rd, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_fleq_s.rs1, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_fleq_s.rs2, ss); + break; + case RISCV_FLTQ_S: + SStream_concat(ss, "fltq.s"); + spc(ss, conf); + freg_name(tree->ast_node.riscv_fltq_s.rd, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_fltq_s.rs1, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_fltq_s.rs2, ss); + break; + case RISCV_FLEQ_D: + SStream_concat(ss, "fleq.d"); + spc(ss, conf); + freg_name(tree->ast_node.riscv_fleq_d.rd, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_fleq_d.rs1, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_fleq_d.rs2, ss); + break; + case RISCV_FLTQ_D: + SStream_concat(ss, "fltq.d"); + spc(ss, conf); + freg_name(tree->ast_node.riscv_fltq_d.rd, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_fltq_d.rs1, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_fltq_d.rs2, ss); + break; + case RISCV_FCVTMOD_W_D: + SStream_concat(ss, "fcvtmod.w.d"); + spc(ss, conf); + reg_name(tree->ast_node.riscv_fcvtmod_w_d.rd, ss); + sep(ss, conf); + freg_name(tree->ast_node.riscv_fcvtmod_w_d.rs1, ss); + break; + case RISCV_SHA256SIG0: + SStream_concat(ss, "sha256sig0"); + spc(ss, conf); + reg_name(tree->ast_node.sha256sig0.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.sha256sig0.rs1, ss); + break; + case RISCV_SHA256SIG1: + SStream_concat(ss, "sha256sig1"); + spc(ss, conf); + reg_name(tree->ast_node.sha256sig1.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.sha256sig1.rs1, ss); + break; + case RISCV_SHA256SUM0: + SStream_concat(ss, "sha256sum0"); + spc(ss, conf); + reg_name(tree->ast_node.sha256sum0.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.sha256sum0.rs1, ss); + break; + case RISCV_SHA256SUM1: + SStream_concat(ss, "sha256sum1"); + spc(ss, conf); + reg_name(tree->ast_node.sha256sum1.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.sha256sum1.rs1, ss); + break; + case RISCV_AES32ESMI: + SStream_concat(ss, "aes32esmi"); + spc(ss, conf); + reg_name(tree->ast_node.aes32esmi.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.aes32esmi.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.aes32esmi.rs2, ss); + sep(ss, conf); + hex_bits_2(tree->ast_node.aes32esmi.bs, ss, conf); + break; + case RISCV_AES32ESI: + SStream_concat(ss, "aes32esi"); + spc(ss, conf); + reg_name(tree->ast_node.aes32esi.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.aes32esi.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.aes32esi.rs2, ss); + sep(ss, conf); + hex_bits_2(tree->ast_node.aes32esi.bs, ss, conf); + break; + case RISCV_AES32DSMI: + SStream_concat(ss, "aes32dsmi"); + spc(ss, conf); + reg_name(tree->ast_node.aes32dsmi.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.aes32dsmi.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.aes32dsmi.rs2, ss); + sep(ss, conf); + hex_bits_2(tree->ast_node.aes32dsmi.bs, ss, conf); + break; + case RISCV_AES32DSI: + SStream_concat(ss, "aes32dsi"); + spc(ss, conf); + reg_name(tree->ast_node.aes32dsi.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.aes32dsi.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.aes32dsi.rs2, ss); + sep(ss, conf); + hex_bits_2(tree->ast_node.aes32dsi.bs, ss, conf); + break; + case RISCV_SHA512SIG0L: + SStream_concat(ss, "sha512sig0l"); + spc(ss, conf); + reg_name(tree->ast_node.sha512sig0l.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.sha512sig0l.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.sha512sig0l.rs2, ss); + break; + case RISCV_SHA512SIG0H: + SStream_concat(ss, "sha512sig0h"); + spc(ss, conf); + reg_name(tree->ast_node.sha512sig0h.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.sha512sig0h.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.sha512sig0h.rs2, ss); + break; + case RISCV_SHA512SIG1L: + SStream_concat(ss, "sha512sig1l"); + spc(ss, conf); + reg_name(tree->ast_node.sha512sig1l.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.sha512sig1l.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.sha512sig1l.rs2, ss); + break; + case RISCV_SHA512SIG1H: + SStream_concat(ss, "sha512sig1h"); + spc(ss, conf); + reg_name(tree->ast_node.sha512sig1h.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.sha512sig1h.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.sha512sig1h.rs2, ss); + break; + case RISCV_SHA512SUM0R: + SStream_concat(ss, "sha512sum0r"); + spc(ss, conf); + reg_name(tree->ast_node.sha512sum0r.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.sha512sum0r.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.sha512sum0r.rs2, ss); + break; + case RISCV_SHA512SUM1R: + SStream_concat(ss, "sha512sum1r"); + spc(ss, conf); + reg_name(tree->ast_node.sha512sum1r.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.sha512sum1r.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.sha512sum1r.rs2, ss); + break; + case RISCV_AES64KS1I: + SStream_concat(ss, "aes64ks1i"); + spc(ss, conf); + reg_name(tree->ast_node.aes64ks1i.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.aes64ks1i.rs1, ss); + sep(ss, conf); + hex_bits_4(tree->ast_node.aes64ks1i.rnum, ss, conf); + break; + case RISCV_AES64KS2: + SStream_concat(ss, "aes64ks2"); + spc(ss, conf); + reg_name(tree->ast_node.aes64ks2.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.aes64ks2.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.aes64ks2.rs2, ss); + break; + case RISCV_AES64IM: + SStream_concat(ss, "aes64im"); + spc(ss, conf); + reg_name(tree->ast_node.aes64im.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.aes64im.rs1, ss); + break; + case RISCV_AES64ESM: + SStream_concat(ss, "aes64esm"); + spc(ss, conf); + reg_name(tree->ast_node.aes64esm.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.aes64esm.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.aes64esm.rs2, ss); + break; + case RISCV_AES64ES: + SStream_concat(ss, "aes64es"); + spc(ss, conf); + reg_name(tree->ast_node.aes64es.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.aes64es.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.aes64es.rs2, ss); + break; + case RISCV_AES64DSM: + SStream_concat(ss, "aes64dsm"); + spc(ss, conf); + reg_name(tree->ast_node.aes64dsm.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.aes64dsm.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.aes64dsm.rs2, ss); + break; + case RISCV_AES64DS: + SStream_concat(ss, "aes64ds"); + spc(ss, conf); + reg_name(tree->ast_node.aes64ds.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.aes64ds.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.aes64ds.rs2, ss); + break; + case RISCV_SHA512SIG0: + SStream_concat(ss, "sha512sig0"); + spc(ss, conf); + reg_name(tree->ast_node.sha512sig0.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.sha512sig0.rs1, ss); + break; + case RISCV_SHA512SIG1: + SStream_concat(ss, "sha512sig1"); + spc(ss, conf); + reg_name(tree->ast_node.sha512sig1.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.sha512sig1.rs1, ss); + break; + case RISCV_SHA512SUM0: + SStream_concat(ss, "sha512sum0"); + spc(ss, conf); + reg_name(tree->ast_node.sha512sum0.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.sha512sum0.rs1, ss); + break; + case RISCV_SHA512SUM1: + SStream_concat(ss, "sha512sum1"); + spc(ss, conf); + reg_name(tree->ast_node.sha512sum1.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.sha512sum1.rs1, ss); + break; + case RISCV_SM3P0: + SStream_concat(ss, "sm3p0"); + spc(ss, conf); + reg_name(tree->ast_node.sm3p0.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.sm3p0.rs1, ss); + break; + case RISCV_SM3P1: + SStream_concat(ss, "sm3p1"); + spc(ss, conf); + reg_name(tree->ast_node.sm3p1.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.sm3p1.rs1, ss); + break; + case RISCV_SM4ED: + SStream_concat(ss, "sm4ed"); + spc(ss, conf); + reg_name(tree->ast_node.sm4ed.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.sm4ed.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.sm4ed.rs2, ss); + sep(ss, conf); + hex_bits_2(tree->ast_node.sm4ed.bs, ss, conf); + break; + case RISCV_SM4KS: + SStream_concat(ss, "sm4ks"); + spc(ss, conf); + reg_name(tree->ast_node.sm4ks.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.sm4ks.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.sm4ks.rs2, ss); + sep(ss, conf); + hex_bits_2(tree->ast_node.sm4ks.bs, ss, conf); + break; + case RISCV_ZBKB_RTYPE: + zbkb_rtype_mnemonic(tree->ast_node.zbkb_rtype.op, ss); + spc(ss, conf); + reg_name(tree->ast_node.zbkb_rtype.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.zbkb_rtype.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.zbkb_rtype.rs2, ss); + break; + case RISCV_ZBKB_PACKW: + SStream_concat(ss, "packw"); + spc(ss, conf); + reg_name(tree->ast_node.zbkb_packw.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.zbkb_packw.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.zbkb_packw.rs2, ss); + break; + case RISCV_ZIP: + SStream_concat(ss, "zip"); + spc(ss, conf); + reg_name(tree->ast_node.riscv_zip.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.riscv_zip.rs1, ss); + break; + case RISCV_UNZIP: + SStream_concat(ss, "unzip"); + spc(ss, conf); + reg_name(tree->ast_node.riscv_unzip.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.riscv_unzip.rs1, ss); + break; + case RISCV_BREV8: + SStream_concat(ss, "brev8"); + spc(ss, conf); + reg_name(tree->ast_node.riscv_brev8.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.riscv_brev8.rs1, ss); + break; + case RISCV_XPERM8: + SStream_concat(ss, "xperm8"); + spc(ss, conf); + reg_name(tree->ast_node.riscv_xperm8.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.riscv_xperm8.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.riscv_xperm8.rs2, ss); + break; + case RISCV_XPERM4: + SStream_concat(ss, "xperm4"); + spc(ss, conf); + reg_name(tree->ast_node.riscv_xperm4.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.riscv_xperm4.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.riscv_xperm4.rs2, ss); + break; + case RISCV_ZICOND_RTYPE: + zicond_mnemonic(tree->ast_node.zicond_rtype.riscv_czero_nez, ss); + spc(ss, conf); + reg_name(tree->ast_node.zicond_rtype.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.zicond_rtype.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.zicond_rtype.rs2, ss); + break; + case RISCV_VSETVLI: + SStream_concat(ss, "vsetvli"); + spc(ss, conf); + reg_name(tree->ast_node.vsetvli.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.vsetvli.rs1, ss); + sep(ss, conf); + sew_flag(tree->ast_node.vsetvli.sew, ss); + maybe_lmul_flag(tree->ast_node.vsetvli.lmul, ss, conf); + maybe_ta_flag(tree->ast_node.vsetvli.ta, ss, conf); + maybe_ma_flag(tree->ast_node.vsetvli.ma, ss, conf); + break; + case RISCV_VSETVL: + SStream_concat(ss, "vsetvl"); + spc(ss, conf); + reg_name(tree->ast_node.vsetvl.rd, ss); + sep(ss, conf); + reg_name(tree->ast_node.vsetvl.rs1, ss); + sep(ss, conf); + reg_name(tree->ast_node.vsetvl.rs2, ss); + break; + case RISCV_VSETIVLI: + SStream_concat(ss, "vsetivli"); + spc(ss, conf); + reg_name(tree->ast_node.vsetivli.rd, ss); + sep(ss, conf); + hex_bits_5(tree->ast_node.vsetivli.uimm, ss, conf); + sep(ss, conf); + sew_flag(tree->ast_node.vsetivli.sew, ss); + maybe_lmul_flag(tree->ast_node.vsetivli.lmul, ss, conf); + maybe_ta_flag(tree->ast_node.vsetivli.ta, ss, conf); + maybe_ma_flag(tree->ast_node.vsetivli.ma, ss, conf); + break; + case RISCV_VVTYPE: + vvtype_mnemonic(tree->ast_node.vvtype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.vvtype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vvtype.vs2, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vvtype.vs1, ss); + maybe_vmask(tree->ast_node.vvtype.vm, ss, conf); + break; + case RISCV_NVSTYPE: + nvstype_mnemonic(tree->ast_node.nvstype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.nvstype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.nvstype.vs2, ss); + sep(ss, conf); + vreg_name(tree->ast_node.nvstype.vs1, ss); + maybe_vmask(tree->ast_node.nvstype.vm, ss, conf); + break; + case RISCV_NVTYPE: + nvtype_mnemonic(tree->ast_node.nvtype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.nvtype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.nvtype.vs2, ss); + sep(ss, conf); + vreg_name(tree->ast_node.nvtype.vs1, ss); + maybe_vmask(tree->ast_node.nvtype.vm, ss, conf); + break; + case RISCV_MASKTYPEV: + SStream_concat(ss, "vmerge.vvm"); + spc(ss, conf); + vreg_name(tree->ast_node.masktypev.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.masktypev.vs2, ss); + sep(ss, conf); + vreg_name(tree->ast_node.masktypev.vs1, ss); + sep(ss, conf); + SStream_concat(ss, "v0"); + break; + case RISCV_MOVETYPEV: + SStream_concat(ss, "vmv.v.v"); + spc(ss, conf); + vreg_name(tree->ast_node.movetypev.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.movetypev.vs1, ss); + break; + case RISCV_VXTYPE: + vxtype_mnemonic(tree->ast_node.vxtype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.vxtype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vxtype.vs2, ss); + sep(ss, conf); + reg_name(tree->ast_node.vxtype.rs1, ss); + maybe_vmask(tree->ast_node.vxtype.vm, ss, conf); + break; + case RISCV_NXSTYPE: + nxstype_mnemonic(tree->ast_node.nxstype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.nxstype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.nxstype.vs2, ss); + sep(ss, conf); + reg_name(tree->ast_node.nxstype.rs1, ss); + maybe_vmask(tree->ast_node.nxstype.vm, ss, conf); + break; + case RISCV_NXTYPE: + nxtype_mnemonic(tree->ast_node.nxtype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.nxtype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.nxtype.vs2, ss); + sep(ss, conf); + reg_name(tree->ast_node.nxtype.rs1, ss); + maybe_vmask(tree->ast_node.nxtype.vm, ss, conf); + break; + case RISCV_VXSG: + vxsg_mnemonic(tree->ast_node.vxsg.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.vxsg.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vxsg.vs2, ss); + sep(ss, conf); + reg_name(tree->ast_node.vxsg.rs1, ss); + maybe_vmask(tree->ast_node.vxsg.vm, ss, conf); + break; + case RISCV_MASKTYPEX: + SStream_concat(ss, "vmerge.vxm"); + spc(ss, conf); + vreg_name(tree->ast_node.masktypex.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.masktypex.vs2, ss); + sep(ss, conf); + reg_name(tree->ast_node.masktypex.rs1, ss); + sep(ss, conf); + SStream_concat(ss, "v0"); + break; + case RISCV_MOVETYPEX: + SStream_concat(ss, "vmv.v.x"); + spc(ss, conf); + vreg_name(tree->ast_node.movetypex.vd, ss); + sep(ss, conf); + reg_name(tree->ast_node.movetypex.rs1, ss); + break; + case RISCV_VITYPE: + vitype_mnemonic(tree->ast_node.vitype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.vitype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vitype.vs2, ss); + sep(ss, conf); + hex_bits_5(tree->ast_node.vitype.simm, ss, conf); + maybe_vmask(tree->ast_node.vitype.vm, ss, conf); + break; + case RISCV_NISTYPE: + nistype_mnemonic(tree->ast_node.nistype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.nistype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.nistype.vs2, ss); + sep(ss, conf); + hex_bits_5(tree->ast_node.nistype.simm, ss, conf); + maybe_vmask(tree->ast_node.nistype.vm, ss, conf); + break; + case RISCV_NITYPE: + nitype_mnemonic(tree->ast_node.nitype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.nitype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.nitype.vs2, ss); + sep(ss, conf); + hex_bits_5(tree->ast_node.nitype.simm, ss, conf); + maybe_vmask(tree->ast_node.nitype.vm, ss, conf); + break; + case RISCV_VISG: + visg_mnemonic(tree->ast_node.visg.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.visg.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.visg.vs2, ss); + sep(ss, conf); + reg_name(tree->ast_node.visg.simm, ss); + maybe_vmask(tree->ast_node.visg.vm, ss, conf); + break; + case RISCV_MASKTYPEI: + SStream_concat(ss, "vmerge.vim"); + spc(ss, conf); + vreg_name(tree->ast_node.masktypei.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.masktypei.vs2, ss); + sep(ss, conf); + hex_bits_5(tree->ast_node.masktypei.simm, ss, conf); + sep(ss, conf); + SStream_concat(ss, "v0"); + break; + case RISCV_MOVETYPEI: + SStream_concat(ss, "vmv.v.i"); + spc(ss, conf); + vreg_name(tree->ast_node.movetypei.vd, ss); + sep(ss, conf); + hex_bits_5(tree->ast_node.movetypei.simm, ss, conf); + break; + case RISCV_VMVRTYPE: + SStream_concat(ss, "vmv"); + simm_string(tree->ast_node.vmvrtype.simm, ss); + SStream_concat(ss, "r.v"); + spc(ss, conf); + vreg_name(tree->ast_node.vmvrtype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vmvrtype.vs2, ss); + break; + case RISCV_MVVTYPE: + mvvtype_mnemonic(tree->ast_node.mvvtype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.mvvtype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.mvvtype.vs2, ss); + sep(ss, conf); + vreg_name(tree->ast_node.mvvtype.vs1, ss); + maybe_vmask(tree->ast_node.mvvtype.vm, ss, conf); + break; + case RISCV_MVVMATYPE: + mvvmatype_mnemonic(tree->ast_node.mvvmatype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.mvvmatype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.mvvmatype.vs1, ss); + sep(ss, conf); + vreg_name(tree->ast_node.mvvmatype.vs2, ss); + maybe_vmask(tree->ast_node.mvvmatype.vm, ss, conf); + break; + case RISCV_WVVTYPE: + wvvtype_mnemonic(tree->ast_node.wvvtype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.wvvtype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.wvvtype.vs2, ss); + sep(ss, conf); + vreg_name(tree->ast_node.wvvtype.vs1, ss); + maybe_vmask(tree->ast_node.wvvtype.vm, ss, conf); + break; + case RISCV_WVTYPE: + wvtype_mnemonic(tree->ast_node.wvtype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.wvtype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.wvtype.vs2, ss); + sep(ss, conf); + vreg_name(tree->ast_node.wvtype.vs1, ss); + maybe_vmask(tree->ast_node.wvtype.vm, ss, conf); + break; + case RISCV_WMVVTYPE: + wmvvtype_mnemonic(tree->ast_node.wmvvtype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.wmvvtype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.wmvvtype.vs1, ss); + sep(ss, conf); + vreg_name(tree->ast_node.wmvvtype.vs2, ss); + maybe_vmask(tree->ast_node.wmvvtype.vm, ss, conf); + break; + case RISCV_VEXT2TYPE: + vext2type_mnemonic(tree->ast_node.vext2type.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.vext2type.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vext2type.vs2, ss); + maybe_vmask(tree->ast_node.vext2type.vm, ss, conf); + break; + case RISCV_VEXT4TYPE: + vext4type_mnemonic(tree->ast_node.vext4type.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.vext4type.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vext4type.vs2, ss); + maybe_vmask(tree->ast_node.vext4type.vm, ss, conf); + break; + case RISCV_VEXT8TYPE: + vext8type_mnemonic(tree->ast_node.vext8type.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.vext8type.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vext8type.vs2, ss); + maybe_vmask(tree->ast_node.vext8type.vm, ss, conf); + break; + case RISCV_VMVXS: + SStream_concat(ss, "vmv.x.s"); + spc(ss, conf); + reg_name(tree->ast_node.vmvxs.rd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vmvxs.vs2, ss); + break; + case RISCV_MVVCOMPRESS: + SStream_concat(ss, "vcompress.vm"); + spc(ss, conf); + vreg_name(tree->ast_node.mvvcompress.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.mvvcompress.vs2, ss); + sep(ss, conf); + vreg_name(tree->ast_node.mvvcompress.vs1, ss); + break; + case RISCV_MVXTYPE: + mvxtype_mnemonic(tree->ast_node.mvxtype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.mvxtype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.mvxtype.vs2, ss); + sep(ss, conf); + reg_name(tree->ast_node.mvxtype.rs1, ss); + maybe_vmask(tree->ast_node.mvxtype.vm, ss, conf); + break; + case RISCV_MVXMATYPE: + mvxmatype_mnemonic(tree->ast_node.mvxmatype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.mvxmatype.vd, ss); + sep(ss, conf); + reg_name(tree->ast_node.mvxmatype.rs1, ss); + sep(ss, conf); + vreg_name(tree->ast_node.mvxmatype.vs2, ss); + maybe_vmask(tree->ast_node.mvxmatype.vm, ss, conf); + break; + case RISCV_WVXTYPE: + wvxtype_mnemonic(tree->ast_node.wvxtype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.wvxtype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.wvxtype.vs2, ss); + sep(ss, conf); + reg_name(tree->ast_node.wvxtype.rs1, ss); + maybe_vmask(tree->ast_node.wvxtype.vm, ss, conf); + break; + case RISCV_WXTYPE: + wxtype_mnemonic(tree->ast_node.wxtype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.wxtype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.wxtype.vs2, ss); + sep(ss, conf); + reg_name(tree->ast_node.wxtype.rs1, ss); + maybe_vmask(tree->ast_node.wxtype.vm, ss, conf); + break; + case RISCV_WMVXTYPE: + wmvxtype_mnemonic(tree->ast_node.wmvxtype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.wmvxtype.vd, ss); + sep(ss, conf); + reg_name(tree->ast_node.wmvxtype.rs1, ss); + sep(ss, conf); + vreg_name(tree->ast_node.wmvxtype.vs2, ss); + maybe_vmask(tree->ast_node.wmvxtype.vm, ss, conf); + break; + case RISCV_VMVSX: + SStream_concat(ss, "vmv.s.x"); + spc(ss, conf); + vreg_name(tree->ast_node.vmvsx.vd, ss); + sep(ss, conf); + reg_name(tree->ast_node.vmvsx.rs1, ss); + break; + case RISCV_FVVTYPE: + fvvtype_mnemonic(tree->ast_node.fvvtype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.fvvtype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.fvvtype.vs2, ss); + sep(ss, conf); + vreg_name(tree->ast_node.fvvtype.vs1, ss); + maybe_vmask(tree->ast_node.fvvtype.vm, ss, conf); + break; + case RISCV_FVVMATYPE: + fvvmatype_mnemonic(tree->ast_node.fvvmatype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.fvvmatype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.fvvmatype.vs1, ss); + sep(ss, conf); + vreg_name(tree->ast_node.fvvmatype.vs2, ss); + maybe_vmask(tree->ast_node.fvvmatype.vm, ss, conf); + break; + case RISCV_FWVVTYPE: + fwvvtype_mnemonic(tree->ast_node.fwvvtype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.fwvvtype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.fwvvtype.vs2, ss); + sep(ss, conf); + vreg_name(tree->ast_node.fwvvtype.vs1, ss); + maybe_vmask(tree->ast_node.fwvvtype.vm, ss, conf); + break; + case RISCV_FWVVMATYPE: + fwvvmatype_mnemonic(tree->ast_node.fwvvmatype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.fwvvmatype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.fwvvmatype.vs1, ss); + sep(ss, conf); + vreg_name(tree->ast_node.fwvvmatype.vs2, ss); + maybe_vmask(tree->ast_node.fwvvmatype.vm, ss, conf); + break; + case RISCV_FWVTYPE: + fwvtype_mnemonic(tree->ast_node.fwvtype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.fwvtype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.fwvtype.vs2, ss); + sep(ss, conf); + vreg_name(tree->ast_node.fwvtype.vs1, ss); + maybe_vmask(tree->ast_node.fwvtype.vm, ss, conf); + break; + case RISCV_VFUNARY0: + vfunary0_mnemonic(tree->ast_node.vfunary0.vfunary0, ss); + spc(ss, conf); + vreg_name(tree->ast_node.vfunary0.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vfunary0.vs2, ss); + maybe_vmask(tree->ast_node.vfunary0.vm, ss, conf); + break; + case RISCV_VFWUNARY0: + vfwunary0_mnemonic(tree->ast_node.vfwunary0.vfwunary0, ss); + spc(ss, conf); + vreg_name(tree->ast_node.vfwunary0.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vfwunary0.vs2, ss); + maybe_vmask(tree->ast_node.vfwunary0.vm, ss, conf); + break; + case RISCV_VFNUNARY0: + vfnunary0_mnemonic(tree->ast_node.vfnunary0.vfnunary0, ss); + spc(ss, conf); + vreg_name(tree->ast_node.vfnunary0.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vfnunary0.vs2, ss); + maybe_vmask(tree->ast_node.vfnunary0.vm, ss, conf); + break; + case RISCV_VFUNARY1: + vfunary1_mnemonic(tree->ast_node.vfunary1.vfunary1, ss); + spc(ss, conf); + vreg_name(tree->ast_node.vfunary1.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vfunary1.vs2, ss); + maybe_vmask(tree->ast_node.vfunary1.vm, ss, conf); + break; + case RISCV_VFMVFS: + SStream_concat(ss, "vfmv.f.s"); + spc(ss, conf); + freg_name(tree->ast_node.vfmvfs.rd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vfmvfs.vs2, ss); + break; + case RISCV_FVFTYPE: + fvftype_mnemonic(tree->ast_node.fvftype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.fvftype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.fvftype.vs2, ss); + sep(ss, conf); + reg_name(tree->ast_node.fvftype.rs1, ss); + maybe_vmask(tree->ast_node.fvftype.vm, ss, conf); + break; + case RISCV_FVFMATYPE: + fvfmatype_mnemonic(tree->ast_node.fvfmatype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.fvfmatype.vd, ss); + sep(ss, conf); + reg_name(tree->ast_node.fvfmatype.rs1, ss); + sep(ss, conf); + vreg_name(tree->ast_node.fvfmatype.vs2, ss); + maybe_vmask(tree->ast_node.fvfmatype.vm, ss, conf); + break; + case RISCV_FWVFTYPE: + fwvftype_mnemonic(tree->ast_node.fwvftype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.fwvftype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.fwvftype.vs2, ss); + sep(ss, conf); + reg_name(tree->ast_node.fwvftype.rs1, ss); + maybe_vmask(tree->ast_node.fwvftype.vm, ss, conf); + break; + case RISCV_FWVFMATYPE: + fwvfmatype_mnemonic(tree->ast_node.fwvfmatype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.fwvfmatype.vd, ss); + sep(ss, conf); + reg_name(tree->ast_node.fwvfmatype.rs1, ss); + sep(ss, conf); + vreg_name(tree->ast_node.fwvfmatype.vs2, ss); + maybe_vmask(tree->ast_node.fwvfmatype.vm, ss, conf); + break; + case RISCV_FWFTYPE: + fwftype_mnemonic(tree->ast_node.fwftype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.fwftype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.fwftype.vs2, ss); + sep(ss, conf); + reg_name(tree->ast_node.fwftype.rs1, ss); + maybe_vmask(tree->ast_node.fwftype.vm, ss, conf); + break; + case RISCV_VFMERGE: + SStream_concat(ss, "vfmerge.vfm"); + spc(ss, conf); + vreg_name(tree->ast_node.vfmerge.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vfmerge.vs2, ss); + sep(ss, conf); + reg_name(tree->ast_node.vfmerge.rs1, ss); + sep(ss, conf); + SStream_concat(ss, "v0"); + break; + case RISCV_VFMV: + SStream_concat(ss, "vfmv.v.f"); + spc(ss, conf); + vreg_name(tree->ast_node.vfmv.vd, ss); + sep(ss, conf); + reg_name(tree->ast_node.vfmv.rs1, ss); + break; + case RISCV_VFMVSF: + SStream_concat(ss, "vfmv.s.f"); + spc(ss, conf); + vreg_name(tree->ast_node.vfmvsf.vd, ss); + sep(ss, conf); + freg_name(tree->ast_node.vfmvsf.rs1, ss); + break; + case RISCV_VLSEGTYPE: + SStream_concat(ss, "vl"); + nfields_string(tree->ast_node.vlsegtype.nf, ss); + SStream_concat(ss, "e"); + vlewidth_bitsnumberstr(tree->ast_node.vlsegtype.width, ss); + SStream_concat(ss, ".v"); + spc(ss, conf); + vreg_name(tree->ast_node.vlsegtype.vd, ss); + sep(ss, conf); + SStream_concat(ss, "("); + reg_name(tree->ast_node.vlsegtype.rs1, ss); + SStream_concat(ss, ")"); + maybe_vmask(tree->ast_node.vlsegtype.vm, ss, conf); + break; + case RISCV_VLSEGFFTYPE: + SStream_concat(ss, "vl"); + nfields_string(tree->ast_node.vlsegfftype.nf, ss); + SStream_concat(ss, "e"); + vlewidth_bitsnumberstr(tree->ast_node.vlsegfftype.width, ss); + SStream_concat(ss, "ff.v"); + spc(ss, conf); + vreg_name(tree->ast_node.vlsegfftype.vd, ss); + sep(ss, conf); + SStream_concat(ss, "("); + reg_name(tree->ast_node.vlsegfftype.rs1, ss); + SStream_concat(ss, ")"); + maybe_vmask(tree->ast_node.vlsegfftype.vm, ss, conf); + break; + case RISCV_VSSEGTYPE: + SStream_concat(ss, "vs"); + nfields_string(tree->ast_node.vssegtype.nf, ss); + SStream_concat(ss, "e"); + vlewidth_bitsnumberstr(tree->ast_node.vssegtype.width, ss); + SStream_concat(ss, ".v"); + spc(ss, conf); + vreg_name(tree->ast_node.vssegtype.vs3, ss); + sep(ss, conf); + SStream_concat(ss, "("); + reg_name(tree->ast_node.vssegtype.rs1, ss); + SStream_concat(ss, ")"); + maybe_vmask(tree->ast_node.vssegtype.vm, ss, conf); + break; + case RISCV_VLSSEGTYPE: + SStream_concat(ss, "vls"); + nfields_string(tree->ast_node.vlssegtype.nf, ss); + SStream_concat(ss, "e"); + vlewidth_bitsnumberstr(tree->ast_node.vlssegtype.width, ss); + SStream_concat(ss, ".v"); + spc(ss, conf); + vreg_name(tree->ast_node.vlssegtype.vd, ss); + sep(ss, conf); + SStream_concat(ss, "("); + reg_name(tree->ast_node.vlssegtype.rs1, ss); + SStream_concat(ss, ")"); + sep(ss, conf); + reg_name(tree->ast_node.vlssegtype.rs2, ss); + maybe_vmask(tree->ast_node.vlssegtype.vm, ss, conf); + break; + case RISCV_VSSSEGTYPE: + SStream_concat(ss, "vss"); + nfields_string(tree->ast_node.vsssegtype.nf, ss); + SStream_concat(ss, "e"); + vlewidth_bitsnumberstr(tree->ast_node.vsssegtype.width, ss); + SStream_concat(ss, ".v"); + spc(ss, conf); + vreg_name(tree->ast_node.vsssegtype.vs3, ss); + sep(ss, conf); + SStream_concat(ss, "("); + reg_name(tree->ast_node.vsssegtype.rs1, ss); + SStream_concat(ss, ")"); + sep(ss, conf); + reg_name(tree->ast_node.vsssegtype.rs2, ss); + maybe_vmask(tree->ast_node.vsssegtype.vm, ss, conf); + break; + case RISCV_VLUXSEGTYPE: + SStream_concat(ss, "vlux"); + nfields_string(tree->ast_node.vluxsegtype.nf, ss); + SStream_concat(ss, "ei"); + vlewidth_bitsnumberstr(tree->ast_node.vluxsegtype.width, ss); + SStream_concat(ss, ".v"); + spc(ss, conf); + vreg_name(tree->ast_node.vluxsegtype.vd, ss); + sep(ss, conf); + SStream_concat(ss, "("); + reg_name(tree->ast_node.vluxsegtype.rs1, ss); + SStream_concat(ss, ")"); + sep(ss, conf); + reg_name(tree->ast_node.vluxsegtype.vs2, ss); + maybe_vmask(tree->ast_node.vluxsegtype.vm, ss, conf); + break; + case RISCV_VLOXSEGTYPE: + SStream_concat(ss, "vlox"); + nfields_string(tree->ast_node.vloxsegtype.nf, ss); + SStream_concat(ss, "ei"); + vlewidth_bitsnumberstr(tree->ast_node.vloxsegtype.width, ss); + SStream_concat(ss, ".v"); + spc(ss, conf); + vreg_name(tree->ast_node.vloxsegtype.vd, ss); + sep(ss, conf); + SStream_concat(ss, "("); + reg_name(tree->ast_node.vloxsegtype.rs1, ss); + SStream_concat(ss, ")"); + sep(ss, conf); + reg_name(tree->ast_node.vloxsegtype.vs2, ss); + maybe_vmask(tree->ast_node.vloxsegtype.vm, ss, conf); + break; + case RISCV_VSUXSEGTYPE: + SStream_concat(ss, "vsux"); + nfields_string(tree->ast_node.vsuxsegtype.nf, ss); + SStream_concat(ss, "ei"); + vlewidth_bitsnumberstr(tree->ast_node.vsuxsegtype.width, ss); + SStream_concat(ss, ".v"); + spc(ss, conf); + vreg_name(tree->ast_node.vsuxsegtype.vs3, ss); + sep(ss, conf); + SStream_concat(ss, "("); + reg_name(tree->ast_node.vsuxsegtype.rs1, ss); + SStream_concat(ss, ")"); + sep(ss, conf); + reg_name(tree->ast_node.vsuxsegtype.vs2, ss); + maybe_vmask(tree->ast_node.vsuxsegtype.vm, ss, conf); + break; + case RISCV_VSOXSEGTYPE: + SStream_concat(ss, "vsox"); + nfields_string(tree->ast_node.vsoxsegtype.nf, ss); + SStream_concat(ss, "ei"); + vlewidth_bitsnumberstr(tree->ast_node.vsoxsegtype.width, ss); + SStream_concat(ss, ".v"); + spc(ss, conf); + vreg_name(tree->ast_node.vsoxsegtype.vs3, ss); + sep(ss, conf); + SStream_concat(ss, "("); + reg_name(tree->ast_node.vsoxsegtype.rs1, ss); + SStream_concat(ss, ")"); + sep(ss, conf); + reg_name(tree->ast_node.vsoxsegtype.vs2, ss); + maybe_vmask(tree->ast_node.vsoxsegtype.vm, ss, conf); + break; + case RISCV_VLRETYPE: + SStream_concat(ss, "vl"); + nfields_string(tree->ast_node.vlretype.nf, ss); + SStream_concat(ss, "re"); + vlewidth_bitsnumberstr(tree->ast_node.vlretype.width, ss); + SStream_concat(ss, ".v"); + spc(ss, conf); + vreg_name(tree->ast_node.vlretype.vd, ss); + sep(ss, conf); + SStream_concat(ss, "("); + reg_name(tree->ast_node.vlretype.rs1, ss); + SStream_concat(ss, ")"); + break; + case RISCV_VSRETYPE: + SStream_concat(ss, "vs"); + nfields_string(tree->ast_node.vsretype.nf, ss); + SStream_concat(ss, "r.v"); + spc(ss, conf); + vreg_name(tree->ast_node.vsretype.vs3, ss); + sep(ss, conf); + SStream_concat(ss, "("); + reg_name(tree->ast_node.vsretype.rs1, ss); + SStream_concat(ss, ")"); + break; + case RISCV_VMTYPE: + vmtype_mnemonic(tree->ast_node.vmtype.op, ss); + spc(ss, conf); + vreg_name(tree->ast_node.vmtype.vd_or_vs3, ss); + sep(ss, conf); + SStream_concat(ss, "("); + reg_name(tree->ast_node.vmtype.rs1, ss); + SStream_concat(ss, ")"); + break; + case RISCV_MMTYPE: + mmtype_mnemonic(tree->ast_node.mmtype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.mmtype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.mmtype.vs2, ss); + sep(ss, conf); + vreg_name(tree->ast_node.mmtype.vs1, ss); + break; + case RISCV_VCPOP_M: + SStream_concat(ss, "vpopc.m"); + spc(ss, conf); + reg_name(tree->ast_node.vcpop_m.rd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vcpop_m.vs2, ss); + maybe_vmask(tree->ast_node.vcpop_m.vm, ss, conf); + break; + case RISCV_VFIRST_M: + SStream_concat(ss, "vfirst.m"); + spc(ss, conf); + reg_name(tree->ast_node.vfirst_m.rd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vfirst_m.vs2, ss); + maybe_vmask(tree->ast_node.vfirst_m.vm, ss, conf); + break; + case RISCV_VMSBF_M: + SStream_concat(ss, "vmsbf.m"); + spc(ss, conf); + vreg_name(tree->ast_node.vmsbf_m.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vmsbf_m.vs2, ss); + maybe_vmask(tree->ast_node.vmsbf_m.vm, ss, conf); + break; + case RISCV_VMSIF_M: + SStream_concat(ss, "vmsif.m"); + spc(ss, conf); + vreg_name(tree->ast_node.vmsif_m.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vmsif_m.vs2, ss); + maybe_vmask(tree->ast_node.vmsif_m.vm, ss, conf); + break; + case RISCV_VMSOF_M: + SStream_concat(ss, "vmsof.m"); + spc(ss, conf); + vreg_name(tree->ast_node.vmsof_m.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vmsof_m.vs2, ss); + maybe_vmask(tree->ast_node.vmsof_m.vm, ss, conf); + break; + case RISCV_VIOTA_M: + SStream_concat(ss, "viota.m"); + spc(ss, conf); + vreg_name(tree->ast_node.viota_m.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.viota_m.vs2, ss); + maybe_vmask(tree->ast_node.viota_m.vm, ss, conf); + break; + case RISCV_VID_V: + SStream_concat(ss, "vid.v"); + spc(ss, conf); + vreg_name(tree->ast_node.vid_v.vd, ss); + maybe_vmask(tree->ast_node.vid_v.vm, ss, conf); + break; + case RISCV_VVMTYPE: + vvmtype_mnemonic(tree->ast_node.vvmtype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.vvmtype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vvmtype.vs2, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vvmtype.vs1, ss); + sep(ss, conf); + SStream_concat(ss, "v0"); + break; + case RISCV_VVMCTYPE: + vvmctype_mnemonic(tree->ast_node.vvmctype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.vvmctype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vvmctype.vs2, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vvmctype.vs1, ss); + break; + case RISCV_VVMSTYPE: + vvmstype_mnemonic(tree->ast_node.vvmstype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.vvmstype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vvmstype.vs2, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vvmstype.vs1, ss); + sep(ss, conf); + SStream_concat(ss, "v0"); + break; + case RISCV_VVCMPTYPE: + vvcmptype_mnemonic(tree->ast_node.vvcmptype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.vvcmptype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vvcmptype.vs2, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vvcmptype.vs1, ss); + maybe_vmask(tree->ast_node.vvcmptype.vm, ss, conf); + break; + case RISCV_VXMTYPE: + vxmtype_mnemonic(tree->ast_node.vxmtype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.vxmtype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vxmtype.vs2, ss); + sep(ss, conf); + reg_name(tree->ast_node.vxmtype.rs1, ss); + sep(ss, conf); + SStream_concat(ss, "v0"); + break; + case RISCV_VXMCTYPE: + vxmctype_mnemonic(tree->ast_node.vxmctype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.vxmctype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vxmctype.vs2, ss); + sep(ss, conf); + reg_name(tree->ast_node.vxmctype.rs1, ss); + break; + case RISCV_VXMSTYPE: + vxmstype_mnemonic(tree->ast_node.vxmstype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.vxmstype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vxmstype.vs2, ss); + sep(ss, conf); + reg_name(tree->ast_node.vxmstype.rs1, ss); + sep(ss, conf); + SStream_concat(ss, "v0"); + break; + case RISCV_VXCMPTYPE: + vxcmptype_mnemonic(tree->ast_node.vxcmptype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.vxcmptype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vxcmptype.vs2, ss); + sep(ss, conf); + reg_name(tree->ast_node.vxcmptype.rs1, ss); + maybe_vmask(tree->ast_node.vxcmptype.vm, ss, conf); + break; + case RISCV_VIMTYPE: + vimtype_mnemonic(tree->ast_node.vimtype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.vimtype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vimtype.vs2, ss); + sep(ss, conf); + hex_bits_5(tree->ast_node.vimtype.simm, ss, conf); + sep(ss, conf); + SStream_concat(ss, "v0"); + break; + case RISCV_VIMCTYPE: + vimctype_mnemonic(tree->ast_node.vimctype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.vimctype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vimctype.vs2, ss); + sep(ss, conf); + hex_bits_5(tree->ast_node.vimctype.simm, ss, conf); + break; + case RISCV_VIMSTYPE: + vimstype_mnemonic(tree->ast_node.vimstype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.vimstype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vimstype.vs2, ss); + sep(ss, conf); + hex_bits_5(tree->ast_node.vimstype.simm, ss, conf); + sep(ss, conf); + SStream_concat(ss, "v0"); + break; + case RISCV_VICMPTYPE: + vicmptype_mnemonic(tree->ast_node.vicmptype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.vicmptype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.vicmptype.vs2, ss); + sep(ss, conf); + hex_bits_5(tree->ast_node.vicmptype.simm, ss, conf); + maybe_vmask(tree->ast_node.vicmptype.vm, ss, conf); + break; + case RISCV_FVVMTYPE: + fvvmtype_mnemonic(tree->ast_node.fvvmtype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.fvvmtype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.fvvmtype.vs2, ss); + sep(ss, conf); + vreg_name(tree->ast_node.fvvmtype.vs1, ss); + maybe_vmask(tree->ast_node.fvvmtype.vm, ss, conf); + break; + case RISCV_FVFMTYPE: + fvfmtype_mnemonic(tree->ast_node.fvfmtype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.fvfmtype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.fvfmtype.vs2, ss); + sep(ss, conf); + reg_name(tree->ast_node.fvfmtype.rs1, ss); + maybe_vmask(tree->ast_node.fvfmtype.vm, ss, conf); + break; + case RISCV_RIVVTYPE: + rivvtype_mnemonic(tree->ast_node.rivvtype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.rivvtype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.rivvtype.vs2, ss); + sep(ss, conf); + vreg_name(tree->ast_node.rivvtype.vs1, ss); + maybe_vmask(tree->ast_node.rivvtype.vm, ss, conf); + break; + case RISCV_RMVVTYPE: + rmvvtype_mnemonic(tree->ast_node.rmvvtype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.rmvvtype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.rmvvtype.vs2, ss); + sep(ss, conf); + vreg_name(tree->ast_node.rmvvtype.vs1, ss); + maybe_vmask(tree->ast_node.rmvvtype.vm, ss, conf); + break; + case RISCV_RFVVTYPE: + rfvvtype_mnemonic(tree->ast_node.rfvvtype.funct6, ss); + spc(ss, conf); + vreg_name(tree->ast_node.rfvvtype.vd, ss); + sep(ss, conf); + vreg_name(tree->ast_node.rfvvtype.vs2, ss); + sep(ss, conf); + vreg_name(tree->ast_node.rfvvtype.vs1, ss); + maybe_vmask(tree->ast_node.rfvvtype.vm, ss, conf); + break; + case RISCV_ZICBOM: + cbop_mnemonic(tree->ast_node.riscv_zicbom.cbop, ss); + spc(ss, conf); + SStream_concat(ss, "("); + opt_spc(ss, conf); + reg_name(tree->ast_node.riscv_zicbom.rs1, ss); + opt_spc(ss, conf); + SStream_concat(ss, ")"); + break; + case RISCV_ZICBOZ: + SStream_concat(ss, "cbo.zero"); + spc(ss, conf); + SStream_concat(ss, "("); + opt_spc(ss, conf); + reg_name(tree->ast_node.riscv_zicboz, ss); + opt_spc(ss, conf); + SStream_concat(ss, ")"); + break; + case RISCV_ILLEGAL: + SStream_concat(ss, "illegal"); + spc(ss, conf); + hex_bits_32(tree->ast_node.illegal, ss, conf); + break; + case RISCV_C_ILLEGAL: + SStream_concat(ss, "c.illegal"); + spc(ss, conf); + hex_bits_16(tree->ast_node.c_illegal, ss, conf); + break; + } +} +#endif diff --git a/arch/RISCV/RISCVAst2StrTbls.gen.inc b/arch/RISCV/RISCVAst2StrTbls.gen.inc new file mode 100644 index 0000000000..72968ea87e --- /dev/null +++ b/arch/RISCV/RISCVAst2StrTbls.gen.inc @@ -0,0 +1,2522 @@ +/*=======================================================================*/ +/* This code was generated by the tool auto-sync-sail*/ +/* (see https://github.com/rizinorg/capstone-autosync-sail)*/ +/* from the sail model of RISC-V*/ +/* (see https://github.com/riscv/sail-riscv) @ version + * 0b9c639f19da48734cbf14b61f6ad200b7c70de9.*/ +/* DO NOT MODIFY THIS CODE MANUALLY. ANY MANUAL EDITS ARE OVERWRITTEN.*/ +/* ------------------------------------------------------------------- */ +/* Copyright © 2024 moste00 */ +/* SPDX-License-Identifier: BSD-3-Clause*/ +/*=======================================================================*/ + +#ifndef __RISCVAST2STRTBLS_GEN_INC__ +#define __RISCVAST2STRTBLS_GEN_INC__ +#include +#include +#include + +#include "RISCVAst.gen.inc" +#include "../../SStream.h" + +void utype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_LUI: { + SStream_concat(ss, "lui"); + break; + } + case RISCV_AUIPC: { + SStream_concat(ss, "auipc"); + break; + } + } +} +void reg_name(uint64_t member, SStream *ss) { + switch (member) { + case 0x08: { + SStream_concat(ss, "fp"); + break; + } + case 0x15: { + SStream_concat(ss, "s5"); + break; + } + case 0x01: { + SStream_concat(ss, "ra"); + break; + } + case 0x06: { + SStream_concat(ss, "t1"); + break; + } + case 0x09: { + SStream_concat(ss, "s1"); + break; + } + case 0x10: { + SStream_concat(ss, "a6"); + break; + } + case 0x1B: { + SStream_concat(ss, "s11"); + break; + } + case 0x1C: { + SStream_concat(ss, "t3"); + break; + } + case 0x16: { + SStream_concat(ss, "s6"); + break; + } + case 0x00: { + SStream_concat(ss, "zero"); + break; + } + case 0x0A: { + SStream_concat(ss, "a0"); + break; + } + case 0x1A: { + SStream_concat(ss, "s10"); + break; + } + case 0x17: { + SStream_concat(ss, "s7"); + break; + } + case 0x0C: { + SStream_concat(ss, "a2"); + break; + } + case 0x18: { + SStream_concat(ss, "s8"); + break; + } + case 0x02: { + SStream_concat(ss, "sp"); + break; + } + case 0x1F: { + SStream_concat(ss, "t6"); + break; + } + case 0x0B: { + SStream_concat(ss, "a1"); + break; + } + case 0x07: { + SStream_concat(ss, "t2"); + break; + } + case 0x13: { + SStream_concat(ss, "s3"); + break; + } + case 0x04: { + SStream_concat(ss, "tp"); + break; + } + case 0x19: { + SStream_concat(ss, "s9"); + break; + } + case 0x12: { + SStream_concat(ss, "s2"); + break; + } + case 0x14: { + SStream_concat(ss, "s4"); + break; + } + case 0x0E: { + SStream_concat(ss, "a4"); + break; + } + case 0x1E: { + SStream_concat(ss, "t5"); + break; + } + case 0x11: { + SStream_concat(ss, "a7"); + break; + } + case 0x03: { + SStream_concat(ss, "gp"); + break; + } + case 0x05: { + SStream_concat(ss, "t0"); + break; + } + case 0x1D: { + SStream_concat(ss, "t4"); + break; + } + case 0x0D: { + SStream_concat(ss, "a3"); + break; + } + case 0x0F: { + SStream_concat(ss, "a5"); + break; + } + } +} +void btype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_BGEU: { + SStream_concat(ss, "bgeu"); + break; + } + case RISCV_BLT: { + SStream_concat(ss, "blt"); + break; + } + case RISCV_BGE: { + SStream_concat(ss, "bge"); + break; + } + case RISCV_BLTU: { + SStream_concat(ss, "bltu"); + break; + } + case RISCV_BNE: { + SStream_concat(ss, "bne"); + break; + } + case RISCV_BEQ: { + SStream_concat(ss, "beq"); + break; + } + } +} +void itype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_ANDI: { + SStream_concat(ss, "andi"); + break; + } + case RISCV_ADDI: { + SStream_concat(ss, "addi"); + break; + } + case RISCV_XORI: { + SStream_concat(ss, "xori"); + break; + } + case RISCV_SLTI: { + SStream_concat(ss, "slti"); + break; + } + case RISCV_ORI: { + SStream_concat(ss, "ori"); + break; + } + case RISCV_SLTIU: { + SStream_concat(ss, "sltiu"); + break; + } + } +} +void shiftiop_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_SRAI: { + SStream_concat(ss, "srai"); + break; + } + case RISCV_SRLI: { + SStream_concat(ss, "srli"); + break; + } + case RISCV_SLLI: { + SStream_concat(ss, "slli"); + break; + } + } +} +void rtype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_SLL: { + SStream_concat(ss, "sll"); + break; + } + case RISCV_SRL: { + SStream_concat(ss, "srl"); + break; + } + case RISCV_SLTU: { + SStream_concat(ss, "sltu"); + break; + } + case RISCV_ADD: { + SStream_concat(ss, "add"); + break; + } + case RISCV_XOR: { + SStream_concat(ss, "xor"); + break; + } + case RISCV_SLT: { + SStream_concat(ss, "slt"); + break; + } + case RISCV_AND: { + SStream_concat(ss, "and"); + break; + } + case RISCV_OR: { + SStream_concat(ss, "or"); + break; + } + case RISCV_SRA: { + SStream_concat(ss, "sra"); + break; + } + case RISCV_SUB: { + SStream_concat(ss, "sub"); + break; + } + } +} +void size_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_BYTE: { + SStream_concat(ss, "b"); + break; + } + case RISCV_WORD: { + SStream_concat(ss, "w"); + break; + } + case RISCV_DOUBLE: { + SStream_concat(ss, "d"); + break; + } + case RISCV_HALF: { + SStream_concat(ss, "h"); + break; + } + } +} +void rtypew_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_SRAW: { + SStream_concat(ss, "sraw"); + break; + } + case RISCV_SUBW: { + SStream_concat(ss, "subw"); + break; + } + case RISCV_SLLW: { + SStream_concat(ss, "sllw"); + break; + } + case RISCV_SRLW: { + SStream_concat(ss, "srlw"); + break; + } + case RISCV_ADDW: { + SStream_concat(ss, "addw"); + break; + } + } +} +void shiftiwop_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_SRLIW: { + SStream_concat(ss, "srliw"); + break; + } + case RISCV_SLLIW: { + SStream_concat(ss, "slliw"); + break; + } + case RISCV_SRAIW: { + SStream_concat(ss, "sraiw"); + break; + } + } +} +void amo_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_AMOMIN: { + SStream_concat(ss, "amomin"); + break; + } + case RISCV_AMOXOR: { + SStream_concat(ss, "amoxor"); + break; + } + case RISCV_AMOADD: { + SStream_concat(ss, "amoadd"); + break; + } + case RISCV_AMOOR: { + SStream_concat(ss, "amoor"); + break; + } + case RISCV_AMOSWAP: { + SStream_concat(ss, "amoswap"); + break; + } + case RISCV_AMOMAX: { + SStream_concat(ss, "amomax"); + break; + } + case RISCV_AMOMINU: { + SStream_concat(ss, "amominu"); + break; + } + case RISCV_AMOAND: { + SStream_concat(ss, "amoand"); + break; + } + case RISCV_AMOMAXU: { + SStream_concat(ss, "amomaxu"); + break; + } + } +} +void creg_name(uint64_t member, SStream *ss) { + switch (member) { + case 0x7: { + SStream_concat(ss, "a5"); + break; + } + case 0x5: { + SStream_concat(ss, "a3"); + break; + } + case 0x1: { + SStream_concat(ss, "s1"); + break; + } + case 0x3: { + SStream_concat(ss, "a1"); + break; + } + case 0x2: { + SStream_concat(ss, "a0"); + break; + } + case 0x4: { + SStream_concat(ss, "a2"); + break; + } + case 0x6: { + SStream_concat(ss, "a4"); + break; + } + case 0x0: { + SStream_concat(ss, "s0"); + break; + } + } +} +void csr_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_CSRRS: { + SStream_concat(ss, "csrrs"); + break; + } + case RISCV_CSRRW: { + SStream_concat(ss, "csrrw"); + break; + } + case RISCV_CSRRC: { + SStream_concat(ss, "csrrc"); + break; + } + } +} +void freg_name(uint64_t member, SStream *ss) { + switch (member) { + case 0x08: { + SStream_concat(ss, "fs0"); + break; + } + case 0x15: { + SStream_concat(ss, "fs5"); + break; + } + case 0x01: { + SStream_concat(ss, "ft1"); + break; + } + case 0x06: { + SStream_concat(ss, "ft6"); + break; + } + case 0x09: { + SStream_concat(ss, "fs1"); + break; + } + case 0x10: { + SStream_concat(ss, "fa6"); + break; + } + case 0x1B: { + SStream_concat(ss, "fs11"); + break; + } + case 0x1C: { + SStream_concat(ss, "ft8"); + break; + } + case 0x16: { + SStream_concat(ss, "fs6"); + break; + } + case 0x00: { + SStream_concat(ss, "ft0"); + break; + } + case 0x0A: { + SStream_concat(ss, "fa0"); + break; + } + case 0x1A: { + SStream_concat(ss, "fs10"); + break; + } + case 0x17: { + SStream_concat(ss, "fs7"); + break; + } + case 0x0C: { + SStream_concat(ss, "fa2"); + break; + } + case 0x18: { + SStream_concat(ss, "fs8"); + break; + } + case 0x02: { + SStream_concat(ss, "ft2"); + break; + } + case 0x1F: { + SStream_concat(ss, "ft11"); + break; + } + case 0x0B: { + SStream_concat(ss, "fa1"); + break; + } + case 0x07: { + SStream_concat(ss, "ft7"); + break; + } + case 0x13: { + SStream_concat(ss, "fs3"); + break; + } + case 0x04: { + SStream_concat(ss, "ft4"); + break; + } + case 0x19: { + SStream_concat(ss, "fs9"); + break; + } + case 0x12: { + SStream_concat(ss, "fs2"); + break; + } + case 0x14: { + SStream_concat(ss, "fs4"); + break; + } + case 0x0E: { + SStream_concat(ss, "fa4"); + break; + } + case 0x1E: { + SStream_concat(ss, "ft10"); + break; + } + case 0x11: { + SStream_concat(ss, "fa7"); + break; + } + case 0x03: { + SStream_concat(ss, "ft3"); + break; + } + case 0x05: { + SStream_concat(ss, "ft5"); + break; + } + case 0x1D: { + SStream_concat(ss, "ft9"); + break; + } + case 0x0D: { + SStream_concat(ss, "fa3"); + break; + } + case 0x0F: { + SStream_concat(ss, "fa5"); + break; + } + } +} +void f_madd_type_mnemonic_S(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_FMADD_S: { + SStream_concat(ss, "fmadd.s"); + break; + } + case RISCV_FNMADD_S: { + SStream_concat(ss, "fnmadd.s"); + break; + } + case RISCV_FNMSUB_S: { + SStream_concat(ss, "fnmsub.s"); + break; + } + case RISCV_FMSUB_S: { + SStream_concat(ss, "fmsub.s"); + break; + } + } +} +void frm_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_RM_RNE: { + SStream_concat(ss, "rne"); + break; + } + case RISCV_RM_RTZ: { + SStream_concat(ss, "rtz"); + break; + } + case RISCV_RM_RDN: { + SStream_concat(ss, "rdn"); + break; + } + case RISCV_RM_RMM: { + SStream_concat(ss, "rmm"); + break; + } + case RISCV_RM_RUP: { + SStream_concat(ss, "rup"); + break; + } + case RISCV_RM_DYN: { + SStream_concat(ss, "dyn"); + break; + } + } +} +void f_bin_rm_type_mnemonic_S(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_FDIV_S: { + SStream_concat(ss, "fdiv.s"); + break; + } + case RISCV_FADD_S: { + SStream_concat(ss, "fadd.s"); + break; + } + case RISCV_FMUL_S: { + SStream_concat(ss, "fmul.s"); + break; + } + case RISCV_FSUB_S: { + SStream_concat(ss, "fsub.s"); + break; + } + } +} +void f_madd_type_mnemonic_D(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_FMSUB_D: { + SStream_concat(ss, "fmsub.d"); + break; + } + case RISCV_FNMSUB_D: { + SStream_concat(ss, "fnmsub.d"); + break; + } + case RISCV_FNMADD_D: { + SStream_concat(ss, "fnmadd.d"); + break; + } + case RISCV_FMADD_D: { + SStream_concat(ss, "fmadd.d"); + break; + } + } +} +void f_bin_rm_type_mnemonic_D(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_FMUL_D: { + SStream_concat(ss, "fmul.d"); + break; + } + case RISCV_FADD_D: { + SStream_concat(ss, "fadd.d"); + break; + } + case RISCV_FSUB_D: { + SStream_concat(ss, "fsub.d"); + break; + } + case RISCV_FDIV_D: { + SStream_concat(ss, "fdiv.d"); + break; + } + } +} +void zba_rtypeuw_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_SH1ADDUW: { + SStream_concat(ss, "sh1add.uw"); + break; + } + case RISCV_SH2ADDUW: { + SStream_concat(ss, "sh2add.uw"); + break; + } + case RISCV_ADDUW: { + SStream_concat(ss, "add.uw"); + break; + } + case RISCV_SH3ADDUW: { + SStream_concat(ss, "sh3add.uw"); + break; + } + } +} +void zba_rtype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_SH3ADD: { + SStream_concat(ss, "sh3add"); + break; + } + case RISCV_SH2ADD: { + SStream_concat(ss, "sh2add"); + break; + } + case RISCV_SH1ADD: { + SStream_concat(ss, "sh1add"); + break; + } + } +} +void zbb_rtypew_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_RORW: { + SStream_concat(ss, "rorw"); + break; + } + case RISCV_ROLW: { + SStream_concat(ss, "rolw"); + break; + } + } +} +void zbb_rtype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_ROR: { + SStream_concat(ss, "ror"); + break; + } + case RISCV_MAXU: { + SStream_concat(ss, "maxu"); + break; + } + case RISCV_MIN: { + SStream_concat(ss, "min"); + break; + } + case RISCV_MAX: { + SStream_concat(ss, "max"); + break; + } + case RISCV_ANDN: { + SStream_concat(ss, "andn"); + break; + } + case RISCV_ORN: { + SStream_concat(ss, "orn"); + break; + } + case RISCV_XNOR: { + SStream_concat(ss, "xnor"); + break; + } + case RISCV_MINU: { + SStream_concat(ss, "minu"); + break; + } + case RISCV_ROL: { + SStream_concat(ss, "rol"); + break; + } + } +} +void zbb_extop_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_SEXTH: { + SStream_concat(ss, "sext.h"); + break; + } + case RISCV_ZEXTH: { + SStream_concat(ss, "zext.h"); + break; + } + case RISCV_SEXTB: { + SStream_concat(ss, "sext.b"); + break; + } + } +} +void zbs_iop_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_BCLRI: { + SStream_concat(ss, "bclri"); + break; + } + case RISCV_BINVI: { + SStream_concat(ss, "binvi"); + break; + } + case RISCV_BSETI: { + SStream_concat(ss, "bseti"); + break; + } + case RISCV_BEXTI: { + SStream_concat(ss, "bexti"); + break; + } + } +} +void zbs_rtype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_BEXT: { + SStream_concat(ss, "bext"); + break; + } + case RISCV_BINV: { + SStream_concat(ss, "binv"); + break; + } + case RISCV_BSET: { + SStream_concat(ss, "bset"); + break; + } + case RISCV_BCLR: { + SStream_concat(ss, "bclr"); + break; + } + } +} +void f_bin_rm_type_mnemonic_H(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_FDIV_H: { + SStream_concat(ss, "fdiv.h"); + break; + } + case RISCV_FADD_H: { + SStream_concat(ss, "fadd.h"); + break; + } + case RISCV_FMUL_H: { + SStream_concat(ss, "fmul.h"); + break; + } + case RISCV_FSUB_H: { + SStream_concat(ss, "fsub.h"); + break; + } + } +} +void f_madd_type_mnemonic_H(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_FNMSUB_H: { + SStream_concat(ss, "fnmsub.h"); + break; + } + case RISCV_FMSUB_H: { + SStream_concat(ss, "fmsub.h"); + break; + } + case RISCV_FNMADD_H: { + SStream_concat(ss, "fnmadd.h"); + break; + } + case RISCV_FMADD_H: { + SStream_concat(ss, "fmadd.h"); + break; + } + } +} +void zbkb_rtype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_PACKH: { + SStream_concat(ss, "packh"); + break; + } + case RISCV_PACK: { + SStream_concat(ss, "pack"); + break; + } + } +} +void zicond_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_CZERO_EQZ: { + SStream_concat(ss, "czero.eqz"); + break; + } + case RISCV_CZERO_NEZ: { + SStream_concat(ss, "czero.nez"); + break; + } + } +} +void sew_flag(uint64_t member, SStream *ss) { + switch (member) { + case 0x1: { + SStream_concat(ss, "e16"); + break; + } + case 0x3: { + SStream_concat(ss, "e64"); + break; + } + case 0x2: { + SStream_concat(ss, "e32"); + break; + } + case 0x0: { + SStream_concat(ss, "e8"); + break; + } + } +} +void vvtype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_VV_VSSRA: { + SStream_concat(ss, "vssra.vv"); + break; + } + case RISCV_VV_VXOR: { + SStream_concat(ss, "vxor.vv"); + break; + } + case RISCV_VV_VSMUL: { + SStream_concat(ss, "vsmul.vv"); + break; + } + case RISCV_VV_VAND: { + SStream_concat(ss, "vand.vv"); + break; + } + case RISCV_VV_VSSUB: { + SStream_concat(ss, "vssub.vv"); + break; + } + case RISCV_VV_VSUB: { + SStream_concat(ss, "vsub.vv"); + break; + } + case RISCV_VV_VSLL: { + SStream_concat(ss, "vsll.vv"); + break; + } + case RISCV_VV_VSSRL: { + SStream_concat(ss, "vssrl.vv"); + break; + } + case RISCV_VV_VSADD: { + SStream_concat(ss, "vsadd.vv"); + break; + } + case RISCV_VV_VSSUBU: { + SStream_concat(ss, "vssubu.vv"); + break; + } + case RISCV_VV_VMAX: { + SStream_concat(ss, "vmax.vv"); + break; + } + case RISCV_VV_VADD: { + SStream_concat(ss, "vadd.vv"); + break; + } + case RISCV_VV_VSRL: { + SStream_concat(ss, "vsrl.vv"); + break; + } + case RISCV_VV_VMAXU: { + SStream_concat(ss, "vmaxu.vv"); + break; + } + case RISCV_VV_VRGATHER: { + SStream_concat(ss, "vrgather.vv"); + break; + } + case RISCV_VV_VSRA: { + SStream_concat(ss, "vsra.vv"); + break; + } + case RISCV_VV_VRGATHEREI16: { + SStream_concat(ss, "vrgatherei16.vv"); + break; + } + case RISCV_VV_VMINU: { + SStream_concat(ss, "vminu.vv"); + break; + } + case RISCV_VV_VSADDU: { + SStream_concat(ss, "vsaddu.vv"); + break; + } + case RISCV_VV_VMIN: { + SStream_concat(ss, "vmin.vv"); + break; + } + case RISCV_VV_VOR: { + SStream_concat(ss, "vor.vv"); + break; + } + } +} +void vreg_name(uint64_t member, SStream *ss) { + switch (member) { + case 0x08: { + SStream_concat(ss, "v8"); + break; + } + case 0x15: { + SStream_concat(ss, "v21"); + break; + } + case 0x01: { + SStream_concat(ss, "v1"); + break; + } + case 0x06: { + SStream_concat(ss, "v6"); + break; + } + case 0x09: { + SStream_concat(ss, "v9"); + break; + } + case 0x10: { + SStream_concat(ss, "v16"); + break; + } + case 0x1B: { + SStream_concat(ss, "v27"); + break; + } + case 0x1C: { + SStream_concat(ss, "v28"); + break; + } + case 0x16: { + SStream_concat(ss, "v22"); + break; + } + case 0x00: { + SStream_concat(ss, "v0"); + break; + } + case 0x0A: { + SStream_concat(ss, "v10"); + break; + } + case 0x1A: { + SStream_concat(ss, "v26"); + break; + } + case 0x17: { + SStream_concat(ss, "v23"); + break; + } + case 0x0C: { + SStream_concat(ss, "v12"); + break; + } + case 0x18: { + SStream_concat(ss, "v24"); + break; + } + case 0x02: { + SStream_concat(ss, "v2"); + break; + } + case 0x1F: { + SStream_concat(ss, "v31"); + break; + } + case 0x0B: { + SStream_concat(ss, "v11"); + break; + } + case 0x07: { + SStream_concat(ss, "v7"); + break; + } + case 0x13: { + SStream_concat(ss, "v19"); + break; + } + case 0x04: { + SStream_concat(ss, "v4"); + break; + } + case 0x19: { + SStream_concat(ss, "v25"); + break; + } + case 0x12: { + SStream_concat(ss, "v18"); + break; + } + case 0x14: { + SStream_concat(ss, "v20"); + break; + } + case 0x0E: { + SStream_concat(ss, "v14"); + break; + } + case 0x1E: { + SStream_concat(ss, "v30"); + break; + } + case 0x11: { + SStream_concat(ss, "v17"); + break; + } + case 0x03: { + SStream_concat(ss, "v3"); + break; + } + case 0x05: { + SStream_concat(ss, "v5"); + break; + } + case 0x1D: { + SStream_concat(ss, "v29"); + break; + } + case 0x0D: { + SStream_concat(ss, "v13"); + break; + } + case 0x0F: { + SStream_concat(ss, "v15"); + break; + } + } +} +void nvstype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_NVS_VNSRL: { + SStream_concat(ss, "vnsrl.wv"); + break; + } + case RISCV_NVS_VNSRA: { + SStream_concat(ss, "vnsra.wv"); + break; + } + } +} +void nvtype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_NV_VNCLIP: { + SStream_concat(ss, "vnclip.wv"); + break; + } + case RISCV_NV_VNCLIPU: { + SStream_concat(ss, "vnclipu.wv"); + break; + } + } +} +void vxtype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_VX_VSRA: { + SStream_concat(ss, "vsra.vx"); + break; + } + case RISCV_VX_VOR: { + SStream_concat(ss, "vor.vx"); + break; + } + case RISCV_VX_VADD: { + SStream_concat(ss, "vadd.vx"); + break; + } + case RISCV_VX_VSADDU: { + SStream_concat(ss, "vsaddu.vx"); + break; + } + case RISCV_VX_VMAX: { + SStream_concat(ss, "vmax.vx"); + break; + } + case RISCV_VX_VSSRA: { + SStream_concat(ss, "vssra.vx"); + break; + } + case RISCV_VX_VXOR: { + SStream_concat(ss, "vxor.vx"); + break; + } + case RISCV_VX_VSSRL: { + SStream_concat(ss, "vssrl.vx"); + break; + } + case RISCV_VX_VRSUB: { + SStream_concat(ss, "vrsub.vx"); + break; + } + case RISCV_VX_VSUB: { + SStream_concat(ss, "vsub.vx"); + break; + } + case RISCV_VX_VSADD: { + SStream_concat(ss, "vsadd.vx"); + break; + } + case RISCV_VX_VSSUBU: { + SStream_concat(ss, "vssubu.vx"); + break; + } + case RISCV_VX_VMIN: { + SStream_concat(ss, "vmin.vx"); + break; + } + case RISCV_VX_VSLL: { + SStream_concat(ss, "vsll.vx"); + break; + } + case RISCV_VX_VSMUL: { + SStream_concat(ss, "vsmul.vx"); + break; + } + case RISCV_VX_VMINU: { + SStream_concat(ss, "vminu.vx"); + break; + } + case RISCV_VX_VMAXU: { + SStream_concat(ss, "vmaxu.vx"); + break; + } + case RISCV_VX_VAND: { + SStream_concat(ss, "vand.vx"); + break; + } + case RISCV_VX_VSSUB: { + SStream_concat(ss, "vssub.vx"); + break; + } + case RISCV_VX_VSRL: { + SStream_concat(ss, "vsrl.vx"); + break; + } + } +} +void nxstype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_NXS_VNSRA: { + SStream_concat(ss, "vnsra.wx"); + break; + } + case RISCV_NXS_VNSRL: { + SStream_concat(ss, "vnsrl.wx"); + break; + } + } +} +void nxtype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_NX_VNCLIP: { + SStream_concat(ss, "vnclip.wx"); + break; + } + case RISCV_NX_VNCLIPU: { + SStream_concat(ss, "vnclipu.wx"); + break; + } + } +} +void vxsg_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_VX_VSLIDEDOWN: { + SStream_concat(ss, "vslidedown.vx"); + break; + } + case RISCV_VX_VSLIDEUP: { + SStream_concat(ss, "vslideup.vx"); + break; + } + case RISCV_VX_VRGATHER: { + SStream_concat(ss, "vrgather.vx"); + break; + } + } +} +void vitype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_VI_VSRL: { + SStream_concat(ss, "vsrl.vi"); + break; + } + case RISCV_VI_VAND: { + SStream_concat(ss, "vand.vi"); + break; + } + case RISCV_VI_VXOR: { + SStream_concat(ss, "vxor.vi"); + break; + } + case RISCV_VI_VSADD: { + SStream_concat(ss, "vsadd.vi"); + break; + } + case RISCV_VI_VSRA: { + SStream_concat(ss, "vsra.vi"); + break; + } + case RISCV_VI_VSSRL: { + SStream_concat(ss, "vssrl.vi"); + break; + } + case RISCV_VI_VSADDU: { + SStream_concat(ss, "vsaddu.vi"); + break; + } + case RISCV_VI_VSLL: { + SStream_concat(ss, "vsll.vi"); + break; + } + case RISCV_VI_VRSUB: { + SStream_concat(ss, "vrsub.vi"); + break; + } + case RISCV_VI_VADD: { + SStream_concat(ss, "vadd.vi"); + break; + } + case RISCV_VI_VOR: { + SStream_concat(ss, "vor.vi"); + break; + } + case RISCV_VI_VSSRA: { + SStream_concat(ss, "vssra.vi"); + break; + } + } +} +void nistype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_NIS_VNSRL: { + SStream_concat(ss, "vnsrl.wi"); + break; + } + case RISCV_NIS_VNSRA: { + SStream_concat(ss, "vnsra.wi"); + break; + } + } +} +void nitype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_NI_VNCLIPU: { + SStream_concat(ss, "vnclipu.wi"); + break; + } + case RISCV_NI_VNCLIP: { + SStream_concat(ss, "vnclip.wi"); + break; + } + } +} +void visg_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_VI_VRGATHER: { + SStream_concat(ss, "vrgather.vi"); + break; + } + case RISCV_VI_VSLIDEDOWN: { + SStream_concat(ss, "vslidedown.vi"); + break; + } + case RISCV_VI_VSLIDEUP: { + SStream_concat(ss, "vslideup.vi"); + break; + } + } +} +void simm_string(uint64_t member, SStream *ss) { + switch (member) { + case 0x01: { + SStream_concat(ss, "2"); + break; + } + case 0x07: { + SStream_concat(ss, "8"); + break; + } + case 0x00: { + SStream_concat(ss, "1"); + break; + } + case 0x03: { + SStream_concat(ss, "4"); + break; + } + } +} +void mvvtype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_MVV_VDIV: { + SStream_concat(ss, "vdiv.vv"); + break; + } + case RISCV_MVV_VREMU: { + SStream_concat(ss, "vremu.vv"); + break; + } + case RISCV_MVV_VAADDU: { + SStream_concat(ss, "vaaddu.vv"); + break; + } + case RISCV_MVV_VMULHSU: { + SStream_concat(ss, "vmulhsu.vv"); + break; + } + case RISCV_MVV_VASUB: { + SStream_concat(ss, "vasub.vv"); + break; + } + case RISCV_MVV_VMULHU: { + SStream_concat(ss, "vmulhu.vv"); + break; + } + case RISCV_MVV_VDIVU: { + SStream_concat(ss, "vdivu.vv"); + break; + } + case RISCV_MVV_VMULH: { + SStream_concat(ss, "vmulh.vv"); + break; + } + case RISCV_MVV_VAADD: { + SStream_concat(ss, "vaadd.vv"); + break; + } + case RISCV_MVV_VMUL: { + SStream_concat(ss, "vmul.vv"); + break; + } + case RISCV_MVV_VREM: { + SStream_concat(ss, "vrem.vv"); + break; + } + case RISCV_MVV_VASUBU: { + SStream_concat(ss, "vasubu.vv"); + break; + } + } +} +void mvvmatype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_MVV_VMACC: { + SStream_concat(ss, "vmacc.vv"); + break; + } + case RISCV_MVV_VNMSUB: { + SStream_concat(ss, "vnmsub.vv"); + break; + } + case RISCV_MVV_VNMSAC: { + SStream_concat(ss, "vnmsac.vv"); + break; + } + case RISCV_MVV_VMADD: { + SStream_concat(ss, "vmadd.vv"); + break; + } + } +} +void wvvtype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_WVV_VSUBU: { + SStream_concat(ss, "vwsubu.vv"); + break; + } + case RISCV_WVV_VWMULSU: { + SStream_concat(ss, "vwmulsu.vv"); + break; + } + case RISCV_WVV_VADD: { + SStream_concat(ss, "vwadd.vv"); + break; + } + case RISCV_WVV_VWMUL: { + SStream_concat(ss, "vwmul.vv"); + break; + } + case RISCV_WVV_VADDU: { + SStream_concat(ss, "vwaddu.vv"); + break; + } + case RISCV_WVV_VWMULU: { + SStream_concat(ss, "vwmulu.vv"); + break; + } + case RISCV_WVV_VSUB: { + SStream_concat(ss, "vwsub.vv"); + break; + } + } +} +void wvtype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_WV_VSUB: { + SStream_concat(ss, "vwsub.wv"); + break; + } + case RISCV_WV_VADDU: { + SStream_concat(ss, "vwaddu.wv"); + break; + } + case RISCV_WV_VSUBU: { + SStream_concat(ss, "vwsubu.wv"); + break; + } + case RISCV_WV_VADD: { + SStream_concat(ss, "vwadd.wv"); + break; + } + } +} +void wmvvtype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_WMVV_VWMACCU: { + SStream_concat(ss, "vwmaccu.vv"); + break; + } + case RISCV_WMVV_VWMACCSU: { + SStream_concat(ss, "vwmaccsu.vv"); + break; + } + case RISCV_WMVV_VWMACC: { + SStream_concat(ss, "vwmacc.vv"); + break; + } + } +} +void vext2type_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_VEXT2_SVF2: { + SStream_concat(ss, "vsext.vf2"); + break; + } + case RISCV_VEXT2_ZVF2: { + SStream_concat(ss, "vzext.vf2"); + break; + } + } +} +void vext4type_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_VEXT4_ZVF4: { + SStream_concat(ss, "vzext.vf4"); + break; + } + case RISCV_VEXT4_SVF4: { + SStream_concat(ss, "vsext.vf4"); + break; + } + } +} +void vext8type_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_VEXT8_SVF8: { + SStream_concat(ss, "vsext.vf8"); + break; + } + case RISCV_VEXT8_ZVF8: { + SStream_concat(ss, "vzext.vf8"); + break; + } + } +} +void mvxtype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_MVX_VMUL: { + SStream_concat(ss, "vmul.vx"); + break; + } + case RISCV_MVX_VREM: { + SStream_concat(ss, "vrem.vx"); + break; + } + case RISCV_MVX_VMULH: { + SStream_concat(ss, "vmulh.vx"); + break; + } + case RISCV_MVX_VDIV: { + SStream_concat(ss, "vdiv.vx"); + break; + } + case RISCV_MVX_VAADDU: { + SStream_concat(ss, "vaaddu.vx"); + break; + } + case RISCV_MVX_VSLIDE1DOWN: { + SStream_concat(ss, "vslide1down.vx"); + break; + } + case RISCV_MVX_VMULHSU: { + SStream_concat(ss, "vmulhsu.vx"); + break; + } + case RISCV_MVX_VSLIDE1UP: { + SStream_concat(ss, "vslide1up.vx"); + break; + } + case RISCV_MVX_VMULHU: { + SStream_concat(ss, "vmulhu.vx"); + break; + } + case RISCV_MVX_VASUBU: { + SStream_concat(ss, "vasubu.vx"); + break; + } + case RISCV_MVX_VREMU: { + SStream_concat(ss, "vremu.vx"); + break; + } + case RISCV_MVX_VDIVU: { + SStream_concat(ss, "vdivu.vx"); + break; + } + case RISCV_MVX_VAADD: { + SStream_concat(ss, "vaadd.vx"); + break; + } + case RISCV_MVX_VASUB: { + SStream_concat(ss, "vasub.vx"); + break; + } + } +} +void mvxmatype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_MVX_VNMSAC: { + SStream_concat(ss, "vnmsac.vx"); + break; + } + case RISCV_MVX_VMADD: { + SStream_concat(ss, "vmadd.vx"); + break; + } + case RISCV_MVX_VMACC: { + SStream_concat(ss, "vmacc.vx"); + break; + } + case RISCV_MVX_VNMSUB: { + SStream_concat(ss, "vnmsub.vx"); + break; + } + } +} +void wvxtype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_WVX_VSUB: { + SStream_concat(ss, "vwsub.vx"); + break; + } + case RISCV_WVX_VADDU: { + SStream_concat(ss, "vwaddu.vx"); + break; + } + case RISCV_WVX_VADD: { + SStream_concat(ss, "vwadd.vx"); + break; + } + case RISCV_WVX_VSUBU: { + SStream_concat(ss, "vwsubu.vx"); + break; + } + case RISCV_WVX_VWMULSU: { + SStream_concat(ss, "vwmulsu.vx"); + break; + } + case RISCV_WVX_VWMUL: { + SStream_concat(ss, "vwmul.vx"); + break; + } + case RISCV_WVX_VWMULU: { + SStream_concat(ss, "vwmulu.vx"); + break; + } + } +} +void wxtype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_WX_VSUB: { + SStream_concat(ss, "vwsub.wx"); + break; + } + case RISCV_WX_VSUBU: { + SStream_concat(ss, "vwsubu.wx"); + break; + } + case RISCV_WX_VADD: { + SStream_concat(ss, "vwadd.wx"); + break; + } + case RISCV_WX_VADDU: { + SStream_concat(ss, "vwaddu.wx"); + break; + } + } +} +void wmvxtype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_WMVX_VWMACCU: { + SStream_concat(ss, "vwmaccu.vx"); + break; + } + case RISCV_WMVX_VWMACCSU: { + SStream_concat(ss, "vwmaccsu.vx"); + break; + } + case RISCV_WMVX_VWMACCUS: { + SStream_concat(ss, "vwmaccus.vx"); + break; + } + case RISCV_WMVX_VWMACC: { + SStream_concat(ss, "vwmacc.vx"); + break; + } + } +} +void fvvtype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_FVV_VSGNJ: { + SStream_concat(ss, "vfsgnj.vv"); + break; + } + case RISCV_FVV_VMIN: { + SStream_concat(ss, "vfmin.vv"); + break; + } + case RISCV_FVV_VDIV: { + SStream_concat(ss, "vfdiv.vv"); + break; + } + case RISCV_FVV_VMAX: { + SStream_concat(ss, "vfmax.vv"); + break; + } + case RISCV_FVV_VADD: { + SStream_concat(ss, "vfadd.vv"); + break; + } + case RISCV_FVV_VSUB: { + SStream_concat(ss, "vfsub.vv"); + break; + } + case RISCV_FVV_VSGNJN: { + SStream_concat(ss, "vfsgnjn.vv"); + break; + } + case RISCV_FVV_VSGNJX: { + SStream_concat(ss, "vfsgnjx.vv"); + break; + } + case RISCV_FVV_VMUL: { + SStream_concat(ss, "vfmul.vv"); + break; + } + } +} +void fvvmatype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_FVV_VNMSAC: { + SStream_concat(ss, "vfnmsac.vv"); + break; + } + case RISCV_FVV_VMACC: { + SStream_concat(ss, "vfmacc.vv"); + break; + } + case RISCV_FVV_VNMSUB: { + SStream_concat(ss, "vfnmsub.vv"); + break; + } + case RISCV_FVV_VMSAC: { + SStream_concat(ss, "vfmsac.vv"); + break; + } + case RISCV_FVV_VMADD: { + SStream_concat(ss, "vfmadd.vv"); + break; + } + case RISCV_FVV_VMSUB: { + SStream_concat(ss, "vfmsub.vv"); + break; + } + case RISCV_FVV_VNMACC: { + SStream_concat(ss, "vfnmacc.vv"); + break; + } + case RISCV_FVV_VNMADD: { + SStream_concat(ss, "vfnmadd.vv"); + break; + } + } +} +void fwvvtype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_FWVV_VADD: { + SStream_concat(ss, "vfwadd.vv"); + break; + } + case RISCV_FWVV_VSUB: { + SStream_concat(ss, "vfwsub.vv"); + break; + } + case RISCV_FWVV_VMUL: { + SStream_concat(ss, "vfwmul.vv"); + break; + } + } +} +void fwvvmatype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_FWVV_VMSAC: { + SStream_concat(ss, "vfwmsac.vv"); + break; + } + case RISCV_FWVV_VNMACC: { + SStream_concat(ss, "vfwnmacc.vv"); + break; + } + case RISCV_FWVV_VNMSAC: { + SStream_concat(ss, "vfwnmsac.vv"); + break; + } + case RISCV_FWVV_VMACC: { + SStream_concat(ss, "vfwmacc.vv"); + break; + } + } +} +void fwvtype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_FWV_VADD: { + SStream_concat(ss, "vfwadd.wv"); + break; + } + case RISCV_FWV_VSUB: { + SStream_concat(ss, "vfwsub.wv"); + break; + } + } +} +void vfunary0_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_FV_CVT_F_X: { + SStream_concat(ss, "vfcvt.f.x.v"); + break; + } + case RISCV_FV_CVT_X_F: { + SStream_concat(ss, "vfcvt.x.f.v"); + break; + } + case RISCV_FV_CVT_XU_F: { + SStream_concat(ss, "vfcvt.xu.f.v"); + break; + } + case RISCV_FV_CVT_RTZ_XU_F: { + SStream_concat(ss, "vfcvt.rtz.xu.f.v"); + break; + } + case RISCV_FV_CVT_RTZ_X_F: { + SStream_concat(ss, "vfcvt.rtz.x.f.v"); + break; + } + case RISCV_FV_CVT_F_XU: { + SStream_concat(ss, "vfcvt.f.xu.v"); + break; + } + } +} +void vfwunary0_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_FWV_CVT_F_X: { + SStream_concat(ss, "vfwcvt.f.x.v"); + break; + } + case RISCV_FWV_CVT_F_XU: { + SStream_concat(ss, "vfwcvt.f.xu.v"); + break; + } + case RISCV_FWV_CVT_F_F: { + SStream_concat(ss, "vfwcvt.f.f.v"); + break; + } + case RISCV_FWV_CVT_X_F: { + SStream_concat(ss, "vfwcvt.x.f.v"); + break; + } + case RISCV_FWV_CVT_RTZ_XU_F: { + SStream_concat(ss, "vfwcvt.rtz.xu.f.v"); + break; + } + case RISCV_FWV_CVT_RTZ_X_F: { + SStream_concat(ss, "vfwcvt.rtz.x.f.v"); + break; + } + case RISCV_FWV_CVT_XU_F: { + SStream_concat(ss, "vfwcvt.xu.f.v"); + break; + } + } +} +void vfnunary0_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_FNV_CVT_F_F: { + SStream_concat(ss, "vfncvt.f.f.w"); + break; + } + case RISCV_FNV_CVT_RTZ_XU_F: { + SStream_concat(ss, "vfncvt.rtz.xu.f.w"); + break; + } + case RISCV_FNV_CVT_F_XU: { + SStream_concat(ss, "vfncvt.f.xu.w"); + break; + } + case RISCV_FNV_CVT_F_X: { + SStream_concat(ss, "vfncvt.f.x.w"); + break; + } + case RISCV_FNV_CVT_RTZ_X_F: { + SStream_concat(ss, "vfncvt.rtz.x.f.w"); + break; + } + case RISCV_FNV_CVT_XU_F: { + SStream_concat(ss, "vfncvt.xu.f.w"); + break; + } + case RISCV_FNV_CVT_X_F: { + SStream_concat(ss, "vfncvt.x.f.w"); + break; + } + case RISCV_FNV_CVT_ROD_F_F: { + SStream_concat(ss, "vfncvt.rod.f.f.w"); + break; + } + } +} +void vfunary1_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_FVV_VCLASS: { + SStream_concat(ss, "vfclass.v"); + break; + } + case RISCV_FVV_VREC7: { + SStream_concat(ss, "vfrec7.v"); + break; + } + case RISCV_FVV_VRSQRT7: { + SStream_concat(ss, "vfrsqrt7.v"); + break; + } + case RISCV_FVV_VSQRT: { + SStream_concat(ss, "vfsqrt.v"); + break; + } + } +} +void fvftype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_VF_VMIN: { + SStream_concat(ss, "vfmin.vf"); + break; + } + case RISCV_VF_VSGNJ: { + SStream_concat(ss, "vfsgnj.vf"); + break; + } + case RISCV_VF_VSLIDE1UP: { + SStream_concat(ss, "vfslide1up.vf"); + break; + } + case RISCV_VF_VRSUB: { + SStream_concat(ss, "vfrsub.vf"); + break; + } + case RISCV_VF_VADD: { + SStream_concat(ss, "vfadd.vf"); + break; + } + case RISCV_VF_VSGNJX: { + SStream_concat(ss, "vfsgnjx.vf"); + break; + } + case RISCV_VF_VDIV: { + SStream_concat(ss, "vfdiv.vf"); + break; + } + case RISCV_VF_VSUB: { + SStream_concat(ss, "vfsub.vf"); + break; + } + case RISCV_VF_VRDIV: { + SStream_concat(ss, "vfrdiv.vf"); + break; + } + case RISCV_VF_VMUL: { + SStream_concat(ss, "vfmul.vf"); + break; + } + case RISCV_VF_VSGNJN: { + SStream_concat(ss, "vfsgnjn.vf"); + break; + } + case RISCV_VF_VMAX: { + SStream_concat(ss, "vfmax.vf"); + break; + } + case RISCV_VF_VSLIDE1DOWN: { + SStream_concat(ss, "vfslide1down.vf"); + break; + } + } +} +void fvfmatype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_VF_VNMADD: { + SStream_concat(ss, "vfnmadd.vf"); + break; + } + case RISCV_VF_VMSUB: { + SStream_concat(ss, "vfmsub.vf"); + break; + } + case RISCV_VF_VMACC: { + SStream_concat(ss, "vfmacc.vf"); + break; + } + case RISCV_VF_VMADD: { + SStream_concat(ss, "vfmadd.vf"); + break; + } + case RISCV_VF_VNMSAC: { + SStream_concat(ss, "vfnmsac.vf"); + break; + } + case RISCV_VF_VMSAC: { + SStream_concat(ss, "vfmsac.vf"); + break; + } + case RISCV_VF_VNMACC: { + SStream_concat(ss, "vfnmacc.vf"); + break; + } + case RISCV_VF_VNMSUB: { + SStream_concat(ss, "vfnmsub.vf"); + break; + } + } +} +void fwvftype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_FWVF_VADD: { + SStream_concat(ss, "vfwadd.vf"); + break; + } + case RISCV_FWVF_VSUB: { + SStream_concat(ss, "vfwsub.vf"); + break; + } + case RISCV_FWVF_VMUL: { + SStream_concat(ss, "vfwmul.vf"); + break; + } + } +} +void fwvfmatype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_FWVF_VNMACC: { + SStream_concat(ss, "vfwnmacc.vf"); + break; + } + case RISCV_FWVF_VMACC: { + SStream_concat(ss, "vfwmacc.vf"); + break; + } + case RISCV_FWVF_VNMSAC: { + SStream_concat(ss, "vfwnmsac.vf"); + break; + } + case RISCV_FWVF_VMSAC: { + SStream_concat(ss, "vfwmsac.vf"); + break; + } + } +} +void fwftype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_FWF_VSUB: { + SStream_concat(ss, "vfwsub.wf"); + break; + } + case RISCV_FWF_VADD: { + SStream_concat(ss, "vfwadd.wf"); + break; + } + } +} +void nfields_string(uint64_t member, SStream *ss) { + switch (member) { + case 0x7: { + SStream_concat(ss, "seg8"); + break; + } + case 0x5: { + SStream_concat(ss, "seg6"); + break; + } + case 0x1: { + SStream_concat(ss, "seg2"); + break; + } + case 0x3: { + SStream_concat(ss, "seg4"); + break; + } + case 0x2: { + SStream_concat(ss, "seg3"); + break; + } + case 0x4: { + SStream_concat(ss, "seg5"); + break; + } + case 0x6: { + SStream_concat(ss, "seg7"); + break; + } + case 0x0: { + SStream_concat(ss, ""); + break; + } + } +} +void vlewidth_bitsnumberstr(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_VLE16: { + SStream_concat(ss, "16"); + break; + } + case RISCV_VLE32: { + SStream_concat(ss, "32"); + break; + } + case RISCV_VLE64: { + SStream_concat(ss, "64"); + break; + } + case RISCV_VLE8: { + SStream_concat(ss, "8"); + break; + } + } +} +void vmtype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_VLM: { + SStream_concat(ss, "vlm.v"); + break; + } + case RISCV_VSM: { + SStream_concat(ss, "vsm.v"); + break; + } + } +} +void mmtype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_MM_VMANDN: { + SStream_concat(ss, "vmandn.mm"); + break; + } + case RISCV_MM_VMOR: { + SStream_concat(ss, "vmor.mm"); + break; + } + case RISCV_MM_VMXOR: { + SStream_concat(ss, "vmxor.mm"); + break; + } + case RISCV_MM_VMNOR: { + SStream_concat(ss, "vmnor.mm"); + break; + } + case RISCV_MM_VMORN: { + SStream_concat(ss, "vmorn.mm"); + break; + } + case RISCV_MM_VMAND: { + SStream_concat(ss, "vmand.mm"); + break; + } + case RISCV_MM_VMXNOR: { + SStream_concat(ss, "vmxnor.mm"); + break; + } + case RISCV_MM_VMNAND: { + SStream_concat(ss, "vmnand.mm"); + break; + } + } +} +void vvmtype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_VVM_VMADC: { + SStream_concat(ss, "vmadc.vvm"); + break; + } + case RISCV_VVM_VMSBC: { + SStream_concat(ss, "vmsbc.vvm"); + break; + } + } +} +void vvmctype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_VVMC_VMADC: { + SStream_concat(ss, "vmadc.vv"); + break; + } + case RISCV_VVMC_VMSBC: { + SStream_concat(ss, "vmsbc.vv"); + break; + } + } +} +void vvmstype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_VVMS_VSBC: { + SStream_concat(ss, "vsbc.vvm"); + break; + } + case RISCV_VVMS_VADC: { + SStream_concat(ss, "vadc.vvm"); + break; + } + } +} +void vvcmptype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_VVCMP_VMSEQ: { + SStream_concat(ss, "vmseq.vv"); + break; + } + case RISCV_VVCMP_VMSLTU: { + SStream_concat(ss, "vmsltu.vv"); + break; + } + case RISCV_VVCMP_VMSLE: { + SStream_concat(ss, "vmsle.vv"); + break; + } + case RISCV_VVCMP_VMSLEU: { + SStream_concat(ss, "vmsleu.vv"); + break; + } + case RISCV_VVCMP_VMSNE: { + SStream_concat(ss, "vmsne.vv"); + break; + } + case RISCV_VVCMP_VMSLT: { + SStream_concat(ss, "vmslt.vv"); + break; + } + } +} +void vxmtype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_VXM_VMSBC: { + SStream_concat(ss, "vmsbc.vxm"); + break; + } + case RISCV_VXM_VMADC: { + SStream_concat(ss, "vmadc.vxm"); + break; + } + } +} +void vxmctype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_VXMC_VMSBC: { + SStream_concat(ss, "vmsbc.vx"); + break; + } + case RISCV_VXMC_VMADC: { + SStream_concat(ss, "vmadc.vx"); + break; + } + } +} +void vxmstype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_VXMS_VADC: { + SStream_concat(ss, "vadc.vxm"); + break; + } + case RISCV_VXMS_VSBC: { + SStream_concat(ss, "vsbc.vxm"); + break; + } + } +} +void vxcmptype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_VXCMP_VMSLTU: { + SStream_concat(ss, "vmsltu.vx"); + break; + } + case RISCV_VXCMP_VMSLEU: { + SStream_concat(ss, "vmsleu.vx"); + break; + } + case RISCV_VXCMP_VMSNE: { + SStream_concat(ss, "vmsne.vx"); + break; + } + case RISCV_VXCMP_VMSGT: { + SStream_concat(ss, "vmsgt.vx"); + break; + } + case RISCV_VXCMP_VMSEQ: { + SStream_concat(ss, "vmseq.vx"); + break; + } + case RISCV_VXCMP_VMSGTU: { + SStream_concat(ss, "vmsgtu.vx"); + break; + } + case RISCV_VXCMP_VMSLT: { + SStream_concat(ss, "vmslt.vx"); + break; + } + case RISCV_VXCMP_VMSLE: { + SStream_concat(ss, "vmsle.vx"); + break; + } + } +} +void vimtype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_VIM_VMADC: { + SStream_concat(ss, "vmadc.vim"); + break; + } + } +} +void vimctype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_VIMC_VMADC: { + SStream_concat(ss, "vmadc.vi"); + break; + } + } +} +void vimstype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_VIMS_VADC: { + SStream_concat(ss, "vadc.vim"); + break; + } + } +} +void vicmptype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_VICMP_VMSEQ: { + SStream_concat(ss, "vmseq.vi"); + break; + } + case RISCV_VICMP_VMSGTU: { + SStream_concat(ss, "vmsgtu.vi"); + break; + } + case RISCV_VICMP_VMSLEU: { + SStream_concat(ss, "vmsleu.vi"); + break; + } + case RISCV_VICMP_VMSLE: { + SStream_concat(ss, "vmsle.vi"); + break; + } + case RISCV_VICMP_VMSNE: { + SStream_concat(ss, "vmsne.vi"); + break; + } + case RISCV_VICMP_VMSGT: { + SStream_concat(ss, "vmsgt.vi"); + break; + } + } +} +void fvvmtype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_FVVM_VMFNE: { + SStream_concat(ss, "vmfne.vv"); + break; + } + case RISCV_FVVM_VMFEQ: { + SStream_concat(ss, "vmfeq.vv"); + break; + } + case RISCV_FVVM_VMFLT: { + SStream_concat(ss, "vmflt.vv"); + break; + } + case RISCV_FVVM_VMFLE: { + SStream_concat(ss, "vmfle.vv"); + break; + } + } +} +void fvfmtype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_VFM_VMFNE: { + SStream_concat(ss, "vmfne.vf"); + break; + } + case RISCV_VFM_VMFGT: { + SStream_concat(ss, "vmfgt.vf"); + break; + } + case RISCV_VFM_VMFLT: { + SStream_concat(ss, "vmflt.vf"); + break; + } + case RISCV_VFM_VMFEQ: { + SStream_concat(ss, "vmfeq.vf"); + break; + } + case RISCV_VFM_VMFLE: { + SStream_concat(ss, "vmfle.vf"); + break; + } + case RISCV_VFM_VMFGE: { + SStream_concat(ss, "vmfge.vf"); + break; + } + } +} +void rivvtype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_IVV_VWREDSUMU: { + SStream_concat(ss, "vwredsumu.vs"); + break; + } + case RISCV_IVV_VWREDSUM: { + SStream_concat(ss, "vwredsum.vs"); + break; + } + } +} +void rmvvtype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_MVV_VREDAND: { + SStream_concat(ss, "vredand.vs"); + break; + } + case RISCV_MVV_VREDXOR: { + SStream_concat(ss, "vredxor.vs"); + break; + } + case RISCV_MVV_VREDOR: { + SStream_concat(ss, "vredor.vs"); + break; + } + case RISCV_MVV_VREDMIN: { + SStream_concat(ss, "vredmin.vs"); + break; + } + case RISCV_MVV_VREDMAXU: { + SStream_concat(ss, "vredmaxu.vs"); + break; + } + case RISCV_MVV_VREDMINU: { + SStream_concat(ss, "vredminu.vs"); + break; + } + case RISCV_MVV_VREDSUM: { + SStream_concat(ss, "vredsum.vs"); + break; + } + case RISCV_MVV_VREDMAX: { + SStream_concat(ss, "vredmax.vs"); + break; + } + } +} +void rfvvtype_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_FVV_VFWREDOSUM: { + SStream_concat(ss, "vfwredosum.vs"); + break; + } + case RISCV_FVV_VFREDOSUM: { + SStream_concat(ss, "vfredosum.vs"); + break; + } + case RISCV_FVV_VFREDUSUM: { + SStream_concat(ss, "vfredusum.vs"); + break; + } + case RISCV_FVV_VFREDMIN: { + SStream_concat(ss, "vfredmin.vs"); + break; + } + case RISCV_FVV_VFWREDUSUM: { + SStream_concat(ss, "vfwredusum.vs"); + break; + } + case RISCV_FVV_VFREDMAX: { + SStream_concat(ss, "vfredmax.vs"); + break; + } + } +} +void cbop_mnemonic(uint64_t member, SStream *ss) { + switch (member) { + case RISCV_CBO_INVAL: { + SStream_concat(ss, "cbo.inval"); + break; + } + case RISCV_CBO_CLEAN: { + SStream_concat(ss, "cbo.clean"); + break; + } + case RISCV_CBO_FLUSH: { + SStream_concat(ss, "cbo.flush"); + break; + } + } +} +#endif diff --git a/arch/RISCV/riscv_decode.gen.inc b/arch/RISCV/RISCVDecode.gen.inc similarity index 99% rename from arch/RISCV/riscv_decode.gen.inc rename to arch/RISCV/RISCVDecode.gen.inc index 43028d0af1..f752e23592 100644 --- a/arch/RISCV/riscv_decode.gen.inc +++ b/arch/RISCV/RISCVDecode.gen.inc @@ -1,22 +1,23 @@ /*=======================================================================*/ -/*This code was generated by the tool riscv_disasm_from_sail (see - * https://github.com/moste00/riscv_disasm_from_sail)*/ -/*from the sail model of RISC-V (see https://github.com/riscv/sail-riscv) @ - * version 0b9c639f19da48734cbf14b61f6ad200b7c70de9.*/ -/*DO NOT MODIFY THIS CODE MANUALLY.*/ -/* */ -/*SPDX-License-Identifier: BSD-3-Clause*/ +/* This code was generated by the tool auto-sync-sail*/ +/* (see https://github.com/rizinorg/capstone-autosync-sail)*/ +/* from the sail model of RISC-V*/ +/* (see https://github.com/riscv/sail-riscv) @ version + * 0b9c639f19da48734cbf14b61f6ad200b7c70de9.*/ +/* DO NOT MODIFY THIS CODE MANUALLY. ANY MANUAL EDITS ARE OVERWRITTEN.*/ +/* ------------------------------------------------------------------- */ +/* Copyright © 2024 moste00 */ +/* SPDX-License-Identifier: BSD-3-Clause*/ /*=======================================================================*/ -#ifndef __Riscv_decode_gen_inc__ -#define __Riscv_decode_gen_inc__ -#include - +#ifndef __RISCVDECODE_GEN_INC__ +#define __RISCVDECODE_GEN_INC__ #include - -#include "riscv_ast.gen.inc" +#include #include +#include "RISCVAst.gen.inc" + static void decode(struct ast *tree, uint64_t binary_stream) { // ---------------------------UTYPE------------------------------- { @@ -9404,5 +9405,4 @@ static void decode(struct ast *tree, uint64_t binary_stream) { } //------------------------------------------------------------ } - #endif diff --git a/arch/RISCV/riscv_decode_compressed.gen.inc b/arch/RISCV/RISCVDecodeCompressed.gen.inc similarity index 98% rename from arch/RISCV/riscv_decode_compressed.gen.inc rename to arch/RISCV/RISCVDecodeCompressed.gen.inc index cacac74d6e..76c14e4816 100644 --- a/arch/RISCV/riscv_decode_compressed.gen.inc +++ b/arch/RISCV/RISCVDecodeCompressed.gen.inc @@ -1,22 +1,23 @@ /*=======================================================================*/ -/*This code was generated by the tool riscv_disasm_from_sail (see - * https://github.com/moste00/riscv_disasm_from_sail)*/ -/*from the sail model of RISC-V (see https://github.com/riscv/sail-riscv) @ - * version 0b9c639f19da48734cbf14b61f6ad200b7c70de9.*/ -/*DO NOT MODIFY THIS CODE MANUALLY.*/ -/* */ -/*SPDX-License-Identifier: BSD-3-Clause*/ +/* This code was generated by the tool auto-sync-sail*/ +/* (see https://github.com/rizinorg/capstone-autosync-sail)*/ +/* from the sail model of RISC-V*/ +/* (see https://github.com/riscv/sail-riscv) @ version + * 0b9c639f19da48734cbf14b61f6ad200b7c70de9.*/ +/* DO NOT MODIFY THIS CODE MANUALLY. ANY MANUAL EDITS ARE OVERWRITTEN.*/ +/* ------------------------------------------------------------------- */ +/* Copyright © 2024 moste00 */ +/* SPDX-License-Identifier: BSD-3-Clause*/ /*=======================================================================*/ -#ifndef __Riscv_decode_compressed_gen_inc__ -#define __Riscv_decode_compressed_gen_inc__ -#include - +#ifndef __RISCVDECODECOMPRESSED_GEN_INC__ +#define __RISCVDECODECOMPRESSED_GEN_INC__ #include - -#include "riscv_ast.gen.inc" +#include #include +#include "RISCVAst.gen.inc" + void decode_compressed(struct ast *tree, uint64_t binary_stream) { // ---------------------------C_NOP------------------------------- { @@ -1039,5 +1040,4 @@ void decode_compressed(struct ast *tree, uint64_t binary_stream) { } //------------------------------------------------------------ } - #endif diff --git a/arch/RISCV/RISCVDetails.c b/arch/RISCV/RISCVDetails.c index b0b12e17e0..7dfc309a7e 100644 --- a/arch/RISCV/RISCVDetails.c +++ b/arch/RISCV/RISCVDetails.c @@ -17,20 +17,19 @@ The size calculation algorithm according to the RISCV spec: 5- Otherwise, the instruction size can be determined from other bits further from the first byte. (The spec actually specifies valid sizes up to 192-bits instructions, even reserving a pattern for - instructions beyond 192 bits. In practice, even 48-bits or 64-bits instructions are rare in practice, + instructions beyond 192 bits. In practice, even 48-bits or 64-bits instructions are extremly rare, and it's not worth complicating the code with a bitvector type to represent bigger instructions.) */ -bool riscv_fill_size(cs_insn *insn, uint8_t first_byte) { +int riscv_get_instruction_size(uint8_t first_byte) { if ((first_byte & 0x3) != 0x3) { - insn->size = 2; + return 2; } else if (((first_byte >> 2) & 0x7) != 0x7) { - insn->size = 4; + return 4; } else if (((first_byte >> 5) & 0x1) == 0x0) { - insn->size = 6; + return 6; } else if (((first_byte >> 6) & 0x1) == 0x0) { - insn->size = 8; + return 8; } else { - return false; + return 0; } - return true; } \ No newline at end of file diff --git a/arch/RISCV/RISCVDetails.h b/arch/RISCV/RISCVDetails.h index b04b6177ad..b41eec870a 100644 --- a/arch/RISCV/RISCVDetails.h +++ b/arch/RISCV/RISCVDetails.h @@ -1,3 +1,3 @@ #include "../include/capstone/capstone.h" -bool riscv_fill_size(cs_insn *insn, uint8_t binary); \ No newline at end of file +int riscv_get_instruction_size(uint8_t first_byte); \ No newline at end of file diff --git a/arch/RISCV/RISCVDisassembler.c b/arch/RISCV/RISCVDisassembler.c index 7b15ba6970..f715f9546c 100644 --- a/arch/RISCV/RISCVDisassembler.c +++ b/arch/RISCV/RISCVDisassembler.c @@ -1,31 +1,40 @@ #include "RISCVDisassembler.h" #include "RISCVDetails.h" -#include "riscv_decode.gen.inc" -#include "riscv_insn_mapping.gen.inc" +#include "RISCVDecode.gen.inc" +#include "RISCVDecodeCompressed.gen.inc" +#include "RISCVInsnMappings.gen.inc" +#include "../../cs_priv.h" +#include "../../utils.h" bool riscv_get_instruction(csh handle, const uint8_t *code, size_t code_len, MCInst *instr, uint16_t *size, uint64_t address, void *info) { cs_insn *insn = instr->flat_insn; - if (!riscv_fill_size(insn, code[0])) { + int sz = riscv_get_instruction_size(code[0]); + + struct ast instruction; + if (sz == 2) { + decode_compressed(&instruction, readBytes16(instr, code)); + } else if (sz == 4) { + decode(&instruction, readBytes32(instr, code)); + } else { + printf("RISCVDisassembler.c: Invalid Size %d, RISCV Instructions Are Either 2 Or 4 Bytes\n", sz); return false; } - // TODO: add compressed 2-bytes instructions - if (insn->size == 2) { - } else if (insn->size == 4) { - struct ast instruction; - decode(&instruction, code[3] << 24 | code[2] << 16 | code[1] << 8 | code[0]); + // VERY HACKY: use op_str as a temporary buffer to serialize the instruction struct + // so that the printer callback can later de-serialize it in order to stringify it + // alternatives: dynamic memory, global/static variables, + // duplicating the decoding again in the printer + // doing all the work including decoding in the printer (and not here) + CS_ASSERT(sizeof(struct ast) < 160); + memcpy(insn->op_str, &instruction, sizeof(struct ast)); - insn->id = get_insn_type(&instruction); - insn->address = address; - *size = insn->size; - memcpy(insn->bytes, code, insn->size); - return true; - } else { - - } - return false; + insn->id = get_insn_type(&instruction); + insn->address = address; + + *size = sz; + return true; } \ No newline at end of file diff --git a/arch/RISCV/riscv_helpers_ast2str.h b/arch/RISCV/RISCVHelpersAst2Str.h similarity index 54% rename from arch/RISCV/riscv_helpers_ast2str.h rename to arch/RISCV/RISCVHelpersAst2Str.h index 12bed0470f..a4b97c6c3a 100644 --- a/arch/RISCV/riscv_helpers_ast2str.h +++ b/arch/RISCV/RISCVHelpersAst2Str.h @@ -4,30 +4,30 @@ #include #include -#include "riscv_helpers_rvconf.h" +#include "../../SStream.h" +#include "../../cs_priv.h" +#include "RISCVHelpersRVConf.h" #define RISCV_TEMP_BUFFER_MAX_LEN 32 -#define spc(ps, plen, c) \ - *ps = " "; \ - *plen = 1 +#define spc(ss, c) SStream_concat1(ss, ' ') #define opt_spc spc -#define sep(ps, plen, c) \ - *ps = " , "; \ - *plen = 3 +#define sep(ss, c) SStream_concat(ss, " , ") -static inline void hex_bits(uint64_t bitvec, char **s, size_t *len, - uint8_t bvlen_bits, riscv_conf *conf) { - char *str = *s; +static inline void hex_bits(uint64_t bitvec, uint8_t bvlen_bits, SStream *ss, + riscv_conf *conf) { + char str[25] = {0}; uint8_t str_len = bvlen_bits / 4; // is not divisible by 4? if ((bvlen_bits & 0x3) != 0) { str_len++; } str_len += 2; // for the '0x' in the beginning - *len = str_len; + + CS_ASSERT(str_len > 0); + CS_ASSERT(str_len < 24); for (uint8_t i = 0; i < bvlen_bits; i += 4) { char digit = (bitvec & 0xF) + 48; @@ -40,12 +40,13 @@ static inline void hex_bits(uint64_t bitvec, char **s, size_t *len, } str[0] = '0'; str[1] = 'x'; + SStream_concat(ss, "%s", str); } #define DEF_HEX_BITS(n) \ - static inline void hex_bits_##n(uint64_t bitvec, char **s, size_t *len, \ + static inline void hex_bits_##n(uint64_t bitvec, SStream *ss, \ riscv_conf *conf) { \ - hex_bits(bitvec, s, len, n, conf); \ + hex_bits(bitvec, n, ss, conf); \ } DEF_HEX_BITS(1) @@ -81,23 +82,21 @@ DEF_HEX_BITS(30) DEF_HEX_BITS(31) DEF_HEX_BITS(32) -void hex_bits_signed(uint64_t bitvec, char **s, size_t *len, uint8_t bvlen_bits, +void hex_bits_signed(uint64_t bitvec, uint8_t bvlen_bits, SStream *ss, riscv_conf *conf) { // is not negative ? if ((bitvec & (1 << (bvlen_bits - 1))) == 0) { - hex_bits(bitvec, s, len, bvlen_bits, conf); + hex_bits(bitvec, bvlen_bits, ss, conf); } else { - char *buff = *s; - buff[0] = '-'; - buff++; - hex_bits(~bitvec + 1ULL, &buff, len, bvlen_bits, conf); + SStream_concat1(ss, '-'); + hex_bits(bitvec, bvlen_bits, ss, conf); } } #define DEF_HEX_BITS_SIGNED(n) \ - static inline void hex_bits_signed_##n(uint64_t bitvec, char **s, \ - size_t *len, riscv_conf *conf) { \ - hex_bits_signed(bitvec, s, len, n, conf); \ + static inline void hex_bits_signed_##n(uint64_t bitvec, SStream *ss, \ + riscv_conf *conf) { \ + hex_bits_signed(bitvec, n, ss, conf); \ } DEF_HEX_BITS_SIGNED(1); @@ -134,102 +133,75 @@ DEF_HEX_BITS_SIGNED(31); DEF_HEX_BITS_SIGNED(32); // TODO -void freg_or_reg_name(uint64_t regidx, char **s, size_t *len, - riscv_conf *conf) { - *s = ""; - *len = 0; -} +void freg_or_reg_name(uint64_t regidx, SStream *ss, riscv_conf *conf) {} -void maybe_vmask(uint8_t vm, char **s, size_t *len, riscv_conf *conf) { +void maybe_vmask(uint8_t vm, SStream *ss, riscv_conf *conf) { if (vm) { - *s = ""; - *len = 0; return; } - *s = " , v0.t"; - *len = 7; + SStream_concat(ss, " , v0.t"); } -void maybe_ta_flag(uint8_t ta, char **s, size_t *len, riscv_conf *conf) { +void maybe_ta_flag(uint8_t ta, SStream *ss, riscv_conf *conf) { if (ta) { - *s = "ta"; - *len = 2; + SStream_concat(ss, "ta"); return; } - *s = ""; - *len = 0; } -void maybe_ma_flag(uint8_t ma, char **s, size_t *len, riscv_conf *conf) { +void maybe_ma_flag(uint8_t ma, SStream *ss, riscv_conf *conf) { if (ma) { - *s = "ma"; - *len = 2; + SStream_concat(ss, "ma"); return; } - *s = ""; - *len = 0; } -void maybe_lmul_flag(uint8_t lmul, char **s, size_t *len, riscv_conf *conf) { +void maybe_lmul_flag(uint8_t lmul, SStream *ss, riscv_conf *conf) { switch (lmul) { case 0x0: - *s = ""; - *len = 0; return; case 0x5: - *s = " , mf8"; - *len = 6; + SStream_concat(ss, " , mf8"); return; case 0x6: - *s = " , mf4"; - *len = 6; + SStream_concat(ss, " , mf4"); return; case 0x7: - *s = " , mf2"; - *len = 6; + SStream_concat(ss, " , mf2"); return; case 0x1: - *s = " , m2"; - *len = 5; + SStream_concat(ss, " , m2"); return; case 0x2: - *s = " , m4"; - *len = 5; + SStream_concat(ss, " , m4"); return; case 0x3: - *s = " , m8"; - *len = 5; + SStream_concat(ss, " , m8"); return; } } // TODO -void csr_name_map(uint32_t csr, char **s, size_t *len, riscv_conf *conf) { - *s = ""; - *len = 0; -} +void csr_name_map(uint32_t csr, SStream *ss, riscv_conf *conf) {} -void fence_bits(uint8_t bits, char **s, size_t *len, riscv_conf *conf) { - char *buff = *s; - int length = 0; +void fence_bits(uint8_t bits, SStream *ss, riscv_conf *conf) { if (bits & 0x8) { - buff[length++] = 'i'; + SStream_concat1(ss, 'i'); } if (bits & 0x4) { - buff[length++] = 'o'; + SStream_concat1(ss, 'o'); } if (bits & 0x2) { - buff[length++] = 'r'; + SStream_concat1(ss, 'r'); } if (bits & 0x1) { - buff[length++] = 'w'; + SStream_concat1(ss, 'w'); } - *len = length; } #endif \ No newline at end of file diff --git a/arch/RISCV/riscv_helpers_rvconf.h b/arch/RISCV/RISCVHelpersRVConf.h similarity index 100% rename from arch/RISCV/riscv_helpers_rvconf.h rename to arch/RISCV/RISCVHelpersRVConf.h diff --git a/include/capstone/riscv_insn.gen.inc b/arch/RISCV/RISCVInsn.gen.inc similarity index 98% rename from include/capstone/riscv_insn.gen.inc rename to arch/RISCV/RISCVInsn.gen.inc index bdf93c6ac8..6b59a60bab 100644 --- a/include/capstone/riscv_insn.gen.inc +++ b/arch/RISCV/RISCVInsn.gen.inc @@ -1,19 +1,19 @@ /*=======================================================================*/ -/*This code was generated by the tool riscv_disasm_from_sail (see - * https://github.com/moste00/riscv_disasm_from_sail)*/ -/*from the sail model of RISC-V (see https://github.com/riscv/sail-riscv) @ - * version 0b9c639f19da48734cbf14b61f6ad200b7c70de9.*/ -/*DO NOT MODIFY THIS CODE MANUALLY.*/ -/* */ -/*SPDX-License-Identifier: BSD-3-Clause*/ +/* This code was generated by the tool auto-sync-sail*/ +/* (see https://github.com/rizinorg/capstone-autosync-sail)*/ +/* from the sail model of RISC-V*/ +/* (see https://github.com/riscv/sail-riscv) @ version + * 0b9c639f19da48734cbf14b61f6ad200b7c70de9.*/ +/* DO NOT MODIFY THIS CODE MANUALLY. ANY MANUAL EDITS ARE OVERWRITTEN.*/ +/* ------------------------------------------------------------------- */ +/* Copyright © 2024 moste00 */ +/* SPDX-License-Identifier: BSD-3-Clause*/ /*=======================================================================*/ -#ifndef __Riscv_insn_gen_inc__ -#define __Riscv_insn_gen_inc__ -#include - +#ifndef __RISCVINSN_GEN_INC__ +#define __RISCVINSN_GEN_INC__ #include - +#include #include enum riscv_insn { @@ -980,5 +980,4 @@ enum riscv_insn { RISCV_INSN_MVX_VAADDU, RISCV_INSN_MVX_VAADD, }; - #endif diff --git a/arch/RISCV/RISCVInsnMappings.gen.inc b/arch/RISCV/RISCVInsnMappings.gen.inc new file mode 100644 index 0000000000..1523d7aa3b --- /dev/null +++ b/arch/RISCV/RISCVInsnMappings.gen.inc @@ -0,0 +1,654 @@ +/*=======================================================================*/ +/* This code was generated by the tool auto-sync-sail*/ +/* (see https://github.com/rizinorg/capstone-autosync-sail)*/ +/* from the sail model of RISC-V*/ +/* (see https://github.com/riscv/sail-riscv) @ version + * 0b9c639f19da48734cbf14b61f6ad200b7c70de9.*/ +/* DO NOT MODIFY THIS CODE MANUALLY. ANY MANUAL EDITS ARE OVERWRITTEN.*/ +/* ------------------------------------------------------------------- */ +/* Copyright © 2024 moste00 */ +/* SPDX-License-Identifier: BSD-3-Clause*/ +/*=======================================================================*/ + +#ifndef __RISCVINSNMAPPINGS_GEN_INC__ +#define __RISCVINSNMAPPINGS_GEN_INC__ +#include +#include +#include + +#include "RISCVInsn.gen.inc" + +static const uint16_t to_insn[294][21] = { + [RISCV_REV8] = {RISCV_INSN_REV8}, + [RISCV_WXTYPE] = {RISCV_INSN_WX_VSUBU, RISCV_INSN_WX_VSUB, + RISCV_INSN_WX_VADDU, RISCV_INSN_WX_VADD}, + [RISCV_C_SRLI_HINT] = {RISCV_INSN_C_SRLI_HINT}, + [RISCV_AES64DS] = {RISCV_INSN_AES64DS}, + [RISCV_VMSBF_M] = {RISCV_INSN_VMSBF_M}, + [RISCV_RTYPE] = {RISCV_INSN_XOR, RISCV_INSN_SUB, RISCV_INSN_SRL, + RISCV_INSN_SRA, RISCV_INSN_SLTU, RISCV_INSN_SLT, + RISCV_INSN_SLL, RISCV_INSN_OR, RISCV_INSN_AND, + RISCV_INSN_ADD}, + [RISCV_VFMERGE] = {RISCV_INSN_VFMERGE}, + [RISCV_RIVVTYPE] = {RISCV_INSN_IVV_VWREDSUMU, RISCV_INSN_IVV_VWREDSUM}, + [RISCV_C_ZEXT_W] = {RISCV_INSN_C_ZEXT_W}, + [RISCV_SFENCE_INVAL_IR] = {RISCV_INSN_SFENCE_INVAL_IR}, + [RISCV_XPERM4] = {RISCV_INSN_XPERM4}, + [RISCV_C_AND] = {RISCV_INSN_C_AND}, + [RISCV_AES32DSI] = {RISCV_INSN_AES32DSI}, + [RISCV_RORI] = {RISCV_INSN_RORI}, + [RISCV_JALR] = {RISCV_INSN_JALR}, + [RISCV_VMSIF_M] = {RISCV_INSN_VMSIF_M}, + [RISCV_VLSSEGTYPE] = {RISCV_INSN_VLSSEGTYPE}, + [RISCV_SHA512SIG1H] = {RISCV_INSN_SHA512SIG1H}, + [RISCV_FLTQ_S] = {RISCV_INSN_FLTQ_S}, + [RISCV_VXSG] = {RISCV_INSN_VX_VSLIDEUP, RISCV_INSN_VX_VSLIDEDOWN, + RISCV_INSN_VX_VRGATHER}, + [RISCV_VXCMPTYPE] = {RISCV_INSN_VXCMP_VMSNE, RISCV_INSN_VXCMP_VMSLTU, + RISCV_INSN_VXCMP_VMSLT, RISCV_INSN_VXCMP_VMSLEU, + RISCV_INSN_VXCMP_VMSLE, RISCV_INSN_VXCMP_VMSGTU, + RISCV_INSN_VXCMP_VMSGT, RISCV_INSN_VXCMP_VMSEQ}, + [RISCV_C_LHU] = {RISCV_INSN_C_LHU}, + [RISCV_JAL] = {RISCV_INSN_JAL}, + [RISCV_ECALL] = {RISCV_INSN_ECALL}, + [RISCV_C_FSWSP] = {RISCV_INSN_C_FSWSP}, + [RISCV_VMVXS] = {RISCV_INSN_VMVXS}, + [RISCV_C_FLD] = {RISCV_INSN_C_FLD}, + [RISCV_SHIFTIWOP] = {RISCV_INSN_SRLIW, RISCV_INSN_SRAIW, RISCV_INSN_SLLIW}, + [RISCV_UNZIP] = {RISCV_INSN_UNZIP}, + [RISCV_ZICBOM] = {RISCV_INSN_CBO_INVAL, RISCV_INSN_CBO_FLUSH, + RISCV_INSN_CBO_CLEAN}, + [RISCV_SHA512SIG1] = {RISCV_INSN_SHA512SIG1}, + [RISCV_NITYPE] = {RISCV_INSN_NI_VNCLIPU, RISCV_INSN_NI_VNCLIP}, + [RISCV_WFI] = {RISCV_INSN_WFI}, + [RISCV_VVMTYPE] = {RISCV_INSN_VVM_VMSBC, RISCV_INSN_VVM_VMADC}, + [RISCV_MVXMATYPE] = {RISCV_INSN_MVX_VNMSUB, RISCV_INSN_MVX_VNMSAC, + RISCV_INSN_MVX_VMADD, RISCV_INSN_MVX_VMACC}, + [RISCV_FLI_D] = {RISCV_INSN_FLI_D}, + [RISCV_C_ADDI_HINT] = {RISCV_INSN_C_ADDI_HINT}, + [RISCV_MASKTYPEX] = {RISCV_INSN_MASKTYPEX}, + [RISCV_FROUNDNX_D] = {RISCV_INSN_FROUNDNX_D}, + [RISCV_FROUND_D] = {RISCV_INSN_FROUND_D}, + [RISCV_VSETIVLI] = {RISCV_INSN_VSETIVLI}, + [RISCV_FMAXM_D] = {RISCV_INSN_FMAXM_D}, + [RISCV_C_SD] = {RISCV_INSN_C_SD}, + [RISCV_F_BIN_TYPE_H] = {RISCV_INSN_FSGNJ_H, RISCV_INSN_FSGNJX_H, + RISCV_INSN_FSGNJN_H, RISCV_INSN_FMIN_H, + RISCV_INSN_FMAX_H, RISCV_INSN_FLT_H, + RISCV_INSN_FLE_H, RISCV_INSN_FEQ_H}, + [RISCV_ZBKB_PACKW] = {RISCV_INSN_ZBKB_PACKW}, + [RISCV_FVVMTYPE] = {RISCV_INSN_FVVM_VMFNE, RISCV_INSN_FVVM_VMFLT, + RISCV_INSN_FVVM_VMFLE, RISCV_INSN_FVVM_VMFEQ}, + [RISCV_VMVSX] = {RISCV_INSN_VMVSX}, + [RISCV_F_UN_RM_TYPE_D] = {RISCV_INSN_FSQRT_D, RISCV_INSN_FCVT_W_D, + RISCV_INSN_FCVT_WU_D, RISCV_INSN_FCVT_S_D, + RISCV_INSN_FCVT_L_D, RISCV_INSN_FCVT_LU_D, + RISCV_INSN_FCVT_D_WU, RISCV_INSN_FCVT_D_W, + RISCV_INSN_FCVT_D_S, RISCV_INSN_FCVT_D_LU, + RISCV_INSN_FCVT_D_L}, + [RISCV_ORCB] = {RISCV_INSN_ORCB}, + [RISCV_C_MUL] = {RISCV_INSN_C_MUL}, + [RISCV_SM3P1] = {RISCV_INSN_SM3P1}, + [RISCV_CLMUL] = {RISCV_INSN_CLMUL}, + [RISCV_FLEQ_S] = {RISCV_INSN_FLEQ_S}, + [RISCV_WVXTYPE] = {RISCV_INSN_WVX_VWMULU, RISCV_INSN_WVX_VWMULSU, + RISCV_INSN_WVX_VWMUL, RISCV_INSN_WVX_VSUBU, + RISCV_INSN_WVX_VSUB, RISCV_INSN_WVX_VADDU, + RISCV_INSN_WVX_VADD}, + [RISCV_FMAXM_S] = {RISCV_INSN_FMAXM_S}, + [RISCV_C_ILLEGAL] = {RISCV_INSN_C_ILLEGAL}, + [RISCV_NXSTYPE] = {RISCV_INSN_NXS_VNSRL, RISCV_INSN_NXS_VNSRA}, + [RISCV_VSOXSEGTYPE] = {RISCV_INSN_VSOXSEGTYPE}, + [RISCV_C_NOP] = {RISCV_INSN_C_NOP}, + [RISCV_VXMCTYPE] = {RISCV_INSN_VXMC_VMSBC, RISCV_INSN_VXMC_VMADC}, + [RISCV_MMTYPE] = {RISCV_INSN_MM_VMXOR, RISCV_INSN_MM_VMXNOR, + RISCV_INSN_MM_VMORN, RISCV_INSN_MM_VMOR, + RISCV_INSN_MM_VMNOR, RISCV_INSN_MM_VMNAND, + RISCV_INSN_MM_VMANDN, RISCV_INSN_MM_VMAND}, + [RISCV_F_UN_TYPE_S] = {RISCV_INSN_FMV_X_W, RISCV_INSN_FMV_W_X, + RISCV_INSN_FCLASS_S}, + [RISCV_NVTYPE] = {RISCV_INSN_NV_VNCLIPU, RISCV_INSN_NV_VNCLIP}, + [RISCV_AES64KS2] = {RISCV_INSN_AES64KS2}, + [RISCV_AES32ESMI] = {RISCV_INSN_AES32ESMI}, + [RISCV_F_MADD_TYPE_H] = {RISCV_INSN_FNMSUB_H, RISCV_INSN_FNMADD_H, + RISCV_INSN_FMSUB_H, RISCV_INSN_FMADD_H}, + [RISCV_FROUNDNX_H] = {RISCV_INSN_FROUNDNX_H}, + [RISCV_MOVETYPEI] = {RISCV_INSN_MOVETYPEI}, + [RISCV_FLTQ_H] = {RISCV_INSN_FLTQ_H}, + [RISCV_C_LW] = {RISCV_INSN_C_LW}, + [RISCV_C_LWSP] = {RISCV_INSN_C_LWSP}, + [RISCV_C_ADDI16SP] = {RISCV_INSN_C_ADDI16SP}, + [RISCV_SHA512SIG0L] = {RISCV_INSN_SHA512SIG0L}, + [RISCV_SM3P0] = {RISCV_INSN_SM3P0}, + [RISCV_SM4ED] = {RISCV_INSN_SM4ED}, + [RISCV_FMINM_D] = {RISCV_INSN_FMINM_D}, + [RISCV_AES64IM] = {RISCV_INSN_AES64IM}, + [RISCV_VLRETYPE] = {RISCV_INSN_VLRETYPE}, + [RISCV_VFMVFS] = {RISCV_INSN_VFMVFS}, + [RISCV_CTZ] = {RISCV_INSN_CTZ}, + [RISCV_FMVH_X_D] = {RISCV_INSN_FMVH_X_D}, + [RISCV_SLLIUW] = {RISCV_INSN_SLLIUW}, + [RISCV_FMINM_S] = {RISCV_INSN_FMINM_S}, + [RISCV_ZBA_RTYPEUW] = {RISCV_INSN_SH3ADDUW, RISCV_INSN_SH2ADDUW, + RISCV_INSN_SH1ADDUW, RISCV_INSN_ADDUW}, + [RISCV_F_BIN_RM_TYPE_D] = {RISCV_INSN_FSUB_D, RISCV_INSN_FMUL_D, + RISCV_INSN_FDIV_D, RISCV_INSN_FADD_D}, + [RISCV_C_ADD_HINT] = {RISCV_INSN_C_ADD_HINT}, + [RISCV_F_MADD_TYPE_S] = {RISCV_INSN_FNMSUB_S, RISCV_INSN_FNMADD_S, + RISCV_INSN_FMSUB_S, RISCV_INSN_FMADD_S}, + [RISCV_ZIP] = {RISCV_INSN_ZIP}, + [RISCV_SHA512SUM1] = {RISCV_INSN_SHA512SUM1}, + [RISCV_C_LDSP] = {RISCV_INSN_C_LDSP}, + [RISCV_F_UN_RM_TYPE_H] = {RISCV_INSN_FSQRT_H, RISCV_INSN_FCVT_W_H, + RISCV_INSN_FCVT_WU_H, RISCV_INSN_FCVT_S_H, + RISCV_INSN_FCVT_L_H, RISCV_INSN_FCVT_LU_H, + RISCV_INSN_FCVT_H_WU, RISCV_INSN_FCVT_H_W, + RISCV_INSN_FCVT_H_S, + RISCV_INSN_FCVT_H_LU, RISCV_INSN_FCVT_H_L, + RISCV_INSN_FCVT_H_D, RISCV_INSN_FCVT_D_H}, + [RISCV_CPOP] = {RISCV_INSN_CPOP}, + [RISCV_FWFTYPE] = {RISCV_INSN_FWF_VSUB, RISCV_INSN_FWF_VADD}, + [RISCV_FWVTYPE] = {RISCV_INSN_FWV_VSUB, RISCV_INSN_FWV_VADD}, + [RISCV_ZBB_RTYPE] = {RISCV_INSN_XNOR, RISCV_INSN_ROR, RISCV_INSN_ROL, + RISCV_INSN_ORN, RISCV_INSN_MINU, RISCV_INSN_MIN, + RISCV_INSN_MAXU, RISCV_INSN_MAX, RISCV_INSN_ANDN}, + [RISCV_SM4KS] = {RISCV_INSN_SM4KS}, + [RISCV_RORIW] = {RISCV_INSN_RORIW}, + [RISCV_NXTYPE] = {RISCV_INSN_NX_VNCLIPU, RISCV_INSN_NX_VNCLIP}, + [RISCV_C_ADDIW] = {RISCV_INSN_C_ADDIW}, + [RISCV_C_LD] = {RISCV_INSN_C_LD}, + [RISCV_CTZW] = {RISCV_INSN_CTZW}, + [RISCV_XPERM8] = {RISCV_INSN_XPERM8}, + [RISCV_ITYPE] = {RISCV_INSN_XORI, RISCV_INSN_SLTIU, RISCV_INSN_SLTI, + RISCV_INSN_ORI, RISCV_INSN_ANDI, RISCV_INSN_ADDI}, + [RISCV_VID_V] = {RISCV_INSN_VID_V}, + [RISCV_FENCE] = {RISCV_INSN_FENCE}, + [RISCV_C_FLWSP] = {RISCV_INSN_C_FLWSP}, + [RISCV_STORE] = {RISCV_INSN_STORE}, + [RISCV_F_BIN_TYPE_S] = {RISCV_INSN_FSGNJ_S, RISCV_INSN_FSGNJX_S, + RISCV_INSN_FSGNJN_S, RISCV_INSN_FMIN_S, + RISCV_INSN_FMAX_S, RISCV_INSN_FLT_S, + RISCV_INSN_FLE_S, RISCV_INSN_FEQ_S}, + [RISCV_VSSEGTYPE] = {RISCV_INSN_VSSEGTYPE}, + [RISCV_F_BIN_TYPE_D] = {RISCV_INSN_FSGNJ_D, RISCV_INSN_FSGNJX_D, + RISCV_INSN_FSGNJN_D, RISCV_INSN_FMIN_D, + RISCV_INSN_FMAX_D, RISCV_INSN_FLT_D, + RISCV_INSN_FLE_D, RISCV_INSN_FEQ_D}, + [RISCV_ZICOND_RTYPE] = {RISCV_INSN_CZERO_NEZ, RISCV_INSN_CZERO_EQZ}, + [RISCV_C_FSDSP] = {RISCV_INSN_C_FSDSP}, + [RISCV_SRET] = {RISCV_INSN_SRET}, + [RISCV_STORE_FP] = {RISCV_INSN_STORE_FP}, + [RISCV_C_JALR] = {RISCV_INSN_C_JALR}, + [RISCV_FENCE_TSO] = {RISCV_INSN_FENCE_TSO}, + [RISCV_SHA512SIG0] = {RISCV_INSN_SHA512SIG0}, + [RISCV_FLI_S] = {RISCV_INSN_FLI_S}, + [RISCV_C_SB] = {RISCV_INSN_C_SB}, + [RISCV_ZBB_RTYPEW] = {RISCV_INSN_RORW, RISCV_INSN_ROLW}, + [RISCV_C_FLDSP] = {RISCV_INSN_C_FLDSP}, + [RISCV_C_MV_HINT] = {RISCV_INSN_C_MV_HINT}, + [RISCV_FCVTMOD_W_D] = {RISCV_INSN_FCVTMOD_W_D}, + [RISCV_RFVVTYPE] = {RISCV_INSN_FVV_VFWREDUSUM, RISCV_INSN_FVV_VFWREDOSUM, + RISCV_INSN_FVV_VFREDUSUM, RISCV_INSN_FVV_VFREDOSUM, + RISCV_INSN_FVV_VFREDMIN, RISCV_INSN_FVV_VFREDMAX}, + [RISCV_SHA512SIG0H] = {RISCV_INSN_SHA512SIG0H}, + [RISCV_AMO] = {RISCV_INSN_AMOXOR, RISCV_INSN_AMOSWAP, RISCV_INSN_AMOOR, + RISCV_INSN_AMOMINU, RISCV_INSN_AMOMIN, RISCV_INSN_AMOMAXU, + RISCV_INSN_AMOMAX, RISCV_INSN_AMOAND, RISCV_INSN_AMOADD}, + [RISCV_LOAD_FP] = {RISCV_INSN_LOAD_FP}, + [RISCV_VVMSTYPE] = {RISCV_INSN_VVMS_VSBC, RISCV_INSN_VVMS_VADC}, + [RISCV_FVVMATYPE] = {RISCV_INSN_FVV_VNMSUB, RISCV_INSN_FVV_VNMSAC, + RISCV_INSN_FVV_VNMADD, RISCV_INSN_FVV_VNMACC, + RISCV_INSN_FVV_VMSUB, RISCV_INSN_FVV_VMSAC, + RISCV_INSN_FVV_VMADD, RISCV_INSN_FVV_VMACC}, + [RISCV_VEXT2TYPE] = {RISCV_INSN_VEXT2_ZVF2, RISCV_INSN_VEXT2_SVF2}, + [RISCV_EBREAK] = {RISCV_INSN_EBREAK}, + [RISCV_C_LUI] = {RISCV_INSN_C_LUI}, + [RISCV_F_MADD_TYPE_D] = {RISCV_INSN_FNMSUB_D, RISCV_INSN_FNMADD_D, + RISCV_INSN_FMSUB_D, RISCV_INSN_FMADD_D}, + [RISCV_C_ZEXT_H] = {RISCV_INSN_C_ZEXT_H}, + [RISCV_SHA512SIG1L] = {RISCV_INSN_SHA512SIG1L}, + [RISCV_VLSEGTYPE] = {RISCV_INSN_VLSEGTYPE}, + [RISCV_SHA256SIG0] = {RISCV_INSN_SHA256SIG0}, + [RISCV_F_UN_TYPE_H] = {RISCV_INSN_FMV_X_H, RISCV_INSN_FMV_H_X, + RISCV_INSN_FCLASS_H}, + [RISCV_C_ADDI4SPN] = {RISCV_INSN_C_ADDI4SPN}, + [RISCV_VVTYPE] = {RISCV_INSN_VV_VXOR, RISCV_INSN_VV_VSUB, + RISCV_INSN_VV_VSSUBU, RISCV_INSN_VV_VSSUB, + RISCV_INSN_VV_VSSRL, RISCV_INSN_VV_VSSRA, + RISCV_INSN_VV_VSRL, RISCV_INSN_VV_VSRA, + RISCV_INSN_VV_VSMUL, RISCV_INSN_VV_VSLL, + RISCV_INSN_VV_VSADDU, RISCV_INSN_VV_VSADD, + RISCV_INSN_VV_VRGATHEREI16, RISCV_INSN_VV_VRGATHER, + RISCV_INSN_VV_VOR, RISCV_INSN_VV_VMINU, + RISCV_INSN_VV_VMIN, RISCV_INSN_VV_VMAXU, + RISCV_INSN_VV_VMAX, RISCV_INSN_VV_VAND, + RISCV_INSN_VV_VADD}, + [RISCV_FLEQ_H] = {RISCV_INSN_FLEQ_H}, + [RISCV_VICMPTYPE] = {RISCV_INSN_VICMP_VMSNE, RISCV_INSN_VICMP_VMSLEU, + RISCV_INSN_VICMP_VMSLE, RISCV_INSN_VICMP_VMSGTU, + RISCV_INSN_VICMP_VMSGT, RISCV_INSN_VICMP_VMSEQ}, + [RISCV_C_FLW] = {RISCV_INSN_C_FLW}, + [RISCV_C_SWSP] = {RISCV_INSN_C_SWSP}, + [RISCV_FLTQ_D] = {RISCV_INSN_FLTQ_D}, + [RISCV_AES64ES] = {RISCV_INSN_AES64ES}, + [RISCV_C_SRAI_HINT] = {RISCV_INSN_C_SRAI_HINT}, + [RISCV_DIV] = {RISCV_INSN_DIV}, + [RISCV_F_UN_TYPE_D] = {RISCV_INSN_FMV_X_D, RISCV_INSN_FMV_D_X, + RISCV_INSN_FCLASS_D}, + [RISCV_C_LH] = {RISCV_INSN_C_LH}, + [RISCV_C_NOP_HINT] = {RISCV_INSN_C_NOP_HINT}, + [RISCV_VFIRST_M] = {RISCV_INSN_VFIRST_M}, + [RISCV_MVVMATYPE] = {RISCV_INSN_MVV_VNMSUB, RISCV_INSN_MVV_VNMSAC, + RISCV_INSN_MVV_VMADD, RISCV_INSN_MVV_VMACC}, + [RISCV_FENCEI_RESERVED] = {RISCV_INSN_FENCEI_RESERVED}, + [RISCV_C_ADDI] = {RISCV_INSN_C_ADDI}, + [RISCV_VLOXSEGTYPE] = {RISCV_INSN_VLOXSEGTYPE}, + [RISCV_MUL] = {RISCV_INSN_MUL}, + [RISCV_VMSOF_M] = {RISCV_INSN_VMSOF_M}, + [RISCV_FLEQ_D] = {RISCV_INSN_FLEQ_D}, + [RISCV_VSSSEGTYPE] = {RISCV_INSN_VSSSEGTYPE}, + [RISCV_VXTYPE] = {RISCV_INSN_VX_VXOR, RISCV_INSN_VX_VSUB, + RISCV_INSN_VX_VSSUBU, RISCV_INSN_VX_VSSUB, + RISCV_INSN_VX_VSSRL, RISCV_INSN_VX_VSSRA, + RISCV_INSN_VX_VSRL, RISCV_INSN_VX_VSRA, + RISCV_INSN_VX_VSMUL, RISCV_INSN_VX_VSLL, + RISCV_INSN_VX_VSADDU, RISCV_INSN_VX_VSADD, + RISCV_INSN_VX_VRSUB, RISCV_INSN_VX_VOR, + RISCV_INSN_VX_VMINU, RISCV_INSN_VX_VMIN, + RISCV_INSN_VX_VMAXU, RISCV_INSN_VX_VMAX, + RISCV_INSN_VX_VAND, RISCV_INSN_VX_VADD}, + [RISCV_BTYPE] = {RISCV_INSN_BNE, RISCV_INSN_BLTU, RISCV_INSN_BLT, + RISCV_INSN_BGEU, RISCV_INSN_BGE, RISCV_INSN_BEQ}, + [RISCV_LOAD] = {RISCV_INSN_LOAD}, + [RISCV_VIOTA_M] = {RISCV_INSN_VIOTA_M}, + [RISCV_CLMULR] = {RISCV_INSN_CLMULR}, + [RISCV_VXMSTYPE] = {RISCV_INSN_VXMS_VSBC, RISCV_INSN_VXMS_VADC}, + [RISCV_CLZ] = {RISCV_INSN_CLZ}, + [RISCV_UTYPE] = {RISCV_INSN_LUI, RISCV_INSN_AUIPC}, + [RISCV_CLMULH] = {RISCV_INSN_CLMULH}, + [RISCV_FLI_H] = {RISCV_INSN_FLI_H}, + [RISCV_F_BIN_RM_TYPE_H] = {RISCV_INSN_FSUB_H, RISCV_INSN_FMUL_H, + RISCV_INSN_FDIV_H, RISCV_INSN_FADD_H}, + [RISCV_VSETVLI] = {RISCV_INSN_VSETVLI}, + [RISCV_C_SEXT_B] = {RISCV_INSN_C_SEXT_B}, + [RISCV_VLUXSEGTYPE] = {RISCV_INSN_VLUXSEGTYPE}, + [RISCV_SHA512SUM1R] = {RISCV_INSN_SHA512SUM1R}, + [RISCV_VITYPE] = {RISCV_INSN_VI_VXOR, RISCV_INSN_VI_VSSRL, + RISCV_INSN_VI_VSSRA, RISCV_INSN_VI_VSRL, + RISCV_INSN_VI_VSRA, RISCV_INSN_VI_VSLL, + RISCV_INSN_VI_VSADDU, RISCV_INSN_VI_VSADD, + RISCV_INSN_VI_VRSUB, RISCV_INSN_VI_VOR, + RISCV_INSN_VI_VAND, RISCV_INSN_VI_VADD}, + [RISCV_STORECON] = {RISCV_INSN_STORECON}, + [RISCV_VMVRTYPE] = {RISCV_INSN_VMVRTYPE}, + [RISCV_ZBKB_RTYPE] = {RISCV_INSN_PACKH, RISCV_INSN_PACK}, + [RISCV_VISG] = {RISCV_INSN_VI_VSLIDEUP, RISCV_INSN_VI_VSLIDEDOWN, + RISCV_INSN_VI_VRGATHER}, + [RISCV_C_ADD] = {RISCV_INSN_C_ADD}, + [RISCV_FVFTYPE] = {RISCV_INSN_VF_VSUB, RISCV_INSN_VF_VSLIDE1UP, + RISCV_INSN_VF_VSLIDE1DOWN, RISCV_INSN_VF_VSGNJX, + RISCV_INSN_VF_VSGNJN, RISCV_INSN_VF_VSGNJ, + RISCV_INSN_VF_VRSUB, RISCV_INSN_VF_VRDIV, + RISCV_INSN_VF_VMUL, RISCV_INSN_VF_VMIN, + RISCV_INSN_VF_VMAX, RISCV_INSN_VF_VDIV, + RISCV_INSN_VF_VADD}, + [RISCV_FENCE_RESERVED] = {RISCV_INSN_FENCE_RESERVED}, + [RISCV_MASKTYPEI] = {RISCV_INSN_MASKTYPEI}, + [RISCV_FVVTYPE] = {RISCV_INSN_FVV_VSUB, RISCV_INSN_FVV_VSGNJX, + RISCV_INSN_FVV_VSGNJN, RISCV_INSN_FVV_VSGNJ, + RISCV_INSN_FVV_VMUL, RISCV_INSN_FVV_VMIN, + RISCV_INSN_FVV_VMAX, RISCV_INSN_FVV_VDIV, + RISCV_INSN_FVV_VADD}, + [RISCV_CPOPW] = {RISCV_INSN_CPOPW}, + [RISCV_C_LI_HINT] = {RISCV_INSN_C_LI_HINT}, + [RISCV_SHA256SUM1] = {RISCV_INSN_SHA256SUM1}, + [RISCV_VSUXSEGTYPE] = {RISCV_INSN_VSUXSEGTYPE}, + [RISCV_VIMCTYPE] = {RISCV_INSN_VIMC_VMADC}, + [RISCV_VIMSTYPE] = {RISCV_INSN_VIMS_VADC}, + [RISCV_MASKTYPEV] = {RISCV_INSN_MASKTYPEV}, + [RISCV_FVFMTYPE] = {RISCV_INSN_VFM_VMFNE, RISCV_INSN_VFM_VMFLT, + RISCV_INSN_VFM_VMFLE, RISCV_INSN_VFM_VMFGT, + RISCV_INSN_VFM_VMFGE, RISCV_INSN_VFM_VMFEQ}, + [RISCV_ADDIW] = {RISCV_INSN_ADDIW}, + [RISCV_MRET] = {RISCV_INSN_MRET}, + [RISCV_VLSEGFFTYPE] = {RISCV_INSN_VLSEGFFTYPE}, + [RISCV_C_ANDI] = {RISCV_INSN_C_ANDI}, + [RISCV_WVTYPE] = {RISCV_INSN_WV_VSUBU, RISCV_INSN_WV_VSUB, + RISCV_INSN_WV_VADDU, RISCV_INSN_WV_VADD}, + [RISCV_C_SDSP] = {RISCV_INSN_C_SDSP}, + [RISCV_C_SUBW] = {RISCV_INSN_C_SUBW}, + [RISCV_VEXT4TYPE] = {RISCV_INSN_VEXT4_ZVF4, RISCV_INSN_VEXT4_SVF4}, + [RISCV_VSETVL] = {RISCV_INSN_VSETVL}, + [RISCV_C_SH] = {RISCV_INSN_C_SH}, + [RISCV_MVVCOMPRESS] = {RISCV_INSN_MVVCOMPRESS}, + [RISCV_FWVVTYPE] = {RISCV_INSN_FWVV_VSUB, RISCV_INSN_FWVV_VMUL, + RISCV_INSN_FWVV_VADD}, + [RISCV_VMTYPE] = {RISCV_INSN_VSM, RISCV_INSN_VLM}, + [RISCV_FROUND_H] = {RISCV_INSN_FROUND_H}, + [RISCV_C_JAL] = {RISCV_INSN_C_JAL}, + [RISCV_SFENCE_VMA] = {RISCV_INSN_SFENCE_VMA}, + [RISCV_NVSTYPE] = {RISCV_INSN_NVS_VNSRL, RISCV_INSN_NVS_VNSRA}, + [RISCV_FROUND_S] = {RISCV_INSN_FROUND_S}, + [RISCV_NISTYPE] = {RISCV_INSN_NIS_VNSRL, RISCV_INSN_NIS_VNSRA}, + [RISCV_C_SLLI] = {RISCV_INSN_C_SLLI}, + [RISCV_VXMTYPE] = {RISCV_INSN_VXM_VMSBC, RISCV_INSN_VXM_VMADC}, + [RISCV_FENCEI] = {RISCV_INSN_FENCEI}, + [RISCV_VFMVSF] = {RISCV_INSN_VFMVSF}, + [RISCV_VEXT8TYPE] = {RISCV_INSN_VEXT8_ZVF8, RISCV_INSN_VEXT8_SVF8}, + [RISCV_C_OR] = {RISCV_INSN_C_OR}, + [RISCV_FWVFMATYPE] = {RISCV_INSN_FWVF_VNMSAC, RISCV_INSN_FWVF_VNMACC, + RISCV_INSN_FWVF_VMSAC, RISCV_INSN_FWVF_VMACC}, + [RISCV_SHIFTIOP] = {RISCV_INSN_SRLI, RISCV_INSN_SRAI, RISCV_INSN_SLLI}, + [RISCV_DIVW] = {RISCV_INSN_DIVW}, + [RISCV_C_ZEXT_B] = {RISCV_INSN_C_ZEXT_B}, + [RISCV_C_MV] = {RISCV_INSN_C_MV}, + [RISCV_VIMTYPE] = {RISCV_INSN_VIM_VMADC}, + [RISCV_LOADRES] = {RISCV_INSN_LOADRES}, + [RISCV_C_J] = {RISCV_INSN_C_J}, + [RISCV_AES32ESI] = {RISCV_INSN_AES32ESI}, + [RISCV_C_BEQZ] = {RISCV_INSN_C_BEQZ}, + [RISCV_SHA512SUM0] = {RISCV_INSN_SHA512SUM0}, + [RISCV_SHA512SUM0R] = {RISCV_INSN_SHA512SUM0R}, + [RISCV_REMW] = {RISCV_INSN_REMW}, + [RISCV_VFMV] = {RISCV_INSN_VFMV}, + [RISCV_C_SEXT_H] = {RISCV_INSN_C_SEXT_H}, + [RISCV_WMVXTYPE] = {RISCV_INSN_WMVX_VWMACCUS, RISCV_INSN_WMVX_VWMACCU, + RISCV_INSN_WMVX_VWMACCSU, RISCV_INSN_WMVX_VWMACC}, + [RISCV_C_FSW] = {RISCV_INSN_C_FSW}, + [RISCV_C_SW] = {RISCV_INSN_C_SW}, + [RISCV_ZBS_RTYPE] = {RISCV_INSN_BSET, RISCV_INSN_BINV, RISCV_INSN_BEXT, + RISCV_INSN_BCLR}, + [RISCV_C_SUB] = {RISCV_INSN_C_SUB}, + [RISCV_VFUNARY0] = {RISCV_INSN_FV_CVT_X_F, RISCV_INSN_FV_CVT_XU_F, + RISCV_INSN_FV_CVT_RTZ_X_F, RISCV_INSN_FV_CVT_RTZ_XU_F, + RISCV_INSN_FV_CVT_F_XU, RISCV_INSN_FV_CVT_F_X}, + [RISCV_FROUNDNX_S] = {RISCV_INSN_FROUNDNX_S}, + [RISCV_ZICBOZ] = {RISCV_INSN_ZICBOZ}, + [RISCV_SFENCE_W_INVAL] = {RISCV_INSN_SFENCE_W_INVAL}, + [RISCV_C_JR] = {RISCV_INSN_C_JR}, + [RISCV_C_NOT] = {RISCV_INSN_C_NOT}, + [RISCV_ZBB_EXTOP] = {RISCV_INSN_ZEXTH, RISCV_INSN_SEXTH, RISCV_INSN_SEXTB}, + [RISCV_MVVTYPE] = {RISCV_INSN_MVV_VREMU, RISCV_INSN_MVV_VREM, + RISCV_INSN_MVV_VMULHU, RISCV_INSN_MVV_VMULHSU, + RISCV_INSN_MVV_VMULH, RISCV_INSN_MVV_VMUL, + RISCV_INSN_MVV_VDIVU, RISCV_INSN_MVV_VDIV, + RISCV_INSN_MVV_VASUBU, RISCV_INSN_MVV_VASUB, + RISCV_INSN_MVV_VAADDU, RISCV_INSN_MVV_VAADD}, + [RISCV_FVFMATYPE] = {RISCV_INSN_VF_VNMSUB, RISCV_INSN_VF_VNMSAC, + RISCV_INSN_VF_VNMADD, RISCV_INSN_VF_VNMACC, + RISCV_INSN_VF_VMSUB, RISCV_INSN_VF_VMSAC, + RISCV_INSN_VF_VMADD, RISCV_INSN_VF_VMACC}, + [RISCV_FMAXM_H] = {RISCV_INSN_FMAXM_H}, + [RISCV_SHA256SUM0] = {RISCV_INSN_SHA256SUM0}, + [RISCV_ZBS_IOP] = {RISCV_INSN_BSETI, RISCV_INSN_BINVI, RISCV_INSN_BEXTI, + RISCV_INSN_BCLRI}, + [RISCV_C_XOR] = {RISCV_INSN_C_XOR}, + [RISCV_FMINM_H] = {RISCV_INSN_FMINM_H}, + [RISCV_C_LUI_HINT] = {RISCV_INSN_C_LUI_HINT}, + [RISCV_VVMCTYPE] = {RISCV_INSN_VVMC_VMSBC, RISCV_INSN_VVMC_VMADC}, + [RISCV_F_BIN_RM_TYPE_S] = {RISCV_INSN_FSUB_S, RISCV_INSN_FMUL_S, + RISCV_INSN_FDIV_S, RISCV_INSN_FADD_S}, + [RISCV_SINVAL_VMA] = {RISCV_INSN_SINVAL_VMA}, + [RISCV_MOVETYPEX] = {RISCV_INSN_MOVETYPEX}, + [RISCV_C_BNEZ] = {RISCV_INSN_C_BNEZ}, + [RISCV_FWVVMATYPE] = {RISCV_INSN_FWVV_VNMSAC, RISCV_INSN_FWVV_VNMACC, + RISCV_INSN_FWVV_VMSAC, RISCV_INSN_FWVV_VMACC}, + [RISCV_AES64KS1I] = {RISCV_INSN_AES64KS1I}, + [RISCV_RMVVTYPE] = {RISCV_INSN_MVV_VREDXOR, RISCV_INSN_MVV_VREDSUM, + RISCV_INSN_MVV_VREDOR, RISCV_INSN_MVV_VREDMINU, + RISCV_INSN_MVV_VREDMIN, RISCV_INSN_MVV_VREDMAXU, + RISCV_INSN_MVV_VREDMAX, RISCV_INSN_MVV_VREDAND}, + [RISCV_CLZW] = {RISCV_INSN_CLZW}, + [RISCV_REM] = {RISCV_INSN_REM}, + [RISCV_C_EBREAK] = {RISCV_INSN_C_EBREAK}, + [RISCV_AES64ESM] = {RISCV_INSN_AES64ESM}, + [RISCV_VFNUNARY0] = {RISCV_INSN_FNV_CVT_X_F, RISCV_INSN_FNV_CVT_XU_F, + RISCV_INSN_FNV_CVT_RTZ_X_F, + RISCV_INSN_FNV_CVT_RTZ_XU_F, + RISCV_INSN_FNV_CVT_ROD_F_F, RISCV_INSN_FNV_CVT_F_XU, + RISCV_INSN_FNV_CVT_F_X, RISCV_INSN_FNV_CVT_F_F}, + [RISCV_VFWUNARY0] = {RISCV_INSN_FWV_CVT_X_F, RISCV_INSN_FWV_CVT_XU_F, + RISCV_INSN_FWV_CVT_RTZ_X_F, + RISCV_INSN_FWV_CVT_RTZ_XU_F, RISCV_INSN_FWV_CVT_F_XU, + RISCV_INSN_FWV_CVT_F_X, RISCV_INSN_FWV_CVT_F_F}, + [RISCV_MOVETYPEV] = {RISCV_INSN_MOVETYPEV}, + [RISCV_VFUNARY1] = {RISCV_INSN_FVV_VSQRT, RISCV_INSN_FVV_VRSQRT7, + RISCV_INSN_FVV_VREC7, RISCV_INSN_FVV_VCLASS}, + [RISCV_FWVFTYPE] = {RISCV_INSN_FWVF_VSUB, RISCV_INSN_FWVF_VMUL, + RISCV_INSN_FWVF_VADD}, + [RISCV_ZBA_RTYPE] = {RISCV_INSN_SH3ADD, RISCV_INSN_SH2ADD, + RISCV_INSN_SH1ADD}, + [RISCV_C_SRLI] = {RISCV_INSN_C_SRLI}, + [RISCV_VSRETYPE] = {RISCV_INSN_VSRETYPE}, + [RISCV_C_SLLI_HINT] = {RISCV_INSN_C_SLLI_HINT}, + [RISCV_WVVTYPE] = {RISCV_INSN_WVV_VWMULU, RISCV_INSN_WVV_VWMULSU, + RISCV_INSN_WVV_VWMUL, RISCV_INSN_WVV_VSUBU, + RISCV_INSN_WVV_VSUB, RISCV_INSN_WVV_VADDU, + RISCV_INSN_WVV_VADD}, + [RISCV_AES64DSM] = {RISCV_INSN_AES64DSM}, + [RISCV_C_LI] = {RISCV_INSN_C_LI}, + [RISCV_CSR] = {RISCV_INSN_CSRRW, RISCV_INSN_CSRRS, RISCV_INSN_CSRRC}, + [RISCV_C_SRAI] = {RISCV_INSN_C_SRAI}, + [RISCV_FMVP_D_X] = {RISCV_INSN_FMVP_D_X}, + [RISCV_C_LBU] = {RISCV_INSN_C_LBU}, + [RISCV_F_UN_RM_TYPE_S] = {RISCV_INSN_FSQRT_S, RISCV_INSN_FCVT_W_S, + RISCV_INSN_FCVT_WU_S, RISCV_INSN_FCVT_S_WU, + RISCV_INSN_FCVT_S_W, RISCV_INSN_FCVT_S_LU, + RISCV_INSN_FCVT_S_L, RISCV_INSN_FCVT_L_S, + RISCV_INSN_FCVT_LU_S}, + [RISCV_RTYPEW] = {RISCV_INSN_SUBW, RISCV_INSN_SRLW, RISCV_INSN_SRAW, + RISCV_INSN_SLLW, RISCV_INSN_ADDW}, + [RISCV_WMVVTYPE] = {RISCV_INSN_WMVV_VWMACCU, RISCV_INSN_WMVV_VWMACCSU, + RISCV_INSN_WMVV_VWMACC}, + [RISCV_MULW] = {RISCV_INSN_MULW}, + [RISCV_VVCMPTYPE] = {RISCV_INSN_VVCMP_VMSNE, RISCV_INSN_VVCMP_VMSLTU, + RISCV_INSN_VVCMP_VMSLT, RISCV_INSN_VVCMP_VMSLEU, + RISCV_INSN_VVCMP_VMSLE, RISCV_INSN_VVCMP_VMSEQ}, + [RISCV_ILLEGAL] = {RISCV_INSN_ILLEGAL}, + [RISCV_BREV8] = {RISCV_INSN_BREV8}, + [RISCV_AES32DSMI] = {RISCV_INSN_AES32DSMI}, + [RISCV_C_FSD] = {RISCV_INSN_C_FSD}, + [RISCV_C_ADDW] = {RISCV_INSN_C_ADDW}, + [RISCV_VCPOP_M] = {RISCV_INSN_VCPOP_M}, + [RISCV_SHA256SIG1] = {RISCV_INSN_SHA256SIG1}, + [RISCV_MVXTYPE] = {RISCV_INSN_MVX_VSLIDE1UP, RISCV_INSN_MVX_VSLIDE1DOWN, + RISCV_INSN_MVX_VREMU, RISCV_INSN_MVX_VREM, + RISCV_INSN_MVX_VMULHU, RISCV_INSN_MVX_VMULHSU, + RISCV_INSN_MVX_VMULH, RISCV_INSN_MVX_VMUL, + RISCV_INSN_MVX_VDIVU, RISCV_INSN_MVX_VDIV, + RISCV_INSN_MVX_VASUBU, RISCV_INSN_MVX_VASUB, + RISCV_INSN_MVX_VAADDU, RISCV_INSN_MVX_VAADD}, +}; +uint16_t get_insn_type(struct ast *tree) { + switch (tree->ast_node_type) { + case RISCV_WXTYPE: + return to_insn[RISCV_WXTYPE][tree->ast_node.wxtype.funct6]; + case RISCV_RTYPE: + return to_insn[RISCV_RTYPE][tree->ast_node.rtype.op]; + case RISCV_RIVVTYPE: + return to_insn[RISCV_RIVVTYPE][tree->ast_node.rivvtype.funct6]; + case RISCV_VXSG: + return to_insn[RISCV_VXSG][tree->ast_node.vxsg.funct6]; + case RISCV_VXCMPTYPE: + return to_insn[RISCV_VXCMPTYPE][tree->ast_node.vxcmptype.funct6]; + case RISCV_SHIFTIWOP: + return to_insn[RISCV_SHIFTIWOP][tree->ast_node.shiftiwop.op]; + case RISCV_ZICBOM: + return to_insn[RISCV_ZICBOM][tree->ast_node.riscv_zicbom.cbop]; + case RISCV_NITYPE: + return to_insn[RISCV_NITYPE][tree->ast_node.nitype.funct6]; + case RISCV_VVMTYPE: + return to_insn[RISCV_VVMTYPE][tree->ast_node.vvmtype.funct6]; + case RISCV_MVXMATYPE: + return to_insn[RISCV_MVXMATYPE][tree->ast_node.mvxmatype.funct6]; + case RISCV_F_BIN_TYPE_H: + return to_insn[RISCV_F_BIN_TYPE_H][tree->ast_node.f_bin_type_h.fle_h]; + case RISCV_FVVMTYPE: + return to_insn[RISCV_FVVMTYPE][tree->ast_node.fvvmtype.funct6]; + case RISCV_F_UN_RM_TYPE_D: + return to_insn[RISCV_F_UN_RM_TYPE_D] + [tree->ast_node.f_un_rm_type_d.fcvt_d_lu]; + case RISCV_WVXTYPE: + return to_insn[RISCV_WVXTYPE][tree->ast_node.wvxtype.funct6]; + case RISCV_NXSTYPE: + return to_insn[RISCV_NXSTYPE][tree->ast_node.nxstype.funct6]; + case RISCV_VXMCTYPE: + return to_insn[RISCV_VXMCTYPE][tree->ast_node.vxmctype.funct6]; + case RISCV_MMTYPE: + return to_insn[RISCV_MMTYPE][tree->ast_node.mmtype.funct6]; + case RISCV_F_UN_TYPE_S: + return to_insn[RISCV_F_UN_TYPE_S][tree->ast_node.f_un_type_s.fmv_w_x]; + case RISCV_NVTYPE: + return to_insn[RISCV_NVTYPE][tree->ast_node.nvtype.funct6]; + case RISCV_F_MADD_TYPE_H: + return to_insn[RISCV_F_MADD_TYPE_H][tree->ast_node.f_madd_type_h.op]; + case RISCV_ZBA_RTYPEUW: + return to_insn[RISCV_ZBA_RTYPEUW][tree->ast_node.zba_rtypeuw.op]; + case RISCV_F_BIN_RM_TYPE_D: + return to_insn[RISCV_F_BIN_RM_TYPE_D][tree->ast_node.f_bin_rm_type_d.op]; + case RISCV_F_MADD_TYPE_S: + return to_insn[RISCV_F_MADD_TYPE_S][tree->ast_node.f_madd_type_s.op]; + case RISCV_F_UN_RM_TYPE_H: + return to_insn[RISCV_F_UN_RM_TYPE_H] + [tree->ast_node.f_un_rm_type_h.fcvt_h_lu]; + case RISCV_FWFTYPE: + return to_insn[RISCV_FWFTYPE][tree->ast_node.fwftype.funct6]; + case RISCV_FWVTYPE: + return to_insn[RISCV_FWVTYPE][tree->ast_node.fwvtype.funct6]; + case RISCV_ZBB_RTYPE: + return to_insn[RISCV_ZBB_RTYPE][tree->ast_node.zbb_rtype.op]; + case RISCV_NXTYPE: + return to_insn[RISCV_NXTYPE][tree->ast_node.nxtype.funct6]; + case RISCV_ITYPE: + return to_insn[RISCV_ITYPE][tree->ast_node.itype.op]; + case RISCV_F_BIN_TYPE_S: + return to_insn[RISCV_F_BIN_TYPE_S][tree->ast_node.f_bin_type_s.fle_s]; + case RISCV_F_BIN_TYPE_D: + return to_insn[RISCV_F_BIN_TYPE_D][tree->ast_node.f_bin_type_d.fle_d]; + case RISCV_ZICOND_RTYPE: + return to_insn[RISCV_ZICOND_RTYPE] + [tree->ast_node.zicond_rtype.riscv_czero_nez]; + case RISCV_ZBB_RTYPEW: + return to_insn[RISCV_ZBB_RTYPEW][tree->ast_node.zbb_rtypew.op]; + case RISCV_RFVVTYPE: + return to_insn[RISCV_RFVVTYPE][tree->ast_node.rfvvtype.funct6]; + case RISCV_AMO: + return to_insn[RISCV_AMO][tree->ast_node.amo.op]; + case RISCV_VVMSTYPE: + return to_insn[RISCV_VVMSTYPE][tree->ast_node.vvmstype.funct6]; + case RISCV_FVVMATYPE: + return to_insn[RISCV_FVVMATYPE][tree->ast_node.fvvmatype.funct6]; + case RISCV_VEXT2TYPE: + return to_insn[RISCV_VEXT2TYPE][tree->ast_node.vext2type.funct6]; + case RISCV_F_MADD_TYPE_D: + return to_insn[RISCV_F_MADD_TYPE_D][tree->ast_node.f_madd_type_d.op]; + case RISCV_F_UN_TYPE_H: + return to_insn[RISCV_F_UN_TYPE_H][tree->ast_node.f_un_type_h.fmv_h_x]; + case RISCV_VVTYPE: + return to_insn[RISCV_VVTYPE][tree->ast_node.vvtype.funct6]; + case RISCV_VICMPTYPE: + return to_insn[RISCV_VICMPTYPE][tree->ast_node.vicmptype.funct6]; + case RISCV_F_UN_TYPE_D: + return to_insn[RISCV_F_UN_TYPE_D][tree->ast_node.f_un_type_d.fmv_d_x]; + case RISCV_MVVMATYPE: + return to_insn[RISCV_MVVMATYPE][tree->ast_node.mvvmatype.funct6]; + case RISCV_VXTYPE: + return to_insn[RISCV_VXTYPE][tree->ast_node.vxtype.funct6]; + case RISCV_BTYPE: + return to_insn[RISCV_BTYPE][tree->ast_node.btype.op]; + case RISCV_VXMSTYPE: + return to_insn[RISCV_VXMSTYPE][tree->ast_node.vxmstype.funct6]; + case RISCV_UTYPE: + return to_insn[RISCV_UTYPE][tree->ast_node.utype.op]; + case RISCV_F_BIN_RM_TYPE_H: + return to_insn[RISCV_F_BIN_RM_TYPE_H][tree->ast_node.f_bin_rm_type_h.op]; + case RISCV_VITYPE: + return to_insn[RISCV_VITYPE][tree->ast_node.vitype.funct6]; + case RISCV_ZBKB_RTYPE: + return to_insn[RISCV_ZBKB_RTYPE][tree->ast_node.zbkb_rtype.op]; + case RISCV_VISG: + return to_insn[RISCV_VISG][tree->ast_node.visg.funct6]; + case RISCV_FVFTYPE: + return to_insn[RISCV_FVFTYPE][tree->ast_node.fvftype.funct6]; + case RISCV_FVVTYPE: + return to_insn[RISCV_FVVTYPE][tree->ast_node.fvvtype.funct6]; + case RISCV_VIMCTYPE: + return to_insn[RISCV_VIMCTYPE][tree->ast_node.vimctype.funct6]; + case RISCV_VIMSTYPE: + return to_insn[RISCV_VIMSTYPE][tree->ast_node.vimstype.funct6]; + case RISCV_FVFMTYPE: + return to_insn[RISCV_FVFMTYPE][tree->ast_node.fvfmtype.funct6]; + case RISCV_WVTYPE: + return to_insn[RISCV_WVTYPE][tree->ast_node.wvtype.funct6]; + case RISCV_VEXT4TYPE: + return to_insn[RISCV_VEXT4TYPE][tree->ast_node.vext4type.funct6]; + case RISCV_FWVVTYPE: + return to_insn[RISCV_FWVVTYPE][tree->ast_node.fwvvtype.funct6]; + case RISCV_VMTYPE: + return to_insn[RISCV_VMTYPE][tree->ast_node.vmtype.op]; + case RISCV_NVSTYPE: + return to_insn[RISCV_NVSTYPE][tree->ast_node.nvstype.funct6]; + case RISCV_NISTYPE: + return to_insn[RISCV_NISTYPE][tree->ast_node.nistype.funct6]; + case RISCV_VXMTYPE: + return to_insn[RISCV_VXMTYPE][tree->ast_node.vxmtype.funct6]; + case RISCV_VEXT8TYPE: + return to_insn[RISCV_VEXT8TYPE][tree->ast_node.vext8type.funct6]; + case RISCV_FWVFMATYPE: + return to_insn[RISCV_FWVFMATYPE][tree->ast_node.fwvfmatype.funct6]; + case RISCV_SHIFTIOP: + return to_insn[RISCV_SHIFTIOP][tree->ast_node.shiftiop.op]; + case RISCV_VIMTYPE: + return to_insn[RISCV_VIMTYPE][tree->ast_node.vimtype.funct6]; + case RISCV_WMVXTYPE: + return to_insn[RISCV_WMVXTYPE][tree->ast_node.wmvxtype.funct6]; + case RISCV_ZBS_RTYPE: + return to_insn[RISCV_ZBS_RTYPE][tree->ast_node.zbs_rtype.op]; + case RISCV_VFUNARY0: + return to_insn[RISCV_VFUNARY0][tree->ast_node.vfunary0.vfunary0]; + case RISCV_ZBB_EXTOP: + return to_insn[RISCV_ZBB_EXTOP][tree->ast_node.zbb_extop.op]; + case RISCV_MVVTYPE: + return to_insn[RISCV_MVVTYPE][tree->ast_node.mvvtype.funct6]; + case RISCV_FVFMATYPE: + return to_insn[RISCV_FVFMATYPE][tree->ast_node.fvfmatype.funct6]; + case RISCV_ZBS_IOP: + return to_insn[RISCV_ZBS_IOP][tree->ast_node.zbs_iop.op]; + case RISCV_VVMCTYPE: + return to_insn[RISCV_VVMCTYPE][tree->ast_node.vvmctype.funct6]; + case RISCV_F_BIN_RM_TYPE_S: + return to_insn[RISCV_F_BIN_RM_TYPE_S][tree->ast_node.f_bin_rm_type_s.op]; + case RISCV_FWVVMATYPE: + return to_insn[RISCV_FWVVMATYPE][tree->ast_node.fwvvmatype.funct6]; + case RISCV_RMVVTYPE: + return to_insn[RISCV_RMVVTYPE][tree->ast_node.rmvvtype.funct6]; + case RISCV_VFNUNARY0: + return to_insn[RISCV_VFNUNARY0][tree->ast_node.vfnunary0.vfnunary0]; + case RISCV_VFWUNARY0: + return to_insn[RISCV_VFWUNARY0][tree->ast_node.vfwunary0.vfwunary0]; + case RISCV_VFUNARY1: + return to_insn[RISCV_VFUNARY1][tree->ast_node.vfunary1.vfunary1]; + case RISCV_FWVFTYPE: + return to_insn[RISCV_FWVFTYPE][tree->ast_node.fwvftype.funct6]; + case RISCV_ZBA_RTYPE: + return to_insn[RISCV_ZBA_RTYPE][tree->ast_node.zba_rtype.op]; + case RISCV_WVVTYPE: + return to_insn[RISCV_WVVTYPE][tree->ast_node.wvvtype.funct6]; + case RISCV_CSR: + return to_insn[RISCV_CSR][tree->ast_node.csr.op]; + case RISCV_F_UN_RM_TYPE_S: + return to_insn[RISCV_F_UN_RM_TYPE_S] + [tree->ast_node.f_un_rm_type_s.fcvt_s_lu]; + case RISCV_RTYPEW: + return to_insn[RISCV_RTYPEW][tree->ast_node.rtypew.op]; + case RISCV_WMVVTYPE: + return to_insn[RISCV_WMVVTYPE][tree->ast_node.wmvvtype.funct6]; + case RISCV_VVCMPTYPE: + return to_insn[RISCV_VVCMPTYPE][tree->ast_node.vvcmptype.funct6]; + case RISCV_MVXTYPE: + return to_insn[RISCV_MVXTYPE][tree->ast_node.mvxtype.funct6]; + default: + return to_insn[tree->ast_node_type][0]; + } +} +#endif diff --git a/arch/RISCV/RISCVPrinter.c b/arch/RISCV/RISCVPrinter.c index f17f9f4116..e592449bd8 100644 --- a/arch/RISCV/RISCVPrinter.c +++ b/arch/RISCV/RISCVPrinter.c @@ -1,12 +1,15 @@ #include "RISCVPrinter.h" +#include "RISCVAst2Str.gen.inc" void riscv_printer(MCInst *MI, SStream *OS, void *info) { - // FIXME: add the ast struct as a member in the riscv_details - //( stringification can't happen unless ast is available) + struct ast instruction; - // char instruction_as_str[RISCV_MAX_INSTRUCTION_STR_LEN]; - // riscv_conf conf; - // conf.sys_enable_fdext = NULL; - // conf.sys_enable_zfinx = NULL; - // ast2str(&instruction, instruction_as_str, &conf); + riscv_conf conf; + conf.sys_enable_fdext = NULL; + conf.sys_enable_zfinx = NULL; + + CS_ASSERT(sizeof(struct ast) < 160); + memcpy(&instruction, MI->flat_insn->op_str, sizeof(struct ast)); + + ast2str(&instruction, OS, &conf); } \ No newline at end of file diff --git a/arch/RISCV/RISCVPrinter.h b/arch/RISCV/RISCVPrinter.h index f8e4d66086..481aa205ab 100644 --- a/arch/RISCV/RISCVPrinter.h +++ b/arch/RISCV/RISCVPrinter.h @@ -3,8 +3,6 @@ #include "../../cs_priv.h" -//#include "riscv_ast2str.gen.inc" FIXME: uncomment when printer is implemented - void riscv_printer(MCInst *MI, SStream *OS, void *info); #endif \ No newline at end of file diff --git a/arch/RISCV/riscv_ast2str.gen.inc b/arch/RISCV/riscv_ast2str.gen.inc deleted file mode 100644 index 86e2772c8a..0000000000 --- a/arch/RISCV/riscv_ast2str.gen.inc +++ /dev/null @@ -1,9907 +0,0 @@ -/*=======================================================================*/ -/*This code was generated by the tool riscv_disasm_from_sail (see - * https://github.com/moste00/riscv_disasm_from_sail)*/ -/*from the sail model of RISC-V (see https://github.com/riscv/sail-riscv) @ - * version 0b9c639f19da48734cbf14b61f6ad200b7c70de9.*/ -/*DO NOT MODIFY THIS CODE MANUALLY.*/ -/* */ -/*SPDX-License-Identifier: BSD-3-Clause*/ -/*=======================================================================*/ - -#ifndef __Riscv_ast2str_gen_inc__ -#define __Riscv_ast2str_gen_inc__ -#include - -#include - -#include "riscv_ast.gen.inc" -#include - -#include "riscv_ast2str_tbls.gen.inc" - -#include "riscv_helpers_ast2str.h" - -#define RISCV_MAX_INSTRUCTION_STR_LEN 256 - -#define DO_MEMCPY1 memcpy(buff, s0, s0_len) -#define DO_MEMCPY2 \ - DO_MEMCPY1; \ - memcpy(buff + s0_len, s1, s1_len) -#define DO_MEMCPY3 \ - DO_MEMCPY2; \ - memcpy(buff + s0_len + s1_len, s2, s2_len) -#define DO_MEMCPY4 \ - DO_MEMCPY3; \ - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len) -#define DO_MEMCPY5 \ - DO_MEMCPY4; \ - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len) -#define DO_MEMCPY6 \ - DO_MEMCPY5; \ - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len) -#define DO_MEMCPY7 \ - DO_MEMCPY6; \ - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len) -#define DO_MEMCPY8 \ - DO_MEMCPY7; \ - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, \ - s7, s7_len) -#define DO_MEMCPY9 \ - DO_MEMCPY8; \ - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + \ - s7_len, \ - s8, s8_len) -#define DO_MEMCPY10 \ - DO_MEMCPY9; \ - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + \ - s7_len + s8_len, \ - s9, s9_len) -#define DO_MEMCPY11 \ - DO_MEMCPY10; \ - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + \ - s7_len + s8_len + s9_len, \ - s10, s10_len) -#define DO_MEMCPY12 \ - DO_MEMCPY11; \ - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + \ - s7_len + s8_len + s9_len + s10_len, \ - s11, s11_len) -#define DO_MEMCPY13 \ - DO_MEMCPY12; \ - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + \ - s7_len + s8_len + s9_len + s10_len + s11_len, \ - s12, s12_len) -#define DO_MEMCPY14 \ - DO_MEMCPY13; \ - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + \ - s7_len + s8_len + s9_len + s10_len + s11_len + s12_len, \ - s13, s13_len) - -void ast2str(struct ast *tree, char *buff, riscv_conf *conf) { - memset(buff, 0, RISCV_MAX_INSTRUCTION_STR_LEN); - switch (tree->ast_node_type) { - case RISCV_UTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - utype_mnemonic(tree->ast_node.utype.op, &s0, &s0_len); - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.utype.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_signed_20(tree->ast_node.utype.imm, &s4, &s4_len, conf); - DO_MEMCPY5; - } break; - case RISCV_JAL: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - s0 = "jal"; - s0_len = 3; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.riscv_jal.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_signed_21(tree->ast_node.riscv_jal.imm, &s4, &s4_len, conf); - DO_MEMCPY5; - } break; - case RISCV_JALR: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char *s5 = ""; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char *s7 = ""; - size_t s7_len = 0; - s0 = "jalr"; - s0_len = 4; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.riscv_jalr.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_signed_12(tree->ast_node.riscv_jalr.imm, &s4, &s4_len, conf); - s5 = "("; - s5_len = 1; - reg_name(tree->ast_node.riscv_jalr.rs1, &s6, &s6_len); - s7 = ")"; - s7_len = 1; - DO_MEMCPY8; - } break; - case RISCV_BTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - btype_mnemonic(tree->ast_node.btype.op, &s0, &s0_len); - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.btype.rs1, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.btype.rs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - hex_bits_signed_13(tree->ast_node.btype.imm, &s6, &s6_len, conf); - DO_MEMCPY7; - } break; - case RISCV_ITYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - itype_mnemonic(tree->ast_node.itype.op, &s0, &s0_len); - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.itype.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.itype.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - hex_bits_signed_12(tree->ast_node.itype.imm, &s6, &s6_len, conf); - DO_MEMCPY7; - } break; - case RISCV_SHIFTIOP: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - shiftiop_mnemonic(tree->ast_node.shiftiop.op, &s0, &s0_len); - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.shiftiop.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.shiftiop.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - hex_bits_6(tree->ast_node.shiftiop.shamt, &s6, &s6_len, conf); - DO_MEMCPY7; - } break; - case RISCV_RTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - rtype_mnemonic(tree->ast_node.rtype.op, &s0, &s0_len); - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.rtype.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.rtype.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.rtype.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_LOAD: { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char *s3 = ""; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char s8_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s8 = s8_buffer; - size_t s8_len = 0; - char *s9 = ""; - size_t s9_len = 0; - char *s10 = ""; - size_t s10_len = 0; - char *s11 = ""; - size_t s11_len = 0; - s0 = "l"; - s0_len = 1; - size_mnemonic(tree->ast_node.load.width, &s1, &s1_len); - if (tree->ast_node.load.is_unsigned) { - s2 = "u"; - s2_len = 1; - } else { - s2 = ""; - s2_len = 0; - } - if (tree->ast_node.load.aq) { - s3 = ".aq"; - s3_len = 3; - } else { - s3 = ""; - s3_len = 0; - } - if (tree->ast_node.load.rl) { - s4 = ".rl"; - s4_len = 3; - } else { - s4 = ""; - s4_len = 0; - } - spc(&s5, &s5_len, conf); - reg_name(tree->ast_node.load.rd, &s6, &s6_len); - sep(&s7, &s7_len, conf); - hex_bits_signed_12(tree->ast_node.load.imm, &s8, &s8_len, conf); - s9 = "("; - s9_len = 1; - reg_name(tree->ast_node.load.rs1, &s10, &s10_len); - s11 = ")"; - s11_len = 1; - DO_MEMCPY12; - } break; - case RISCV_STORE: { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char *s3 = ""; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char *s5 = ""; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char s8_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s8 = s8_buffer; - size_t s8_len = 0; - char *s9 = ""; - size_t s9_len = 0; - char s10_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s10 = s10_buffer; - size_t s10_len = 0; - char *s11 = ""; - size_t s11_len = 0; - char s12_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s12 = s12_buffer; - size_t s12_len = 0; - char *s13 = ""; - size_t s13_len = 0; - s0 = "s"; - s0_len = 1; - size_mnemonic(tree->ast_node.store.width, &s1, &s1_len); - if (tree->ast_node.store.aq) { - s2 = ".aq"; - s2_len = 3; - } else { - s2 = ""; - s2_len = 0; - } - if (tree->ast_node.store.rl) { - s3 = ".rl"; - s3_len = 3; - } else { - s3 = ""; - s3_len = 0; - } - spc(&s4, &s4_len, conf); - reg_name(tree->ast_node.store.rs2, &s5, &s5_len); - sep(&s6, &s6_len, conf); - hex_bits_signed_12(tree->ast_node.store.imm, &s7, &s7_len, conf); - opt_spc(&s8, &s8_len, conf); - s9 = "("; - s9_len = 1; - opt_spc(&s10, &s10_len, conf); - reg_name(tree->ast_node.store.rs1, &s11, &s11_len); - opt_spc(&s12, &s12_len, conf); - s13 = ")"; - s13_len = 1; - DO_MEMCPY14; - } break; - case RISCV_ADDIW: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "addiw"; - s0_len = 5; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.addiw.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.addiw.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - hex_bits_signed_12(tree->ast_node.addiw.imm, &s6, &s6_len, conf); - DO_MEMCPY7; - } break; - case RISCV_RTYPEW: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - rtypew_mnemonic(tree->ast_node.rtypew.op, &s0, &s0_len); - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.rtypew.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.rtypew.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.rtypew.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_SHIFTIWOP: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - shiftiwop_mnemonic(tree->ast_node.shiftiwop.op, &s0, &s0_len); - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.shiftiwop.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.shiftiwop.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - hex_bits_5(tree->ast_node.shiftiwop.shamt, &s6, &s6_len, conf); - DO_MEMCPY7; - } break; - case RISCV_FENCE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - s0 = "fence"; - s0_len = 5; - spc(&s1, &s1_len, conf); - fence_bits(tree->ast_node.fence.pred, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - fence_bits(tree->ast_node.fence.succ, &s4, &s4_len, conf); - DO_MEMCPY5; - } break; - case RISCV_FENCE_TSO: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - s0 = "fence.tso"; - s0_len = 9; - spc(&s1, &s1_len, conf); - fence_bits(tree->ast_node.fence_tso.pred, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - fence_bits(tree->ast_node.fence_tso.succ, &s4, &s4_len, conf); - DO_MEMCPY5; - } break; - case RISCV_ECALL: { - char *s0 = ""; - size_t s0_len = 0; - s0 = "ecall"; - s0_len = 5; - DO_MEMCPY1; - } break; - case RISCV_MRET: { - char *s0 = ""; - size_t s0_len = 0; - s0 = "mret"; - s0_len = 4; - DO_MEMCPY1; - } break; - case RISCV_SRET: { - char *s0 = ""; - size_t s0_len = 0; - s0 = "sret"; - s0_len = 4; - DO_MEMCPY1; - } break; - case RISCV_EBREAK: { - char *s0 = ""; - size_t s0_len = 0; - s0 = "ebreak"; - s0_len = 6; - DO_MEMCPY1; - } break; - case RISCV_WFI: { - char *s0 = ""; - size_t s0_len = 0; - s0 = "wfi"; - s0_len = 3; - DO_MEMCPY1; - } break; - case RISCV_SFENCE_VMA: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "sfence.vma"; - s0_len = 10; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.sfence_vma.rs1, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.sfence_vma.rs2, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_FENCEI: { - char *s0 = ""; - size_t s0_len = 0; - s0 = "fence.i"; - s0_len = 7; - DO_MEMCPY1; - } break; - case RISCV_LOADRES: { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char *s3 = ""; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char *s5 = ""; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - char *s7 = ""; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - char *s9 = ""; - size_t s9_len = 0; - s0 = "lr."; - s0_len = 3; - size_mnemonic(tree->ast_node.loadres.width, &s1, &s1_len); - if (tree->ast_node.loadres.aq) { - s2 = ".aq"; - s2_len = 3; - } else { - s2 = ""; - s2_len = 0; - } - if (tree->ast_node.loadres.rl) { - s3 = ".rl"; - s3_len = 3; - } else { - s3 = ""; - s3_len = 0; - } - spc(&s4, &s4_len, conf); - reg_name(tree->ast_node.loadres.rd, &s5, &s5_len); - sep(&s6, &s6_len, conf); - s7 = "("; - s7_len = 1; - reg_name(tree->ast_node.loadres.rs1, &s8, &s8_len); - s9 = ")"; - s9_len = 1; - DO_MEMCPY10; - } break; - case RISCV_STORECON: { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char *s3 = ""; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char *s5 = ""; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - char *s7 = ""; - size_t s7_len = 0; - char s8_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s8 = s8_buffer; - size_t s8_len = 0; - char *s9 = ""; - size_t s9_len = 0; - char *s10 = ""; - size_t s10_len = 0; - char *s11 = ""; - size_t s11_len = 0; - s0 = "sc."; - s0_len = 3; - size_mnemonic(tree->ast_node.storecon.width, &s1, &s1_len); - if (tree->ast_node.storecon.aq) { - s2 = ".aq"; - s2_len = 3; - } else { - s2 = ""; - s2_len = 0; - } - if (tree->ast_node.storecon.rl) { - s3 = ".rl"; - s3_len = 3; - } else { - s3 = ""; - s3_len = 0; - } - spc(&s4, &s4_len, conf); - reg_name(tree->ast_node.storecon.rd, &s5, &s5_len); - sep(&s6, &s6_len, conf); - reg_name(tree->ast_node.storecon.rs2, &s7, &s7_len); - sep(&s8, &s8_len, conf); - s9 = "("; - s9_len = 1; - reg_name(tree->ast_node.storecon.rs1, &s10, &s10_len); - s11 = ")"; - s11_len = 1; - DO_MEMCPY12; - } break; - case RISCV_AMO: { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char *s3 = ""; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - char s9_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s9 = s9_buffer; - size_t s9_len = 0; - char *s10 = ""; - size_t s10_len = 0; - char *s11 = ""; - size_t s11_len = 0; - char *s12 = ""; - size_t s12_len = 0; - amo_mnemonic(tree->ast_node.amo.op, &s0, &s0_len); - s1 = "."; - s1_len = 1; - size_mnemonic(tree->ast_node.amo.width, &s2, &s2_len); - if (tree->ast_node.amo.aq) { - s3 = ".aq"; - s3_len = 3; - } else { - s3 = ""; - s3_len = 0; - } - if (tree->ast_node.amo.rl) { - s4 = ".rl"; - s4_len = 3; - } else { - s4 = ""; - s4_len = 0; - } - spc(&s5, &s5_len, conf); - reg_name(tree->ast_node.amo.rd, &s6, &s6_len); - sep(&s7, &s7_len, conf); - reg_name(tree->ast_node.amo.rs2, &s8, &s8_len); - sep(&s9, &s9_len, conf); - s10 = "("; - s10_len = 1; - reg_name(tree->ast_node.amo.rs1, &s11, &s11_len); - s12 = ")"; - s12_len = 1; - DO_MEMCPY13; - } break; - case RISCV_C_NOP: { - char *s0 = ""; - size_t s0_len = 0; - s0 = "c.nop"; - s0_len = 5; - DO_MEMCPY1; - } break; - case RISCV_C_ADDI4SPN: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - s0 = "c.addi4spn"; - s0_len = 10; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_addi4spn.rdc, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_10(tree->ast_node.c_addi4spn.nzimm << 2 | 0x0 << 0, &s4, &s4_len, - conf); - DO_MEMCPY5; - } break; - case RISCV_C_LW: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "c.lw"; - s0_len = 4; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_lw.rdc, &s2, &s2_len); - sep(&s3, &s3_len, conf); - creg_name(tree->ast_node.c_lw.rsc, &s4, &s4_len); - sep(&s5, &s5_len, conf); - hex_bits_7(tree->ast_node.c_lw.uimm << 2 | 0x0 << 0, &s6, &s6_len, conf); - DO_MEMCPY7; - } break; - case RISCV_C_LD: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "c.ld"; - s0_len = 4; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_ld.rdc, &s2, &s2_len); - sep(&s3, &s3_len, conf); - creg_name(tree->ast_node.c_ld.rsc, &s4, &s4_len); - sep(&s5, &s5_len, conf); - hex_bits_8(tree->ast_node.c_ld.uimm << 3 | 0x0 << 0, &s6, &s6_len, conf); - DO_MEMCPY7; - } break; - case RISCV_C_SW: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "c.sw"; - s0_len = 4; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_sw.rsc1, &s2, &s2_len); - sep(&s3, &s3_len, conf); - creg_name(tree->ast_node.c_sw.rsc2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - hex_bits_7(tree->ast_node.c_sw.uimm << 2 | 0x0 << 0, &s6, &s6_len, conf); - DO_MEMCPY7; - } break; - case RISCV_C_SD: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "c.sd"; - s0_len = 4; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_sd.rsc1, &s2, &s2_len); - sep(&s3, &s3_len, conf); - creg_name(tree->ast_node.c_sd.rsc2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - hex_bits_8(tree->ast_node.c_sd.uimm << 3 | 0x0 << 0, &s6, &s6_len, conf); - DO_MEMCPY7; - } break; - case RISCV_C_ADDI: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - s0 = "c.addi"; - s0_len = 6; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.c_addi.rsd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_signed_6(tree->ast_node.c_addi.nzi, &s4, &s4_len, conf); - DO_MEMCPY5; - } break; - case RISCV_C_JAL: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - s0 = "c.jal"; - s0_len = 5; - spc(&s1, &s1_len, conf); - hex_bits_signed_12(tree->ast_node.c_jal << 1 | 0x0 << 0, &s2, &s2_len, - conf); - DO_MEMCPY3; - } break; - case RISCV_C_ADDIW: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - s0 = "c.addiw"; - s0_len = 7; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.c_addiw.rsd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_signed_6(tree->ast_node.c_addiw.imm, &s4, &s4_len, conf); - DO_MEMCPY5; - } break; - case RISCV_C_LI: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - s0 = "c.li"; - s0_len = 4; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.c_li.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_signed_6(tree->ast_node.c_li.imm, &s4, &s4_len, conf); - DO_MEMCPY5; - } break; - case RISCV_C_ADDI16SP: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - s0 = "c.addi16sp"; - s0_len = 10; - spc(&s1, &s1_len, conf); - hex_bits_signed_6(tree->ast_node.c_addi16sp, &s2, &s2_len, conf); - DO_MEMCPY3; - } break; - case RISCV_C_LUI: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - s0 = "c.lui"; - s0_len = 5; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.c_lui.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_signed_6(tree->ast_node.c_lui.imm, &s4, &s4_len, conf); - DO_MEMCPY5; - } break; - case RISCV_C_SRLI: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - s0 = "c.srli"; - s0_len = 6; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_srli.rsd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_6(tree->ast_node.c_srli.shamt, &s4, &s4_len, conf); - DO_MEMCPY5; - } break; - case RISCV_C_SRAI: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - s0 = "c.srai"; - s0_len = 6; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_srai.rsd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_6(tree->ast_node.c_srai.shamt, &s4, &s4_len, conf); - DO_MEMCPY5; - } break; - case RISCV_C_ANDI: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - s0 = "c.andi"; - s0_len = 6; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_andi.rsd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_signed_6(tree->ast_node.c_andi.imm, &s4, &s4_len, conf); - DO_MEMCPY5; - } break; - case RISCV_C_SUB: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "c.sub"; - s0_len = 5; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_sub.rsd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - creg_name(tree->ast_node.c_sub.rs2, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_C_XOR: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "c.xor"; - s0_len = 5; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_xor.rsd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - creg_name(tree->ast_node.c_xor.rs2, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_C_OR: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "c.or"; - s0_len = 4; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_or.rsd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - creg_name(tree->ast_node.c_or.rs2, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_C_AND: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "c.and"; - s0_len = 5; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_and.rsd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - creg_name(tree->ast_node.c_and.rs2, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_C_SUBW: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "c.subw"; - s0_len = 6; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_subw.rsd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - creg_name(tree->ast_node.c_subw.rs2, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_C_ADDW: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "c.addw"; - s0_len = 6; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_addw.rsd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - creg_name(tree->ast_node.c_addw.rs2, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_C_J: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - s0 = "c.j"; - s0_len = 3; - spc(&s1, &s1_len, conf); - hex_bits_signed_12(tree->ast_node.c_j << 1 | 0x0 << 0, &s2, &s2_len, conf); - DO_MEMCPY3; - } break; - case RISCV_C_BEQZ: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - s0 = "c.beqz"; - s0_len = 6; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_beqz.rs, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_signed_8(tree->ast_node.c_beqz.imm, &s4, &s4_len, conf); - DO_MEMCPY5; - } break; - case RISCV_C_BNEZ: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - s0 = "c.bnez"; - s0_len = 6; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_bnez.rs, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_signed_8(tree->ast_node.c_bnez.imm, &s4, &s4_len, conf); - DO_MEMCPY5; - } break; - case RISCV_C_SLLI: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - s0 = "c.slli"; - s0_len = 6; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.c_slli.rsd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_6(tree->ast_node.c_slli.shamt, &s4, &s4_len, conf); - DO_MEMCPY5; - } break; - case RISCV_C_LWSP: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - s0 = "c.lwsp"; - s0_len = 6; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.c_lwsp.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_6(tree->ast_node.c_lwsp.uimm, &s4, &s4_len, conf); - DO_MEMCPY5; - } break; - case RISCV_C_LDSP: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - s0 = "c.ldsp"; - s0_len = 6; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.c_ldsp.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_6(tree->ast_node.c_ldsp.uimm, &s4, &s4_len, conf); - DO_MEMCPY5; - } break; - case RISCV_C_SWSP: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - s0 = "c.swsp"; - s0_len = 6; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.c_swsp.rs2, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_6(tree->ast_node.c_swsp.uimm, &s4, &s4_len, conf); - DO_MEMCPY5; - } break; - case RISCV_C_SDSP: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - s0 = "c.sdsp"; - s0_len = 6; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.c_sdsp.rs2, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_6(tree->ast_node.c_sdsp.uimm, &s4, &s4_len, conf); - DO_MEMCPY5; - } break; - case RISCV_C_JR: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - s0 = "c.jr"; - s0_len = 4; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.c_jr, &s2, &s2_len); - DO_MEMCPY3; - } break; - case RISCV_C_JALR: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - s0 = "c.jalr"; - s0_len = 6; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.c_jalr, &s2, &s2_len); - DO_MEMCPY3; - } break; - case RISCV_C_MV: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "c.mv"; - s0_len = 4; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.c_mv.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.c_mv.rs2, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_C_EBREAK: { - char *s0 = ""; - size_t s0_len = 0; - s0 = "c.ebreak"; - s0_len = 8; - DO_MEMCPY1; - } break; - case RISCV_C_ADD: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "c.add"; - s0_len = 5; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.c_add.rsd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.c_add.rs2, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_MUL: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - if ((tree->ast_node.mul.mul_op.high == 1) && - (tree->ast_node.mul.mul_op.signed_rs1 == 1) && - (tree->ast_node.mul.mul_op.signed_rs2 == 1)) { - s0 = "mulh"; - s0_len = 4; - } else if ((tree->ast_node.mul.mul_op.high == 1) && - (tree->ast_node.mul.mul_op.signed_rs1 == 0) && - (tree->ast_node.mul.mul_op.signed_rs2 == 0)) { - s0 = "mulhu"; - s0_len = 5; - } else if ((tree->ast_node.mul.mul_op.high == 1) && - (tree->ast_node.mul.mul_op.signed_rs1 == 1) && - (tree->ast_node.mul.mul_op.signed_rs2 == 0)) { - s0 = "mulhsu"; - s0_len = 6; - } else if ((tree->ast_node.mul.mul_op.high == 0) && - (tree->ast_node.mul.mul_op.signed_rs1 == 1) && - (tree->ast_node.mul.mul_op.signed_rs2 == 1)) { - s0 = "mul"; - s0_len = 3; - } else - ; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.mul.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.mul.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.mul.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_DIV: { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char *s3 = ""; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char *s5 = ""; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - char *s7 = ""; - size_t s7_len = 0; - s0 = "div"; - s0_len = 3; - if (tree->ast_node.div.s) { - s1 = ""; - s1_len = 0; - } else { - s1 = "u"; - s1_len = 1; - } - spc(&s2, &s2_len, conf); - reg_name(tree->ast_node.div.rd, &s3, &s3_len); - sep(&s4, &s4_len, conf); - reg_name(tree->ast_node.div.rs1, &s5, &s5_len); - sep(&s6, &s6_len, conf); - reg_name(tree->ast_node.div.rs2, &s7, &s7_len); - DO_MEMCPY8; - } break; - case RISCV_REM: { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char *s3 = ""; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char *s5 = ""; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - char *s7 = ""; - size_t s7_len = 0; - s0 = "rem"; - s0_len = 3; - if (tree->ast_node.rem.s) { - s1 = ""; - s1_len = 0; - } else { - s1 = "u"; - s1_len = 1; - } - spc(&s2, &s2_len, conf); - reg_name(tree->ast_node.rem.rd, &s3, &s3_len); - sep(&s4, &s4_len, conf); - reg_name(tree->ast_node.rem.rs1, &s5, &s5_len); - sep(&s6, &s6_len, conf); - reg_name(tree->ast_node.rem.rs2, &s7, &s7_len); - DO_MEMCPY8; - } break; - case RISCV_MULW: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "mulw"; - s0_len = 4; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.mulw.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.mulw.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.mulw.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_DIVW: { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - s0 = "div"; - s0_len = 3; - if (tree->ast_node.divw.s) { - s1 = ""; - s1_len = 0; - } else { - s1 = "u"; - s1_len = 1; - } - s2 = "w"; - s2_len = 1; - spc(&s3, &s3_len, conf); - reg_name(tree->ast_node.divw.rd, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.divw.rs1, &s6, &s6_len); - sep(&s7, &s7_len, conf); - reg_name(tree->ast_node.divw.rs2, &s8, &s8_len); - DO_MEMCPY9; - } break; - case RISCV_REMW: { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - s0 = "rem"; - s0_len = 3; - if (tree->ast_node.remw.s) { - s1 = ""; - s1_len = 0; - } else { - s1 = "u"; - s1_len = 1; - } - s2 = "w"; - s2_len = 1; - spc(&s3, &s3_len, conf); - reg_name(tree->ast_node.remw.rd, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.remw.rs1, &s6, &s6_len); - sep(&s7, &s7_len, conf); - reg_name(tree->ast_node.remw.rs2, &s8, &s8_len); - DO_MEMCPY9; - } break; - case RISCV_CSR: { - if (tree->ast_node.csr.is_imm == RISCV_true) { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char *s3 = ""; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - csr_mnemonic(tree->ast_node.csr.op, &s0, &s0_len); - s1 = "i"; - s1_len = 1; - spc(&s2, &s2_len, conf); - reg_name(tree->ast_node.csr.rd, &s3, &s3_len); - sep(&s4, &s4_len, conf); - csr_name_map(tree->ast_node.csr.csr, &s5, &s5_len, conf); - sep(&s6, &s6_len, conf); - hex_bits_5(tree->ast_node.csr.rs1, &s7, &s7_len, conf); - DO_MEMCPY8; - } - if (tree->ast_node.csr.is_imm == RISCV_false) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - csr_mnemonic(tree->ast_node.csr.op, &s0, &s0_len); - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.csr.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - csr_name_map(tree->ast_node.csr.csr, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.csr.rs1, &s6, &s6_len); - DO_MEMCPY7; - } - } break; - case RISCV_C_NOP_HINT: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - s0 = "c.nop.hint."; - s0_len = 11; - hex_bits_6(tree->ast_node.c_nop_hint, &s1, &s1_len, conf); - DO_MEMCPY2; - } break; - case RISCV_C_ADDI_HINT: { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - s0 = "c.addi.hint."; - s0_len = 12; - reg_name(tree->ast_node.c_addi_hint, &s1, &s1_len); - DO_MEMCPY2; - } break; - case RISCV_C_LI_HINT: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - s0 = "c.li.hint."; - s0_len = 10; - hex_bits_6(tree->ast_node.c_li_hint, &s1, &s1_len, conf); - DO_MEMCPY2; - } break; - case RISCV_C_LUI_HINT: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - s0 = "c.lui.hint."; - s0_len = 11; - hex_bits_6(tree->ast_node.c_lui_hint, &s1, &s1_len, conf); - DO_MEMCPY2; - } break; - case RISCV_C_MV_HINT: { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - s0 = "c.mv.hint."; - s0_len = 10; - reg_name(tree->ast_node.c_mv_hint, &s1, &s1_len); - DO_MEMCPY2; - } break; - case RISCV_C_ADD_HINT: { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - s0 = "c.add.hint."; - s0_len = 11; - reg_name(tree->ast_node.c_add_hint, &s1, &s1_len); - DO_MEMCPY2; - } break; - case RISCV_C_SLLI_HINT: { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - s0 = "c.slli.hint."; - s0_len = 12; - reg_name(tree->ast_node.c_slli_hint.rsd, &s1, &s1_len); - s2 = "."; - s2_len = 1; - hex_bits_6(tree->ast_node.c_slli_hint.shamt, &s3, &s3_len, conf); - DO_MEMCPY4; - } break; - case RISCV_C_SRLI_HINT: { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - s0 = "c.srli.hint."; - s0_len = 12; - creg_name(tree->ast_node.c_srli_hint, &s1, &s1_len); - DO_MEMCPY2; - } break; - case RISCV_C_SRAI_HINT: { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - s0 = "c.srai.hint."; - s0_len = 12; - creg_name(tree->ast_node.c_srai_hint, &s1, &s1_len); - DO_MEMCPY2; - } break; - case RISCV_FENCE_RESERVED: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char *s5 = ""; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char *s7 = ""; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - char s9_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s9 = s9_buffer; - size_t s9_len = 0; - s0 = "fence.reserved."; - s0_len = 15; - fence_bits(tree->ast_node.fence_reserved.pred, &s1, &s1_len, conf); - s2 = "."; - s2_len = 1; - fence_bits(tree->ast_node.fence_reserved.succ, &s3, &s3_len, conf); - s4 = "."; - s4_len = 1; - reg_name(tree->ast_node.fence_reserved.rs, &s5, &s5_len); - s6 = "."; - s6_len = 1; - reg_name(tree->ast_node.fence_reserved.rd, &s7, &s7_len); - s8 = "."; - s8_len = 1; - hex_bits_4(tree->ast_node.fence_reserved.fm, &s9, &s9_len, conf); - DO_MEMCPY10; - } break; - case RISCV_FENCEI_RESERVED: { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char *s3 = ""; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - s0 = "fence.i.reserved."; - s0_len = 17; - reg_name(tree->ast_node.fencei_reserved.rd, &s1, &s1_len); - s2 = "."; - s2_len = 1; - reg_name(tree->ast_node.fencei_reserved.rs, &s3, &s3_len); - s4 = "."; - s4_len = 1; - hex_bits_12(tree->ast_node.fencei_reserved.imm, &s5, &s5_len, conf); - DO_MEMCPY6; - } break; - case RISCV_LOAD_FP: { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - char *s7 = ""; - size_t s7_len = 0; - char s8_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s8 = s8_buffer; - size_t s8_len = 0; - char *s9 = ""; - size_t s9_len = 0; - char s10_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s10 = s10_buffer; - size_t s10_len = 0; - char *s11 = ""; - size_t s11_len = 0; - s0 = "fl"; - s0_len = 2; - size_mnemonic(tree->ast_node.load_fp.width, &s1, &s1_len); - spc(&s2, &s2_len, conf); - freg_or_reg_name(tree->ast_node.load_fp.rd, &s3, &s3_len, conf); - sep(&s4, &s4_len, conf); - hex_bits_signed_12(tree->ast_node.load_fp.imm, &s5, &s5_len, conf); - opt_spc(&s6, &s6_len, conf); - s7 = "("; - s7_len = 1; - opt_spc(&s8, &s8_len, conf); - reg_name(tree->ast_node.load_fp.rs1, &s9, &s9_len); - opt_spc(&s10, &s10_len, conf); - s11 = ")"; - s11_len = 1; - DO_MEMCPY12; - } break; - case RISCV_STORE_FP: { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char *s3 = ""; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - char *s7 = ""; - size_t s7_len = 0; - char s8_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s8 = s8_buffer; - size_t s8_len = 0; - char *s9 = ""; - size_t s9_len = 0; - char s10_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s10 = s10_buffer; - size_t s10_len = 0; - char *s11 = ""; - size_t s11_len = 0; - s0 = "fs"; - s0_len = 2; - size_mnemonic(tree->ast_node.store_fp.width, &s1, &s1_len); - spc(&s2, &s2_len, conf); - freg_name(tree->ast_node.store_fp.rs2, &s3, &s3_len); - sep(&s4, &s4_len, conf); - hex_bits_signed_12(tree->ast_node.store_fp.imm, &s5, &s5_len, conf); - opt_spc(&s6, &s6_len, conf); - s7 = "("; - s7_len = 1; - opt_spc(&s8, &s8_len, conf); - reg_name(tree->ast_node.store_fp.rs1, &s9, &s9_len); - opt_spc(&s10, &s10_len, conf); - s11 = ")"; - s11_len = 1; - DO_MEMCPY12; - } break; - case RISCV_F_MADD_TYPE_S: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char s8_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s8 = s8_buffer; - size_t s8_len = 0; - char s9_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s9 = s9_buffer; - size_t s9_len = 0; - char *s10 = ""; - size_t s10_len = 0; - f_madd_type_mnemonic_S(tree->ast_node.f_madd_type_s.op, &s0, &s0_len); - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_madd_type_s.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_madd_type_s.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - freg_or_reg_name(tree->ast_node.f_madd_type_s.rs2, &s6, &s6_len, conf); - sep(&s7, &s7_len, conf); - freg_or_reg_name(tree->ast_node.f_madd_type_s.rs3, &s8, &s8_len, conf); - sep(&s9, &s9_len, conf); - frm_mnemonic(tree->ast_node.f_madd_type_s.rm, &s10, &s10_len); - DO_MEMCPY11; - } break; - case RISCV_F_BIN_RM_TYPE_S: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - f_bin_rm_type_mnemonic_S(tree->ast_node.f_bin_rm_type_s.op, &s0, &s0_len); - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_rm_type_s.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_rm_type_s.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_rm_type_s.rs2, &s6, &s6_len, conf); - sep(&s7, &s7_len, conf); - frm_mnemonic(tree->ast_node.f_bin_rm_type_s.rm, &s8, &s8_len); - DO_MEMCPY9; - } break; - case RISCV_F_UN_RM_TYPE_S: { - if (tree->ast_node.f_un_rm_type_s.fcvt_s_lu == RISCV_FSQRT_S) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fsqrt.s"; - s0_len = 7; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_s.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_s.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_s.rm, &s6, &s6_len); - DO_MEMCPY7; - } - if (tree->ast_node.f_un_rm_type_s.fcvt_s_lu == RISCV_FCVT_W_S) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fcvt.w.s"; - s0_len = 8; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.f_un_rm_type_s.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_s.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_s.rm, &s6, &s6_len); - DO_MEMCPY7; - } - if (tree->ast_node.f_un_rm_type_s.fcvt_s_lu == RISCV_FCVT_WU_S) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fcvt.wu.s"; - s0_len = 9; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.f_un_rm_type_s.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_s.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_s.rm, &s6, &s6_len); - DO_MEMCPY7; - } - if (tree->ast_node.f_un_rm_type_s.fcvt_s_lu == RISCV_FCVT_S_W) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fcvt.s.w"; - s0_len = 8; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_s.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.f_un_rm_type_s.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_s.rm, &s6, &s6_len); - DO_MEMCPY7; - } - if (tree->ast_node.f_un_rm_type_s.fcvt_s_lu == RISCV_FCVT_S_WU) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fcvt.s.wu"; - s0_len = 9; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_s.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.f_un_rm_type_s.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_s.rm, &s6, &s6_len); - DO_MEMCPY7; - } - if (tree->ast_node.f_un_rm_type_s.fcvt_s_lu == RISCV_FCVT_L_S) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fcvt.l.s"; - s0_len = 8; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.f_un_rm_type_s.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_s.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_s.rm, &s6, &s6_len); - DO_MEMCPY7; - } - if (tree->ast_node.f_un_rm_type_s.fcvt_s_lu == RISCV_FCVT_LU_S) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fcvt.lu.s"; - s0_len = 9; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.f_un_rm_type_s.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_s.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_s.rm, &s6, &s6_len); - DO_MEMCPY7; - } - if (tree->ast_node.f_un_rm_type_s.fcvt_s_lu == RISCV_FCVT_S_L) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fcvt.s.l"; - s0_len = 8; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_s.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.f_un_rm_type_s.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_s.rm, &s6, &s6_len); - DO_MEMCPY7; - } - if (tree->ast_node.f_un_rm_type_s.fcvt_s_lu == RISCV_FCVT_S_LU) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fcvt.s.lu"; - s0_len = 9; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_s.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.f_un_rm_type_s.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_s.rm, &s6, &s6_len); - DO_MEMCPY7; - } - } break; - case RISCV_F_BIN_TYPE_S: { - if (tree->ast_node.f_bin_type_s.fle_s == RISCV_FSGNJ_S) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "fsgnj.s"; - s0_len = 7; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs2, &s6, &s6_len, conf); - DO_MEMCPY7; - } - if (tree->ast_node.f_bin_type_s.fle_s == RISCV_FSGNJN_S) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "fsgnjn.s"; - s0_len = 8; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs2, &s6, &s6_len, conf); - DO_MEMCPY7; - } - if (tree->ast_node.f_bin_type_s.fle_s == RISCV_FSGNJX_S) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "fsgnjx.s"; - s0_len = 8; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs2, &s6, &s6_len, conf); - DO_MEMCPY7; - } - if (tree->ast_node.f_bin_type_s.fle_s == RISCV_FMIN_S) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "fmin.s"; - s0_len = 6; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs2, &s6, &s6_len, conf); - DO_MEMCPY7; - } - if (tree->ast_node.f_bin_type_s.fle_s == RISCV_FMAX_S) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "fmax.s"; - s0_len = 6; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs2, &s6, &s6_len, conf); - DO_MEMCPY7; - } - if (tree->ast_node.f_bin_type_s.fle_s == RISCV_FEQ_S) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "feq.s"; - s0_len = 5; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.f_bin_type_s.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs2, &s6, &s6_len, conf); - DO_MEMCPY7; - } - if (tree->ast_node.f_bin_type_s.fle_s == RISCV_FLT_S) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "flt.s"; - s0_len = 5; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.f_bin_type_s.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs2, &s6, &s6_len, conf); - DO_MEMCPY7; - } - if (tree->ast_node.f_bin_type_s.fle_s == RISCV_FLE_S) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "fle.s"; - s0_len = 5; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.f_bin_type_s.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs2, &s6, &s6_len, conf); - DO_MEMCPY7; - } - } break; - case RISCV_F_UN_TYPE_S: { - if (tree->ast_node.f_un_type_s.fmv_w_x == RISCV_FMV_X_W) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "fmv.x.w"; - s0_len = 7; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.f_un_type_s.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_name(tree->ast_node.f_un_type_s.rs1, &s4, &s4_len); - DO_MEMCPY5; - } - if (tree->ast_node.f_un_type_s.fmv_w_x == RISCV_FMV_W_X) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "fmv.w.x"; - s0_len = 7; - spc(&s1, &s1_len, conf); - freg_name(tree->ast_node.f_un_type_s.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.f_un_type_s.rs1, &s4, &s4_len); - DO_MEMCPY5; - } - if (tree->ast_node.f_un_type_s.fmv_w_x == RISCV_FCLASS_S) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - s0 = "fclass.s"; - s0_len = 8; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.f_un_type_s.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_un_type_s.rs1, &s4, &s4_len, conf); - DO_MEMCPY5; - } - } break; - case RISCV_C_FLWSP: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - s0 = "c.flwsp"; - s0_len = 7; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.c_flwsp.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_6(tree->ast_node.c_flwsp.imm, &s4, &s4_len, conf); - DO_MEMCPY5; - } break; - case RISCV_C_FSWSP: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - s0 = "c.fswsp"; - s0_len = 7; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.c_fswsp.rs2, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_6(tree->ast_node.c_fswsp.uimm, &s4, &s4_len, conf); - DO_MEMCPY5; - } break; - case RISCV_C_FLW: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "c.flw"; - s0_len = 5; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_flw.rdc, &s2, &s2_len); - sep(&s3, &s3_len, conf); - creg_name(tree->ast_node.c_flw.rsc, &s4, &s4_len); - sep(&s5, &s5_len, conf); - hex_bits_7(tree->ast_node.c_flw.uimm << 2 | 0x0 << 0, &s6, &s6_len, conf); - DO_MEMCPY7; - } break; - case RISCV_C_FSW: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "c.fsw"; - s0_len = 5; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_fsw.rsc1, &s2, &s2_len); - sep(&s3, &s3_len, conf); - creg_name(tree->ast_node.c_fsw.rsc2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - hex_bits_7(tree->ast_node.c_fsw.uimm << 2 | 0x0 << 0, &s6, &s6_len, conf); - DO_MEMCPY7; - } break; - case RISCV_F_MADD_TYPE_D: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char s8_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s8 = s8_buffer; - size_t s8_len = 0; - char s9_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s9 = s9_buffer; - size_t s9_len = 0; - char *s10 = ""; - size_t s10_len = 0; - f_madd_type_mnemonic_D(tree->ast_node.f_madd_type_d.op, &s0, &s0_len); - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_madd_type_d.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_madd_type_d.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - freg_or_reg_name(tree->ast_node.f_madd_type_d.rs2, &s6, &s6_len, conf); - sep(&s7, &s7_len, conf); - freg_or_reg_name(tree->ast_node.f_madd_type_d.rs3, &s8, &s8_len, conf); - sep(&s9, &s9_len, conf); - frm_mnemonic(tree->ast_node.f_madd_type_d.rm, &s10, &s10_len); - DO_MEMCPY11; - } break; - case RISCV_F_BIN_RM_TYPE_D: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - f_bin_rm_type_mnemonic_D(tree->ast_node.f_bin_rm_type_d.op, &s0, &s0_len); - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_rm_type_d.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_rm_type_d.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_rm_type_d.rs2, &s6, &s6_len, conf); - sep(&s7, &s7_len, conf); - frm_mnemonic(tree->ast_node.f_bin_rm_type_d.rm, &s8, &s8_len); - DO_MEMCPY9; - } break; - case RISCV_F_UN_RM_TYPE_D: { - if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FSQRT_D) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fsqrt.d"; - s0_len = 7; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_d.rm, &s6, &s6_len); - DO_MEMCPY7; - } - if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FCVT_W_D) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fcvt.w.d"; - s0_len = 8; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.f_un_rm_type_d.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_d.rm, &s6, &s6_len); - DO_MEMCPY7; - } - if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FCVT_WU_D) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fcvt.wu.d"; - s0_len = 9; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.f_un_rm_type_d.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_d.rm, &s6, &s6_len); - DO_MEMCPY7; - } - if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FCVT_D_W) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fcvt.d.w"; - s0_len = 8; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.f_un_rm_type_d.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_d.rm, &s6, &s6_len); - DO_MEMCPY7; - } - if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FCVT_D_WU) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fcvt.d.wu"; - s0_len = 9; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.f_un_rm_type_d.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_d.rm, &s6, &s6_len); - DO_MEMCPY7; - } - if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FCVT_L_D) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fcvt.l.d"; - s0_len = 8; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.f_un_rm_type_d.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_d.rm, &s6, &s6_len); - DO_MEMCPY7; - } - if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FCVT_LU_D) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fcvt.lu.d"; - s0_len = 9; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.f_un_rm_type_d.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_d.rm, &s6, &s6_len); - DO_MEMCPY7; - } - if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FCVT_D_L) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fcvt.d.l"; - s0_len = 8; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.f_un_rm_type_d.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_d.rm, &s6, &s6_len); - DO_MEMCPY7; - } - if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FCVT_D_LU) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fcvt.d.lu"; - s0_len = 9; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.f_un_rm_type_d.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_d.rm, &s6, &s6_len); - DO_MEMCPY7; - } - if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FCVT_S_D) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fcvt.s.d"; - s0_len = 8; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_d.rm, &s6, &s6_len); - DO_MEMCPY7; - } - if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FCVT_D_S) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fcvt.d.s"; - s0_len = 8; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_d.rm, &s6, &s6_len); - DO_MEMCPY7; - } - } break; - case RISCV_F_BIN_TYPE_D: { - if (tree->ast_node.f_bin_type_d.fle_d == RISCV_FSGNJ_D) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "fsgnj.d"; - s0_len = 7; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs2, &s6, &s6_len, conf); - DO_MEMCPY7; - } - if (tree->ast_node.f_bin_type_d.fle_d == RISCV_FSGNJN_D) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "fsgnjn.d"; - s0_len = 8; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs2, &s6, &s6_len, conf); - DO_MEMCPY7; - } - if (tree->ast_node.f_bin_type_d.fle_d == RISCV_FSGNJX_D) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "fsgnjx.d"; - s0_len = 8; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs2, &s6, &s6_len, conf); - DO_MEMCPY7; - } - if (tree->ast_node.f_bin_type_d.fle_d == RISCV_FMIN_D) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "fmin.d"; - s0_len = 6; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs2, &s6, &s6_len, conf); - DO_MEMCPY7; - } - if (tree->ast_node.f_bin_type_d.fle_d == RISCV_FMAX_D) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "fmax.d"; - s0_len = 6; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs2, &s6, &s6_len, conf); - DO_MEMCPY7; - } - if (tree->ast_node.f_bin_type_d.fle_d == RISCV_FEQ_D) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "feq.d"; - s0_len = 5; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.f_bin_type_d.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs2, &s6, &s6_len, conf); - DO_MEMCPY7; - } - if (tree->ast_node.f_bin_type_d.fle_d == RISCV_FLT_D) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "flt.d"; - s0_len = 5; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.f_bin_type_d.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs2, &s6, &s6_len, conf); - DO_MEMCPY7; - } - if (tree->ast_node.f_bin_type_d.fle_d == RISCV_FLE_D) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "fle.d"; - s0_len = 5; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.f_bin_type_d.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs2, &s6, &s6_len, conf); - DO_MEMCPY7; - } - } break; - case RISCV_F_UN_TYPE_D: { - if (tree->ast_node.f_un_type_d.fmv_d_x == RISCV_FMV_X_D) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "fmv.x.d"; - s0_len = 7; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.f_un_type_d.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_name(tree->ast_node.f_un_type_d.rs1, &s4, &s4_len); - DO_MEMCPY5; - } - if (tree->ast_node.f_un_type_d.fmv_d_x == RISCV_FMV_D_X) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "fmv.d.x"; - s0_len = 7; - spc(&s1, &s1_len, conf); - freg_name(tree->ast_node.f_un_type_d.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.f_un_type_d.rs1, &s4, &s4_len); - DO_MEMCPY5; - } - if (tree->ast_node.f_un_type_d.fmv_d_x == RISCV_FCLASS_D) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - s0 = "fclass.d"; - s0_len = 8; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.f_un_type_d.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_un_type_d.rs1, &s4, &s4_len, conf); - DO_MEMCPY5; - } - } break; - case RISCV_C_FLDSP: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - s0 = "c.fldsp"; - s0_len = 7; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.c_fldsp.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_6(tree->ast_node.c_fldsp.uimm, &s4, &s4_len, conf); - DO_MEMCPY5; - } break; - case RISCV_C_FSDSP: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - s0 = "c.fsdsp"; - s0_len = 7; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.c_fsdsp.rs2, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_6(tree->ast_node.c_fsdsp.uimm, &s4, &s4_len, conf); - DO_MEMCPY5; - } break; - case RISCV_C_FLD: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "c.fld"; - s0_len = 5; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_fld.rdc, &s2, &s2_len); - sep(&s3, &s3_len, conf); - creg_name(tree->ast_node.c_fld.rsc, &s4, &s4_len); - sep(&s5, &s5_len, conf); - hex_bits_8(tree->ast_node.c_fld.uimm << 3 | 0x0 << 0, &s6, &s6_len, conf); - DO_MEMCPY7; - } break; - case RISCV_C_FSD: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "c.fsd"; - s0_len = 5; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_fsd.rsc1, &s2, &s2_len); - sep(&s3, &s3_len, conf); - creg_name(tree->ast_node.c_fsd.rsc2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - hex_bits_8(tree->ast_node.c_fsd.uimm << 3 | 0x0 << 0, &s6, &s6_len, conf); - DO_MEMCPY7; - } break; - case RISCV_SINVAL_VMA: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "sinval.vma"; - s0_len = 10; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.sinval_vma.rs1, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.sinval_vma.rs2, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_SFENCE_W_INVAL: { - char *s0 = ""; - size_t s0_len = 0; - s0 = "sfence.w.inval"; - s0_len = 14; - DO_MEMCPY1; - } break; - case RISCV_SFENCE_INVAL_IR: { - char *s0 = ""; - size_t s0_len = 0; - s0 = "sfence.inval.ir"; - s0_len = 15; - DO_MEMCPY1; - } break; - case RISCV_SLLIUW: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "slli.uw"; - s0_len = 7; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.riscv_slliuw.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.riscv_slliuw.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - hex_bits_6(tree->ast_node.riscv_slliuw.shamt, &s6, &s6_len, conf); - DO_MEMCPY7; - } break; - case RISCV_ZBA_RTYPEUW: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - zba_rtypeuw_mnemonic(tree->ast_node.zba_rtypeuw.op, &s0, &s0_len); - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.zba_rtypeuw.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.zba_rtypeuw.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.zba_rtypeuw.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_ZBA_RTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - zba_rtype_mnemonic(tree->ast_node.zba_rtype.op, &s0, &s0_len); - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.zba_rtype.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.zba_rtype.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.zba_rtype.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_RORIW: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "roriw"; - s0_len = 5; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.riscv_roriw.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.riscv_roriw.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - hex_bits_5(tree->ast_node.riscv_roriw.shamt, &s6, &s6_len, conf); - DO_MEMCPY7; - } break; - case RISCV_RORI: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "rori"; - s0_len = 4; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.riscv_rori.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.riscv_rori.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - hex_bits_6(tree->ast_node.riscv_rori.shamt, &s6, &s6_len, conf); - DO_MEMCPY7; - } break; - case RISCV_ZBB_RTYPEW: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - zbb_rtypew_mnemonic(tree->ast_node.zbb_rtypew.op, &s0, &s0_len); - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.zbb_rtypew.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.zbb_rtypew.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.zbb_rtypew.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_ZBB_RTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - zbb_rtype_mnemonic(tree->ast_node.zbb_rtype.op, &s0, &s0_len); - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.zbb_rtype.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.zbb_rtype.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.zbb_rtype.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_ZBB_EXTOP: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - zbb_extop_mnemonic(tree->ast_node.zbb_extop.op, &s0, &s0_len); - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.zbb_extop.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.zbb_extop.rs1, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_REV8: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "rev8"; - s0_len = 4; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.riscv_rev8.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.riscv_rev8.rs1, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_ORCB: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "orc.b"; - s0_len = 5; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.riscv_orcb.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.riscv_orcb.rs1, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_CPOP: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "cpop"; - s0_len = 4; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.riscv_cpop.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.riscv_cpop.rs1, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_CPOPW: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "cpopw"; - s0_len = 5; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.riscv_cpopw.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.riscv_cpopw.rs1, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_CLZ: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "clz"; - s0_len = 3; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.riscv_clz.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.riscv_clz.rs1, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_CLZW: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "clzw"; - s0_len = 4; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.riscv_clzw.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.riscv_clzw.rs1, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_CTZ: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "ctz"; - s0_len = 3; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.riscv_ctz.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.riscv_ctz.rs1, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_CTZW: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "ctzw"; - s0_len = 4; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.riscv_ctzw.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.riscv_ctzw.rs1, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_CLMUL: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "clmul"; - s0_len = 5; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.riscv_clmul.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.riscv_clmul.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.riscv_clmul.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_CLMULH: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "clmulh"; - s0_len = 6; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.riscv_clmulh.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.riscv_clmulh.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.riscv_clmulh.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_CLMULR: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "clmulr"; - s0_len = 6; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.riscv_clmulr.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.riscv_clmulr.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.riscv_clmulr.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_ZBS_IOP: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - zbs_iop_mnemonic(tree->ast_node.zbs_iop.op, &s0, &s0_len); - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.zbs_iop.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.zbs_iop.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - hex_bits_6(tree->ast_node.zbs_iop.shamt, &s6, &s6_len, conf); - DO_MEMCPY7; - } break; - case RISCV_ZBS_RTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - zbs_rtype_mnemonic(tree->ast_node.zbs_rtype.op, &s0, &s0_len); - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.zbs_rtype.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.zbs_rtype.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.zbs_rtype.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_C_LBU: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - char s9_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s9 = s9_buffer; - size_t s9_len = 0; - char *s10 = ""; - size_t s10_len = 0; - s0 = "c.lbu"; - s0_len = 5; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_lbu.rdc, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_2(tree->ast_node.c_lbu.uimm, &s4, &s4_len, conf); - opt_spc(&s5, &s5_len, conf); - s6 = "("; - s6_len = 1; - opt_spc(&s7, &s7_len, conf); - creg_name(tree->ast_node.c_lbu.rs1c, &s8, &s8_len); - opt_spc(&s9, &s9_len, conf); - s10 = ")"; - s10_len = 1; - DO_MEMCPY11; - } break; - case RISCV_C_LHU: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - char s9_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s9 = s9_buffer; - size_t s9_len = 0; - char *s10 = ""; - size_t s10_len = 0; - s0 = "c.lhu"; - s0_len = 5; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_lhu.rdc, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_2(tree->ast_node.c_lhu.uimm, &s4, &s4_len, conf); - opt_spc(&s5, &s5_len, conf); - s6 = "("; - s6_len = 1; - opt_spc(&s7, &s7_len, conf); - creg_name(tree->ast_node.c_lhu.rs1c, &s8, &s8_len); - opt_spc(&s9, &s9_len, conf); - s10 = ")"; - s10_len = 1; - DO_MEMCPY11; - } break; - case RISCV_C_LH: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - char s9_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s9 = s9_buffer; - size_t s9_len = 0; - char *s10 = ""; - size_t s10_len = 0; - s0 = "c.lh"; - s0_len = 4; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_lh.rdc, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_2(tree->ast_node.c_lh.uimm, &s4, &s4_len, conf); - opt_spc(&s5, &s5_len, conf); - s6 = "("; - s6_len = 1; - opt_spc(&s7, &s7_len, conf); - creg_name(tree->ast_node.c_lh.rs1c, &s8, &s8_len); - opt_spc(&s9, &s9_len, conf); - s10 = ")"; - s10_len = 1; - DO_MEMCPY11; - } break; - case RISCV_C_SB: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - char s9_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s9 = s9_buffer; - size_t s9_len = 0; - char *s10 = ""; - size_t s10_len = 0; - s0 = "c.sb"; - s0_len = 4; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_sb.rs2c, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_2(tree->ast_node.c_sb.uimm, &s4, &s4_len, conf); - opt_spc(&s5, &s5_len, conf); - s6 = "("; - s6_len = 1; - opt_spc(&s7, &s7_len, conf); - creg_name(tree->ast_node.c_sb.rs1c, &s8, &s8_len); - opt_spc(&s9, &s9_len, conf); - s10 = ")"; - s10_len = 1; - DO_MEMCPY11; - } break; - case RISCV_C_SH: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - char s9_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s9 = s9_buffer; - size_t s9_len = 0; - char *s10 = ""; - size_t s10_len = 0; - s0 = "c.sh"; - s0_len = 4; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_sh.rs1c, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_2(tree->ast_node.c_sh.uimm, &s4, &s4_len, conf); - opt_spc(&s5, &s5_len, conf); - s6 = "("; - s6_len = 1; - opt_spc(&s7, &s7_len, conf); - creg_name(tree->ast_node.c_sh.rs2c, &s8, &s8_len); - opt_spc(&s9, &s9_len, conf); - s10 = ")"; - s10_len = 1; - DO_MEMCPY11; - } break; - case RISCV_C_ZEXT_B: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - s0 = "c.zext.b"; - s0_len = 8; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_zext_b, &s2, &s2_len); - DO_MEMCPY3; - } break; - case RISCV_C_SEXT_B: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - s0 = "c.sext.b"; - s0_len = 8; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_sext_b, &s2, &s2_len); - DO_MEMCPY3; - } break; - case RISCV_C_ZEXT_H: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - s0 = "c.zext.h"; - s0_len = 8; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_zext_h, &s2, &s2_len); - DO_MEMCPY3; - } break; - case RISCV_C_SEXT_H: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - s0 = "c.sext.h"; - s0_len = 8; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_sext_h, &s2, &s2_len); - DO_MEMCPY3; - } break; - case RISCV_C_ZEXT_W: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - s0 = "c.zext.w"; - s0_len = 8; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_zext_w, &s2, &s2_len); - DO_MEMCPY3; - } break; - case RISCV_C_NOT: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - s0 = "c.not"; - s0_len = 5; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_not, &s2, &s2_len); - DO_MEMCPY3; - } break; - case RISCV_C_MUL: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "c.mul"; - s0_len = 5; - spc(&s1, &s1_len, conf); - creg_name(tree->ast_node.c_mul.rsdc, &s2, &s2_len); - sep(&s3, &s3_len, conf); - creg_name(tree->ast_node.c_mul.rs2c, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_F_BIN_RM_TYPE_H: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - f_bin_rm_type_mnemonic_H(tree->ast_node.f_bin_rm_type_h.op, &s0, &s0_len); - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_rm_type_h.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_rm_type_h.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_rm_type_h.rs2, &s6, &s6_len, conf); - sep(&s7, &s7_len, conf); - frm_mnemonic(tree->ast_node.f_bin_rm_type_h.rm, &s8, &s8_len); - DO_MEMCPY9; - } break; - case RISCV_F_MADD_TYPE_H: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char s8_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s8 = s8_buffer; - size_t s8_len = 0; - char s9_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s9 = s9_buffer; - size_t s9_len = 0; - char *s10 = ""; - size_t s10_len = 0; - f_madd_type_mnemonic_H(tree->ast_node.f_madd_type_h.op, &s0, &s0_len); - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_madd_type_h.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_madd_type_h.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - freg_or_reg_name(tree->ast_node.f_madd_type_h.rs2, &s6, &s6_len, conf); - sep(&s7, &s7_len, conf); - freg_or_reg_name(tree->ast_node.f_madd_type_h.rs3, &s8, &s8_len, conf); - sep(&s9, &s9_len, conf); - frm_mnemonic(tree->ast_node.f_madd_type_h.rm, &s10, &s10_len); - DO_MEMCPY11; - } break; - case RISCV_F_BIN_TYPE_H: { - if (tree->ast_node.f_bin_type_h.fle_h == RISCV_FSGNJ_H) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "fsgnj.h"; - s0_len = 7; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs2, &s6, &s6_len, conf); - DO_MEMCPY7; - } - if (tree->ast_node.f_bin_type_h.fle_h == RISCV_FSGNJN_H) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "fsgnjn.h"; - s0_len = 8; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs2, &s6, &s6_len, conf); - DO_MEMCPY7; - } - if (tree->ast_node.f_bin_type_h.fle_h == RISCV_FSGNJX_H) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "fsgnjx.h"; - s0_len = 8; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs2, &s6, &s6_len, conf); - DO_MEMCPY7; - } - if (tree->ast_node.f_bin_type_h.fle_h == RISCV_FMIN_H) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "fmin.h"; - s0_len = 6; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs2, &s6, &s6_len, conf); - DO_MEMCPY7; - } - if (tree->ast_node.f_bin_type_h.fle_h == RISCV_FMAX_H) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "fmax.h"; - s0_len = 6; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs2, &s6, &s6_len, conf); - DO_MEMCPY7; - } - if (tree->ast_node.f_bin_type_h.fle_h == RISCV_FEQ_H) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "feq.h"; - s0_len = 5; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.f_bin_type_h.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs2, &s6, &s6_len, conf); - DO_MEMCPY7; - } - if (tree->ast_node.f_bin_type_h.fle_h == RISCV_FLT_H) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "flt.h"; - s0_len = 5; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.f_bin_type_h.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs2, &s6, &s6_len, conf); - DO_MEMCPY7; - } - if (tree->ast_node.f_bin_type_h.fle_h == RISCV_FLE_H) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "fle.h"; - s0_len = 5; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.f_bin_type_h.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs2, &s6, &s6_len, conf); - DO_MEMCPY7; - } - } break; - case RISCV_F_UN_RM_TYPE_H: { - if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FSQRT_H) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fsqrt.h"; - s0_len = 7; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_h.rm, &s6, &s6_len); - DO_MEMCPY7; - } - if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_W_H) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fcvt.w.h"; - s0_len = 8; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.f_un_rm_type_h.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_h.rm, &s6, &s6_len); - DO_MEMCPY7; - } - if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_WU_H) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fcvt.wu.h"; - s0_len = 9; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.f_un_rm_type_h.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_h.rm, &s6, &s6_len); - DO_MEMCPY7; - } - if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_H_W) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fcvt.h.w"; - s0_len = 8; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.f_un_rm_type_h.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_h.rm, &s6, &s6_len); - DO_MEMCPY7; - } - if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_H_WU) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fcvt.h.wu"; - s0_len = 9; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.f_un_rm_type_h.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_h.rm, &s6, &s6_len); - DO_MEMCPY7; - } - if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_L_H) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fcvt.l.h"; - s0_len = 8; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.f_un_rm_type_h.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_h.rm, &s6, &s6_len); - DO_MEMCPY7; - } - if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_LU_H) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fcvt.lu.h"; - s0_len = 9; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.f_un_rm_type_h.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_h.rm, &s6, &s6_len); - DO_MEMCPY7; - } - if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_H_L) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fcvt.h.l"; - s0_len = 8; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.f_un_rm_type_h.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_h.rm, &s6, &s6_len); - DO_MEMCPY7; - } - if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_H_LU) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fcvt.h.lu"; - s0_len = 9; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.f_un_rm_type_h.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_h.rm, &s6, &s6_len); - DO_MEMCPY7; - } - if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_H_S) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fcvt.h.s"; - s0_len = 8; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_h.rm, &s6, &s6_len); - DO_MEMCPY7; - } - if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_H_D) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fcvt.h.d"; - s0_len = 8; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_h.rm, &s6, &s6_len); - DO_MEMCPY7; - } - if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_S_H) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fcvt.s.h"; - s0_len = 8; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_h.rm, &s6, &s6_len); - DO_MEMCPY7; - } - if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_D_H) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fcvt.d.h"; - s0_len = 8; - spc(&s1, &s1_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rd, &s2, &s2_len, conf); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rs1, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.f_un_rm_type_h.rm, &s6, &s6_len); - DO_MEMCPY7; - } - } break; - case RISCV_F_UN_TYPE_H: { - if (tree->ast_node.f_un_type_h.fmv_h_x == RISCV_FMV_X_H) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "fmv.x.h"; - s0_len = 7; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.f_un_type_h.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_name(tree->ast_node.f_un_type_h.rs1, &s4, &s4_len); - DO_MEMCPY5; - } - if (tree->ast_node.f_un_type_h.fmv_h_x == RISCV_FMV_H_X) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "fmv.h.x"; - s0_len = 7; - spc(&s1, &s1_len, conf); - freg_name(tree->ast_node.f_un_type_h.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.f_un_type_h.rs1, &s4, &s4_len); - DO_MEMCPY5; - } - if (tree->ast_node.f_un_type_h.fmv_h_x == RISCV_FCLASS_H) { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - s0 = "fclass.h"; - s0_len = 8; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.f_un_type_h.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_or_reg_name(tree->ast_node.f_un_type_h.rs1, &s4, &s4_len, conf); - DO_MEMCPY5; - } - } break; - case RISCV_FLI_H: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - s0 = "fli.h"; - s0_len = 5; - spc(&s1, &s1_len, conf); - freg_name(tree->ast_node.riscv_fli_h.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_5(tree->ast_node.riscv_fli_h.constantidx, &s4, &s4_len, conf); - DO_MEMCPY5; - } break; - case RISCV_FLI_S: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - s0 = "fli.s"; - s0_len = 5; - spc(&s1, &s1_len, conf); - freg_name(tree->ast_node.riscv_fli_s.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_5(tree->ast_node.riscv_fli_s.constantidx, &s4, &s4_len, conf); - DO_MEMCPY5; - } break; - case RISCV_FLI_D: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - s0 = "fli.d"; - s0_len = 5; - spc(&s1, &s1_len, conf); - freg_name(tree->ast_node.riscv_fli_d.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_5(tree->ast_node.riscv_fli_d.constantidx, &s4, &s4_len, conf); - DO_MEMCPY5; - } break; - case RISCV_FMINM_H: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fminm.h"; - s0_len = 7; - spc(&s1, &s1_len, conf); - freg_name(tree->ast_node.riscv_fminm_h.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_name(tree->ast_node.riscv_fminm_h.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - freg_name(tree->ast_node.riscv_fminm_h.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_FMAXM_H: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fmaxm.h"; - s0_len = 7; - spc(&s1, &s1_len, conf); - freg_name(tree->ast_node.riscv_fmaxm_h.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_name(tree->ast_node.riscv_fmaxm_h.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - freg_name(tree->ast_node.riscv_fmaxm_h.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_FMINM_S: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fminm.s"; - s0_len = 7; - spc(&s1, &s1_len, conf); - freg_name(tree->ast_node.riscv_fminm_s.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_name(tree->ast_node.riscv_fminm_s.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - freg_name(tree->ast_node.riscv_fminm_s.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_FMAXM_S: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fmaxm.s"; - s0_len = 7; - spc(&s1, &s1_len, conf); - freg_name(tree->ast_node.riscv_fmaxm_s.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_name(tree->ast_node.riscv_fmaxm_s.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - freg_name(tree->ast_node.riscv_fmaxm_s.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_FMINM_D: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fminm.d"; - s0_len = 7; - spc(&s1, &s1_len, conf); - freg_name(tree->ast_node.riscv_fminm_d.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_name(tree->ast_node.riscv_fminm_d.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - freg_name(tree->ast_node.riscv_fminm_d.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_FMAXM_D: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fmaxm.d"; - s0_len = 7; - spc(&s1, &s1_len, conf); - freg_name(tree->ast_node.riscv_fmaxm_d.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_name(tree->ast_node.riscv_fmaxm_d.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - freg_name(tree->ast_node.riscv_fmaxm_d.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_FROUND_H: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fround.h"; - s0_len = 8; - spc(&s1, &s1_len, conf); - freg_name(tree->ast_node.riscv_fround_h.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_name(tree->ast_node.riscv_fround_h.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.riscv_fround_h.rm, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_FROUNDNX_H: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "froundnx.h"; - s0_len = 10; - spc(&s1, &s1_len, conf); - freg_name(tree->ast_node.riscv_froundnx_h.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_name(tree->ast_node.riscv_froundnx_h.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.riscv_froundnx_h.rm, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_FROUND_S: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fround.s"; - s0_len = 8; - spc(&s1, &s1_len, conf); - freg_name(tree->ast_node.riscv_fround_s.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_name(tree->ast_node.riscv_fround_s.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.riscv_fround_s.rm, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_FROUNDNX_S: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "froundnx.s"; - s0_len = 10; - spc(&s1, &s1_len, conf); - freg_name(tree->ast_node.riscv_froundnx_s.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_name(tree->ast_node.riscv_froundnx_s.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.riscv_froundnx_s.rm, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_FROUND_D: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fround.d"; - s0_len = 8; - spc(&s1, &s1_len, conf); - freg_name(tree->ast_node.riscv_fround_d.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_name(tree->ast_node.riscv_fround_d.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.riscv_fround_d.rm, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_FROUNDNX_D: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "froundnx.d"; - s0_len = 10; - spc(&s1, &s1_len, conf); - freg_name(tree->ast_node.riscv_froundnx_d.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_name(tree->ast_node.riscv_froundnx_d.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - frm_mnemonic(tree->ast_node.riscv_froundnx_d.rm, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_FMVH_X_D: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "fmvh.x.d"; - s0_len = 8; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.riscv_fmvh_x_d.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_name(tree->ast_node.riscv_fmvh_x_d.rs1, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_FMVP_D_X: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fmvp.d.x"; - s0_len = 8; - spc(&s1, &s1_len, conf); - freg_name(tree->ast_node.riscv_fmvp_d_x.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.riscv_fmvp_d_x.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.riscv_fmvp_d_x.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_FLEQ_H: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fleq.h"; - s0_len = 6; - spc(&s1, &s1_len, conf); - freg_name(tree->ast_node.riscv_fleq_h.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_name(tree->ast_node.riscv_fleq_h.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - freg_name(tree->ast_node.riscv_fleq_h.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_FLTQ_H: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fltq.h"; - s0_len = 6; - spc(&s1, &s1_len, conf); - freg_name(tree->ast_node.riscv_fltq_h.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_name(tree->ast_node.riscv_fltq_h.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - freg_name(tree->ast_node.riscv_fltq_h.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_FLEQ_S: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fleq.s"; - s0_len = 6; - spc(&s1, &s1_len, conf); - freg_name(tree->ast_node.riscv_fleq_s.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_name(tree->ast_node.riscv_fleq_s.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - freg_name(tree->ast_node.riscv_fleq_s.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_FLTQ_S: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fltq.s"; - s0_len = 6; - spc(&s1, &s1_len, conf); - freg_name(tree->ast_node.riscv_fltq_s.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_name(tree->ast_node.riscv_fltq_s.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - freg_name(tree->ast_node.riscv_fltq_s.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_FLEQ_D: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fleq.d"; - s0_len = 6; - spc(&s1, &s1_len, conf); - freg_name(tree->ast_node.riscv_fleq_d.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_name(tree->ast_node.riscv_fleq_d.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - freg_name(tree->ast_node.riscv_fleq_d.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_FLTQ_D: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "fltq.d"; - s0_len = 6; - spc(&s1, &s1_len, conf); - freg_name(tree->ast_node.riscv_fltq_d.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_name(tree->ast_node.riscv_fltq_d.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - freg_name(tree->ast_node.riscv_fltq_d.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_FCVTMOD_W_D: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "fcvtmod.w.d"; - s0_len = 11; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.riscv_fcvtmod_w_d.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_name(tree->ast_node.riscv_fcvtmod_w_d.rs1, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_SHA256SIG0: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "sha256sig0"; - s0_len = 10; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.sha256sig0.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.sha256sig0.rs1, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_SHA256SIG1: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "sha256sig1"; - s0_len = 10; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.sha256sig1.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.sha256sig1.rs1, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_SHA256SUM0: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "sha256sum0"; - s0_len = 10; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.sha256sum0.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.sha256sum0.rs1, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_SHA256SUM1: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "sha256sum1"; - s0_len = 10; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.sha256sum1.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.sha256sum1.rs1, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_AES32ESMI: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char s8_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s8 = s8_buffer; - size_t s8_len = 0; - s0 = "aes32esmi"; - s0_len = 9; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.aes32esmi.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.aes32esmi.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.aes32esmi.rs2, &s6, &s6_len); - sep(&s7, &s7_len, conf); - hex_bits_2(tree->ast_node.aes32esmi.bs, &s8, &s8_len, conf); - DO_MEMCPY9; - } break; - case RISCV_AES32ESI: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char s8_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s8 = s8_buffer; - size_t s8_len = 0; - s0 = "aes32esi"; - s0_len = 8; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.aes32esi.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.aes32esi.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.aes32esi.rs2, &s6, &s6_len); - sep(&s7, &s7_len, conf); - hex_bits_2(tree->ast_node.aes32esi.bs, &s8, &s8_len, conf); - DO_MEMCPY9; - } break; - case RISCV_AES32DSMI: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char s8_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s8 = s8_buffer; - size_t s8_len = 0; - s0 = "aes32dsmi"; - s0_len = 9; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.aes32dsmi.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.aes32dsmi.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.aes32dsmi.rs2, &s6, &s6_len); - sep(&s7, &s7_len, conf); - hex_bits_2(tree->ast_node.aes32dsmi.bs, &s8, &s8_len, conf); - DO_MEMCPY9; - } break; - case RISCV_AES32DSI: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char s8_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s8 = s8_buffer; - size_t s8_len = 0; - s0 = "aes32dsi"; - s0_len = 8; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.aes32dsi.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.aes32dsi.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.aes32dsi.rs2, &s6, &s6_len); - sep(&s7, &s7_len, conf); - hex_bits_2(tree->ast_node.aes32dsi.bs, &s8, &s8_len, conf); - DO_MEMCPY9; - } break; - case RISCV_SHA512SIG0L: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "sha512sig0l"; - s0_len = 11; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.sha512sig0l.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.sha512sig0l.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.sha512sig0l.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_SHA512SIG0H: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "sha512sig0h"; - s0_len = 11; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.sha512sig0h.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.sha512sig0h.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.sha512sig0h.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_SHA512SIG1L: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "sha512sig1l"; - s0_len = 11; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.sha512sig1l.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.sha512sig1l.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.sha512sig1l.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_SHA512SIG1H: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "sha512sig1h"; - s0_len = 11; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.sha512sig1h.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.sha512sig1h.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.sha512sig1h.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_SHA512SUM0R: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "sha512sum0r"; - s0_len = 11; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.sha512sum0r.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.sha512sum0r.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.sha512sum0r.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_SHA512SUM1R: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "sha512sum1r"; - s0_len = 11; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.sha512sum1r.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.sha512sum1r.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.sha512sum1r.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_AES64KS1I: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - s0 = "aes64ks1i"; - s0_len = 9; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.aes64ks1i.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.aes64ks1i.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - hex_bits_4(tree->ast_node.aes64ks1i.rnum, &s6, &s6_len, conf); - DO_MEMCPY7; - } break; - case RISCV_AES64KS2: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "aes64ks2"; - s0_len = 8; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.aes64ks2.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.aes64ks2.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.aes64ks2.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_AES64IM: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "aes64im"; - s0_len = 7; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.aes64im.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.aes64im.rs1, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_AES64ESM: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "aes64esm"; - s0_len = 8; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.aes64esm.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.aes64esm.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.aes64esm.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_AES64ES: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "aes64es"; - s0_len = 7; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.aes64es.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.aes64es.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.aes64es.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_AES64DSM: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "aes64dsm"; - s0_len = 8; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.aes64dsm.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.aes64dsm.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.aes64dsm.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_AES64DS: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "aes64ds"; - s0_len = 7; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.aes64ds.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.aes64ds.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.aes64ds.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_SHA512SIG0: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "sha512sig0"; - s0_len = 10; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.sha512sig0.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.sha512sig0.rs1, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_SHA512SIG1: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "sha512sig1"; - s0_len = 10; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.sha512sig1.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.sha512sig1.rs1, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_SHA512SUM0: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "sha512sum0"; - s0_len = 10; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.sha512sum0.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.sha512sum0.rs1, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_SHA512SUM1: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "sha512sum1"; - s0_len = 10; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.sha512sum1.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.sha512sum1.rs1, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_SM3P0: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "sm3p0"; - s0_len = 5; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.sm3p0.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.sm3p0.rs1, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_SM3P1: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "sm3p1"; - s0_len = 5; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.sm3p1.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.sm3p1.rs1, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_SM4ED: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char s8_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s8 = s8_buffer; - size_t s8_len = 0; - s0 = "sm4ed"; - s0_len = 5; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.sm4ed.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.sm4ed.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.sm4ed.rs2, &s6, &s6_len); - sep(&s7, &s7_len, conf); - hex_bits_2(tree->ast_node.sm4ed.bs, &s8, &s8_len, conf); - DO_MEMCPY9; - } break; - case RISCV_SM4KS: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char s8_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s8 = s8_buffer; - size_t s8_len = 0; - s0 = "sm4ks"; - s0_len = 5; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.sm4ks.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.sm4ks.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.sm4ks.rs2, &s6, &s6_len); - sep(&s7, &s7_len, conf); - hex_bits_2(tree->ast_node.sm4ks.bs, &s8, &s8_len, conf); - DO_MEMCPY9; - } break; - case RISCV_ZBKB_RTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - zbkb_rtype_mnemonic(tree->ast_node.zbkb_rtype.op, &s0, &s0_len); - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.zbkb_rtype.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.zbkb_rtype.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.zbkb_rtype.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_ZBKB_PACKW: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "packw"; - s0_len = 5; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.zbkb_packw.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.zbkb_packw.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.zbkb_packw.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_ZIP: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "zip"; - s0_len = 3; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.riscv_zip.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.riscv_zip.rs1, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_UNZIP: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "unzip"; - s0_len = 5; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.riscv_unzip.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.riscv_unzip.rs1, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_BREV8: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "brev8"; - s0_len = 5; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.riscv_brev8.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.riscv_brev8.rs1, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_XPERM8: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "xperm8"; - s0_len = 6; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.riscv_xperm8.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.riscv_xperm8.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.riscv_xperm8.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_XPERM4: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "xperm4"; - s0_len = 6; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.riscv_xperm4.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.riscv_xperm4.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.riscv_xperm4.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_ZICOND_RTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - zicond_mnemonic(tree->ast_node.zicond_rtype.riscv_czero_nez, &s0, &s0_len); - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.zicond_rtype.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.zicond_rtype.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.zicond_rtype.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_VSETVLI: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char s8_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s8 = s8_buffer; - size_t s8_len = 0; - char s9_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s9 = s9_buffer; - size_t s9_len = 0; - s0 = "vsetvli"; - s0_len = 7; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.vsetvli.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.vsetvli.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - sew_flag(tree->ast_node.vsetvli.sew, &s6, &s6_len); - maybe_lmul_flag(tree->ast_node.vsetvli.lmul, &s7, &s7_len, conf); - maybe_ta_flag(tree->ast_node.vsetvli.ta, &s8, &s8_len, conf); - maybe_ma_flag(tree->ast_node.vsetvli.ma, &s9, &s9_len, conf); - DO_MEMCPY10; - } break; - case RISCV_VSETVL: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "vsetvl"; - s0_len = 6; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.vsetvl.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.vsetvl.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.vsetvl.rs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_VSETIVLI: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char s8_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s8 = s8_buffer; - size_t s8_len = 0; - char s9_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s9 = s9_buffer; - size_t s9_len = 0; - s0 = "vsetivli"; - s0_len = 8; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.vsetivli.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_5(tree->ast_node.vsetivli.uimm, &s4, &s4_len, conf); - sep(&s5, &s5_len, conf); - sew_flag(tree->ast_node.vsetivli.sew, &s6, &s6_len); - maybe_lmul_flag(tree->ast_node.vsetivli.lmul, &s7, &s7_len, conf); - maybe_ta_flag(tree->ast_node.vsetivli.ta, &s8, &s8_len, conf); - maybe_ma_flag(tree->ast_node.vsetivli.ma, &s9, &s9_len, conf); - DO_MEMCPY10; - } break; - case RISCV_VVTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - vvtype_mnemonic(tree->ast_node.vvtype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vvtype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vvtype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - vreg_name(tree->ast_node.vvtype.vs1, &s6, &s6_len); - maybe_vmask(tree->ast_node.vvtype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_NVSTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - nvstype_mnemonic(tree->ast_node.nvstype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.nvstype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.nvstype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - vreg_name(tree->ast_node.nvstype.vs1, &s6, &s6_len); - maybe_vmask(tree->ast_node.nvstype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_NVTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - nvtype_mnemonic(tree->ast_node.nvtype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.nvtype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.nvtype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - vreg_name(tree->ast_node.nvtype.vs1, &s6, &s6_len); - maybe_vmask(tree->ast_node.nvtype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_MASKTYPEV: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - s0 = "vmerge.vvm"; - s0_len = 10; - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.masktypev.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.masktypev.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - vreg_name(tree->ast_node.masktypev.vs1, &s6, &s6_len); - sep(&s7, &s7_len, conf); - s8 = "v0"; - s8_len = 2; - DO_MEMCPY9; - } break; - case RISCV_MOVETYPEV: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "vmv.v.v"; - s0_len = 7; - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.movetypev.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.movetypev.vs1, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_VXTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - vxtype_mnemonic(tree->ast_node.vxtype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vxtype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vxtype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.vxtype.rs1, &s6, &s6_len); - maybe_vmask(tree->ast_node.vxtype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_NXSTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - nxstype_mnemonic(tree->ast_node.nxstype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.nxstype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.nxstype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.nxstype.rs1, &s6, &s6_len); - maybe_vmask(tree->ast_node.nxstype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_NXTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - nxtype_mnemonic(tree->ast_node.nxtype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.nxtype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.nxtype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.nxtype.rs1, &s6, &s6_len); - maybe_vmask(tree->ast_node.nxtype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_VXSG: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - vxsg_mnemonic(tree->ast_node.vxsg.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vxsg.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vxsg.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.vxsg.rs1, &s6, &s6_len); - maybe_vmask(tree->ast_node.vxsg.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_MASKTYPEX: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - s0 = "vmerge.vxm"; - s0_len = 10; - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.masktypex.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.masktypex.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.masktypex.rs1, &s6, &s6_len); - sep(&s7, &s7_len, conf); - s8 = "v0"; - s8_len = 2; - DO_MEMCPY9; - } break; - case RISCV_MOVETYPEX: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "vmv.v.x"; - s0_len = 7; - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.movetypex.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.movetypex.rs1, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_VITYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - vitype_mnemonic(tree->ast_node.vitype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vitype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vitype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - hex_bits_5(tree->ast_node.vitype.simm, &s6, &s6_len, conf); - maybe_vmask(tree->ast_node.vitype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_NISTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - nistype_mnemonic(tree->ast_node.nistype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.nistype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.nistype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - hex_bits_5(tree->ast_node.nistype.simm, &s6, &s6_len, conf); - maybe_vmask(tree->ast_node.nistype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_NITYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - nitype_mnemonic(tree->ast_node.nitype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.nitype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.nitype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - hex_bits_5(tree->ast_node.nitype.simm, &s6, &s6_len, conf); - maybe_vmask(tree->ast_node.nitype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_VISG: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - visg_mnemonic(tree->ast_node.visg.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.visg.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.visg.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.visg.simm, &s6, &s6_len); - maybe_vmask(tree->ast_node.visg.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_MASKTYPEI: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - s0 = "vmerge.vim"; - s0_len = 10; - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.masktypei.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.masktypei.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - hex_bits_5(tree->ast_node.masktypei.simm, &s6, &s6_len, conf); - sep(&s7, &s7_len, conf); - s8 = "v0"; - s8_len = 2; - DO_MEMCPY9; - } break; - case RISCV_MOVETYPEI: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char s4_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s4 = s4_buffer; - size_t s4_len = 0; - s0 = "vmv.v.i"; - s0_len = 7; - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.movetypei.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - hex_bits_5(tree->ast_node.movetypei.simm, &s4, &s4_len, conf); - DO_MEMCPY5; - } break; - case RISCV_VMVRTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "vmv"; - s0_len = 3; - simm_string(tree->ast_node.vmvrtype.simm, &s1, &s1_len); - s2 = "r.v"; - s2_len = 3; - spc(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vmvrtype.vd, &s4, &s4_len); - sep(&s5, &s5_len, conf); - vreg_name(tree->ast_node.vmvrtype.vs2, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_MVVTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - mvvtype_mnemonic(tree->ast_node.mvvtype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.mvvtype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.mvvtype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - vreg_name(tree->ast_node.mvvtype.vs1, &s6, &s6_len); - maybe_vmask(tree->ast_node.mvvtype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_MVVMATYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - mvvmatype_mnemonic(tree->ast_node.mvvmatype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.mvvmatype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.mvvmatype.vs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - vreg_name(tree->ast_node.mvvmatype.vs2, &s6, &s6_len); - maybe_vmask(tree->ast_node.mvvmatype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_WVVTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - wvvtype_mnemonic(tree->ast_node.wvvtype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.wvvtype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.wvvtype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - vreg_name(tree->ast_node.wvvtype.vs1, &s6, &s6_len); - maybe_vmask(tree->ast_node.wvvtype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_WVTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - wvtype_mnemonic(tree->ast_node.wvtype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.wvtype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.wvtype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - vreg_name(tree->ast_node.wvtype.vs1, &s6, &s6_len); - maybe_vmask(tree->ast_node.wvtype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_WMVVTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - wmvvtype_mnemonic(tree->ast_node.wmvvtype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.wmvvtype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.wmvvtype.vs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - vreg_name(tree->ast_node.wmvvtype.vs2, &s6, &s6_len); - maybe_vmask(tree->ast_node.wmvvtype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_VEXT2TYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - vext2type_mnemonic(tree->ast_node.vext2type.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vext2type.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vext2type.vs2, &s4, &s4_len); - maybe_vmask(tree->ast_node.vext2type.vm, &s5, &s5_len, conf); - DO_MEMCPY6; - } break; - case RISCV_VEXT4TYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - vext4type_mnemonic(tree->ast_node.vext4type.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vext4type.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vext4type.vs2, &s4, &s4_len); - maybe_vmask(tree->ast_node.vext4type.vm, &s5, &s5_len, conf); - DO_MEMCPY6; - } break; - case RISCV_VEXT8TYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - vext8type_mnemonic(tree->ast_node.vext8type.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vext8type.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vext8type.vs2, &s4, &s4_len); - maybe_vmask(tree->ast_node.vext8type.vm, &s5, &s5_len, conf); - DO_MEMCPY6; - } break; - case RISCV_VMVXS: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "vmv.x.s"; - s0_len = 7; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.vmvxs.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vmvxs.vs2, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_MVVCOMPRESS: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "vcompress.vm"; - s0_len = 12; - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.mvvcompress.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.mvvcompress.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - vreg_name(tree->ast_node.mvvcompress.vs1, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_MVXTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - mvxtype_mnemonic(tree->ast_node.mvxtype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.mvxtype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.mvxtype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.mvxtype.rs1, &s6, &s6_len); - maybe_vmask(tree->ast_node.mvxtype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_MVXMATYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - mvxmatype_mnemonic(tree->ast_node.mvxmatype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.mvxmatype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.mvxmatype.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - vreg_name(tree->ast_node.mvxmatype.vs2, &s6, &s6_len); - maybe_vmask(tree->ast_node.mvxmatype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_WVXTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - wvxtype_mnemonic(tree->ast_node.wvxtype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.wvxtype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.wvxtype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.wvxtype.rs1, &s6, &s6_len); - maybe_vmask(tree->ast_node.wvxtype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_WXTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - wxtype_mnemonic(tree->ast_node.wxtype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.wxtype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.wxtype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.wxtype.rs1, &s6, &s6_len); - maybe_vmask(tree->ast_node.wxtype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_WMVXTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - wmvxtype_mnemonic(tree->ast_node.wmvxtype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.wmvxtype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.wmvxtype.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - vreg_name(tree->ast_node.wmvxtype.vs2, &s6, &s6_len); - maybe_vmask(tree->ast_node.wmvxtype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_VMVSX: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "vmv.s.x"; - s0_len = 7; - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vmvsx.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.vmvsx.rs1, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_FVVTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - fvvtype_mnemonic(tree->ast_node.fvvtype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.fvvtype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.fvvtype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - vreg_name(tree->ast_node.fvvtype.vs1, &s6, &s6_len); - maybe_vmask(tree->ast_node.fvvtype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_FVVMATYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - fvvmatype_mnemonic(tree->ast_node.fvvmatype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.fvvmatype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.fvvmatype.vs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - vreg_name(tree->ast_node.fvvmatype.vs2, &s6, &s6_len); - maybe_vmask(tree->ast_node.fvvmatype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_FWVVTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - fwvvtype_mnemonic(tree->ast_node.fwvvtype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.fwvvtype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.fwvvtype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - vreg_name(tree->ast_node.fwvvtype.vs1, &s6, &s6_len); - maybe_vmask(tree->ast_node.fwvvtype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_FWVVMATYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - fwvvmatype_mnemonic(tree->ast_node.fwvvmatype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.fwvvmatype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.fwvvmatype.vs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - vreg_name(tree->ast_node.fwvvmatype.vs2, &s6, &s6_len); - maybe_vmask(tree->ast_node.fwvvmatype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_FWVTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - fwvtype_mnemonic(tree->ast_node.fwvtype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.fwvtype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.fwvtype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - vreg_name(tree->ast_node.fwvtype.vs1, &s6, &s6_len); - maybe_vmask(tree->ast_node.fwvtype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_VFUNARY0: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - vfunary0_mnemonic(tree->ast_node.vfunary0.vfunary0, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vfunary0.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vfunary0.vs2, &s4, &s4_len); - maybe_vmask(tree->ast_node.vfunary0.vm, &s5, &s5_len, conf); - DO_MEMCPY6; - } break; - case RISCV_VFWUNARY0: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - vfwunary0_mnemonic(tree->ast_node.vfwunary0.vfwunary0, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vfwunary0.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vfwunary0.vs2, &s4, &s4_len); - maybe_vmask(tree->ast_node.vfwunary0.vm, &s5, &s5_len, conf); - DO_MEMCPY6; - } break; - case RISCV_VFNUNARY0: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - vfnunary0_mnemonic(tree->ast_node.vfnunary0.vfnunary0, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vfnunary0.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vfnunary0.vs2, &s4, &s4_len); - maybe_vmask(tree->ast_node.vfnunary0.vm, &s5, &s5_len, conf); - DO_MEMCPY6; - } break; - case RISCV_VFUNARY1: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - vfunary1_mnemonic(tree->ast_node.vfunary1.vfunary1, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vfunary1.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vfunary1.vs2, &s4, &s4_len); - maybe_vmask(tree->ast_node.vfunary1.vm, &s5, &s5_len, conf); - DO_MEMCPY6; - } break; - case RISCV_VFMVFS: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "vfmv.f.s"; - s0_len = 8; - spc(&s1, &s1_len, conf); - freg_name(tree->ast_node.vfmvfs.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vfmvfs.vs2, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_FVFTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - fvftype_mnemonic(tree->ast_node.fvftype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.fvftype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.fvftype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.fvftype.rs1, &s6, &s6_len); - maybe_vmask(tree->ast_node.fvftype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_FVFMATYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - fvfmatype_mnemonic(tree->ast_node.fvfmatype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.fvfmatype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.fvfmatype.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - vreg_name(tree->ast_node.fvfmatype.vs2, &s6, &s6_len); - maybe_vmask(tree->ast_node.fvfmatype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_FWVFTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - fwvftype_mnemonic(tree->ast_node.fwvftype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.fwvftype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.fwvftype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.fwvftype.rs1, &s6, &s6_len); - maybe_vmask(tree->ast_node.fwvftype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_FWVFMATYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - fwvfmatype_mnemonic(tree->ast_node.fwvfmatype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.fwvfmatype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.fwvfmatype.rs1, &s4, &s4_len); - sep(&s5, &s5_len, conf); - vreg_name(tree->ast_node.fwvfmatype.vs2, &s6, &s6_len); - maybe_vmask(tree->ast_node.fwvfmatype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_FWFTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - fwftype_mnemonic(tree->ast_node.fwftype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.fwftype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.fwftype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.fwftype.rs1, &s6, &s6_len); - maybe_vmask(tree->ast_node.fwftype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_VFMERGE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - s0 = "vfmerge.vfm"; - s0_len = 11; - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vfmerge.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vfmerge.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.vfmerge.rs1, &s6, &s6_len); - sep(&s7, &s7_len, conf); - s8 = "v0"; - s8_len = 2; - DO_MEMCPY9; - } break; - case RISCV_VFMV: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "vfmv.v.f"; - s0_len = 8; - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vfmv.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - reg_name(tree->ast_node.vfmv.rs1, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_VFMVSF: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - s0 = "vfmv.s.f"; - s0_len = 8; - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vfmvsf.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - freg_name(tree->ast_node.vfmvsf.rs1, &s4, &s4_len); - DO_MEMCPY5; - } break; - case RISCV_VLSEGTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char *s3 = ""; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - char *s9 = ""; - size_t s9_len = 0; - char *s10 = ""; - size_t s10_len = 0; - char s11_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s11 = s11_buffer; - size_t s11_len = 0; - s0 = "vl"; - s0_len = 2; - nfields_string(tree->ast_node.vlsegtype.nf, &s1, &s1_len); - s2 = "e"; - s2_len = 1; - vlewidth_bitsnumberstr(tree->ast_node.vlsegtype.width, &s3, &s3_len); - s4 = ".v"; - s4_len = 2; - spc(&s5, &s5_len, conf); - vreg_name(tree->ast_node.vlsegtype.vd, &s6, &s6_len); - sep(&s7, &s7_len, conf); - s8 = "("; - s8_len = 1; - reg_name(tree->ast_node.vlsegtype.rs1, &s9, &s9_len); - s10 = ")"; - s10_len = 1; - maybe_vmask(tree->ast_node.vlsegtype.vm, &s11, &s11_len, conf); - DO_MEMCPY12; - } break; - case RISCV_VLSEGFFTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char *s3 = ""; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - char *s9 = ""; - size_t s9_len = 0; - char *s10 = ""; - size_t s10_len = 0; - char s11_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s11 = s11_buffer; - size_t s11_len = 0; - s0 = "vl"; - s0_len = 2; - nfields_string(tree->ast_node.vlsegfftype.nf, &s1, &s1_len); - s2 = "e"; - s2_len = 1; - vlewidth_bitsnumberstr(tree->ast_node.vlsegfftype.width, &s3, &s3_len); - s4 = "ff.v"; - s4_len = 4; - spc(&s5, &s5_len, conf); - vreg_name(tree->ast_node.vlsegfftype.vd, &s6, &s6_len); - sep(&s7, &s7_len, conf); - s8 = "("; - s8_len = 1; - reg_name(tree->ast_node.vlsegfftype.rs1, &s9, &s9_len); - s10 = ")"; - s10_len = 1; - maybe_vmask(tree->ast_node.vlsegfftype.vm, &s11, &s11_len, conf); - DO_MEMCPY12; - } break; - case RISCV_VSSEGTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char *s3 = ""; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - char *s9 = ""; - size_t s9_len = 0; - char *s10 = ""; - size_t s10_len = 0; - char s11_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s11 = s11_buffer; - size_t s11_len = 0; - s0 = "vs"; - s0_len = 2; - nfields_string(tree->ast_node.vssegtype.nf, &s1, &s1_len); - s2 = "e"; - s2_len = 1; - vlewidth_bitsnumberstr(tree->ast_node.vssegtype.width, &s3, &s3_len); - s4 = ".v"; - s4_len = 2; - spc(&s5, &s5_len, conf); - vreg_name(tree->ast_node.vssegtype.vs3, &s6, &s6_len); - sep(&s7, &s7_len, conf); - s8 = "("; - s8_len = 1; - reg_name(tree->ast_node.vssegtype.rs1, &s9, &s9_len); - s10 = ")"; - s10_len = 1; - maybe_vmask(tree->ast_node.vssegtype.vm, &s11, &s11_len, conf); - DO_MEMCPY12; - } break; - case RISCV_VLSSEGTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char *s3 = ""; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - char *s9 = ""; - size_t s9_len = 0; - char *s10 = ""; - size_t s10_len = 0; - char s11_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s11 = s11_buffer; - size_t s11_len = 0; - char *s12 = ""; - size_t s12_len = 0; - char s13_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s13 = s13_buffer; - size_t s13_len = 0; - s0 = "vls"; - s0_len = 3; - nfields_string(tree->ast_node.vlssegtype.nf, &s1, &s1_len); - s2 = "e"; - s2_len = 1; - vlewidth_bitsnumberstr(tree->ast_node.vlssegtype.width, &s3, &s3_len); - s4 = ".v"; - s4_len = 2; - spc(&s5, &s5_len, conf); - vreg_name(tree->ast_node.vlssegtype.vd, &s6, &s6_len); - sep(&s7, &s7_len, conf); - s8 = "("; - s8_len = 1; - reg_name(tree->ast_node.vlssegtype.rs1, &s9, &s9_len); - s10 = ")"; - s10_len = 1; - sep(&s11, &s11_len, conf); - reg_name(tree->ast_node.vlssegtype.rs2, &s12, &s12_len); - maybe_vmask(tree->ast_node.vlssegtype.vm, &s13, &s13_len, conf); - DO_MEMCPY14; - } break; - case RISCV_VSSSEGTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char *s3 = ""; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - char *s9 = ""; - size_t s9_len = 0; - char *s10 = ""; - size_t s10_len = 0; - char s11_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s11 = s11_buffer; - size_t s11_len = 0; - char *s12 = ""; - size_t s12_len = 0; - char s13_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s13 = s13_buffer; - size_t s13_len = 0; - s0 = "vss"; - s0_len = 3; - nfields_string(tree->ast_node.vsssegtype.nf, &s1, &s1_len); - s2 = "e"; - s2_len = 1; - vlewidth_bitsnumberstr(tree->ast_node.vsssegtype.width, &s3, &s3_len); - s4 = ".v"; - s4_len = 2; - spc(&s5, &s5_len, conf); - vreg_name(tree->ast_node.vsssegtype.vs3, &s6, &s6_len); - sep(&s7, &s7_len, conf); - s8 = "("; - s8_len = 1; - reg_name(tree->ast_node.vsssegtype.rs1, &s9, &s9_len); - s10 = ")"; - s10_len = 1; - sep(&s11, &s11_len, conf); - reg_name(tree->ast_node.vsssegtype.rs2, &s12, &s12_len); - maybe_vmask(tree->ast_node.vsssegtype.vm, &s13, &s13_len, conf); - DO_MEMCPY14; - } break; - case RISCV_VLUXSEGTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char *s3 = ""; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - char *s9 = ""; - size_t s9_len = 0; - char *s10 = ""; - size_t s10_len = 0; - char s11_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s11 = s11_buffer; - size_t s11_len = 0; - char *s12 = ""; - size_t s12_len = 0; - char s13_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s13 = s13_buffer; - size_t s13_len = 0; - s0 = "vlux"; - s0_len = 4; - nfields_string(tree->ast_node.vluxsegtype.nf, &s1, &s1_len); - s2 = "ei"; - s2_len = 2; - vlewidth_bitsnumberstr(tree->ast_node.vluxsegtype.width, &s3, &s3_len); - s4 = ".v"; - s4_len = 2; - spc(&s5, &s5_len, conf); - vreg_name(tree->ast_node.vluxsegtype.vd, &s6, &s6_len); - sep(&s7, &s7_len, conf); - s8 = "("; - s8_len = 1; - reg_name(tree->ast_node.vluxsegtype.rs1, &s9, &s9_len); - s10 = ")"; - s10_len = 1; - sep(&s11, &s11_len, conf); - reg_name(tree->ast_node.vluxsegtype.vs2, &s12, &s12_len); - maybe_vmask(tree->ast_node.vluxsegtype.vm, &s13, &s13_len, conf); - DO_MEMCPY14; - } break; - case RISCV_VLOXSEGTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char *s3 = ""; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - char *s9 = ""; - size_t s9_len = 0; - char *s10 = ""; - size_t s10_len = 0; - char s11_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s11 = s11_buffer; - size_t s11_len = 0; - char *s12 = ""; - size_t s12_len = 0; - char s13_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s13 = s13_buffer; - size_t s13_len = 0; - s0 = "vlox"; - s0_len = 4; - nfields_string(tree->ast_node.vloxsegtype.nf, &s1, &s1_len); - s2 = "ei"; - s2_len = 2; - vlewidth_bitsnumberstr(tree->ast_node.vloxsegtype.width, &s3, &s3_len); - s4 = ".v"; - s4_len = 2; - spc(&s5, &s5_len, conf); - vreg_name(tree->ast_node.vloxsegtype.vd, &s6, &s6_len); - sep(&s7, &s7_len, conf); - s8 = "("; - s8_len = 1; - reg_name(tree->ast_node.vloxsegtype.rs1, &s9, &s9_len); - s10 = ")"; - s10_len = 1; - sep(&s11, &s11_len, conf); - reg_name(tree->ast_node.vloxsegtype.vs2, &s12, &s12_len); - maybe_vmask(tree->ast_node.vloxsegtype.vm, &s13, &s13_len, conf); - DO_MEMCPY14; - } break; - case RISCV_VSUXSEGTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char *s3 = ""; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - char *s9 = ""; - size_t s9_len = 0; - char *s10 = ""; - size_t s10_len = 0; - char s11_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s11 = s11_buffer; - size_t s11_len = 0; - char *s12 = ""; - size_t s12_len = 0; - char s13_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s13 = s13_buffer; - size_t s13_len = 0; - s0 = "vsux"; - s0_len = 4; - nfields_string(tree->ast_node.vsuxsegtype.nf, &s1, &s1_len); - s2 = "ei"; - s2_len = 2; - vlewidth_bitsnumberstr(tree->ast_node.vsuxsegtype.width, &s3, &s3_len); - s4 = ".v"; - s4_len = 2; - spc(&s5, &s5_len, conf); - vreg_name(tree->ast_node.vsuxsegtype.vs3, &s6, &s6_len); - sep(&s7, &s7_len, conf); - s8 = "("; - s8_len = 1; - reg_name(tree->ast_node.vsuxsegtype.rs1, &s9, &s9_len); - s10 = ")"; - s10_len = 1; - sep(&s11, &s11_len, conf); - reg_name(tree->ast_node.vsuxsegtype.vs2, &s12, &s12_len); - maybe_vmask(tree->ast_node.vsuxsegtype.vm, &s13, &s13_len, conf); - DO_MEMCPY14; - } break; - case RISCV_VSOXSEGTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char *s3 = ""; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - char *s9 = ""; - size_t s9_len = 0; - char *s10 = ""; - size_t s10_len = 0; - char s11_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s11 = s11_buffer; - size_t s11_len = 0; - char *s12 = ""; - size_t s12_len = 0; - char s13_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s13 = s13_buffer; - size_t s13_len = 0; - s0 = "vsox"; - s0_len = 4; - nfields_string(tree->ast_node.vsoxsegtype.nf, &s1, &s1_len); - s2 = "ei"; - s2_len = 2; - vlewidth_bitsnumberstr(tree->ast_node.vsoxsegtype.width, &s3, &s3_len); - s4 = ".v"; - s4_len = 2; - spc(&s5, &s5_len, conf); - vreg_name(tree->ast_node.vsoxsegtype.vs3, &s6, &s6_len); - sep(&s7, &s7_len, conf); - s8 = "("; - s8_len = 1; - reg_name(tree->ast_node.vsoxsegtype.rs1, &s9, &s9_len); - s10 = ")"; - s10_len = 1; - sep(&s11, &s11_len, conf); - reg_name(tree->ast_node.vsoxsegtype.vs2, &s12, &s12_len); - maybe_vmask(tree->ast_node.vsoxsegtype.vm, &s13, &s13_len, conf); - DO_MEMCPY14; - } break; - case RISCV_VLRETYPE: { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char *s3 = ""; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - char *s9 = ""; - size_t s9_len = 0; - char *s10 = ""; - size_t s10_len = 0; - s0 = "vl"; - s0_len = 2; - nfields_string(tree->ast_node.vlretype.nf, &s1, &s1_len); - s2 = "re"; - s2_len = 2; - vlewidth_bitsnumberstr(tree->ast_node.vlretype.width, &s3, &s3_len); - s4 = ".v"; - s4_len = 2; - spc(&s5, &s5_len, conf); - vreg_name(tree->ast_node.vlretype.vd, &s6, &s6_len); - sep(&s7, &s7_len, conf); - s8 = "("; - s8_len = 1; - reg_name(tree->ast_node.vlretype.rs1, &s9, &s9_len); - s10 = ")"; - s10_len = 1; - DO_MEMCPY11; - } break; - case RISCV_VSRETYPE: { - char *s0 = ""; - size_t s0_len = 0; - char *s1 = ""; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char *s7 = ""; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - s0 = "vs"; - s0_len = 2; - nfields_string(tree->ast_node.vsretype.nf, &s1, &s1_len); - s2 = "r.v"; - s2_len = 3; - spc(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vsretype.vs3, &s4, &s4_len); - sep(&s5, &s5_len, conf); - s6 = "("; - s6_len = 1; - reg_name(tree->ast_node.vsretype.rs1, &s7, &s7_len); - s8 = ")"; - s8_len = 1; - DO_MEMCPY9; - } break; - case RISCV_VMTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char *s5 = ""; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - vmtype_mnemonic(tree->ast_node.vmtype.op, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vmtype.vd_or_vs3, &s2, &s2_len); - sep(&s3, &s3_len, conf); - s4 = "("; - s4_len = 1; - reg_name(tree->ast_node.vmtype.rs1, &s5, &s5_len); - s6 = ")"; - s6_len = 1; - DO_MEMCPY7; - } break; - case RISCV_MMTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - mmtype_mnemonic(tree->ast_node.mmtype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.mmtype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.mmtype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - vreg_name(tree->ast_node.mmtype.vs1, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_VCPOP_M: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - s0 = "vpopc.m"; - s0_len = 7; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.vcpop_m.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vcpop_m.vs2, &s4, &s4_len); - maybe_vmask(tree->ast_node.vcpop_m.vm, &s5, &s5_len, conf); - DO_MEMCPY6; - } break; - case RISCV_VFIRST_M: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - s0 = "vfirst.m"; - s0_len = 8; - spc(&s1, &s1_len, conf); - reg_name(tree->ast_node.vfirst_m.rd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vfirst_m.vs2, &s4, &s4_len); - maybe_vmask(tree->ast_node.vfirst_m.vm, &s5, &s5_len, conf); - DO_MEMCPY6; - } break; - case RISCV_VMSBF_M: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - s0 = "vmsbf.m"; - s0_len = 7; - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vmsbf_m.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vmsbf_m.vs2, &s4, &s4_len); - maybe_vmask(tree->ast_node.vmsbf_m.vm, &s5, &s5_len, conf); - DO_MEMCPY6; - } break; - case RISCV_VMSIF_M: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - s0 = "vmsif.m"; - s0_len = 7; - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vmsif_m.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vmsif_m.vs2, &s4, &s4_len); - maybe_vmask(tree->ast_node.vmsif_m.vm, &s5, &s5_len, conf); - DO_MEMCPY6; - } break; - case RISCV_VMSOF_M: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - s0 = "vmsof.m"; - s0_len = 7; - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vmsof_m.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vmsof_m.vs2, &s4, &s4_len); - maybe_vmask(tree->ast_node.vmsof_m.vm, &s5, &s5_len, conf); - DO_MEMCPY6; - } break; - case RISCV_VIOTA_M: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - s0 = "viota.m"; - s0_len = 7; - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.viota_m.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.viota_m.vs2, &s4, &s4_len); - maybe_vmask(tree->ast_node.viota_m.vm, &s5, &s5_len, conf); - DO_MEMCPY6; - } break; - case RISCV_VID_V: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - s0 = "vid.v"; - s0_len = 5; - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vid_v.vd, &s2, &s2_len); - maybe_vmask(tree->ast_node.vid_v.vm, &s3, &s3_len, conf); - DO_MEMCPY4; - } break; - case RISCV_VVMTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - vvmtype_mnemonic(tree->ast_node.vvmtype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vvmtype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vvmtype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - vreg_name(tree->ast_node.vvmtype.vs1, &s6, &s6_len); - sep(&s7, &s7_len, conf); - s8 = "v0"; - s8_len = 2; - DO_MEMCPY9; - } break; - case RISCV_VVMCTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - vvmctype_mnemonic(tree->ast_node.vvmctype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vvmctype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vvmctype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - vreg_name(tree->ast_node.vvmctype.vs1, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_VVMSTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - vvmstype_mnemonic(tree->ast_node.vvmstype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vvmstype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vvmstype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - vreg_name(tree->ast_node.vvmstype.vs1, &s6, &s6_len); - sep(&s7, &s7_len, conf); - s8 = "v0"; - s8_len = 2; - DO_MEMCPY9; - } break; - case RISCV_VVCMPTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - vvcmptype_mnemonic(tree->ast_node.vvcmptype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vvcmptype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vvcmptype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - vreg_name(tree->ast_node.vvcmptype.vs1, &s6, &s6_len); - maybe_vmask(tree->ast_node.vvcmptype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_VXMTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - vxmtype_mnemonic(tree->ast_node.vxmtype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vxmtype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vxmtype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.vxmtype.rs1, &s6, &s6_len); - sep(&s7, &s7_len, conf); - s8 = "v0"; - s8_len = 2; - DO_MEMCPY9; - } break; - case RISCV_VXMCTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - vxmctype_mnemonic(tree->ast_node.vxmctype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vxmctype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vxmctype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.vxmctype.rs1, &s6, &s6_len); - DO_MEMCPY7; - } break; - case RISCV_VXMSTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - vxmstype_mnemonic(tree->ast_node.vxmstype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vxmstype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vxmstype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.vxmstype.rs1, &s6, &s6_len); - sep(&s7, &s7_len, conf); - s8 = "v0"; - s8_len = 2; - DO_MEMCPY9; - } break; - case RISCV_VXCMPTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - vxcmptype_mnemonic(tree->ast_node.vxcmptype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vxcmptype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vxcmptype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.vxcmptype.rs1, &s6, &s6_len); - maybe_vmask(tree->ast_node.vxcmptype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_VIMTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - vimtype_mnemonic(tree->ast_node.vimtype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vimtype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vimtype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - hex_bits_5(tree->ast_node.vimtype.simm, &s6, &s6_len, conf); - sep(&s7, &s7_len, conf); - s8 = "v0"; - s8_len = 2; - DO_MEMCPY9; - } break; - case RISCV_VIMCTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - vimctype_mnemonic(tree->ast_node.vimctype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vimctype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vimctype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - hex_bits_5(tree->ast_node.vimctype.simm, &s6, &s6_len, conf); - DO_MEMCPY7; - } break; - case RISCV_VIMSTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - char *s8 = ""; - size_t s8_len = 0; - vimstype_mnemonic(tree->ast_node.vimstype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vimstype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vimstype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - hex_bits_5(tree->ast_node.vimstype.simm, &s6, &s6_len, conf); - sep(&s7, &s7_len, conf); - s8 = "v0"; - s8_len = 2; - DO_MEMCPY9; - } break; - case RISCV_VICMPTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char s6_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s6 = s6_buffer; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - vicmptype_mnemonic(tree->ast_node.vicmptype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.vicmptype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.vicmptype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - hex_bits_5(tree->ast_node.vicmptype.simm, &s6, &s6_len, conf); - maybe_vmask(tree->ast_node.vicmptype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_FVVMTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - fvvmtype_mnemonic(tree->ast_node.fvvmtype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.fvvmtype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.fvvmtype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - vreg_name(tree->ast_node.fvvmtype.vs1, &s6, &s6_len); - maybe_vmask(tree->ast_node.fvvmtype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_FVFMTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - fvfmtype_mnemonic(tree->ast_node.fvfmtype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.fvfmtype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.fvfmtype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - reg_name(tree->ast_node.fvfmtype.rs1, &s6, &s6_len); - maybe_vmask(tree->ast_node.fvfmtype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_RIVVTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - rivvtype_mnemonic(tree->ast_node.rivvtype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.rivvtype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.rivvtype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - vreg_name(tree->ast_node.rivvtype.vs1, &s6, &s6_len); - maybe_vmask(tree->ast_node.rivvtype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_RMVVTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - rmvvtype_mnemonic(tree->ast_node.rmvvtype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.rmvvtype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.rmvvtype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - vreg_name(tree->ast_node.rmvvtype.vs1, &s6, &s6_len); - maybe_vmask(tree->ast_node.rmvvtype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_RFVVTYPE: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - char s7_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s7 = s7_buffer; - size_t s7_len = 0; - rfvvtype_mnemonic(tree->ast_node.rfvvtype.funct6, &s0, &s0_len); - spc(&s1, &s1_len, conf); - vreg_name(tree->ast_node.rfvvtype.vd, &s2, &s2_len); - sep(&s3, &s3_len, conf); - vreg_name(tree->ast_node.rfvvtype.vs2, &s4, &s4_len); - sep(&s5, &s5_len, conf); - vreg_name(tree->ast_node.rfvvtype.vs1, &s6, &s6_len); - maybe_vmask(tree->ast_node.rfvvtype.vm, &s7, &s7_len, conf); - DO_MEMCPY8; - } break; - case RISCV_ZICBOM: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - cbop_mnemonic(tree->ast_node.riscv_zicbom.cbop, &s0, &s0_len); - spc(&s1, &s1_len, conf); - s2 = "("; - s2_len = 1; - opt_spc(&s3, &s3_len, conf); - reg_name(tree->ast_node.riscv_zicbom.rs1, &s4, &s4_len); - opt_spc(&s5, &s5_len, conf); - s6 = ")"; - s6_len = 1; - DO_MEMCPY7; - } break; - case RISCV_ZICBOZ: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char *s2 = ""; - size_t s2_len = 0; - char s3_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s3 = s3_buffer; - size_t s3_len = 0; - char *s4 = ""; - size_t s4_len = 0; - char s5_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s5 = s5_buffer; - size_t s5_len = 0; - char *s6 = ""; - size_t s6_len = 0; - s0 = "cbo.zero"; - s0_len = 8; - spc(&s1, &s1_len, conf); - s2 = "("; - s2_len = 1; - opt_spc(&s3, &s3_len, conf); - reg_name(tree->ast_node.riscv_zicboz, &s4, &s4_len); - opt_spc(&s5, &s5_len, conf); - s6 = ")"; - s6_len = 1; - DO_MEMCPY7; - } break; - case RISCV_ILLEGAL: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - s0 = "illegal"; - s0_len = 7; - spc(&s1, &s1_len, conf); - hex_bits_32(tree->ast_node.illegal, &s2, &s2_len, conf); - DO_MEMCPY3; - } break; - case RISCV_C_ILLEGAL: { - char *s0 = ""; - size_t s0_len = 0; - char s1_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s1 = s1_buffer; - size_t s1_len = 0; - char s2_buffer[RISCV_TEMP_BUFFER_MAX_LEN] = {0}; - char *s2 = s2_buffer; - size_t s2_len = 0; - s0 = "c.illegal"; - s0_len = 9; - spc(&s1, &s1_len, conf); - hex_bits_16(tree->ast_node.c_illegal, &s2, &s2_len, conf); - DO_MEMCPY3; - } break; - } -} - -#endif diff --git a/arch/RISCV/riscv_ast2str_tbls.gen.inc b/arch/RISCV/riscv_ast2str_tbls.gen.inc deleted file mode 100644 index fd49df2c4d..0000000000 --- a/arch/RISCV/riscv_ast2str_tbls.gen.inc +++ /dev/null @@ -1,3054 +0,0 @@ -/*=======================================================================*/ -/*This code was generated by the tool riscv_disasm_from_sail (see - * https://github.com/moste00/riscv_disasm_from_sail)*/ -/*from the sail model of RISC-V (see https://github.com/riscv/sail-riscv) @ - * version 0b9c639f19da48734cbf14b61f6ad200b7c70de9.*/ -/*DO NOT MODIFY THIS CODE MANUALLY.*/ -/* */ -/*SPDX-License-Identifier: BSD-3-Clause*/ -/*=======================================================================*/ - -#ifndef __Riscv_ast2str_tbls_gen_inc__ -#define __Riscv_ast2str_tbls_gen_inc__ -#include - -#include - -#include "riscv_ast.gen.inc" -#include - -void utype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_LUI: { - *s = "lui"; - *len = 3; - break; - } - case RISCV_AUIPC: { - *s = "auipc"; - *len = 5; - break; - } - } -} -void reg_name(uint64_t member, char **s, size_t *len) { - switch (member) { - case 0x08: { - *s = "fp"; - *len = 2; - break; - } - case 0x15: { - *s = "s5"; - *len = 2; - break; - } - case 0x01: { - *s = "ra"; - *len = 2; - break; - } - case 0x06: { - *s = "t1"; - *len = 2; - break; - } - case 0x09: { - *s = "s1"; - *len = 2; - break; - } - case 0x10: { - *s = "a6"; - *len = 2; - break; - } - case 0x1B: { - *s = "s11"; - *len = 3; - break; - } - case 0x1C: { - *s = "t3"; - *len = 2; - break; - } - case 0x16: { - *s = "s6"; - *len = 2; - break; - } - case 0x00: { - *s = "zero"; - *len = 4; - break; - } - case 0x0A: { - *s = "a0"; - *len = 2; - break; - } - case 0x1A: { - *s = "s10"; - *len = 3; - break; - } - case 0x17: { - *s = "s7"; - *len = 2; - break; - } - case 0x0C: { - *s = "a2"; - *len = 2; - break; - } - case 0x18: { - *s = "s8"; - *len = 2; - break; - } - case 0x02: { - *s = "sp"; - *len = 2; - break; - } - case 0x1F: { - *s = "t6"; - *len = 2; - break; - } - case 0x0B: { - *s = "a1"; - *len = 2; - break; - } - case 0x07: { - *s = "t2"; - *len = 2; - break; - } - case 0x13: { - *s = "s3"; - *len = 2; - break; - } - case 0x04: { - *s = "tp"; - *len = 2; - break; - } - case 0x19: { - *s = "s9"; - *len = 2; - break; - } - case 0x12: { - *s = "s2"; - *len = 2; - break; - } - case 0x14: { - *s = "s4"; - *len = 2; - break; - } - case 0x0E: { - *s = "a4"; - *len = 2; - break; - } - case 0x1E: { - *s = "t5"; - *len = 2; - break; - } - case 0x11: { - *s = "a7"; - *len = 2; - break; - } - case 0x03: { - *s = "gp"; - *len = 2; - break; - } - case 0x05: { - *s = "t0"; - *len = 2; - break; - } - case 0x1D: { - *s = "t4"; - *len = 2; - break; - } - case 0x0D: { - *s = "a3"; - *len = 2; - break; - } - case 0x0F: { - *s = "a5"; - *len = 2; - break; - } - } -} -void btype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_BGEU: { - *s = "bgeu"; - *len = 4; - break; - } - case RISCV_BLT: { - *s = "blt"; - *len = 3; - break; - } - case RISCV_BGE: { - *s = "bge"; - *len = 3; - break; - } - case RISCV_BLTU: { - *s = "bltu"; - *len = 4; - break; - } - case RISCV_BNE: { - *s = "bne"; - *len = 3; - break; - } - case RISCV_BEQ: { - *s = "beq"; - *len = 3; - break; - } - } -} -void itype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_ANDI: { - *s = "andi"; - *len = 4; - break; - } - case RISCV_ADDI: { - *s = "addi"; - *len = 4; - break; - } - case RISCV_XORI: { - *s = "xori"; - *len = 4; - break; - } - case RISCV_SLTI: { - *s = "slti"; - *len = 4; - break; - } - case RISCV_ORI: { - *s = "ori"; - *len = 3; - break; - } - case RISCV_SLTIU: { - *s = "sltiu"; - *len = 5; - break; - } - } -} -void shiftiop_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_SRAI: { - *s = "srai"; - *len = 4; - break; - } - case RISCV_SRLI: { - *s = "srli"; - *len = 4; - break; - } - case RISCV_SLLI: { - *s = "slli"; - *len = 4; - break; - } - } -} -void rtype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_SLL: { - *s = "sll"; - *len = 3; - break; - } - case RISCV_SRL: { - *s = "srl"; - *len = 3; - break; - } - case RISCV_SLTU: { - *s = "sltu"; - *len = 4; - break; - } - case RISCV_ADD: { - *s = "add"; - *len = 3; - break; - } - case RISCV_XOR: { - *s = "xor"; - *len = 3; - break; - } - case RISCV_SLT: { - *s = "slt"; - *len = 3; - break; - } - case RISCV_AND: { - *s = "and"; - *len = 3; - break; - } - case RISCV_OR: { - *s = "or"; - *len = 2; - break; - } - case RISCV_SRA: { - *s = "sra"; - *len = 3; - break; - } - case RISCV_SUB: { - *s = "sub"; - *len = 3; - break; - } - } -} -void size_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_BYTE: { - *s = "b"; - *len = 1; - break; - } - case RISCV_WORD: { - *s = "w"; - *len = 1; - break; - } - case RISCV_DOUBLE: { - *s = "d"; - *len = 1; - break; - } - case RISCV_HALF: { - *s = "h"; - *len = 1; - break; - } - } -} -void rtypew_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_SRAW: { - *s = "sraw"; - *len = 4; - break; - } - case RISCV_SUBW: { - *s = "subw"; - *len = 4; - break; - } - case RISCV_SLLW: { - *s = "sllw"; - *len = 4; - break; - } - case RISCV_SRLW: { - *s = "srlw"; - *len = 4; - break; - } - case RISCV_ADDW: { - *s = "addw"; - *len = 4; - break; - } - } -} -void shiftiwop_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_SRLIW: { - *s = "srliw"; - *len = 5; - break; - } - case RISCV_SLLIW: { - *s = "slliw"; - *len = 5; - break; - } - case RISCV_SRAIW: { - *s = "sraiw"; - *len = 5; - break; - } - } -} -void amo_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_AMOMIN: { - *s = "amomin"; - *len = 6; - break; - } - case RISCV_AMOXOR: { - *s = "amoxor"; - *len = 6; - break; - } - case RISCV_AMOADD: { - *s = "amoadd"; - *len = 6; - break; - } - case RISCV_AMOOR: { - *s = "amoor"; - *len = 5; - break; - } - case RISCV_AMOSWAP: { - *s = "amoswap"; - *len = 7; - break; - } - case RISCV_AMOMAX: { - *s = "amomax"; - *len = 6; - break; - } - case RISCV_AMOMINU: { - *s = "amominu"; - *len = 7; - break; - } - case RISCV_AMOAND: { - *s = "amoand"; - *len = 6; - break; - } - case RISCV_AMOMAXU: { - *s = "amomaxu"; - *len = 7; - break; - } - } -} -void creg_name(uint64_t member, char **s, size_t *len) { - switch (member) { - case 0x7: { - *s = "a5"; - *len = 2; - break; - } - case 0x5: { - *s = "a3"; - *len = 2; - break; - } - case 0x1: { - *s = "s1"; - *len = 2; - break; - } - case 0x3: { - *s = "a1"; - *len = 2; - break; - } - case 0x2: { - *s = "a0"; - *len = 2; - break; - } - case 0x4: { - *s = "a2"; - *len = 2; - break; - } - case 0x6: { - *s = "a4"; - *len = 2; - break; - } - case 0x0: { - *s = "s0"; - *len = 2; - break; - } - } -} -void csr_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_CSRRS: { - *s = "csrrs"; - *len = 5; - break; - } - case RISCV_CSRRW: { - *s = "csrrw"; - *len = 5; - break; - } - case RISCV_CSRRC: { - *s = "csrrc"; - *len = 5; - break; - } - } -} -void freg_name(uint64_t member, char **s, size_t *len) { - switch (member) { - case 0x08: { - *s = "fs0"; - *len = 3; - break; - } - case 0x15: { - *s = "fs5"; - *len = 3; - break; - } - case 0x01: { - *s = "ft1"; - *len = 3; - break; - } - case 0x06: { - *s = "ft6"; - *len = 3; - break; - } - case 0x09: { - *s = "fs1"; - *len = 3; - break; - } - case 0x10: { - *s = "fa6"; - *len = 3; - break; - } - case 0x1B: { - *s = "fs11"; - *len = 4; - break; - } - case 0x1C: { - *s = "ft8"; - *len = 3; - break; - } - case 0x16: { - *s = "fs6"; - *len = 3; - break; - } - case 0x00: { - *s = "ft0"; - *len = 3; - break; - } - case 0x0A: { - *s = "fa0"; - *len = 3; - break; - } - case 0x1A: { - *s = "fs10"; - *len = 4; - break; - } - case 0x17: { - *s = "fs7"; - *len = 3; - break; - } - case 0x0C: { - *s = "fa2"; - *len = 3; - break; - } - case 0x18: { - *s = "fs8"; - *len = 3; - break; - } - case 0x02: { - *s = "ft2"; - *len = 3; - break; - } - case 0x1F: { - *s = "ft11"; - *len = 4; - break; - } - case 0x0B: { - *s = "fa1"; - *len = 3; - break; - } - case 0x07: { - *s = "ft7"; - *len = 3; - break; - } - case 0x13: { - *s = "fs3"; - *len = 3; - break; - } - case 0x04: { - *s = "ft4"; - *len = 3; - break; - } - case 0x19: { - *s = "fs9"; - *len = 3; - break; - } - case 0x12: { - *s = "fs2"; - *len = 3; - break; - } - case 0x14: { - *s = "fs4"; - *len = 3; - break; - } - case 0x0E: { - *s = "fa4"; - *len = 3; - break; - } - case 0x1E: { - *s = "ft10"; - *len = 4; - break; - } - case 0x11: { - *s = "fa7"; - *len = 3; - break; - } - case 0x03: { - *s = "ft3"; - *len = 3; - break; - } - case 0x05: { - *s = "ft5"; - *len = 3; - break; - } - case 0x1D: { - *s = "ft9"; - *len = 3; - break; - } - case 0x0D: { - *s = "fa3"; - *len = 3; - break; - } - case 0x0F: { - *s = "fa5"; - *len = 3; - break; - } - } -} -void f_madd_type_mnemonic_S(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_FMADD_S: { - *s = "fmadd.s"; - *len = 7; - break; - } - case RISCV_FNMADD_S: { - *s = "fnmadd.s"; - *len = 8; - break; - } - case RISCV_FNMSUB_S: { - *s = "fnmsub.s"; - *len = 8; - break; - } - case RISCV_FMSUB_S: { - *s = "fmsub.s"; - *len = 7; - break; - } - } -} -void frm_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_RM_RNE: { - *s = "rne"; - *len = 3; - break; - } - case RISCV_RM_RTZ: { - *s = "rtz"; - *len = 3; - break; - } - case RISCV_RM_RDN: { - *s = "rdn"; - *len = 3; - break; - } - case RISCV_RM_RMM: { - *s = "rmm"; - *len = 3; - break; - } - case RISCV_RM_RUP: { - *s = "rup"; - *len = 3; - break; - } - case RISCV_RM_DYN: { - *s = "dyn"; - *len = 3; - break; - } - } -} -void f_bin_rm_type_mnemonic_S(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_FDIV_S: { - *s = "fdiv.s"; - *len = 6; - break; - } - case RISCV_FADD_S: { - *s = "fadd.s"; - *len = 6; - break; - } - case RISCV_FMUL_S: { - *s = "fmul.s"; - *len = 6; - break; - } - case RISCV_FSUB_S: { - *s = "fsub.s"; - *len = 6; - break; - } - } -} -void f_madd_type_mnemonic_D(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_FMSUB_D: { - *s = "fmsub.d"; - *len = 7; - break; - } - case RISCV_FNMSUB_D: { - *s = "fnmsub.d"; - *len = 8; - break; - } - case RISCV_FNMADD_D: { - *s = "fnmadd.d"; - *len = 8; - break; - } - case RISCV_FMADD_D: { - *s = "fmadd.d"; - *len = 7; - break; - } - } -} -void f_bin_rm_type_mnemonic_D(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_FMUL_D: { - *s = "fmul.d"; - *len = 6; - break; - } - case RISCV_FADD_D: { - *s = "fadd.d"; - *len = 6; - break; - } - case RISCV_FSUB_D: { - *s = "fsub.d"; - *len = 6; - break; - } - case RISCV_FDIV_D: { - *s = "fdiv.d"; - *len = 6; - break; - } - } -} -void zba_rtypeuw_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_SH1ADDUW: { - *s = "sh1add.uw"; - *len = 9; - break; - } - case RISCV_SH2ADDUW: { - *s = "sh2add.uw"; - *len = 9; - break; - } - case RISCV_ADDUW: { - *s = "add.uw"; - *len = 6; - break; - } - case RISCV_SH3ADDUW: { - *s = "sh3add.uw"; - *len = 9; - break; - } - } -} -void zba_rtype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_SH3ADD: { - *s = "sh3add"; - *len = 6; - break; - } - case RISCV_SH2ADD: { - *s = "sh2add"; - *len = 6; - break; - } - case RISCV_SH1ADD: { - *s = "sh1add"; - *len = 6; - break; - } - } -} -void zbb_rtypew_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_RORW: { - *s = "rorw"; - *len = 4; - break; - } - case RISCV_ROLW: { - *s = "rolw"; - *len = 4; - break; - } - } -} -void zbb_rtype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_ROR: { - *s = "ror"; - *len = 3; - break; - } - case RISCV_MAXU: { - *s = "maxu"; - *len = 4; - break; - } - case RISCV_MIN: { - *s = "min"; - *len = 3; - break; - } - case RISCV_MAX: { - *s = "max"; - *len = 3; - break; - } - case RISCV_ANDN: { - *s = "andn"; - *len = 4; - break; - } - case RISCV_ORN: { - *s = "orn"; - *len = 3; - break; - } - case RISCV_XNOR: { - *s = "xnor"; - *len = 4; - break; - } - case RISCV_MINU: { - *s = "minu"; - *len = 4; - break; - } - case RISCV_ROL: { - *s = "rol"; - *len = 3; - break; - } - } -} -void zbb_extop_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_SEXTH: { - *s = "sext.h"; - *len = 6; - break; - } - case RISCV_ZEXTH: { - *s = "zext.h"; - *len = 6; - break; - } - case RISCV_SEXTB: { - *s = "sext.b"; - *len = 6; - break; - } - } -} -void zbs_iop_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_BCLRI: { - *s = "bclri"; - *len = 5; - break; - } - case RISCV_BINVI: { - *s = "binvi"; - *len = 5; - break; - } - case RISCV_BSETI: { - *s = "bseti"; - *len = 5; - break; - } - case RISCV_BEXTI: { - *s = "bexti"; - *len = 5; - break; - } - } -} -void zbs_rtype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_BEXT: { - *s = "bext"; - *len = 4; - break; - } - case RISCV_BINV: { - *s = "binv"; - *len = 4; - break; - } - case RISCV_BSET: { - *s = "bset"; - *len = 4; - break; - } - case RISCV_BCLR: { - *s = "bclr"; - *len = 4; - break; - } - } -} -void f_bin_rm_type_mnemonic_H(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_FDIV_H: { - *s = "fdiv.h"; - *len = 6; - break; - } - case RISCV_FADD_H: { - *s = "fadd.h"; - *len = 6; - break; - } - case RISCV_FMUL_H: { - *s = "fmul.h"; - *len = 6; - break; - } - case RISCV_FSUB_H: { - *s = "fsub.h"; - *len = 6; - break; - } - } -} -void f_madd_type_mnemonic_H(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_FNMSUB_H: { - *s = "fnmsub.h"; - *len = 8; - break; - } - case RISCV_FMSUB_H: { - *s = "fmsub.h"; - *len = 7; - break; - } - case RISCV_FNMADD_H: { - *s = "fnmadd.h"; - *len = 8; - break; - } - case RISCV_FMADD_H: { - *s = "fmadd.h"; - *len = 7; - break; - } - } -} -void zbkb_rtype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_PACKH: { - *s = "packh"; - *len = 5; - break; - } - case RISCV_PACK: { - *s = "pack"; - *len = 4; - break; - } - } -} -void zicond_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_CZERO_EQZ: { - *s = "czero.eqz"; - *len = 9; - break; - } - case RISCV_CZERO_NEZ: { - *s = "czero.nez"; - *len = 9; - break; - } - } -} -void sew_flag(uint64_t member, char **s, size_t *len) { - switch (member) { - case 0x1: { - *s = "e16"; - *len = 3; - break; - } - case 0x3: { - *s = "e64"; - *len = 3; - break; - } - case 0x2: { - *s = "e32"; - *len = 3; - break; - } - case 0x0: { - *s = "e8"; - *len = 2; - break; - } - } -} -void vvtype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_VV_VSSRA: { - *s = "vssra.vv"; - *len = 8; - break; - } - case RISCV_VV_VXOR: { - *s = "vxor.vv"; - *len = 7; - break; - } - case RISCV_VV_VSMUL: { - *s = "vsmul.vv"; - *len = 8; - break; - } - case RISCV_VV_VAND: { - *s = "vand.vv"; - *len = 7; - break; - } - case RISCV_VV_VSSUB: { - *s = "vssub.vv"; - *len = 8; - break; - } - case RISCV_VV_VSUB: { - *s = "vsub.vv"; - *len = 7; - break; - } - case RISCV_VV_VSLL: { - *s = "vsll.vv"; - *len = 7; - break; - } - case RISCV_VV_VSSRL: { - *s = "vssrl.vv"; - *len = 8; - break; - } - case RISCV_VV_VSADD: { - *s = "vsadd.vv"; - *len = 8; - break; - } - case RISCV_VV_VSSUBU: { - *s = "vssubu.vv"; - *len = 9; - break; - } - case RISCV_VV_VMAX: { - *s = "vmax.vv"; - *len = 7; - break; - } - case RISCV_VV_VADD: { - *s = "vadd.vv"; - *len = 7; - break; - } - case RISCV_VV_VSRL: { - *s = "vsrl.vv"; - *len = 7; - break; - } - case RISCV_VV_VMAXU: { - *s = "vmaxu.vv"; - *len = 8; - break; - } - case RISCV_VV_VRGATHER: { - *s = "vrgather.vv"; - *len = 11; - break; - } - case RISCV_VV_VSRA: { - *s = "vsra.vv"; - *len = 7; - break; - } - case RISCV_VV_VRGATHEREI16: { - *s = "vrgatherei16.vv"; - *len = 15; - break; - } - case RISCV_VV_VMINU: { - *s = "vminu.vv"; - *len = 8; - break; - } - case RISCV_VV_VSADDU: { - *s = "vsaddu.vv"; - *len = 9; - break; - } - case RISCV_VV_VMIN: { - *s = "vmin.vv"; - *len = 7; - break; - } - case RISCV_VV_VOR: { - *s = "vor.vv"; - *len = 6; - break; - } - } -} -void vreg_name(uint64_t member, char **s, size_t *len) { - switch (member) { - case 0x08: { - *s = "v8"; - *len = 2; - break; - } - case 0x15: { - *s = "v21"; - *len = 3; - break; - } - case 0x01: { - *s = "v1"; - *len = 2; - break; - } - case 0x06: { - *s = "v6"; - *len = 2; - break; - } - case 0x09: { - *s = "v9"; - *len = 2; - break; - } - case 0x10: { - *s = "v16"; - *len = 3; - break; - } - case 0x1B: { - *s = "v27"; - *len = 3; - break; - } - case 0x1C: { - *s = "v28"; - *len = 3; - break; - } - case 0x16: { - *s = "v22"; - *len = 3; - break; - } - case 0x00: { - *s = "v0"; - *len = 2; - break; - } - case 0x0A: { - *s = "v10"; - *len = 3; - break; - } - case 0x1A: { - *s = "v26"; - *len = 3; - break; - } - case 0x17: { - *s = "v23"; - *len = 3; - break; - } - case 0x0C: { - *s = "v12"; - *len = 3; - break; - } - case 0x18: { - *s = "v24"; - *len = 3; - break; - } - case 0x02: { - *s = "v2"; - *len = 2; - break; - } - case 0x1F: { - *s = "v31"; - *len = 3; - break; - } - case 0x0B: { - *s = "v11"; - *len = 3; - break; - } - case 0x07: { - *s = "v7"; - *len = 2; - break; - } - case 0x13: { - *s = "v19"; - *len = 3; - break; - } - case 0x04: { - *s = "v4"; - *len = 2; - break; - } - case 0x19: { - *s = "v25"; - *len = 3; - break; - } - case 0x12: { - *s = "v18"; - *len = 3; - break; - } - case 0x14: { - *s = "v20"; - *len = 3; - break; - } - case 0x0E: { - *s = "v14"; - *len = 3; - break; - } - case 0x1E: { - *s = "v30"; - *len = 3; - break; - } - case 0x11: { - *s = "v17"; - *len = 3; - break; - } - case 0x03: { - *s = "v3"; - *len = 2; - break; - } - case 0x05: { - *s = "v5"; - *len = 2; - break; - } - case 0x1D: { - *s = "v29"; - *len = 3; - break; - } - case 0x0D: { - *s = "v13"; - *len = 3; - break; - } - case 0x0F: { - *s = "v15"; - *len = 3; - break; - } - } -} -void nvstype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_NVS_VNSRL: { - *s = "vnsrl.wv"; - *len = 8; - break; - } - case RISCV_NVS_VNSRA: { - *s = "vnsra.wv"; - *len = 8; - break; - } - } -} -void nvtype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_NV_VNCLIP: { - *s = "vnclip.wv"; - *len = 9; - break; - } - case RISCV_NV_VNCLIPU: { - *s = "vnclipu.wv"; - *len = 10; - break; - } - } -} -void vxtype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_VX_VSRA: { - *s = "vsra.vx"; - *len = 7; - break; - } - case RISCV_VX_VOR: { - *s = "vor.vx"; - *len = 6; - break; - } - case RISCV_VX_VADD: { - *s = "vadd.vx"; - *len = 7; - break; - } - case RISCV_VX_VSADDU: { - *s = "vsaddu.vx"; - *len = 9; - break; - } - case RISCV_VX_VMAX: { - *s = "vmax.vx"; - *len = 7; - break; - } - case RISCV_VX_VSSRA: { - *s = "vssra.vx"; - *len = 8; - break; - } - case RISCV_VX_VXOR: { - *s = "vxor.vx"; - *len = 7; - break; - } - case RISCV_VX_VSSRL: { - *s = "vssrl.vx"; - *len = 8; - break; - } - case RISCV_VX_VRSUB: { - *s = "vrsub.vx"; - *len = 8; - break; - } - case RISCV_VX_VSUB: { - *s = "vsub.vx"; - *len = 7; - break; - } - case RISCV_VX_VSADD: { - *s = "vsadd.vx"; - *len = 8; - break; - } - case RISCV_VX_VSSUBU: { - *s = "vssubu.vx"; - *len = 9; - break; - } - case RISCV_VX_VMIN: { - *s = "vmin.vx"; - *len = 7; - break; - } - case RISCV_VX_VSLL: { - *s = "vsll.vx"; - *len = 7; - break; - } - case RISCV_VX_VSMUL: { - *s = "vsmul.vx"; - *len = 8; - break; - } - case RISCV_VX_VMINU: { - *s = "vminu.vx"; - *len = 8; - break; - } - case RISCV_VX_VMAXU: { - *s = "vmaxu.vx"; - *len = 8; - break; - } - case RISCV_VX_VAND: { - *s = "vand.vx"; - *len = 7; - break; - } - case RISCV_VX_VSSUB: { - *s = "vssub.vx"; - *len = 8; - break; - } - case RISCV_VX_VSRL: { - *s = "vsrl.vx"; - *len = 7; - break; - } - } -} -void nxstype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_NXS_VNSRA: { - *s = "vnsra.wx"; - *len = 8; - break; - } - case RISCV_NXS_VNSRL: { - *s = "vnsrl.wx"; - *len = 8; - break; - } - } -} -void nxtype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_NX_VNCLIP: { - *s = "vnclip.wx"; - *len = 9; - break; - } - case RISCV_NX_VNCLIPU: { - *s = "vnclipu.wx"; - *len = 10; - break; - } - } -} -void vxsg_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_VX_VSLIDEDOWN: { - *s = "vslidedown.vx"; - *len = 13; - break; - } - case RISCV_VX_VSLIDEUP: { - *s = "vslideup.vx"; - *len = 11; - break; - } - case RISCV_VX_VRGATHER: { - *s = "vrgather.vx"; - *len = 11; - break; - } - } -} -void vitype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_VI_VSRL: { - *s = "vsrl.vi"; - *len = 7; - break; - } - case RISCV_VI_VAND: { - *s = "vand.vi"; - *len = 7; - break; - } - case RISCV_VI_VXOR: { - *s = "vxor.vi"; - *len = 7; - break; - } - case RISCV_VI_VSADD: { - *s = "vsadd.vi"; - *len = 8; - break; - } - case RISCV_VI_VSRA: { - *s = "vsra.vi"; - *len = 7; - break; - } - case RISCV_VI_VSSRL: { - *s = "vssrl.vi"; - *len = 8; - break; - } - case RISCV_VI_VSADDU: { - *s = "vsaddu.vi"; - *len = 9; - break; - } - case RISCV_VI_VSLL: { - *s = "vsll.vi"; - *len = 7; - break; - } - case RISCV_VI_VRSUB: { - *s = "vrsub.vi"; - *len = 8; - break; - } - case RISCV_VI_VADD: { - *s = "vadd.vi"; - *len = 7; - break; - } - case RISCV_VI_VOR: { - *s = "vor.vi"; - *len = 6; - break; - } - case RISCV_VI_VSSRA: { - *s = "vssra.vi"; - *len = 8; - break; - } - } -} -void nistype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_NIS_VNSRL: { - *s = "vnsrl.wi"; - *len = 8; - break; - } - case RISCV_NIS_VNSRA: { - *s = "vnsra.wi"; - *len = 8; - break; - } - } -} -void nitype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_NI_VNCLIPU: { - *s = "vnclipu.wi"; - *len = 10; - break; - } - case RISCV_NI_VNCLIP: { - *s = "vnclip.wi"; - *len = 9; - break; - } - } -} -void visg_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_VI_VRGATHER: { - *s = "vrgather.vi"; - *len = 11; - break; - } - case RISCV_VI_VSLIDEDOWN: { - *s = "vslidedown.vi"; - *len = 13; - break; - } - case RISCV_VI_VSLIDEUP: { - *s = "vslideup.vi"; - *len = 11; - break; - } - } -} -void simm_string(uint64_t member, char **s, size_t *len) { - switch (member) { - case 0x01: { - *s = "2"; - *len = 1; - break; - } - case 0x07: { - *s = "8"; - *len = 1; - break; - } - case 0x00: { - *s = "1"; - *len = 1; - break; - } - case 0x03: { - *s = "4"; - *len = 1; - break; - } - } -} -void mvvtype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_MVV_VDIV: { - *s = "vdiv.vv"; - *len = 7; - break; - } - case RISCV_MVV_VREMU: { - *s = "vremu.vv"; - *len = 8; - break; - } - case RISCV_MVV_VAADDU: { - *s = "vaaddu.vv"; - *len = 9; - break; - } - case RISCV_MVV_VMULHSU: { - *s = "vmulhsu.vv"; - *len = 10; - break; - } - case RISCV_MVV_VASUB: { - *s = "vasub.vv"; - *len = 8; - break; - } - case RISCV_MVV_VMULHU: { - *s = "vmulhu.vv"; - *len = 9; - break; - } - case RISCV_MVV_VDIVU: { - *s = "vdivu.vv"; - *len = 8; - break; - } - case RISCV_MVV_VMULH: { - *s = "vmulh.vv"; - *len = 8; - break; - } - case RISCV_MVV_VAADD: { - *s = "vaadd.vv"; - *len = 8; - break; - } - case RISCV_MVV_VMUL: { - *s = "vmul.vv"; - *len = 7; - break; - } - case RISCV_MVV_VREM: { - *s = "vrem.vv"; - *len = 7; - break; - } - case RISCV_MVV_VASUBU: { - *s = "vasubu.vv"; - *len = 9; - break; - } - } -} -void mvvmatype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_MVV_VMACC: { - *s = "vmacc.vv"; - *len = 8; - break; - } - case RISCV_MVV_VNMSUB: { - *s = "vnmsub.vv"; - *len = 9; - break; - } - case RISCV_MVV_VNMSAC: { - *s = "vnmsac.vv"; - *len = 9; - break; - } - case RISCV_MVV_VMADD: { - *s = "vmadd.vv"; - *len = 8; - break; - } - } -} -void wvvtype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_WVV_VSUBU: { - *s = "vwsubu.vv"; - *len = 9; - break; - } - case RISCV_WVV_VWMULSU: { - *s = "vwmulsu.vv"; - *len = 10; - break; - } - case RISCV_WVV_VADD: { - *s = "vwadd.vv"; - *len = 8; - break; - } - case RISCV_WVV_VWMUL: { - *s = "vwmul.vv"; - *len = 8; - break; - } - case RISCV_WVV_VADDU: { - *s = "vwaddu.vv"; - *len = 9; - break; - } - case RISCV_WVV_VWMULU: { - *s = "vwmulu.vv"; - *len = 9; - break; - } - case RISCV_WVV_VSUB: { - *s = "vwsub.vv"; - *len = 8; - break; - } - } -} -void wvtype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_WV_VSUB: { - *s = "vwsub.wv"; - *len = 8; - break; - } - case RISCV_WV_VADDU: { - *s = "vwaddu.wv"; - *len = 9; - break; - } - case RISCV_WV_VSUBU: { - *s = "vwsubu.wv"; - *len = 9; - break; - } - case RISCV_WV_VADD: { - *s = "vwadd.wv"; - *len = 8; - break; - } - } -} -void wmvvtype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_WMVV_VWMACCU: { - *s = "vwmaccu.vv"; - *len = 10; - break; - } - case RISCV_WMVV_VWMACCSU: { - *s = "vwmaccsu.vv"; - *len = 11; - break; - } - case RISCV_WMVV_VWMACC: { - *s = "vwmacc.vv"; - *len = 9; - break; - } - } -} -void vext2type_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_VEXT2_SVF2: { - *s = "vsext.vf2"; - *len = 9; - break; - } - case RISCV_VEXT2_ZVF2: { - *s = "vzext.vf2"; - *len = 9; - break; - } - } -} -void vext4type_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_VEXT4_ZVF4: { - *s = "vzext.vf4"; - *len = 9; - break; - } - case RISCV_VEXT4_SVF4: { - *s = "vsext.vf4"; - *len = 9; - break; - } - } -} -void vext8type_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_VEXT8_SVF8: { - *s = "vsext.vf8"; - *len = 9; - break; - } - case RISCV_VEXT8_ZVF8: { - *s = "vzext.vf8"; - *len = 9; - break; - } - } -} -void mvxtype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_MVX_VMUL: { - *s = "vmul.vx"; - *len = 7; - break; - } - case RISCV_MVX_VREM: { - *s = "vrem.vx"; - *len = 7; - break; - } - case RISCV_MVX_VMULH: { - *s = "vmulh.vx"; - *len = 8; - break; - } - case RISCV_MVX_VDIV: { - *s = "vdiv.vx"; - *len = 7; - break; - } - case RISCV_MVX_VAADDU: { - *s = "vaaddu.vx"; - *len = 9; - break; - } - case RISCV_MVX_VSLIDE1DOWN: { - *s = "vslide1down.vx"; - *len = 14; - break; - } - case RISCV_MVX_VMULHSU: { - *s = "vmulhsu.vx"; - *len = 10; - break; - } - case RISCV_MVX_VSLIDE1UP: { - *s = "vslide1up.vx"; - *len = 12; - break; - } - case RISCV_MVX_VMULHU: { - *s = "vmulhu.vx"; - *len = 9; - break; - } - case RISCV_MVX_VASUBU: { - *s = "vasubu.vx"; - *len = 9; - break; - } - case RISCV_MVX_VREMU: { - *s = "vremu.vx"; - *len = 8; - break; - } - case RISCV_MVX_VDIVU: { - *s = "vdivu.vx"; - *len = 8; - break; - } - case RISCV_MVX_VAADD: { - *s = "vaadd.vx"; - *len = 8; - break; - } - case RISCV_MVX_VASUB: { - *s = "vasub.vx"; - *len = 8; - break; - } - } -} -void mvxmatype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_MVX_VNMSAC: { - *s = "vnmsac.vx"; - *len = 9; - break; - } - case RISCV_MVX_VMADD: { - *s = "vmadd.vx"; - *len = 8; - break; - } - case RISCV_MVX_VMACC: { - *s = "vmacc.vx"; - *len = 8; - break; - } - case RISCV_MVX_VNMSUB: { - *s = "vnmsub.vx"; - *len = 9; - break; - } - } -} -void wvxtype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_WVX_VSUB: { - *s = "vwsub.vx"; - *len = 8; - break; - } - case RISCV_WVX_VADDU: { - *s = "vwaddu.vx"; - *len = 9; - break; - } - case RISCV_WVX_VADD: { - *s = "vwadd.vx"; - *len = 8; - break; - } - case RISCV_WVX_VSUBU: { - *s = "vwsubu.vx"; - *len = 9; - break; - } - case RISCV_WVX_VWMULSU: { - *s = "vwmulsu.vx"; - *len = 10; - break; - } - case RISCV_WVX_VWMUL: { - *s = "vwmul.vx"; - *len = 8; - break; - } - case RISCV_WVX_VWMULU: { - *s = "vwmulu.vx"; - *len = 9; - break; - } - } -} -void wxtype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_WX_VSUB: { - *s = "vwsub.wx"; - *len = 8; - break; - } - case RISCV_WX_VSUBU: { - *s = "vwsubu.wx"; - *len = 9; - break; - } - case RISCV_WX_VADD: { - *s = "vwadd.wx"; - *len = 8; - break; - } - case RISCV_WX_VADDU: { - *s = "vwaddu.wx"; - *len = 9; - break; - } - } -} -void wmvxtype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_WMVX_VWMACCU: { - *s = "vwmaccu.vx"; - *len = 10; - break; - } - case RISCV_WMVX_VWMACCSU: { - *s = "vwmaccsu.vx"; - *len = 11; - break; - } - case RISCV_WMVX_VWMACCUS: { - *s = "vwmaccus.vx"; - *len = 11; - break; - } - case RISCV_WMVX_VWMACC: { - *s = "vwmacc.vx"; - *len = 9; - break; - } - } -} -void fvvtype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_FVV_VSGNJ: { - *s = "vfsgnj.vv"; - *len = 9; - break; - } - case RISCV_FVV_VMIN: { - *s = "vfmin.vv"; - *len = 8; - break; - } - case RISCV_FVV_VDIV: { - *s = "vfdiv.vv"; - *len = 8; - break; - } - case RISCV_FVV_VMAX: { - *s = "vfmax.vv"; - *len = 8; - break; - } - case RISCV_FVV_VADD: { - *s = "vfadd.vv"; - *len = 8; - break; - } - case RISCV_FVV_VSUB: { - *s = "vfsub.vv"; - *len = 8; - break; - } - case RISCV_FVV_VSGNJN: { - *s = "vfsgnjn.vv"; - *len = 10; - break; - } - case RISCV_FVV_VSGNJX: { - *s = "vfsgnjx.vv"; - *len = 10; - break; - } - case RISCV_FVV_VMUL: { - *s = "vfmul.vv"; - *len = 8; - break; - } - } -} -void fvvmatype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_FVV_VNMSAC: { - *s = "vfnmsac.vv"; - *len = 10; - break; - } - case RISCV_FVV_VMACC: { - *s = "vfmacc.vv"; - *len = 9; - break; - } - case RISCV_FVV_VNMSUB: { - *s = "vfnmsub.vv"; - *len = 10; - break; - } - case RISCV_FVV_VMSAC: { - *s = "vfmsac.vv"; - *len = 9; - break; - } - case RISCV_FVV_VMADD: { - *s = "vfmadd.vv"; - *len = 9; - break; - } - case RISCV_FVV_VMSUB: { - *s = "vfmsub.vv"; - *len = 9; - break; - } - case RISCV_FVV_VNMACC: { - *s = "vfnmacc.vv"; - *len = 10; - break; - } - case RISCV_FVV_VNMADD: { - *s = "vfnmadd.vv"; - *len = 10; - break; - } - } -} -void fwvvtype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_FWVV_VADD: { - *s = "vfwadd.vv"; - *len = 9; - break; - } - case RISCV_FWVV_VSUB: { - *s = "vfwsub.vv"; - *len = 9; - break; - } - case RISCV_FWVV_VMUL: { - *s = "vfwmul.vv"; - *len = 9; - break; - } - } -} -void fwvvmatype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_FWVV_VMSAC: { - *s = "vfwmsac.vv"; - *len = 10; - break; - } - case RISCV_FWVV_VNMACC: { - *s = "vfwnmacc.vv"; - *len = 11; - break; - } - case RISCV_FWVV_VNMSAC: { - *s = "vfwnmsac.vv"; - *len = 11; - break; - } - case RISCV_FWVV_VMACC: { - *s = "vfwmacc.vv"; - *len = 10; - break; - } - } -} -void fwvtype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_FWV_VADD: { - *s = "vfwadd.wv"; - *len = 9; - break; - } - case RISCV_FWV_VSUB: { - *s = "vfwsub.wv"; - *len = 9; - break; - } - } -} -void vfunary0_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_FV_CVT_F_X: { - *s = "vfcvt.f.x.v"; - *len = 11; - break; - } - case RISCV_FV_CVT_X_F: { - *s = "vfcvt.x.f.v"; - *len = 11; - break; - } - case RISCV_FV_CVT_XU_F: { - *s = "vfcvt.xu.f.v"; - *len = 12; - break; - } - case RISCV_FV_CVT_RTZ_XU_F: { - *s = "vfcvt.rtz.xu.f.v"; - *len = 16; - break; - } - case RISCV_FV_CVT_RTZ_X_F: { - *s = "vfcvt.rtz.x.f.v"; - *len = 15; - break; - } - case RISCV_FV_CVT_F_XU: { - *s = "vfcvt.f.xu.v"; - *len = 12; - break; - } - } -} -void vfwunary0_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_FWV_CVT_F_X: { - *s = "vfwcvt.f.x.v"; - *len = 12; - break; - } - case RISCV_FWV_CVT_F_XU: { - *s = "vfwcvt.f.xu.v"; - *len = 13; - break; - } - case RISCV_FWV_CVT_F_F: { - *s = "vfwcvt.f.f.v"; - *len = 12; - break; - } - case RISCV_FWV_CVT_X_F: { - *s = "vfwcvt.x.f.v"; - *len = 12; - break; - } - case RISCV_FWV_CVT_RTZ_XU_F: { - *s = "vfwcvt.rtz.xu.f.v"; - *len = 17; - break; - } - case RISCV_FWV_CVT_RTZ_X_F: { - *s = "vfwcvt.rtz.x.f.v"; - *len = 16; - break; - } - case RISCV_FWV_CVT_XU_F: { - *s = "vfwcvt.xu.f.v"; - *len = 13; - break; - } - } -} -void vfnunary0_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_FNV_CVT_F_F: { - *s = "vfncvt.f.f.w"; - *len = 12; - break; - } - case RISCV_FNV_CVT_RTZ_XU_F: { - *s = "vfncvt.rtz.xu.f.w"; - *len = 17; - break; - } - case RISCV_FNV_CVT_F_XU: { - *s = "vfncvt.f.xu.w"; - *len = 13; - break; - } - case RISCV_FNV_CVT_F_X: { - *s = "vfncvt.f.x.w"; - *len = 12; - break; - } - case RISCV_FNV_CVT_RTZ_X_F: { - *s = "vfncvt.rtz.x.f.w"; - *len = 16; - break; - } - case RISCV_FNV_CVT_XU_F: { - *s = "vfncvt.xu.f.w"; - *len = 13; - break; - } - case RISCV_FNV_CVT_X_F: { - *s = "vfncvt.x.f.w"; - *len = 12; - break; - } - case RISCV_FNV_CVT_ROD_F_F: { - *s = "vfncvt.rod.f.f.w"; - *len = 16; - break; - } - } -} -void vfunary1_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_FVV_VCLASS: { - *s = "vfclass.v"; - *len = 9; - break; - } - case RISCV_FVV_VREC7: { - *s = "vfrec7.v"; - *len = 8; - break; - } - case RISCV_FVV_VRSQRT7: { - *s = "vfrsqrt7.v"; - *len = 10; - break; - } - case RISCV_FVV_VSQRT: { - *s = "vfsqrt.v"; - *len = 8; - break; - } - } -} -void fvftype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_VF_VMIN: { - *s = "vfmin.vf"; - *len = 8; - break; - } - case RISCV_VF_VSGNJ: { - *s = "vfsgnj.vf"; - *len = 9; - break; - } - case RISCV_VF_VSLIDE1UP: { - *s = "vfslide1up.vf"; - *len = 13; - break; - } - case RISCV_VF_VRSUB: { - *s = "vfrsub.vf"; - *len = 9; - break; - } - case RISCV_VF_VADD: { - *s = "vfadd.vf"; - *len = 8; - break; - } - case RISCV_VF_VSGNJX: { - *s = "vfsgnjx.vf"; - *len = 10; - break; - } - case RISCV_VF_VDIV: { - *s = "vfdiv.vf"; - *len = 8; - break; - } - case RISCV_VF_VSUB: { - *s = "vfsub.vf"; - *len = 8; - break; - } - case RISCV_VF_VRDIV: { - *s = "vfrdiv.vf"; - *len = 9; - break; - } - case RISCV_VF_VMUL: { - *s = "vfmul.vf"; - *len = 8; - break; - } - case RISCV_VF_VSGNJN: { - *s = "vfsgnjn.vf"; - *len = 10; - break; - } - case RISCV_VF_VMAX: { - *s = "vfmax.vf"; - *len = 8; - break; - } - case RISCV_VF_VSLIDE1DOWN: { - *s = "vfslide1down.vf"; - *len = 15; - break; - } - } -} -void fvfmatype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_VF_VNMADD: { - *s = "vfnmadd.vf"; - *len = 10; - break; - } - case RISCV_VF_VMSUB: { - *s = "vfmsub.vf"; - *len = 9; - break; - } - case RISCV_VF_VMACC: { - *s = "vfmacc.vf"; - *len = 9; - break; - } - case RISCV_VF_VMADD: { - *s = "vfmadd.vf"; - *len = 9; - break; - } - case RISCV_VF_VNMSAC: { - *s = "vfnmsac.vf"; - *len = 10; - break; - } - case RISCV_VF_VMSAC: { - *s = "vfmsac.vf"; - *len = 9; - break; - } - case RISCV_VF_VNMACC: { - *s = "vfnmacc.vf"; - *len = 10; - break; - } - case RISCV_VF_VNMSUB: { - *s = "vfnmsub.vf"; - *len = 10; - break; - } - } -} -void fwvftype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_FWVF_VADD: { - *s = "vfwadd.vf"; - *len = 9; - break; - } - case RISCV_FWVF_VSUB: { - *s = "vfwsub.vf"; - *len = 9; - break; - } - case RISCV_FWVF_VMUL: { - *s = "vfwmul.vf"; - *len = 9; - break; - } - } -} -void fwvfmatype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_FWVF_VNMACC: { - *s = "vfwnmacc.vf"; - *len = 11; - break; - } - case RISCV_FWVF_VMACC: { - *s = "vfwmacc.vf"; - *len = 10; - break; - } - case RISCV_FWVF_VNMSAC: { - *s = "vfwnmsac.vf"; - *len = 11; - break; - } - case RISCV_FWVF_VMSAC: { - *s = "vfwmsac.vf"; - *len = 10; - break; - } - } -} -void fwftype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_FWF_VSUB: { - *s = "vfwsub.wf"; - *len = 9; - break; - } - case RISCV_FWF_VADD: { - *s = "vfwadd.wf"; - *len = 9; - break; - } - } -} -void nfields_string(uint64_t member, char **s, size_t *len) { - switch (member) { - case 0x7: { - *s = "seg8"; - *len = 4; - break; - } - case 0x5: { - *s = "seg6"; - *len = 4; - break; - } - case 0x1: { - *s = "seg2"; - *len = 4; - break; - } - case 0x3: { - *s = "seg4"; - *len = 4; - break; - } - case 0x2: { - *s = "seg3"; - *len = 4; - break; - } - case 0x4: { - *s = "seg5"; - *len = 4; - break; - } - case 0x6: { - *s = "seg7"; - *len = 4; - break; - } - case 0x0: { - *s = ""; - *len = 0; - break; - } - } -} -void vlewidth_bitsnumberstr(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_VLE16: { - *s = "16"; - *len = 2; - break; - } - case RISCV_VLE32: { - *s = "32"; - *len = 2; - break; - } - case RISCV_VLE64: { - *s = "64"; - *len = 2; - break; - } - case RISCV_VLE8: { - *s = "8"; - *len = 1; - break; - } - } -} -void vmtype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_VLM: { - *s = "vlm.v"; - *len = 5; - break; - } - case RISCV_VSM: { - *s = "vsm.v"; - *len = 5; - break; - } - } -} -void mmtype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_MM_VMANDN: { - *s = "vmandn.mm"; - *len = 9; - break; - } - case RISCV_MM_VMOR: { - *s = "vmor.mm"; - *len = 7; - break; - } - case RISCV_MM_VMXOR: { - *s = "vmxor.mm"; - *len = 8; - break; - } - case RISCV_MM_VMNOR: { - *s = "vmnor.mm"; - *len = 8; - break; - } - case RISCV_MM_VMORN: { - *s = "vmorn.mm"; - *len = 8; - break; - } - case RISCV_MM_VMAND: { - *s = "vmand.mm"; - *len = 8; - break; - } - case RISCV_MM_VMXNOR: { - *s = "vmxnor.mm"; - *len = 9; - break; - } - case RISCV_MM_VMNAND: { - *s = "vmnand.mm"; - *len = 9; - break; - } - } -} -void vvmtype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_VVM_VMADC: { - *s = "vmadc.vvm"; - *len = 9; - break; - } - case RISCV_VVM_VMSBC: { - *s = "vmsbc.vvm"; - *len = 9; - break; - } - } -} -void vvmctype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_VVMC_VMADC: { - *s = "vmadc.vv"; - *len = 8; - break; - } - case RISCV_VVMC_VMSBC: { - *s = "vmsbc.vv"; - *len = 8; - break; - } - } -} -void vvmstype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_VVMS_VSBC: { - *s = "vsbc.vvm"; - *len = 8; - break; - } - case RISCV_VVMS_VADC: { - *s = "vadc.vvm"; - *len = 8; - break; - } - } -} -void vvcmptype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_VVCMP_VMSEQ: { - *s = "vmseq.vv"; - *len = 8; - break; - } - case RISCV_VVCMP_VMSLTU: { - *s = "vmsltu.vv"; - *len = 9; - break; - } - case RISCV_VVCMP_VMSLE: { - *s = "vmsle.vv"; - *len = 8; - break; - } - case RISCV_VVCMP_VMSLEU: { - *s = "vmsleu.vv"; - *len = 9; - break; - } - case RISCV_VVCMP_VMSNE: { - *s = "vmsne.vv"; - *len = 8; - break; - } - case RISCV_VVCMP_VMSLT: { - *s = "vmslt.vv"; - *len = 8; - break; - } - } -} -void vxmtype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_VXM_VMSBC: { - *s = "vmsbc.vxm"; - *len = 9; - break; - } - case RISCV_VXM_VMADC: { - *s = "vmadc.vxm"; - *len = 9; - break; - } - } -} -void vxmctype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_VXMC_VMSBC: { - *s = "vmsbc.vx"; - *len = 8; - break; - } - case RISCV_VXMC_VMADC: { - *s = "vmadc.vx"; - *len = 8; - break; - } - } -} -void vxmstype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_VXMS_VADC: { - *s = "vadc.vxm"; - *len = 8; - break; - } - case RISCV_VXMS_VSBC: { - *s = "vsbc.vxm"; - *len = 8; - break; - } - } -} -void vxcmptype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_VXCMP_VMSLTU: { - *s = "vmsltu.vx"; - *len = 9; - break; - } - case RISCV_VXCMP_VMSLEU: { - *s = "vmsleu.vx"; - *len = 9; - break; - } - case RISCV_VXCMP_VMSNE: { - *s = "vmsne.vx"; - *len = 8; - break; - } - case RISCV_VXCMP_VMSGT: { - *s = "vmsgt.vx"; - *len = 8; - break; - } - case RISCV_VXCMP_VMSEQ: { - *s = "vmseq.vx"; - *len = 8; - break; - } - case RISCV_VXCMP_VMSGTU: { - *s = "vmsgtu.vx"; - *len = 9; - break; - } - case RISCV_VXCMP_VMSLT: { - *s = "vmslt.vx"; - *len = 8; - break; - } - case RISCV_VXCMP_VMSLE: { - *s = "vmsle.vx"; - *len = 8; - break; - } - } -} -void vimtype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_VIM_VMADC: { - *s = "vmadc.vim"; - *len = 9; - break; - } - } -} -void vimctype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_VIMC_VMADC: { - *s = "vmadc.vi"; - *len = 8; - break; - } - } -} -void vimstype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_VIMS_VADC: { - *s = "vadc.vim"; - *len = 8; - break; - } - } -} -void vicmptype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_VICMP_VMSEQ: { - *s = "vmseq.vi"; - *len = 8; - break; - } - case RISCV_VICMP_VMSGTU: { - *s = "vmsgtu.vi"; - *len = 9; - break; - } - case RISCV_VICMP_VMSLEU: { - *s = "vmsleu.vi"; - *len = 9; - break; - } - case RISCV_VICMP_VMSLE: { - *s = "vmsle.vi"; - *len = 8; - break; - } - case RISCV_VICMP_VMSNE: { - *s = "vmsne.vi"; - *len = 8; - break; - } - case RISCV_VICMP_VMSGT: { - *s = "vmsgt.vi"; - *len = 8; - break; - } - } -} -void fvvmtype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_FVVM_VMFNE: { - *s = "vmfne.vv"; - *len = 8; - break; - } - case RISCV_FVVM_VMFEQ: { - *s = "vmfeq.vv"; - *len = 8; - break; - } - case RISCV_FVVM_VMFLT: { - *s = "vmflt.vv"; - *len = 8; - break; - } - case RISCV_FVVM_VMFLE: { - *s = "vmfle.vv"; - *len = 8; - break; - } - } -} -void fvfmtype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_VFM_VMFNE: { - *s = "vmfne.vf"; - *len = 8; - break; - } - case RISCV_VFM_VMFGT: { - *s = "vmfgt.vf"; - *len = 8; - break; - } - case RISCV_VFM_VMFLT: { - *s = "vmflt.vf"; - *len = 8; - break; - } - case RISCV_VFM_VMFEQ: { - *s = "vmfeq.vf"; - *len = 8; - break; - } - case RISCV_VFM_VMFLE: { - *s = "vmfle.vf"; - *len = 8; - break; - } - case RISCV_VFM_VMFGE: { - *s = "vmfge.vf"; - *len = 8; - break; - } - } -} -void rivvtype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_IVV_VWREDSUMU: { - *s = "vwredsumu.vs"; - *len = 12; - break; - } - case RISCV_IVV_VWREDSUM: { - *s = "vwredsum.vs"; - *len = 11; - break; - } - } -} -void rmvvtype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_MVV_VREDAND: { - *s = "vredand.vs"; - *len = 10; - break; - } - case RISCV_MVV_VREDXOR: { - *s = "vredxor.vs"; - *len = 10; - break; - } - case RISCV_MVV_VREDOR: { - *s = "vredor.vs"; - *len = 9; - break; - } - case RISCV_MVV_VREDMIN: { - *s = "vredmin.vs"; - *len = 10; - break; - } - case RISCV_MVV_VREDMAXU: { - *s = "vredmaxu.vs"; - *len = 11; - break; - } - case RISCV_MVV_VREDMINU: { - *s = "vredminu.vs"; - *len = 11; - break; - } - case RISCV_MVV_VREDSUM: { - *s = "vredsum.vs"; - *len = 10; - break; - } - case RISCV_MVV_VREDMAX: { - *s = "vredmax.vs"; - *len = 10; - break; - } - } -} -void rfvvtype_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_FVV_VFWREDOSUM: { - *s = "vfwredosum.vs"; - *len = 13; - break; - } - case RISCV_FVV_VFREDOSUM: { - *s = "vfredosum.vs"; - *len = 12; - break; - } - case RISCV_FVV_VFREDUSUM: { - *s = "vfredusum.vs"; - *len = 12; - break; - } - case RISCV_FVV_VFREDMIN: { - *s = "vfredmin.vs"; - *len = 11; - break; - } - case RISCV_FVV_VFWREDUSUM: { - *s = "vfwredusum.vs"; - *len = 13; - break; - } - case RISCV_FVV_VFREDMAX: { - *s = "vfredmax.vs"; - *len = 11; - break; - } - } -} -void cbop_mnemonic(uint64_t member, char **s, size_t *len) { - switch (member) { - case RISCV_CBO_INVAL: { - *s = "cbo.inval"; - *len = 9; - break; - } - case RISCV_CBO_CLEAN: { - *s = "cbo.clean"; - *len = 9; - break; - } - case RISCV_CBO_FLUSH: { - *s = "cbo.flush"; - *len = 9; - break; - } - } -} - -#endif diff --git a/arch/RISCV/riscv_insn_mapping.gen.inc b/arch/RISCV/riscv_insn_mapping.gen.inc deleted file mode 100644 index 0480473266..0000000000 --- a/arch/RISCV/riscv_insn_mapping.gen.inc +++ /dev/null @@ -1,608 +0,0 @@ -/*=======================================================================*/ -/*This code was generated by the tool riscv_disasm_from_sail (see - * https://github.com/moste00/riscv_disasm_from_sail)*/ -/*from the sail model of RISC-V (see https://github.com/riscv/sail-riscv) @ - * version 0b9c639f19da48734cbf14b61f6ad200b7c70de9.*/ -/*DO NOT MODIFY THIS CODE MANUALLY.*/ -/* */ -/*SPDX-License-Identifier: BSD-3-Clause*/ -/*=======================================================================*/ - -#ifndef __Riscv_insn_mapping_gen_inc__ -#define __Riscv_insn_mapping_gen_inc__ -#include - -#include - -#include "../include/capstone/riscv_insn.gen.inc" -#include - -static const uint16_t to_insn[294][21] = { - [RISCV_REV8] = {RISCV_REV8}, - [RISCV_WXTYPE] = {RISCV_WX_VSUBU, RISCV_WX_VSUB, RISCV_WX_VADDU, - RISCV_WX_VADD}, - [RISCV_C_SRLI_HINT] = {RISCV_C_SRLI_HINT}, - [RISCV_AES64DS] = {RISCV_AES64DS}, - [RISCV_VMSBF_M] = {RISCV_VMSBF_M}, - [RISCV_RTYPE] = {RISCV_XOR, RISCV_SUB, RISCV_SRL, RISCV_SRA, RISCV_SLTU, - RISCV_SLT, RISCV_SLL, RISCV_OR, RISCV_AND, RISCV_ADD}, - [RISCV_VFMERGE] = {RISCV_VFMERGE}, - [RISCV_RIVVTYPE] = {RISCV_IVV_VWREDSUMU, RISCV_IVV_VWREDSUM}, - [RISCV_C_ZEXT_W] = {RISCV_C_ZEXT_W}, - [RISCV_SFENCE_INVAL_IR] = {RISCV_SFENCE_INVAL_IR}, - [RISCV_XPERM4] = {RISCV_XPERM4}, - [RISCV_C_AND] = {RISCV_C_AND}, - [RISCV_AES32DSI] = {RISCV_AES32DSI}, - [RISCV_RORI] = {RISCV_RORI}, - [RISCV_JALR] = {RISCV_JALR}, - [RISCV_VMSIF_M] = {RISCV_VMSIF_M}, - [RISCV_VLSSEGTYPE] = {RISCV_VLSSEGTYPE}, - [RISCV_SHA512SIG1H] = {RISCV_SHA512SIG1H}, - [RISCV_FLTQ_S] = {RISCV_FLTQ_S}, - [RISCV_VXSG] = {RISCV_VX_VSLIDEUP, RISCV_VX_VSLIDEDOWN, RISCV_VX_VRGATHER}, - [RISCV_VXCMPTYPE] = {RISCV_VXCMP_VMSNE, RISCV_VXCMP_VMSLTU, - RISCV_VXCMP_VMSLT, RISCV_VXCMP_VMSLEU, - RISCV_VXCMP_VMSLE, RISCV_VXCMP_VMSGTU, - RISCV_VXCMP_VMSGT, RISCV_VXCMP_VMSEQ}, - [RISCV_C_LHU] = {RISCV_C_LHU}, - [RISCV_JAL] = {RISCV_JAL}, - [RISCV_ECALL] = {RISCV_ECALL}, - [RISCV_C_FSWSP] = {RISCV_C_FSWSP}, - [RISCV_VMVXS] = {RISCV_VMVXS}, - [RISCV_C_FLD] = {RISCV_C_FLD}, - [RISCV_SHIFTIWOP] = {RISCV_SRLIW, RISCV_SRAIW, RISCV_SLLIW}, - [RISCV_UNZIP] = {RISCV_UNZIP}, - [RISCV_ZICBOM] = {RISCV_CBO_INVAL, RISCV_CBO_FLUSH, RISCV_CBO_CLEAN}, - [RISCV_SHA512SIG1] = {RISCV_SHA512SIG1}, - [RISCV_NITYPE] = {RISCV_NI_VNCLIPU, RISCV_NI_VNCLIP}, - [RISCV_WFI] = {RISCV_WFI}, - [RISCV_VVMTYPE] = {RISCV_VVM_VMSBC, RISCV_VVM_VMADC}, - [RISCV_MVXMATYPE] = {RISCV_MVX_VNMSUB, RISCV_MVX_VNMSAC, RISCV_MVX_VMADD, - RISCV_MVX_VMACC}, - [RISCV_FLI_D] = {RISCV_FLI_D}, - [RISCV_C_ADDI_HINT] = {RISCV_C_ADDI_HINT}, - [RISCV_MASKTYPEX] = {RISCV_MASKTYPEX}, - [RISCV_FROUNDNX_D] = {RISCV_FROUNDNX_D}, - [RISCV_FROUND_D] = {RISCV_FROUND_D}, - [RISCV_VSETIVLI] = {RISCV_VSETIVLI}, - [RISCV_FMAXM_D] = {RISCV_FMAXM_D}, - [RISCV_C_SD] = {RISCV_C_SD}, - [RISCV_F_BIN_TYPE_H] = {RISCV_FSGNJ_H, RISCV_FSGNJX_H, RISCV_FSGNJN_H, - RISCV_FMIN_H, RISCV_FMAX_H, RISCV_FLT_H, - RISCV_FLE_H, RISCV_FEQ_H}, - [RISCV_ZBKB_PACKW] = {RISCV_ZBKB_PACKW}, - [RISCV_FVVMTYPE] = {RISCV_FVVM_VMFNE, RISCV_FVVM_VMFLT, RISCV_FVVM_VMFLE, - RISCV_FVVM_VMFEQ}, - [RISCV_VMVSX] = {RISCV_VMVSX}, - [RISCV_F_UN_RM_TYPE_D] = {RISCV_FSQRT_D, RISCV_FCVT_W_D, RISCV_FCVT_WU_D, - RISCV_FCVT_S_D, RISCV_FCVT_L_D, RISCV_FCVT_LU_D, - RISCV_FCVT_D_WU, RISCV_FCVT_D_W, RISCV_FCVT_D_S, - RISCV_FCVT_D_LU, RISCV_FCVT_D_L}, - [RISCV_ORCB] = {RISCV_ORCB}, - [RISCV_C_MUL] = {RISCV_C_MUL}, - [RISCV_SM3P1] = {RISCV_SM3P1}, - [RISCV_CLMUL] = {RISCV_CLMUL}, - [RISCV_FLEQ_S] = {RISCV_FLEQ_S}, - [RISCV_WVXTYPE] = {RISCV_WVX_VWMULU, RISCV_WVX_VWMULSU, RISCV_WVX_VWMUL, - RISCV_WVX_VSUBU, RISCV_WVX_VSUB, RISCV_WVX_VADDU, - RISCV_WVX_VADD}, - [RISCV_FMAXM_S] = {RISCV_FMAXM_S}, - [RISCV_C_ILLEGAL] = {RISCV_C_ILLEGAL}, - [RISCV_NXSTYPE] = {RISCV_NXS_VNSRL, RISCV_NXS_VNSRA}, - [RISCV_VSOXSEGTYPE] = {RISCV_VSOXSEGTYPE}, - [RISCV_C_NOP] = {RISCV_C_NOP}, - [RISCV_VXMCTYPE] = {RISCV_VXMC_VMSBC, RISCV_VXMC_VMADC}, - [RISCV_MMTYPE] = {RISCV_MM_VMXOR, RISCV_MM_VMXNOR, RISCV_MM_VMORN, - RISCV_MM_VMOR, RISCV_MM_VMNOR, RISCV_MM_VMNAND, - RISCV_MM_VMANDN, RISCV_MM_VMAND}, - [RISCV_F_UN_TYPE_S] = {RISCV_FMV_X_W, RISCV_FMV_W_X, RISCV_FCLASS_S}, - [RISCV_NVTYPE] = {RISCV_NV_VNCLIPU, RISCV_NV_VNCLIP}, - [RISCV_AES64KS2] = {RISCV_AES64KS2}, - [RISCV_AES32ESMI] = {RISCV_AES32ESMI}, - [RISCV_F_MADD_TYPE_H] = {RISCV_FNMSUB_H, RISCV_FNMADD_H, RISCV_FMSUB_H, - RISCV_FMADD_H}, - [RISCV_FROUNDNX_H] = {RISCV_FROUNDNX_H}, - [RISCV_MOVETYPEI] = {RISCV_MOVETYPEI}, - [RISCV_FLTQ_H] = {RISCV_FLTQ_H}, - [RISCV_C_LW] = {RISCV_C_LW}, - [RISCV_C_LWSP] = {RISCV_C_LWSP}, - [RISCV_C_ADDI16SP] = {RISCV_C_ADDI16SP}, - [RISCV_SHA512SIG0L] = {RISCV_SHA512SIG0L}, - [RISCV_SM3P0] = {RISCV_SM3P0}, - [RISCV_SM4ED] = {RISCV_SM4ED}, - [RISCV_FMINM_D] = {RISCV_FMINM_D}, - [RISCV_AES64IM] = {RISCV_AES64IM}, - [RISCV_VLRETYPE] = {RISCV_VLRETYPE}, - [RISCV_VFMVFS] = {RISCV_VFMVFS}, - [RISCV_CTZ] = {RISCV_CTZ}, - [RISCV_FMVH_X_D] = {RISCV_FMVH_X_D}, - [RISCV_SLLIUW] = {RISCV_SLLIUW}, - [RISCV_FMINM_S] = {RISCV_FMINM_S}, - [RISCV_ZBA_RTYPEUW] = {RISCV_SH3ADDUW, RISCV_SH2ADDUW, RISCV_SH1ADDUW, - RISCV_ADDUW}, - [RISCV_F_BIN_RM_TYPE_D] = {RISCV_FSUB_D, RISCV_FMUL_D, RISCV_FDIV_D, - RISCV_FADD_D}, - [RISCV_C_ADD_HINT] = {RISCV_C_ADD_HINT}, - [RISCV_F_MADD_TYPE_S] = {RISCV_FNMSUB_S, RISCV_FNMADD_S, RISCV_FMSUB_S, - RISCV_FMADD_S}, - [RISCV_ZIP] = {RISCV_ZIP}, - [RISCV_SHA512SUM1] = {RISCV_SHA512SUM1}, - [RISCV_C_LDSP] = {RISCV_C_LDSP}, - [RISCV_F_UN_RM_TYPE_H] = {RISCV_FSQRT_H, RISCV_FCVT_W_H, RISCV_FCVT_WU_H, - RISCV_FCVT_S_H, RISCV_FCVT_L_H, RISCV_FCVT_LU_H, - RISCV_FCVT_H_WU, RISCV_FCVT_H_W, RISCV_FCVT_H_S, - RISCV_FCVT_H_LU, RISCV_FCVT_H_L, RISCV_FCVT_H_D, - RISCV_FCVT_D_H}, - [RISCV_CPOP] = {RISCV_CPOP}, - [RISCV_FWFTYPE] = {RISCV_FWF_VSUB, RISCV_FWF_VADD}, - [RISCV_FWVTYPE] = {RISCV_FWV_VSUB, RISCV_FWV_VADD}, - [RISCV_ZBB_RTYPE] = {RISCV_XNOR, RISCV_ROR, RISCV_ROL, RISCV_ORN, - RISCV_MINU, RISCV_MIN, RISCV_MAXU, RISCV_MAX, - RISCV_ANDN}, - [RISCV_SM4KS] = {RISCV_SM4KS}, - [RISCV_RORIW] = {RISCV_RORIW}, - [RISCV_NXTYPE] = {RISCV_NX_VNCLIPU, RISCV_NX_VNCLIP}, - [RISCV_C_ADDIW] = {RISCV_C_ADDIW}, - [RISCV_C_LD] = {RISCV_C_LD}, - [RISCV_CTZW] = {RISCV_CTZW}, - [RISCV_XPERM8] = {RISCV_XPERM8}, - [RISCV_ITYPE] = {RISCV_XORI, RISCV_SLTIU, RISCV_SLTI, RISCV_ORI, RISCV_ANDI, - RISCV_ADDI}, - [RISCV_VID_V] = {RISCV_VID_V}, - [RISCV_FENCE] = {RISCV_FENCE}, - [RISCV_C_FLWSP] = {RISCV_C_FLWSP}, - [RISCV_STORE] = {RISCV_STORE}, - [RISCV_F_BIN_TYPE_S] = {RISCV_FSGNJ_S, RISCV_FSGNJX_S, RISCV_FSGNJN_S, - RISCV_FMIN_S, RISCV_FMAX_S, RISCV_FLT_S, - RISCV_FLE_S, RISCV_FEQ_S}, - [RISCV_VSSEGTYPE] = {RISCV_VSSEGTYPE}, - [RISCV_F_BIN_TYPE_D] = {RISCV_FSGNJ_D, RISCV_FSGNJX_D, RISCV_FSGNJN_D, - RISCV_FMIN_D, RISCV_FMAX_D, RISCV_FLT_D, - RISCV_FLE_D, RISCV_FEQ_D}, - [RISCV_ZICOND_RTYPE] = {RISCV_CZERO_NEZ, RISCV_CZERO_EQZ}, - [RISCV_C_FSDSP] = {RISCV_C_FSDSP}, - [RISCV_SRET] = {RISCV_SRET}, - [RISCV_STORE_FP] = {RISCV_STORE_FP}, - [RISCV_C_JALR] = {RISCV_C_JALR}, - [RISCV_FENCE_TSO] = {RISCV_FENCE_TSO}, - [RISCV_SHA512SIG0] = {RISCV_SHA512SIG0}, - [RISCV_FLI_S] = {RISCV_FLI_S}, - [RISCV_C_SB] = {RISCV_C_SB}, - [RISCV_ZBB_RTYPEW] = {RISCV_RORW, RISCV_ROLW}, - [RISCV_C_FLDSP] = {RISCV_C_FLDSP}, - [RISCV_C_MV_HINT] = {RISCV_C_MV_HINT}, - [RISCV_FCVTMOD_W_D] = {RISCV_FCVTMOD_W_D}, - [RISCV_RFVVTYPE] = {RISCV_FVV_VFWREDUSUM, RISCV_FVV_VFWREDOSUM, - RISCV_FVV_VFREDUSUM, RISCV_FVV_VFREDOSUM, - RISCV_FVV_VFREDMIN, RISCV_FVV_VFREDMAX}, - [RISCV_SHA512SIG0H] = {RISCV_SHA512SIG0H}, - [RISCV_AMO] = {RISCV_AMOXOR, RISCV_AMOSWAP, RISCV_AMOOR, RISCV_AMOMINU, - RISCV_AMOMIN, RISCV_AMOMAXU, RISCV_AMOMAX, RISCV_AMOAND, - RISCV_AMOADD}, - [RISCV_LOAD_FP] = {RISCV_LOAD_FP}, - [RISCV_VVMSTYPE] = {RISCV_VVMS_VSBC, RISCV_VVMS_VADC}, - [RISCV_FVVMATYPE] = {RISCV_FVV_VNMSUB, RISCV_FVV_VNMSAC, RISCV_FVV_VNMADD, - RISCV_FVV_VNMACC, RISCV_FVV_VMSUB, RISCV_FVV_VMSAC, - RISCV_FVV_VMADD, RISCV_FVV_VMACC}, - [RISCV_VEXT2TYPE] = {RISCV_VEXT2_ZVF2, RISCV_VEXT2_SVF2}, - [RISCV_EBREAK] = {RISCV_EBREAK}, - [RISCV_C_LUI] = {RISCV_C_LUI}, - [RISCV_F_MADD_TYPE_D] = {RISCV_FNMSUB_D, RISCV_FNMADD_D, RISCV_FMSUB_D, - RISCV_FMADD_D}, - [RISCV_C_ZEXT_H] = {RISCV_C_ZEXT_H}, - [RISCV_SHA512SIG1L] = {RISCV_SHA512SIG1L}, - [RISCV_VLSEGTYPE] = {RISCV_VLSEGTYPE}, - [RISCV_SHA256SIG0] = {RISCV_SHA256SIG0}, - [RISCV_F_UN_TYPE_H] = {RISCV_FMV_X_H, RISCV_FMV_H_X, RISCV_FCLASS_H}, - [RISCV_C_ADDI4SPN] = {RISCV_C_ADDI4SPN}, - [RISCV_VVTYPE] = {RISCV_VV_VXOR, RISCV_VV_VSUB, RISCV_VV_VSSUBU, - RISCV_VV_VSSUB, RISCV_VV_VSSRL, RISCV_VV_VSSRA, - RISCV_VV_VSRL, RISCV_VV_VSRA, RISCV_VV_VSMUL, - RISCV_VV_VSLL, RISCV_VV_VSADDU, RISCV_VV_VSADD, - RISCV_VV_VRGATHEREI16, RISCV_VV_VRGATHER, RISCV_VV_VOR, - RISCV_VV_VMINU, RISCV_VV_VMIN, RISCV_VV_VMAXU, - RISCV_VV_VMAX, RISCV_VV_VAND, RISCV_VV_VADD}, - [RISCV_FLEQ_H] = {RISCV_FLEQ_H}, - [RISCV_VICMPTYPE] = {RISCV_VICMP_VMSNE, RISCV_VICMP_VMSLEU, - RISCV_VICMP_VMSLE, RISCV_VICMP_VMSGTU, - RISCV_VICMP_VMSGT, RISCV_VICMP_VMSEQ}, - [RISCV_C_FLW] = {RISCV_C_FLW}, - [RISCV_C_SWSP] = {RISCV_C_SWSP}, - [RISCV_FLTQ_D] = {RISCV_FLTQ_D}, - [RISCV_AES64ES] = {RISCV_AES64ES}, - [RISCV_C_SRAI_HINT] = {RISCV_C_SRAI_HINT}, - [RISCV_DIV] = {RISCV_DIV}, - [RISCV_F_UN_TYPE_D] = {RISCV_FMV_X_D, RISCV_FMV_D_X, RISCV_FCLASS_D}, - [RISCV_C_LH] = {RISCV_C_LH}, - [RISCV_C_NOP_HINT] = {RISCV_C_NOP_HINT}, - [RISCV_VFIRST_M] = {RISCV_VFIRST_M}, - [RISCV_MVVMATYPE] = {RISCV_MVV_VNMSUB, RISCV_MVV_VNMSAC, RISCV_MVV_VMADD, - RISCV_MVV_VMACC}, - [RISCV_FENCEI_RESERVED] = {RISCV_FENCEI_RESERVED}, - [RISCV_C_ADDI] = {RISCV_C_ADDI}, - [RISCV_VLOXSEGTYPE] = {RISCV_VLOXSEGTYPE}, - [RISCV_MUL] = {RISCV_MUL}, - [RISCV_VMSOF_M] = {RISCV_VMSOF_M}, - [RISCV_FLEQ_D] = {RISCV_FLEQ_D}, - [RISCV_VSSSEGTYPE] = {RISCV_VSSSEGTYPE}, - [RISCV_VXTYPE] = {RISCV_VX_VXOR, RISCV_VX_VSUB, RISCV_VX_VSSUBU, - RISCV_VX_VSSUB, RISCV_VX_VSSRL, RISCV_VX_VSSRA, - RISCV_VX_VSRL, RISCV_VX_VSRA, RISCV_VX_VSMUL, - RISCV_VX_VSLL, RISCV_VX_VSADDU, RISCV_VX_VSADD, - RISCV_VX_VRSUB, RISCV_VX_VOR, RISCV_VX_VMINU, - RISCV_VX_VMIN, RISCV_VX_VMAXU, RISCV_VX_VMAX, - RISCV_VX_VAND, RISCV_VX_VADD}, - [RISCV_BTYPE] = {RISCV_BNE, RISCV_BLTU, RISCV_BLT, RISCV_BGEU, RISCV_BGE, - RISCV_BEQ}, - [RISCV_LOAD] = {RISCV_LOAD}, - [RISCV_VIOTA_M] = {RISCV_VIOTA_M}, - [RISCV_CLMULR] = {RISCV_CLMULR}, - [RISCV_VXMSTYPE] = {RISCV_VXMS_VSBC, RISCV_VXMS_VADC}, - [RISCV_CLZ] = {RISCV_CLZ}, - [RISCV_UTYPE] = {RISCV_LUI, RISCV_AUIPC}, - [RISCV_CLMULH] = {RISCV_CLMULH}, - [RISCV_FLI_H] = {RISCV_FLI_H}, - [RISCV_F_BIN_RM_TYPE_H] = {RISCV_FSUB_H, RISCV_FMUL_H, RISCV_FDIV_H, - RISCV_FADD_H}, - [RISCV_VSETVLI] = {RISCV_VSETVLI}, - [RISCV_C_SEXT_B] = {RISCV_C_SEXT_B}, - [RISCV_VLUXSEGTYPE] = {RISCV_VLUXSEGTYPE}, - [RISCV_SHA512SUM1R] = {RISCV_SHA512SUM1R}, - [RISCV_VITYPE] = {RISCV_VI_VXOR, RISCV_VI_VSSRL, RISCV_VI_VSSRA, - RISCV_VI_VSRL, RISCV_VI_VSRA, RISCV_VI_VSLL, - RISCV_VI_VSADDU, RISCV_VI_VSADD, RISCV_VI_VRSUB, - RISCV_VI_VOR, RISCV_VI_VAND, RISCV_VI_VADD}, - [RISCV_STORECON] = {RISCV_STORECON}, - [RISCV_VMVRTYPE] = {RISCV_VMVRTYPE}, - [RISCV_ZBKB_RTYPE] = {RISCV_PACKH, RISCV_PACK}, - [RISCV_VISG] = {RISCV_VI_VSLIDEUP, RISCV_VI_VSLIDEDOWN, RISCV_VI_VRGATHER}, - [RISCV_C_ADD] = {RISCV_C_ADD}, - [RISCV_FVFTYPE] = {RISCV_VF_VSUB, RISCV_VF_VSLIDE1UP, RISCV_VF_VSLIDE1DOWN, - RISCV_VF_VSGNJX, RISCV_VF_VSGNJN, RISCV_VF_VSGNJ, - RISCV_VF_VRSUB, RISCV_VF_VRDIV, RISCV_VF_VMUL, - RISCV_VF_VMIN, RISCV_VF_VMAX, RISCV_VF_VDIV, - RISCV_VF_VADD}, - [RISCV_FENCE_RESERVED] = {RISCV_FENCE_RESERVED}, - [RISCV_MASKTYPEI] = {RISCV_MASKTYPEI}, - [RISCV_FVVTYPE] = {RISCV_FVV_VSUB, RISCV_FVV_VSGNJX, RISCV_FVV_VSGNJN, - RISCV_FVV_VSGNJ, RISCV_FVV_VMUL, RISCV_FVV_VMIN, - RISCV_FVV_VMAX, RISCV_FVV_VDIV, RISCV_FVV_VADD}, - [RISCV_CPOPW] = {RISCV_CPOPW}, - [RISCV_C_LI_HINT] = {RISCV_C_LI_HINT}, - [RISCV_SHA256SUM1] = {RISCV_SHA256SUM1}, - [RISCV_VSUXSEGTYPE] = {RISCV_VSUXSEGTYPE}, - [RISCV_VIMCTYPE] = {RISCV_VIMC_VMADC}, - [RISCV_VIMSTYPE] = {RISCV_VIMS_VADC}, - [RISCV_MASKTYPEV] = {RISCV_MASKTYPEV}, - [RISCV_FVFMTYPE] = {RISCV_VFM_VMFNE, RISCV_VFM_VMFLT, RISCV_VFM_VMFLE, - RISCV_VFM_VMFGT, RISCV_VFM_VMFGE, RISCV_VFM_VMFEQ}, - [RISCV_ADDIW] = {RISCV_ADDIW}, - [RISCV_MRET] = {RISCV_MRET}, - [RISCV_VLSEGFFTYPE] = {RISCV_VLSEGFFTYPE}, - [RISCV_C_ANDI] = {RISCV_C_ANDI}, - [RISCV_WVTYPE] = {RISCV_WV_VSUBU, RISCV_WV_VSUB, RISCV_WV_VADDU, - RISCV_WV_VADD}, - [RISCV_C_SDSP] = {RISCV_C_SDSP}, - [RISCV_C_SUBW] = {RISCV_C_SUBW}, - [RISCV_VEXT4TYPE] = {RISCV_VEXT4_ZVF4, RISCV_VEXT4_SVF4}, - [RISCV_VSETVL] = {RISCV_VSETVL}, - [RISCV_C_SH] = {RISCV_C_SH}, - [RISCV_MVVCOMPRESS] = {RISCV_MVVCOMPRESS}, - [RISCV_FWVVTYPE] = {RISCV_FWVV_VSUB, RISCV_FWVV_VMUL, RISCV_FWVV_VADD}, - [RISCV_VMTYPE] = {RISCV_VSM, RISCV_VLM}, - [RISCV_FROUND_H] = {RISCV_FROUND_H}, - [RISCV_C_JAL] = {RISCV_C_JAL}, - [RISCV_SFENCE_VMA] = {RISCV_SFENCE_VMA}, - [RISCV_NVSTYPE] = {RISCV_NVS_VNSRL, RISCV_NVS_VNSRA}, - [RISCV_FROUND_S] = {RISCV_FROUND_S}, - [RISCV_NISTYPE] = {RISCV_NIS_VNSRL, RISCV_NIS_VNSRA}, - [RISCV_C_SLLI] = {RISCV_C_SLLI}, - [RISCV_VXMTYPE] = {RISCV_VXM_VMSBC, RISCV_VXM_VMADC}, - [RISCV_FENCEI] = {RISCV_FENCEI}, - [RISCV_VFMVSF] = {RISCV_VFMVSF}, - [RISCV_VEXT8TYPE] = {RISCV_VEXT8_ZVF8, RISCV_VEXT8_SVF8}, - [RISCV_C_OR] = {RISCV_C_OR}, - [RISCV_FWVFMATYPE] = {RISCV_FWVF_VNMSAC, RISCV_FWVF_VNMACC, - RISCV_FWVF_VMSAC, RISCV_FWVF_VMACC}, - [RISCV_SHIFTIOP] = {RISCV_SRLI, RISCV_SRAI, RISCV_SLLI}, - [RISCV_DIVW] = {RISCV_DIVW}, - [RISCV_C_ZEXT_B] = {RISCV_C_ZEXT_B}, - [RISCV_C_MV] = {RISCV_C_MV}, - [RISCV_VIMTYPE] = {RISCV_VIM_VMADC}, - [RISCV_LOADRES] = {RISCV_LOADRES}, - [RISCV_C_J] = {RISCV_C_J}, - [RISCV_AES32ESI] = {RISCV_AES32ESI}, - [RISCV_C_BEQZ] = {RISCV_C_BEQZ}, - [RISCV_SHA512SUM0] = {RISCV_SHA512SUM0}, - [RISCV_SHA512SUM0R] = {RISCV_SHA512SUM0R}, - [RISCV_REMW] = {RISCV_REMW}, - [RISCV_VFMV] = {RISCV_VFMV}, - [RISCV_C_SEXT_H] = {RISCV_C_SEXT_H}, - [RISCV_WMVXTYPE] = {RISCV_WMVX_VWMACCUS, RISCV_WMVX_VWMACCU, - RISCV_WMVX_VWMACCSU, RISCV_WMVX_VWMACC}, - [RISCV_C_FSW] = {RISCV_C_FSW}, - [RISCV_C_SW] = {RISCV_C_SW}, - [RISCV_ZBS_RTYPE] = {RISCV_BSET, RISCV_BINV, RISCV_BEXT, RISCV_BCLR}, - [RISCV_C_SUB] = {RISCV_C_SUB}, - [RISCV_VFUNARY0] = {RISCV_FV_CVT_X_F, RISCV_FV_CVT_XU_F, - RISCV_FV_CVT_RTZ_X_F, RISCV_FV_CVT_RTZ_XU_F, - RISCV_FV_CVT_F_XU, RISCV_FV_CVT_F_X}, - [RISCV_FROUNDNX_S] = {RISCV_FROUNDNX_S}, - [RISCV_ZICBOZ] = {RISCV_ZICBOZ}, - [RISCV_SFENCE_W_INVAL] = {RISCV_SFENCE_W_INVAL}, - [RISCV_C_JR] = {RISCV_C_JR}, - [RISCV_C_NOT] = {RISCV_C_NOT}, - [RISCV_ZBB_EXTOP] = {RISCV_ZEXTH, RISCV_SEXTH, RISCV_SEXTB}, - [RISCV_MVVTYPE] = {RISCV_MVV_VREMU, RISCV_MVV_VREM, RISCV_MVV_VMULHU, - RISCV_MVV_VMULHSU, RISCV_MVV_VMULH, RISCV_MVV_VMUL, - RISCV_MVV_VDIVU, RISCV_MVV_VDIV, RISCV_MVV_VASUBU, - RISCV_MVV_VASUB, RISCV_MVV_VAADDU, RISCV_MVV_VAADD}, - [RISCV_FVFMATYPE] = {RISCV_VF_VNMSUB, RISCV_VF_VNMSAC, RISCV_VF_VNMADD, - RISCV_VF_VNMACC, RISCV_VF_VMSUB, RISCV_VF_VMSAC, - RISCV_VF_VMADD, RISCV_VF_VMACC}, - [RISCV_FMAXM_H] = {RISCV_FMAXM_H}, - [RISCV_SHA256SUM0] = {RISCV_SHA256SUM0}, - [RISCV_ZBS_IOP] = {RISCV_BSETI, RISCV_BINVI, RISCV_BEXTI, RISCV_BCLRI}, - [RISCV_C_XOR] = {RISCV_C_XOR}, - [RISCV_FMINM_H] = {RISCV_FMINM_H}, - [RISCV_C_LUI_HINT] = {RISCV_C_LUI_HINT}, - [RISCV_VVMCTYPE] = {RISCV_VVMC_VMSBC, RISCV_VVMC_VMADC}, - [RISCV_F_BIN_RM_TYPE_S] = {RISCV_FSUB_S, RISCV_FMUL_S, RISCV_FDIV_S, - RISCV_FADD_S}, - [RISCV_SINVAL_VMA] = {RISCV_SINVAL_VMA}, - [RISCV_MOVETYPEX] = {RISCV_MOVETYPEX}, - [RISCV_C_BNEZ] = {RISCV_C_BNEZ}, - [RISCV_FWVVMATYPE] = {RISCV_FWVV_VNMSAC, RISCV_FWVV_VNMACC, - RISCV_FWVV_VMSAC, RISCV_FWVV_VMACC}, - [RISCV_AES64KS1I] = {RISCV_AES64KS1I}, - [RISCV_RMVVTYPE] = {RISCV_MVV_VREDXOR, RISCV_MVV_VREDSUM, RISCV_MVV_VREDOR, - RISCV_MVV_VREDMINU, RISCV_MVV_VREDMIN, - RISCV_MVV_VREDMAXU, RISCV_MVV_VREDMAX, - RISCV_MVV_VREDAND}, - [RISCV_CLZW] = {RISCV_CLZW}, - [RISCV_REM] = {RISCV_REM}, - [RISCV_C_EBREAK] = {RISCV_C_EBREAK}, - [RISCV_AES64ESM] = {RISCV_AES64ESM}, - [RISCV_VFNUNARY0] = {RISCV_FNV_CVT_X_F, RISCV_FNV_CVT_XU_F, - RISCV_FNV_CVT_RTZ_X_F, RISCV_FNV_CVT_RTZ_XU_F, - RISCV_FNV_CVT_ROD_F_F, RISCV_FNV_CVT_F_XU, - RISCV_FNV_CVT_F_X, RISCV_FNV_CVT_F_F}, - [RISCV_VFWUNARY0] = {RISCV_FWV_CVT_X_F, RISCV_FWV_CVT_XU_F, - RISCV_FWV_CVT_RTZ_X_F, RISCV_FWV_CVT_RTZ_XU_F, - RISCV_FWV_CVT_F_XU, RISCV_FWV_CVT_F_X, - RISCV_FWV_CVT_F_F}, - [RISCV_MOVETYPEV] = {RISCV_MOVETYPEV}, - [RISCV_VFUNARY1] = {RISCV_FVV_VSQRT, RISCV_FVV_VRSQRT7, RISCV_FVV_VREC7, - RISCV_FVV_VCLASS}, - [RISCV_FWVFTYPE] = {RISCV_FWVF_VSUB, RISCV_FWVF_VMUL, RISCV_FWVF_VADD}, - [RISCV_ZBA_RTYPE] = {RISCV_SH3ADD, RISCV_SH2ADD, RISCV_SH1ADD}, - [RISCV_C_SRLI] = {RISCV_C_SRLI}, - [RISCV_VSRETYPE] = {RISCV_VSRETYPE}, - [RISCV_C_SLLI_HINT] = {RISCV_C_SLLI_HINT}, - [RISCV_WVVTYPE] = {RISCV_WVV_VWMULU, RISCV_WVV_VWMULSU, RISCV_WVV_VWMUL, - RISCV_WVV_VSUBU, RISCV_WVV_VSUB, RISCV_WVV_VADDU, - RISCV_WVV_VADD}, - [RISCV_AES64DSM] = {RISCV_AES64DSM}, - [RISCV_C_LI] = {RISCV_C_LI}, - [RISCV_CSR] = {RISCV_CSRRW, RISCV_CSRRS, RISCV_CSRRC}, - [RISCV_C_SRAI] = {RISCV_C_SRAI}, - [RISCV_FMVP_D_X] = {RISCV_FMVP_D_X}, - [RISCV_C_LBU] = {RISCV_C_LBU}, - [RISCV_F_UN_RM_TYPE_S] = {RISCV_FSQRT_S, RISCV_FCVT_W_S, RISCV_FCVT_WU_S, - RISCV_FCVT_S_WU, RISCV_FCVT_S_W, RISCV_FCVT_S_LU, - RISCV_FCVT_S_L, RISCV_FCVT_L_S, RISCV_FCVT_LU_S}, - [RISCV_RTYPEW] = {RISCV_SUBW, RISCV_SRLW, RISCV_SRAW, RISCV_SLLW, - RISCV_ADDW}, - [RISCV_WMVVTYPE] = {RISCV_WMVV_VWMACCU, RISCV_WMVV_VWMACCSU, - RISCV_WMVV_VWMACC}, - [RISCV_MULW] = {RISCV_MULW}, - [RISCV_VVCMPTYPE] = {RISCV_VVCMP_VMSNE, RISCV_VVCMP_VMSLTU, - RISCV_VVCMP_VMSLT, RISCV_VVCMP_VMSLEU, - RISCV_VVCMP_VMSLE, RISCV_VVCMP_VMSEQ}, - [RISCV_ILLEGAL] = {RISCV_ILLEGAL}, - [RISCV_BREV8] = {RISCV_BREV8}, - [RISCV_AES32DSMI] = {RISCV_AES32DSMI}, - [RISCV_C_FSD] = {RISCV_C_FSD}, - [RISCV_C_ADDW] = {RISCV_C_ADDW}, - [RISCV_VCPOP_M] = {RISCV_VCPOP_M}, - [RISCV_SHA256SIG1] = {RISCV_SHA256SIG1}, - [RISCV_MVXTYPE] = {RISCV_MVX_VSLIDE1UP, RISCV_MVX_VSLIDE1DOWN, - RISCV_MVX_VREMU, RISCV_MVX_VREM, RISCV_MVX_VMULHU, - RISCV_MVX_VMULHSU, RISCV_MVX_VMULH, RISCV_MVX_VMUL, - RISCV_MVX_VDIVU, RISCV_MVX_VDIV, RISCV_MVX_VASUBU, - RISCV_MVX_VASUB, RISCV_MVX_VAADDU, RISCV_MVX_VAADD}, -}; -uint16_t get_insn_type(struct ast *tree) { - switch (tree->ast_node_type) { - case RISCV_WXTYPE: - return to_insn[RISCV_WXTYPE][tree->ast_node.wxtype.funct6]; - case RISCV_RTYPE: - return to_insn[RISCV_RTYPE][tree->ast_node.rtype.op]; - case RISCV_RIVVTYPE: - return to_insn[RISCV_RIVVTYPE][tree->ast_node.rivvtype.funct6]; - case RISCV_VXSG: - return to_insn[RISCV_VXSG][tree->ast_node.vxsg.funct6]; - case RISCV_VXCMPTYPE: - return to_insn[RISCV_VXCMPTYPE][tree->ast_node.vxcmptype.funct6]; - case RISCV_SHIFTIWOP: - return to_insn[RISCV_SHIFTIWOP][tree->ast_node.shiftiwop.op]; - case RISCV_ZICBOM: - return to_insn[RISCV_ZICBOM][tree->ast_node.riscv_zicbom.cbop]; - case RISCV_NITYPE: - return to_insn[RISCV_NITYPE][tree->ast_node.nitype.funct6]; - case RISCV_VVMTYPE: - return to_insn[RISCV_VVMTYPE][tree->ast_node.vvmtype.funct6]; - case RISCV_MVXMATYPE: - return to_insn[RISCV_MVXMATYPE][tree->ast_node.mvxmatype.funct6]; - case RISCV_F_BIN_TYPE_H: - return to_insn[RISCV_F_BIN_TYPE_H][tree->ast_node.f_bin_type_h.fle_h]; - case RISCV_FVVMTYPE: - return to_insn[RISCV_FVVMTYPE][tree->ast_node.fvvmtype.funct6]; - case RISCV_F_UN_RM_TYPE_D: - return to_insn[RISCV_F_UN_RM_TYPE_D] - [tree->ast_node.f_un_rm_type_d.fcvt_d_lu]; - case RISCV_WVXTYPE: - return to_insn[RISCV_WVXTYPE][tree->ast_node.wvxtype.funct6]; - case RISCV_NXSTYPE: - return to_insn[RISCV_NXSTYPE][tree->ast_node.nxstype.funct6]; - case RISCV_VXMCTYPE: - return to_insn[RISCV_VXMCTYPE][tree->ast_node.vxmctype.funct6]; - case RISCV_MMTYPE: - return to_insn[RISCV_MMTYPE][tree->ast_node.mmtype.funct6]; - case RISCV_F_UN_TYPE_S: - return to_insn[RISCV_F_UN_TYPE_S][tree->ast_node.f_un_type_s.fmv_w_x]; - case RISCV_NVTYPE: - return to_insn[RISCV_NVTYPE][tree->ast_node.nvtype.funct6]; - case RISCV_F_MADD_TYPE_H: - return to_insn[RISCV_F_MADD_TYPE_H][tree->ast_node.f_madd_type_h.op]; - case RISCV_ZBA_RTYPEUW: - return to_insn[RISCV_ZBA_RTYPEUW][tree->ast_node.zba_rtypeuw.op]; - case RISCV_F_BIN_RM_TYPE_D: - return to_insn[RISCV_F_BIN_RM_TYPE_D][tree->ast_node.f_bin_rm_type_d.op]; - case RISCV_F_MADD_TYPE_S: - return to_insn[RISCV_F_MADD_TYPE_S][tree->ast_node.f_madd_type_s.op]; - case RISCV_F_UN_RM_TYPE_H: - return to_insn[RISCV_F_UN_RM_TYPE_H] - [tree->ast_node.f_un_rm_type_h.fcvt_h_lu]; - case RISCV_FWFTYPE: - return to_insn[RISCV_FWFTYPE][tree->ast_node.fwftype.funct6]; - case RISCV_FWVTYPE: - return to_insn[RISCV_FWVTYPE][tree->ast_node.fwvtype.funct6]; - case RISCV_ZBB_RTYPE: - return to_insn[RISCV_ZBB_RTYPE][tree->ast_node.zbb_rtype.op]; - case RISCV_NXTYPE: - return to_insn[RISCV_NXTYPE][tree->ast_node.nxtype.funct6]; - case RISCV_ITYPE: - return to_insn[RISCV_ITYPE][tree->ast_node.itype.op]; - case RISCV_F_BIN_TYPE_S: - return to_insn[RISCV_F_BIN_TYPE_S][tree->ast_node.f_bin_type_s.fle_s]; - case RISCV_F_BIN_TYPE_D: - return to_insn[RISCV_F_BIN_TYPE_D][tree->ast_node.f_bin_type_d.fle_d]; - case RISCV_ZICOND_RTYPE: - return to_insn[RISCV_ZICOND_RTYPE] - [tree->ast_node.zicond_rtype.riscv_czero_nez]; - case RISCV_ZBB_RTYPEW: - return to_insn[RISCV_ZBB_RTYPEW][tree->ast_node.zbb_rtypew.op]; - case RISCV_RFVVTYPE: - return to_insn[RISCV_RFVVTYPE][tree->ast_node.rfvvtype.funct6]; - case RISCV_AMO: - return to_insn[RISCV_AMO][tree->ast_node.amo.op]; - case RISCV_VVMSTYPE: - return to_insn[RISCV_VVMSTYPE][tree->ast_node.vvmstype.funct6]; - case RISCV_FVVMATYPE: - return to_insn[RISCV_FVVMATYPE][tree->ast_node.fvvmatype.funct6]; - case RISCV_VEXT2TYPE: - return to_insn[RISCV_VEXT2TYPE][tree->ast_node.vext2type.funct6]; - case RISCV_F_MADD_TYPE_D: - return to_insn[RISCV_F_MADD_TYPE_D][tree->ast_node.f_madd_type_d.op]; - case RISCV_F_UN_TYPE_H: - return to_insn[RISCV_F_UN_TYPE_H][tree->ast_node.f_un_type_h.fmv_h_x]; - case RISCV_VVTYPE: - return to_insn[RISCV_VVTYPE][tree->ast_node.vvtype.funct6]; - case RISCV_VICMPTYPE: - return to_insn[RISCV_VICMPTYPE][tree->ast_node.vicmptype.funct6]; - case RISCV_F_UN_TYPE_D: - return to_insn[RISCV_F_UN_TYPE_D][tree->ast_node.f_un_type_d.fmv_d_x]; - case RISCV_MVVMATYPE: - return to_insn[RISCV_MVVMATYPE][tree->ast_node.mvvmatype.funct6]; - case RISCV_VXTYPE: - return to_insn[RISCV_VXTYPE][tree->ast_node.vxtype.funct6]; - case RISCV_BTYPE: - return to_insn[RISCV_BTYPE][tree->ast_node.btype.op]; - case RISCV_VXMSTYPE: - return to_insn[RISCV_VXMSTYPE][tree->ast_node.vxmstype.funct6]; - case RISCV_UTYPE: - return to_insn[RISCV_UTYPE][tree->ast_node.utype.op]; - case RISCV_F_BIN_RM_TYPE_H: - return to_insn[RISCV_F_BIN_RM_TYPE_H][tree->ast_node.f_bin_rm_type_h.op]; - case RISCV_VITYPE: - return to_insn[RISCV_VITYPE][tree->ast_node.vitype.funct6]; - case RISCV_ZBKB_RTYPE: - return to_insn[RISCV_ZBKB_RTYPE][tree->ast_node.zbkb_rtype.op]; - case RISCV_VISG: - return to_insn[RISCV_VISG][tree->ast_node.visg.funct6]; - case RISCV_FVFTYPE: - return to_insn[RISCV_FVFTYPE][tree->ast_node.fvftype.funct6]; - case RISCV_FVVTYPE: - return to_insn[RISCV_FVVTYPE][tree->ast_node.fvvtype.funct6]; - case RISCV_VIMCTYPE: - return to_insn[RISCV_VIMCTYPE][tree->ast_node.vimctype.funct6]; - case RISCV_VIMSTYPE: - return to_insn[RISCV_VIMSTYPE][tree->ast_node.vimstype.funct6]; - case RISCV_FVFMTYPE: - return to_insn[RISCV_FVFMTYPE][tree->ast_node.fvfmtype.funct6]; - case RISCV_WVTYPE: - return to_insn[RISCV_WVTYPE][tree->ast_node.wvtype.funct6]; - case RISCV_VEXT4TYPE: - return to_insn[RISCV_VEXT4TYPE][tree->ast_node.vext4type.funct6]; - case RISCV_FWVVTYPE: - return to_insn[RISCV_FWVVTYPE][tree->ast_node.fwvvtype.funct6]; - case RISCV_VMTYPE: - return to_insn[RISCV_VMTYPE][tree->ast_node.vmtype.op]; - case RISCV_NVSTYPE: - return to_insn[RISCV_NVSTYPE][tree->ast_node.nvstype.funct6]; - case RISCV_NISTYPE: - return to_insn[RISCV_NISTYPE][tree->ast_node.nistype.funct6]; - case RISCV_VXMTYPE: - return to_insn[RISCV_VXMTYPE][tree->ast_node.vxmtype.funct6]; - case RISCV_VEXT8TYPE: - return to_insn[RISCV_VEXT8TYPE][tree->ast_node.vext8type.funct6]; - case RISCV_FWVFMATYPE: - return to_insn[RISCV_FWVFMATYPE][tree->ast_node.fwvfmatype.funct6]; - case RISCV_SHIFTIOP: - return to_insn[RISCV_SHIFTIOP][tree->ast_node.shiftiop.op]; - case RISCV_VIMTYPE: - return to_insn[RISCV_VIMTYPE][tree->ast_node.vimtype.funct6]; - case RISCV_WMVXTYPE: - return to_insn[RISCV_WMVXTYPE][tree->ast_node.wmvxtype.funct6]; - case RISCV_ZBS_RTYPE: - return to_insn[RISCV_ZBS_RTYPE][tree->ast_node.zbs_rtype.op]; - case RISCV_VFUNARY0: - return to_insn[RISCV_VFUNARY0][tree->ast_node.vfunary0.vfunary0]; - case RISCV_ZBB_EXTOP: - return to_insn[RISCV_ZBB_EXTOP][tree->ast_node.zbb_extop.op]; - case RISCV_MVVTYPE: - return to_insn[RISCV_MVVTYPE][tree->ast_node.mvvtype.funct6]; - case RISCV_FVFMATYPE: - return to_insn[RISCV_FVFMATYPE][tree->ast_node.fvfmatype.funct6]; - case RISCV_ZBS_IOP: - return to_insn[RISCV_ZBS_IOP][tree->ast_node.zbs_iop.op]; - case RISCV_VVMCTYPE: - return to_insn[RISCV_VVMCTYPE][tree->ast_node.vvmctype.funct6]; - case RISCV_F_BIN_RM_TYPE_S: - return to_insn[RISCV_F_BIN_RM_TYPE_S][tree->ast_node.f_bin_rm_type_s.op]; - case RISCV_FWVVMATYPE: - return to_insn[RISCV_FWVVMATYPE][tree->ast_node.fwvvmatype.funct6]; - case RISCV_RMVVTYPE: - return to_insn[RISCV_RMVVTYPE][tree->ast_node.rmvvtype.funct6]; - case RISCV_VFNUNARY0: - return to_insn[RISCV_VFNUNARY0][tree->ast_node.vfnunary0.vfnunary0]; - case RISCV_VFWUNARY0: - return to_insn[RISCV_VFWUNARY0][tree->ast_node.vfwunary0.vfwunary0]; - case RISCV_VFUNARY1: - return to_insn[RISCV_VFUNARY1][tree->ast_node.vfunary1.vfunary1]; - case RISCV_FWVFTYPE: - return to_insn[RISCV_FWVFTYPE][tree->ast_node.fwvftype.funct6]; - case RISCV_ZBA_RTYPE: - return to_insn[RISCV_ZBA_RTYPE][tree->ast_node.zba_rtype.op]; - case RISCV_WVVTYPE: - return to_insn[RISCV_WVVTYPE][tree->ast_node.wvvtype.funct6]; - case RISCV_CSR: - return to_insn[RISCV_CSR][tree->ast_node.csr.op]; - case RISCV_F_UN_RM_TYPE_S: - return to_insn[RISCV_F_UN_RM_TYPE_S] - [tree->ast_node.f_un_rm_type_s.fcvt_s_lu]; - case RISCV_RTYPEW: - return to_insn[RISCV_RTYPEW][tree->ast_node.rtypew.op]; - case RISCV_WMVVTYPE: - return to_insn[RISCV_WMVVTYPE][tree->ast_node.wmvvtype.funct6]; - case RISCV_VVCMPTYPE: - return to_insn[RISCV_VVCMPTYPE][tree->ast_node.vvcmptype.funct6]; - case RISCV_MVXTYPE: - return to_insn[RISCV_MVXTYPE][tree->ast_node.mvxtype.funct6]; - default: - return to_insn[tree->ast_node_type][0]; - } -} - -#endif diff --git a/include/capstone/riscv.h b/include/capstone/riscv.h index fae66cef8f..80209cd509 100644 --- a/include/capstone/riscv.h +++ b/include/capstone/riscv.h @@ -14,7 +14,6 @@ extern "C" { #endif #include "platform.h" - // GCC MIPS toolchain has a default macro called "mips" which breaks // compilation //#undef riscv @@ -201,7 +200,989 @@ typedef enum riscv_reg { } riscv_reg; //> RISCV instruction -#include "riscv_insn.gen.inc" +/*=======================================================================*/ +/* This code was generated by the tool auto-sync-sail*/ +/* (see https://github.com/rizinorg/capstone-autosync-sail)*/ +/* from the sail model of RISC-V*/ +/* (see https://github.com/riscv/sail-riscv) @ version + * 0b9c639f19da48734cbf14b61f6ad200b7c70de9.*/ +/* DO NOT MODIFY THIS CODE MANUALLY. ANY MANUAL EDITS ARE OVERWRITTEN.*/ +/* ------------------------------------------------------------------- */ +/* Copyright © 2024 moste00 */ +/* SPDX-License-Identifier: BSD-3-Clause*/ +/*=======================================================================*/ + +#ifndef __RISCVINSN_GEN_INC__ +#define __RISCVINSN_GEN_INC__ +#include +#include +#include + +enum riscv_insn { + //--------------------- RISCV_REV8--------------------- + RISCV_INSN_REV8, + //--------------------- RISCV_WXTYPE--------------------- + RISCV_INSN_WX_VSUBU, + RISCV_INSN_WX_VSUB, + RISCV_INSN_WX_VADDU, + RISCV_INSN_WX_VADD, + //--------------------- RISCV_C_SRLI_HINT--------------------- + RISCV_INSN_C_SRLI_HINT, + //--------------------- RISCV_AES64DS--------------------- + RISCV_INSN_AES64DS, + //--------------------- RISCV_VMSBF_M--------------------- + RISCV_INSN_VMSBF_M, + //--------------------- RISCV_RTYPE--------------------- + RISCV_INSN_XOR, + RISCV_INSN_SUB, + RISCV_INSN_SRL, + RISCV_INSN_SRA, + RISCV_INSN_SLTU, + RISCV_INSN_SLT, + RISCV_INSN_SLL, + RISCV_INSN_OR, + RISCV_INSN_AND, + RISCV_INSN_ADD, + //--------------------- RISCV_VFMERGE--------------------- + RISCV_INSN_VFMERGE, + //--------------------- RISCV_RIVVTYPE--------------------- + RISCV_INSN_IVV_VWREDSUMU, + RISCV_INSN_IVV_VWREDSUM, + //--------------------- RISCV_C_ZEXT_W--------------------- + RISCV_INSN_C_ZEXT_W, + //--------------------- RISCV_SFENCE_INVAL_IR--------------------- + RISCV_INSN_SFENCE_INVAL_IR, + //--------------------- RISCV_XPERM4--------------------- + RISCV_INSN_XPERM4, + //--------------------- RISCV_C_AND--------------------- + RISCV_INSN_C_AND, + //--------------------- RISCV_AES32DSI--------------------- + RISCV_INSN_AES32DSI, + //--------------------- RISCV_RORI--------------------- + RISCV_INSN_RORI, + //--------------------- RISCV_JALR--------------------- + RISCV_INSN_JALR, + //--------------------- RISCV_VMSIF_M--------------------- + RISCV_INSN_VMSIF_M, + //--------------------- RISCV_VLSSEGTYPE--------------------- + RISCV_INSN_VLSSEGTYPE, + //--------------------- RISCV_SHA512SIG1H--------------------- + RISCV_INSN_SHA512SIG1H, + //--------------------- RISCV_FLTQ_S--------------------- + RISCV_INSN_FLTQ_S, + //--------------------- RISCV_VXSG--------------------- + RISCV_INSN_VX_VSLIDEUP, + RISCV_INSN_VX_VSLIDEDOWN, + RISCV_INSN_VX_VRGATHER, + //--------------------- RISCV_VXCMPTYPE--------------------- + RISCV_INSN_VXCMP_VMSNE, + RISCV_INSN_VXCMP_VMSLTU, + RISCV_INSN_VXCMP_VMSLT, + RISCV_INSN_VXCMP_VMSLEU, + RISCV_INSN_VXCMP_VMSLE, + RISCV_INSN_VXCMP_VMSGTU, + RISCV_INSN_VXCMP_VMSGT, + RISCV_INSN_VXCMP_VMSEQ, + //--------------------- RISCV_C_LHU--------------------- + RISCV_INSN_C_LHU, + //--------------------- RISCV_JAL--------------------- + RISCV_INSN_JAL, + //--------------------- RISCV_ECALL--------------------- + RISCV_INSN_ECALL, + //--------------------- RISCV_C_FSWSP--------------------- + RISCV_INSN_C_FSWSP, + //--------------------- RISCV_VMVXS--------------------- + RISCV_INSN_VMVXS, + //--------------------- RISCV_C_FLD--------------------- + RISCV_INSN_C_FLD, + //--------------------- RISCV_SHIFTIWOP--------------------- + RISCV_INSN_SRLIW, + RISCV_INSN_SRAIW, + RISCV_INSN_SLLIW, + //--------------------- RISCV_UNZIP--------------------- + RISCV_INSN_UNZIP, + //--------------------- RISCV_ZICBOM--------------------- + RISCV_INSN_CBO_INVAL, + RISCV_INSN_CBO_FLUSH, + RISCV_INSN_CBO_CLEAN, + //--------------------- RISCV_SHA512SIG1--------------------- + RISCV_INSN_SHA512SIG1, + //--------------------- RISCV_NITYPE--------------------- + RISCV_INSN_NI_VNCLIPU, + RISCV_INSN_NI_VNCLIP, + //--------------------- RISCV_WFI--------------------- + RISCV_INSN_WFI, + //--------------------- RISCV_VVMTYPE--------------------- + RISCV_INSN_VVM_VMSBC, + RISCV_INSN_VVM_VMADC, + //--------------------- RISCV_MVXMATYPE--------------------- + RISCV_INSN_MVX_VNMSUB, + RISCV_INSN_MVX_VNMSAC, + RISCV_INSN_MVX_VMADD, + RISCV_INSN_MVX_VMACC, + //--------------------- RISCV_FLI_D--------------------- + RISCV_INSN_FLI_D, + //--------------------- RISCV_C_ADDI_HINT--------------------- + RISCV_INSN_C_ADDI_HINT, + //--------------------- RISCV_MASKTYPEX--------------------- + RISCV_INSN_MASKTYPEX, + //--------------------- RISCV_FROUNDNX_D--------------------- + RISCV_INSN_FROUNDNX_D, + //--------------------- RISCV_FROUND_D--------------------- + RISCV_INSN_FROUND_D, + //--------------------- RISCV_VSETIVLI--------------------- + RISCV_INSN_VSETIVLI, + //--------------------- RISCV_FMAXM_D--------------------- + RISCV_INSN_FMAXM_D, + //--------------------- RISCV_C_SD--------------------- + RISCV_INSN_C_SD, + //--------------------- RISCV_F_BIN_TYPE_H--------------------- + RISCV_INSN_FSGNJ_H, + RISCV_INSN_FSGNJX_H, + RISCV_INSN_FSGNJN_H, + RISCV_INSN_FMIN_H, + RISCV_INSN_FMAX_H, + RISCV_INSN_FLT_H, + RISCV_INSN_FLE_H, + RISCV_INSN_FEQ_H, + //--------------------- RISCV_ZBKB_PACKW--------------------- + RISCV_INSN_ZBKB_PACKW, + //--------------------- RISCV_FVVMTYPE--------------------- + RISCV_INSN_FVVM_VMFNE, + RISCV_INSN_FVVM_VMFLT, + RISCV_INSN_FVVM_VMFLE, + RISCV_INSN_FVVM_VMFEQ, + //--------------------- RISCV_VMVSX--------------------- + RISCV_INSN_VMVSX, + //--------------------- RISCV_F_UN_RM_TYPE_D--------------------- + RISCV_INSN_FSQRT_D, + RISCV_INSN_FCVT_W_D, + RISCV_INSN_FCVT_WU_D, + RISCV_INSN_FCVT_S_D, + RISCV_INSN_FCVT_L_D, + RISCV_INSN_FCVT_LU_D, + RISCV_INSN_FCVT_D_WU, + RISCV_INSN_FCVT_D_W, + RISCV_INSN_FCVT_D_S, + RISCV_INSN_FCVT_D_LU, + RISCV_INSN_FCVT_D_L, + //--------------------- RISCV_ORCB--------------------- + RISCV_INSN_ORCB, + //--------------------- RISCV_C_MUL--------------------- + RISCV_INSN_C_MUL, + //--------------------- RISCV_SM3P1--------------------- + RISCV_INSN_SM3P1, + //--------------------- RISCV_CLMUL--------------------- + RISCV_INSN_CLMUL, + //--------------------- RISCV_FLEQ_S--------------------- + RISCV_INSN_FLEQ_S, + //--------------------- RISCV_WVXTYPE--------------------- + RISCV_INSN_WVX_VWMULU, + RISCV_INSN_WVX_VWMULSU, + RISCV_INSN_WVX_VWMUL, + RISCV_INSN_WVX_VSUBU, + RISCV_INSN_WVX_VSUB, + RISCV_INSN_WVX_VADDU, + RISCV_INSN_WVX_VADD, + //--------------------- RISCV_FMAXM_S--------------------- + RISCV_INSN_FMAXM_S, + //--------------------- RISCV_C_ILLEGAL--------------------- + RISCV_INSN_C_ILLEGAL, + //--------------------- RISCV_NXSTYPE--------------------- + RISCV_INSN_NXS_VNSRL, + RISCV_INSN_NXS_VNSRA, + //--------------------- RISCV_VSOXSEGTYPE--------------------- + RISCV_INSN_VSOXSEGTYPE, + //--------------------- RISCV_C_NOP--------------------- + RISCV_INSN_C_NOP, + //--------------------- RISCV_VXMCTYPE--------------------- + RISCV_INSN_VXMC_VMSBC, + RISCV_INSN_VXMC_VMADC, + //--------------------- RISCV_MMTYPE--------------------- + RISCV_INSN_MM_VMXOR, + RISCV_INSN_MM_VMXNOR, + RISCV_INSN_MM_VMORN, + RISCV_INSN_MM_VMOR, + RISCV_INSN_MM_VMNOR, + RISCV_INSN_MM_VMNAND, + RISCV_INSN_MM_VMANDN, + RISCV_INSN_MM_VMAND, + //--------------------- RISCV_F_UN_TYPE_S--------------------- + RISCV_INSN_FMV_X_W, + RISCV_INSN_FMV_W_X, + RISCV_INSN_FCLASS_S, + //--------------------- RISCV_NVTYPE--------------------- + RISCV_INSN_NV_VNCLIPU, + RISCV_INSN_NV_VNCLIP, + //--------------------- RISCV_AES64KS2--------------------- + RISCV_INSN_AES64KS2, + //--------------------- RISCV_AES32ESMI--------------------- + RISCV_INSN_AES32ESMI, + //--------------------- RISCV_F_MADD_TYPE_H--------------------- + RISCV_INSN_FNMSUB_H, + RISCV_INSN_FNMADD_H, + RISCV_INSN_FMSUB_H, + RISCV_INSN_FMADD_H, + //--------------------- RISCV_FROUNDNX_H--------------------- + RISCV_INSN_FROUNDNX_H, + //--------------------- RISCV_MOVETYPEI--------------------- + RISCV_INSN_MOVETYPEI, + //--------------------- RISCV_FLTQ_H--------------------- + RISCV_INSN_FLTQ_H, + //--------------------- RISCV_C_LW--------------------- + RISCV_INSN_C_LW, + //--------------------- RISCV_C_LWSP--------------------- + RISCV_INSN_C_LWSP, + //--------------------- RISCV_C_ADDI16SP--------------------- + RISCV_INSN_C_ADDI16SP, + //--------------------- RISCV_SHA512SIG0L--------------------- + RISCV_INSN_SHA512SIG0L, + //--------------------- RISCV_SM3P0--------------------- + RISCV_INSN_SM3P0, + //--------------------- RISCV_SM4ED--------------------- + RISCV_INSN_SM4ED, + //--------------------- RISCV_FMINM_D--------------------- + RISCV_INSN_FMINM_D, + //--------------------- RISCV_AES64IM--------------------- + RISCV_INSN_AES64IM, + //--------------------- RISCV_VLRETYPE--------------------- + RISCV_INSN_VLRETYPE, + //--------------------- RISCV_VFMVFS--------------------- + RISCV_INSN_VFMVFS, + //--------------------- RISCV_CTZ--------------------- + RISCV_INSN_CTZ, + //--------------------- RISCV_FMVH_X_D--------------------- + RISCV_INSN_FMVH_X_D, + //--------------------- RISCV_SLLIUW--------------------- + RISCV_INSN_SLLIUW, + //--------------------- RISCV_FMINM_S--------------------- + RISCV_INSN_FMINM_S, + //--------------------- RISCV_ZBA_RTYPEUW--------------------- + RISCV_INSN_SH3ADDUW, + RISCV_INSN_SH2ADDUW, + RISCV_INSN_SH1ADDUW, + RISCV_INSN_ADDUW, + //--------------------- RISCV_F_BIN_RM_TYPE_D--------------------- + RISCV_INSN_FSUB_D, + RISCV_INSN_FMUL_D, + RISCV_INSN_FDIV_D, + RISCV_INSN_FADD_D, + //--------------------- RISCV_C_ADD_HINT--------------------- + RISCV_INSN_C_ADD_HINT, + //--------------------- RISCV_F_MADD_TYPE_S--------------------- + RISCV_INSN_FNMSUB_S, + RISCV_INSN_FNMADD_S, + RISCV_INSN_FMSUB_S, + RISCV_INSN_FMADD_S, + //--------------------- RISCV_ZIP--------------------- + RISCV_INSN_ZIP, + //--------------------- RISCV_SHA512SUM1--------------------- + RISCV_INSN_SHA512SUM1, + //--------------------- RISCV_C_LDSP--------------------- + RISCV_INSN_C_LDSP, + //--------------------- RISCV_F_UN_RM_TYPE_H--------------------- + RISCV_INSN_FSQRT_H, + RISCV_INSN_FCVT_W_H, + RISCV_INSN_FCVT_WU_H, + RISCV_INSN_FCVT_S_H, + RISCV_INSN_FCVT_L_H, + RISCV_INSN_FCVT_LU_H, + RISCV_INSN_FCVT_H_WU, + RISCV_INSN_FCVT_H_W, + RISCV_INSN_FCVT_H_S, + RISCV_INSN_FCVT_H_LU, + RISCV_INSN_FCVT_H_L, + RISCV_INSN_FCVT_H_D, + RISCV_INSN_FCVT_D_H, + //--------------------- RISCV_CPOP--------------------- + RISCV_INSN_CPOP, + //--------------------- RISCV_FWFTYPE--------------------- + RISCV_INSN_FWF_VSUB, + RISCV_INSN_FWF_VADD, + //--------------------- RISCV_FWVTYPE--------------------- + RISCV_INSN_FWV_VSUB, + RISCV_INSN_FWV_VADD, + //--------------------- RISCV_ZBB_RTYPE--------------------- + RISCV_INSN_XNOR, + RISCV_INSN_ROR, + RISCV_INSN_ROL, + RISCV_INSN_ORN, + RISCV_INSN_MINU, + RISCV_INSN_MIN, + RISCV_INSN_MAXU, + RISCV_INSN_MAX, + RISCV_INSN_ANDN, + //--------------------- RISCV_SM4KS--------------------- + RISCV_INSN_SM4KS, + //--------------------- RISCV_RORIW--------------------- + RISCV_INSN_RORIW, + //--------------------- RISCV_NXTYPE--------------------- + RISCV_INSN_NX_VNCLIPU, + RISCV_INSN_NX_VNCLIP, + //--------------------- RISCV_C_ADDIW--------------------- + RISCV_INSN_C_ADDIW, + //--------------------- RISCV_C_LD--------------------- + RISCV_INSN_C_LD, + //--------------------- RISCV_CTZW--------------------- + RISCV_INSN_CTZW, + //--------------------- RISCV_XPERM8--------------------- + RISCV_INSN_XPERM8, + //--------------------- RISCV_ITYPE--------------------- + RISCV_INSN_XORI, + RISCV_INSN_SLTIU, + RISCV_INSN_SLTI, + RISCV_INSN_ORI, + RISCV_INSN_ANDI, + RISCV_INSN_ADDI, + //--------------------- RISCV_VID_V--------------------- + RISCV_INSN_VID_V, + //--------------------- RISCV_FENCE--------------------- + RISCV_INSN_FENCE, + //--------------------- RISCV_C_FLWSP--------------------- + RISCV_INSN_C_FLWSP, + //--------------------- RISCV_STORE--------------------- + RISCV_INSN_STORE, + //--------------------- RISCV_F_BIN_TYPE_S--------------------- + RISCV_INSN_FSGNJ_S, + RISCV_INSN_FSGNJX_S, + RISCV_INSN_FSGNJN_S, + RISCV_INSN_FMIN_S, + RISCV_INSN_FMAX_S, + RISCV_INSN_FLT_S, + RISCV_INSN_FLE_S, + RISCV_INSN_FEQ_S, + //--------------------- RISCV_VSSEGTYPE--------------------- + RISCV_INSN_VSSEGTYPE, + //--------------------- RISCV_F_BIN_TYPE_D--------------------- + RISCV_INSN_FSGNJ_D, + RISCV_INSN_FSGNJX_D, + RISCV_INSN_FSGNJN_D, + RISCV_INSN_FMIN_D, + RISCV_INSN_FMAX_D, + RISCV_INSN_FLT_D, + RISCV_INSN_FLE_D, + RISCV_INSN_FEQ_D, + //--------------------- RISCV_ZICOND_RTYPE--------------------- + RISCV_INSN_CZERO_NEZ, + RISCV_INSN_CZERO_EQZ, + //--------------------- RISCV_C_FSDSP--------------------- + RISCV_INSN_C_FSDSP, + //--------------------- RISCV_SRET--------------------- + RISCV_INSN_SRET, + //--------------------- RISCV_STORE_FP--------------------- + RISCV_INSN_STORE_FP, + //--------------------- RISCV_C_JALR--------------------- + RISCV_INSN_C_JALR, + //--------------------- RISCV_FENCE_TSO--------------------- + RISCV_INSN_FENCE_TSO, + //--------------------- RISCV_SHA512SIG0--------------------- + RISCV_INSN_SHA512SIG0, + //--------------------- RISCV_FLI_S--------------------- + RISCV_INSN_FLI_S, + //--------------------- RISCV_C_SB--------------------- + RISCV_INSN_C_SB, + //--------------------- RISCV_ZBB_RTYPEW--------------------- + RISCV_INSN_RORW, + RISCV_INSN_ROLW, + //--------------------- RISCV_C_FLDSP--------------------- + RISCV_INSN_C_FLDSP, + //--------------------- RISCV_C_MV_HINT--------------------- + RISCV_INSN_C_MV_HINT, + //--------------------- RISCV_FCVTMOD_W_D--------------------- + RISCV_INSN_FCVTMOD_W_D, + //--------------------- RISCV_RFVVTYPE--------------------- + RISCV_INSN_FVV_VFWREDUSUM, + RISCV_INSN_FVV_VFWREDOSUM, + RISCV_INSN_FVV_VFREDUSUM, + RISCV_INSN_FVV_VFREDOSUM, + RISCV_INSN_FVV_VFREDMIN, + RISCV_INSN_FVV_VFREDMAX, + //--------------------- RISCV_SHA512SIG0H--------------------- + RISCV_INSN_SHA512SIG0H, + //--------------------- RISCV_AMO--------------------- + RISCV_INSN_AMOXOR, + RISCV_INSN_AMOSWAP, + RISCV_INSN_AMOOR, + RISCV_INSN_AMOMINU, + RISCV_INSN_AMOMIN, + RISCV_INSN_AMOMAXU, + RISCV_INSN_AMOMAX, + RISCV_INSN_AMOAND, + RISCV_INSN_AMOADD, + //--------------------- RISCV_LOAD_FP--------------------- + RISCV_INSN_LOAD_FP, + //--------------------- RISCV_VVMSTYPE--------------------- + RISCV_INSN_VVMS_VSBC, + RISCV_INSN_VVMS_VADC, + //--------------------- RISCV_FVVMATYPE--------------------- + RISCV_INSN_FVV_VNMSUB, + RISCV_INSN_FVV_VNMSAC, + RISCV_INSN_FVV_VNMADD, + RISCV_INSN_FVV_VNMACC, + RISCV_INSN_FVV_VMSUB, + RISCV_INSN_FVV_VMSAC, + RISCV_INSN_FVV_VMADD, + RISCV_INSN_FVV_VMACC, + //--------------------- RISCV_VEXT2TYPE--------------------- + RISCV_INSN_VEXT2_ZVF2, + RISCV_INSN_VEXT2_SVF2, + //--------------------- RISCV_EBREAK--------------------- + RISCV_INSN_EBREAK, + //--------------------- RISCV_C_LUI--------------------- + RISCV_INSN_C_LUI, + //--------------------- RISCV_F_MADD_TYPE_D--------------------- + RISCV_INSN_FNMSUB_D, + RISCV_INSN_FNMADD_D, + RISCV_INSN_FMSUB_D, + RISCV_INSN_FMADD_D, + //--------------------- RISCV_C_ZEXT_H--------------------- + RISCV_INSN_C_ZEXT_H, + //--------------------- RISCV_SHA512SIG1L--------------------- + RISCV_INSN_SHA512SIG1L, + //--------------------- RISCV_VLSEGTYPE--------------------- + RISCV_INSN_VLSEGTYPE, + //--------------------- RISCV_SHA256SIG0--------------------- + RISCV_INSN_SHA256SIG0, + //--------------------- RISCV_F_UN_TYPE_H--------------------- + RISCV_INSN_FMV_X_H, + RISCV_INSN_FMV_H_X, + RISCV_INSN_FCLASS_H, + //--------------------- RISCV_C_ADDI4SPN--------------------- + RISCV_INSN_C_ADDI4SPN, + //--------------------- RISCV_VVTYPE--------------------- + RISCV_INSN_VV_VXOR, + RISCV_INSN_VV_VSUB, + RISCV_INSN_VV_VSSUBU, + RISCV_INSN_VV_VSSUB, + RISCV_INSN_VV_VSSRL, + RISCV_INSN_VV_VSSRA, + RISCV_INSN_VV_VSRL, + RISCV_INSN_VV_VSRA, + RISCV_INSN_VV_VSMUL, + RISCV_INSN_VV_VSLL, + RISCV_INSN_VV_VSADDU, + RISCV_INSN_VV_VSADD, + RISCV_INSN_VV_VRGATHEREI16, + RISCV_INSN_VV_VRGATHER, + RISCV_INSN_VV_VOR, + RISCV_INSN_VV_VMINU, + RISCV_INSN_VV_VMIN, + RISCV_INSN_VV_VMAXU, + RISCV_INSN_VV_VMAX, + RISCV_INSN_VV_VAND, + RISCV_INSN_VV_VADD, + //--------------------- RISCV_FLEQ_H--------------------- + RISCV_INSN_FLEQ_H, + //--------------------- RISCV_VICMPTYPE--------------------- + RISCV_INSN_VICMP_VMSNE, + RISCV_INSN_VICMP_VMSLEU, + RISCV_INSN_VICMP_VMSLE, + RISCV_INSN_VICMP_VMSGTU, + RISCV_INSN_VICMP_VMSGT, + RISCV_INSN_VICMP_VMSEQ, + //--------------------- RISCV_C_FLW--------------------- + RISCV_INSN_C_FLW, + //--------------------- RISCV_C_SWSP--------------------- + RISCV_INSN_C_SWSP, + //--------------------- RISCV_FLTQ_D--------------------- + RISCV_INSN_FLTQ_D, + //--------------------- RISCV_AES64ES--------------------- + RISCV_INSN_AES64ES, + //--------------------- RISCV_C_SRAI_HINT--------------------- + RISCV_INSN_C_SRAI_HINT, + //--------------------- RISCV_DIV--------------------- + RISCV_INSN_DIV, + //--------------------- RISCV_F_UN_TYPE_D--------------------- + RISCV_INSN_FMV_X_D, + RISCV_INSN_FMV_D_X, + RISCV_INSN_FCLASS_D, + //--------------------- RISCV_C_LH--------------------- + RISCV_INSN_C_LH, + //--------------------- RISCV_C_NOP_HINT--------------------- + RISCV_INSN_C_NOP_HINT, + //--------------------- RISCV_VFIRST_M--------------------- + RISCV_INSN_VFIRST_M, + //--------------------- RISCV_MVVMATYPE--------------------- + RISCV_INSN_MVV_VNMSUB, + RISCV_INSN_MVV_VNMSAC, + RISCV_INSN_MVV_VMADD, + RISCV_INSN_MVV_VMACC, + //--------------------- RISCV_FENCEI_RESERVED--------------------- + RISCV_INSN_FENCEI_RESERVED, + //--------------------- RISCV_C_ADDI--------------------- + RISCV_INSN_C_ADDI, + //--------------------- RISCV_VLOXSEGTYPE--------------------- + RISCV_INSN_VLOXSEGTYPE, + //--------------------- RISCV_MUL--------------------- + RISCV_INSN_MUL, + //--------------------- RISCV_VMSOF_M--------------------- + RISCV_INSN_VMSOF_M, + //--------------------- RISCV_FLEQ_D--------------------- + RISCV_INSN_FLEQ_D, + //--------------------- RISCV_VSSSEGTYPE--------------------- + RISCV_INSN_VSSSEGTYPE, + //--------------------- RISCV_VXTYPE--------------------- + RISCV_INSN_VX_VXOR, + RISCV_INSN_VX_VSUB, + RISCV_INSN_VX_VSSUBU, + RISCV_INSN_VX_VSSUB, + RISCV_INSN_VX_VSSRL, + RISCV_INSN_VX_VSSRA, + RISCV_INSN_VX_VSRL, + RISCV_INSN_VX_VSRA, + RISCV_INSN_VX_VSMUL, + RISCV_INSN_VX_VSLL, + RISCV_INSN_VX_VSADDU, + RISCV_INSN_VX_VSADD, + RISCV_INSN_VX_VRSUB, + RISCV_INSN_VX_VOR, + RISCV_INSN_VX_VMINU, + RISCV_INSN_VX_VMIN, + RISCV_INSN_VX_VMAXU, + RISCV_INSN_VX_VMAX, + RISCV_INSN_VX_VAND, + RISCV_INSN_VX_VADD, + //--------------------- RISCV_BTYPE--------------------- + RISCV_INSN_BNE, + RISCV_INSN_BLTU, + RISCV_INSN_BLT, + RISCV_INSN_BGEU, + RISCV_INSN_BGE, + RISCV_INSN_BEQ, + //--------------------- RISCV_LOAD--------------------- + RISCV_INSN_LOAD, + //--------------------- RISCV_VIOTA_M--------------------- + RISCV_INSN_VIOTA_M, + //--------------------- RISCV_CLMULR--------------------- + RISCV_INSN_CLMULR, + //--------------------- RISCV_VXMSTYPE--------------------- + RISCV_INSN_VXMS_VSBC, + RISCV_INSN_VXMS_VADC, + //--------------------- RISCV_CLZ--------------------- + RISCV_INSN_CLZ, + //--------------------- RISCV_UTYPE--------------------- + RISCV_INSN_LUI, + RISCV_INSN_AUIPC, + //--------------------- RISCV_CLMULH--------------------- + RISCV_INSN_CLMULH, + //--------------------- RISCV_FLI_H--------------------- + RISCV_INSN_FLI_H, + //--------------------- RISCV_F_BIN_RM_TYPE_H--------------------- + RISCV_INSN_FSUB_H, + RISCV_INSN_FMUL_H, + RISCV_INSN_FDIV_H, + RISCV_INSN_FADD_H, + //--------------------- RISCV_VSETVLI--------------------- + RISCV_INSN_VSETVLI, + //--------------------- RISCV_C_SEXT_B--------------------- + RISCV_INSN_C_SEXT_B, + //--------------------- RISCV_VLUXSEGTYPE--------------------- + RISCV_INSN_VLUXSEGTYPE, + //--------------------- RISCV_SHA512SUM1R--------------------- + RISCV_INSN_SHA512SUM1R, + //--------------------- RISCV_VITYPE--------------------- + RISCV_INSN_VI_VXOR, + RISCV_INSN_VI_VSSRL, + RISCV_INSN_VI_VSSRA, + RISCV_INSN_VI_VSRL, + RISCV_INSN_VI_VSRA, + RISCV_INSN_VI_VSLL, + RISCV_INSN_VI_VSADDU, + RISCV_INSN_VI_VSADD, + RISCV_INSN_VI_VRSUB, + RISCV_INSN_VI_VOR, + RISCV_INSN_VI_VAND, + RISCV_INSN_VI_VADD, + //--------------------- RISCV_STORECON--------------------- + RISCV_INSN_STORECON, + //--------------------- RISCV_VMVRTYPE--------------------- + RISCV_INSN_VMVRTYPE, + //--------------------- RISCV_ZBKB_RTYPE--------------------- + RISCV_INSN_PACKH, + RISCV_INSN_PACK, + //--------------------- RISCV_VISG--------------------- + RISCV_INSN_VI_VSLIDEUP, + RISCV_INSN_VI_VSLIDEDOWN, + RISCV_INSN_VI_VRGATHER, + //--------------------- RISCV_C_ADD--------------------- + RISCV_INSN_C_ADD, + //--------------------- RISCV_FVFTYPE--------------------- + RISCV_INSN_VF_VSUB, + RISCV_INSN_VF_VSLIDE1UP, + RISCV_INSN_VF_VSLIDE1DOWN, + RISCV_INSN_VF_VSGNJX, + RISCV_INSN_VF_VSGNJN, + RISCV_INSN_VF_VSGNJ, + RISCV_INSN_VF_VRSUB, + RISCV_INSN_VF_VRDIV, + RISCV_INSN_VF_VMUL, + RISCV_INSN_VF_VMIN, + RISCV_INSN_VF_VMAX, + RISCV_INSN_VF_VDIV, + RISCV_INSN_VF_VADD, + //--------------------- RISCV_FENCE_RESERVED--------------------- + RISCV_INSN_FENCE_RESERVED, + //--------------------- RISCV_MASKTYPEI--------------------- + RISCV_INSN_MASKTYPEI, + //--------------------- RISCV_FVVTYPE--------------------- + RISCV_INSN_FVV_VSUB, + RISCV_INSN_FVV_VSGNJX, + RISCV_INSN_FVV_VSGNJN, + RISCV_INSN_FVV_VSGNJ, + RISCV_INSN_FVV_VMUL, + RISCV_INSN_FVV_VMIN, + RISCV_INSN_FVV_VMAX, + RISCV_INSN_FVV_VDIV, + RISCV_INSN_FVV_VADD, + //--------------------- RISCV_CPOPW--------------------- + RISCV_INSN_CPOPW, + //--------------------- RISCV_C_LI_HINT--------------------- + RISCV_INSN_C_LI_HINT, + //--------------------- RISCV_SHA256SUM1--------------------- + RISCV_INSN_SHA256SUM1, + //--------------------- RISCV_VSUXSEGTYPE--------------------- + RISCV_INSN_VSUXSEGTYPE, + //--------------------- RISCV_VIMCTYPE--------------------- + RISCV_INSN_VIMC_VMADC, + //--------------------- RISCV_VIMSTYPE--------------------- + RISCV_INSN_VIMS_VADC, + //--------------------- RISCV_MASKTYPEV--------------------- + RISCV_INSN_MASKTYPEV, + //--------------------- RISCV_FVFMTYPE--------------------- + RISCV_INSN_VFM_VMFNE, + RISCV_INSN_VFM_VMFLT, + RISCV_INSN_VFM_VMFLE, + RISCV_INSN_VFM_VMFGT, + RISCV_INSN_VFM_VMFGE, + RISCV_INSN_VFM_VMFEQ, + //--------------------- RISCV_ADDIW--------------------- + RISCV_INSN_ADDIW, + //--------------------- RISCV_MRET--------------------- + RISCV_INSN_MRET, + //--------------------- RISCV_VLSEGFFTYPE--------------------- + RISCV_INSN_VLSEGFFTYPE, + //--------------------- RISCV_C_ANDI--------------------- + RISCV_INSN_C_ANDI, + //--------------------- RISCV_WVTYPE--------------------- + RISCV_INSN_WV_VSUBU, + RISCV_INSN_WV_VSUB, + RISCV_INSN_WV_VADDU, + RISCV_INSN_WV_VADD, + //--------------------- RISCV_C_SDSP--------------------- + RISCV_INSN_C_SDSP, + //--------------------- RISCV_C_SUBW--------------------- + RISCV_INSN_C_SUBW, + //--------------------- RISCV_VEXT4TYPE--------------------- + RISCV_INSN_VEXT4_ZVF4, + RISCV_INSN_VEXT4_SVF4, + //--------------------- RISCV_VSETVL--------------------- + RISCV_INSN_VSETVL, + //--------------------- RISCV_C_SH--------------------- + RISCV_INSN_C_SH, + //--------------------- RISCV_MVVCOMPRESS--------------------- + RISCV_INSN_MVVCOMPRESS, + //--------------------- RISCV_FWVVTYPE--------------------- + RISCV_INSN_FWVV_VSUB, + RISCV_INSN_FWVV_VMUL, + RISCV_INSN_FWVV_VADD, + //--------------------- RISCV_VMTYPE--------------------- + RISCV_INSN_VSM, + RISCV_INSN_VLM, + //--------------------- RISCV_FROUND_H--------------------- + RISCV_INSN_FROUND_H, + //--------------------- RISCV_C_JAL--------------------- + RISCV_INSN_C_JAL, + //--------------------- RISCV_SFENCE_VMA--------------------- + RISCV_INSN_SFENCE_VMA, + //--------------------- RISCV_NVSTYPE--------------------- + RISCV_INSN_NVS_VNSRL, + RISCV_INSN_NVS_VNSRA, + //--------------------- RISCV_FROUND_S--------------------- + RISCV_INSN_FROUND_S, + //--------------------- RISCV_NISTYPE--------------------- + RISCV_INSN_NIS_VNSRL, + RISCV_INSN_NIS_VNSRA, + //--------------------- RISCV_C_SLLI--------------------- + RISCV_INSN_C_SLLI, + //--------------------- RISCV_VXMTYPE--------------------- + RISCV_INSN_VXM_VMSBC, + RISCV_INSN_VXM_VMADC, + //--------------------- RISCV_FENCEI--------------------- + RISCV_INSN_FENCEI, + //--------------------- RISCV_VFMVSF--------------------- + RISCV_INSN_VFMVSF, + //--------------------- RISCV_VEXT8TYPE--------------------- + RISCV_INSN_VEXT8_ZVF8, + RISCV_INSN_VEXT8_SVF8, + //--------------------- RISCV_C_OR--------------------- + RISCV_INSN_C_OR, + //--------------------- RISCV_FWVFMATYPE--------------------- + RISCV_INSN_FWVF_VNMSAC, + RISCV_INSN_FWVF_VNMACC, + RISCV_INSN_FWVF_VMSAC, + RISCV_INSN_FWVF_VMACC, + //--------------------- RISCV_SHIFTIOP--------------------- + RISCV_INSN_SRLI, + RISCV_INSN_SRAI, + RISCV_INSN_SLLI, + //--------------------- RISCV_DIVW--------------------- + RISCV_INSN_DIVW, + //--------------------- RISCV_C_ZEXT_B--------------------- + RISCV_INSN_C_ZEXT_B, + //--------------------- RISCV_C_MV--------------------- + RISCV_INSN_C_MV, + //--------------------- RISCV_VIMTYPE--------------------- + RISCV_INSN_VIM_VMADC, + //--------------------- RISCV_LOADRES--------------------- + RISCV_INSN_LOADRES, + //--------------------- RISCV_C_J--------------------- + RISCV_INSN_C_J, + //--------------------- RISCV_AES32ESI--------------------- + RISCV_INSN_AES32ESI, + //--------------------- RISCV_C_BEQZ--------------------- + RISCV_INSN_C_BEQZ, + //--------------------- RISCV_SHA512SUM0--------------------- + RISCV_INSN_SHA512SUM0, + //--------------------- RISCV_SHA512SUM0R--------------------- + RISCV_INSN_SHA512SUM0R, + //--------------------- RISCV_REMW--------------------- + RISCV_INSN_REMW, + //--------------------- RISCV_VFMV--------------------- + RISCV_INSN_VFMV, + //--------------------- RISCV_C_SEXT_H--------------------- + RISCV_INSN_C_SEXT_H, + //--------------------- RISCV_WMVXTYPE--------------------- + RISCV_INSN_WMVX_VWMACCUS, + RISCV_INSN_WMVX_VWMACCU, + RISCV_INSN_WMVX_VWMACCSU, + RISCV_INSN_WMVX_VWMACC, + //--------------------- RISCV_C_FSW--------------------- + RISCV_INSN_C_FSW, + //--------------------- RISCV_C_SW--------------------- + RISCV_INSN_C_SW, + //--------------------- RISCV_ZBS_RTYPE--------------------- + RISCV_INSN_BSET, + RISCV_INSN_BINV, + RISCV_INSN_BEXT, + RISCV_INSN_BCLR, + //--------------------- RISCV_C_SUB--------------------- + RISCV_INSN_C_SUB, + //--------------------- RISCV_VFUNARY0--------------------- + RISCV_INSN_FV_CVT_X_F, + RISCV_INSN_FV_CVT_XU_F, + RISCV_INSN_FV_CVT_RTZ_X_F, + RISCV_INSN_FV_CVT_RTZ_XU_F, + RISCV_INSN_FV_CVT_F_XU, + RISCV_INSN_FV_CVT_F_X, + //--------------------- RISCV_FROUNDNX_S--------------------- + RISCV_INSN_FROUNDNX_S, + //--------------------- RISCV_ZICBOZ--------------------- + RISCV_INSN_ZICBOZ, + //--------------------- RISCV_SFENCE_W_INVAL--------------------- + RISCV_INSN_SFENCE_W_INVAL, + //--------------------- RISCV_C_JR--------------------- + RISCV_INSN_C_JR, + //--------------------- RISCV_C_NOT--------------------- + RISCV_INSN_C_NOT, + //--------------------- RISCV_ZBB_EXTOP--------------------- + RISCV_INSN_ZEXTH, + RISCV_INSN_SEXTH, + RISCV_INSN_SEXTB, + //--------------------- RISCV_MVVTYPE--------------------- + RISCV_INSN_MVV_VREMU, + RISCV_INSN_MVV_VREM, + RISCV_INSN_MVV_VMULHU, + RISCV_INSN_MVV_VMULHSU, + RISCV_INSN_MVV_VMULH, + RISCV_INSN_MVV_VMUL, + RISCV_INSN_MVV_VDIVU, + RISCV_INSN_MVV_VDIV, + RISCV_INSN_MVV_VASUBU, + RISCV_INSN_MVV_VASUB, + RISCV_INSN_MVV_VAADDU, + RISCV_INSN_MVV_VAADD, + //--------------------- RISCV_FVFMATYPE--------------------- + RISCV_INSN_VF_VNMSUB, + RISCV_INSN_VF_VNMSAC, + RISCV_INSN_VF_VNMADD, + RISCV_INSN_VF_VNMACC, + RISCV_INSN_VF_VMSUB, + RISCV_INSN_VF_VMSAC, + RISCV_INSN_VF_VMADD, + RISCV_INSN_VF_VMACC, + //--------------------- RISCV_FMAXM_H--------------------- + RISCV_INSN_FMAXM_H, + //--------------------- RISCV_SHA256SUM0--------------------- + RISCV_INSN_SHA256SUM0, + //--------------------- RISCV_ZBS_IOP--------------------- + RISCV_INSN_BSETI, + RISCV_INSN_BINVI, + RISCV_INSN_BEXTI, + RISCV_INSN_BCLRI, + //--------------------- RISCV_C_XOR--------------------- + RISCV_INSN_C_XOR, + //--------------------- RISCV_FMINM_H--------------------- + RISCV_INSN_FMINM_H, + //--------------------- RISCV_C_LUI_HINT--------------------- + RISCV_INSN_C_LUI_HINT, + //--------------------- RISCV_VVMCTYPE--------------------- + RISCV_INSN_VVMC_VMSBC, + RISCV_INSN_VVMC_VMADC, + //--------------------- RISCV_F_BIN_RM_TYPE_S--------------------- + RISCV_INSN_FSUB_S, + RISCV_INSN_FMUL_S, + RISCV_INSN_FDIV_S, + RISCV_INSN_FADD_S, + //--------------------- RISCV_SINVAL_VMA--------------------- + RISCV_INSN_SINVAL_VMA, + //--------------------- RISCV_MOVETYPEX--------------------- + RISCV_INSN_MOVETYPEX, + //--------------------- RISCV_C_BNEZ--------------------- + RISCV_INSN_C_BNEZ, + //--------------------- RISCV_FWVVMATYPE--------------------- + RISCV_INSN_FWVV_VNMSAC, + RISCV_INSN_FWVV_VNMACC, + RISCV_INSN_FWVV_VMSAC, + RISCV_INSN_FWVV_VMACC, + //--------------------- RISCV_AES64KS1I--------------------- + RISCV_INSN_AES64KS1I, + //--------------------- RISCV_RMVVTYPE--------------------- + RISCV_INSN_MVV_VREDXOR, + RISCV_INSN_MVV_VREDSUM, + RISCV_INSN_MVV_VREDOR, + RISCV_INSN_MVV_VREDMINU, + RISCV_INSN_MVV_VREDMIN, + RISCV_INSN_MVV_VREDMAXU, + RISCV_INSN_MVV_VREDMAX, + RISCV_INSN_MVV_VREDAND, + //--------------------- RISCV_CLZW--------------------- + RISCV_INSN_CLZW, + //--------------------- RISCV_REM--------------------- + RISCV_INSN_REM, + //--------------------- RISCV_C_EBREAK--------------------- + RISCV_INSN_C_EBREAK, + //--------------------- RISCV_AES64ESM--------------------- + RISCV_INSN_AES64ESM, + //--------------------- RISCV_VFNUNARY0--------------------- + RISCV_INSN_FNV_CVT_X_F, + RISCV_INSN_FNV_CVT_XU_F, + RISCV_INSN_FNV_CVT_RTZ_X_F, + RISCV_INSN_FNV_CVT_RTZ_XU_F, + RISCV_INSN_FNV_CVT_ROD_F_F, + RISCV_INSN_FNV_CVT_F_XU, + RISCV_INSN_FNV_CVT_F_X, + RISCV_INSN_FNV_CVT_F_F, + //--------------------- RISCV_VFWUNARY0--------------------- + RISCV_INSN_FWV_CVT_X_F, + RISCV_INSN_FWV_CVT_XU_F, + RISCV_INSN_FWV_CVT_RTZ_X_F, + RISCV_INSN_FWV_CVT_RTZ_XU_F, + RISCV_INSN_FWV_CVT_F_XU, + RISCV_INSN_FWV_CVT_F_X, + RISCV_INSN_FWV_CVT_F_F, + //--------------------- RISCV_MOVETYPEV--------------------- + RISCV_INSN_MOVETYPEV, + //--------------------- RISCV_VFUNARY1--------------------- + RISCV_INSN_FVV_VSQRT, + RISCV_INSN_FVV_VRSQRT7, + RISCV_INSN_FVV_VREC7, + RISCV_INSN_FVV_VCLASS, + //--------------------- RISCV_FWVFTYPE--------------------- + RISCV_INSN_FWVF_VSUB, + RISCV_INSN_FWVF_VMUL, + RISCV_INSN_FWVF_VADD, + //--------------------- RISCV_ZBA_RTYPE--------------------- + RISCV_INSN_SH3ADD, + RISCV_INSN_SH2ADD, + RISCV_INSN_SH1ADD, + //--------------------- RISCV_C_SRLI--------------------- + RISCV_INSN_C_SRLI, + //--------------------- RISCV_VSRETYPE--------------------- + RISCV_INSN_VSRETYPE, + //--------------------- RISCV_C_SLLI_HINT--------------------- + RISCV_INSN_C_SLLI_HINT, + //--------------------- RISCV_WVVTYPE--------------------- + RISCV_INSN_WVV_VWMULU, + RISCV_INSN_WVV_VWMULSU, + RISCV_INSN_WVV_VWMUL, + RISCV_INSN_WVV_VSUBU, + RISCV_INSN_WVV_VSUB, + RISCV_INSN_WVV_VADDU, + RISCV_INSN_WVV_VADD, + //--------------------- RISCV_AES64DSM--------------------- + RISCV_INSN_AES64DSM, + //--------------------- RISCV_C_LI--------------------- + RISCV_INSN_C_LI, + //--------------------- RISCV_CSR--------------------- + RISCV_INSN_CSRRW, + RISCV_INSN_CSRRS, + RISCV_INSN_CSRRC, + //--------------------- RISCV_C_SRAI--------------------- + RISCV_INSN_C_SRAI, + //--------------------- RISCV_FMVP_D_X--------------------- + RISCV_INSN_FMVP_D_X, + //--------------------- RISCV_C_LBU--------------------- + RISCV_INSN_C_LBU, + //--------------------- RISCV_F_UN_RM_TYPE_S--------------------- + RISCV_INSN_FSQRT_S, + RISCV_INSN_FCVT_W_S, + RISCV_INSN_FCVT_WU_S, + RISCV_INSN_FCVT_S_WU, + RISCV_INSN_FCVT_S_W, + RISCV_INSN_FCVT_S_LU, + RISCV_INSN_FCVT_S_L, + RISCV_INSN_FCVT_L_S, + RISCV_INSN_FCVT_LU_S, + //--------------------- RISCV_RTYPEW--------------------- + RISCV_INSN_SUBW, + RISCV_INSN_SRLW, + RISCV_INSN_SRAW, + RISCV_INSN_SLLW, + RISCV_INSN_ADDW, + //--------------------- RISCV_WMVVTYPE--------------------- + RISCV_INSN_WMVV_VWMACCU, + RISCV_INSN_WMVV_VWMACCSU, + RISCV_INSN_WMVV_VWMACC, + //--------------------- RISCV_MULW--------------------- + RISCV_INSN_MULW, + //--------------------- RISCV_VVCMPTYPE--------------------- + RISCV_INSN_VVCMP_VMSNE, + RISCV_INSN_VVCMP_VMSLTU, + RISCV_INSN_VVCMP_VMSLT, + RISCV_INSN_VVCMP_VMSLEU, + RISCV_INSN_VVCMP_VMSLE, + RISCV_INSN_VVCMP_VMSEQ, + //--------------------- RISCV_ILLEGAL--------------------- + RISCV_INSN_ILLEGAL, + //--------------------- RISCV_BREV8--------------------- + RISCV_INSN_BREV8, + //--------------------- RISCV_AES32DSMI--------------------- + RISCV_INSN_AES32DSMI, + //--------------------- RISCV_C_FSD--------------------- + RISCV_INSN_C_FSD, + //--------------------- RISCV_C_ADDW--------------------- + RISCV_INSN_C_ADDW, + //--------------------- RISCV_VCPOP_M--------------------- + RISCV_INSN_VCPOP_M, + //--------------------- RISCV_SHA256SIG1--------------------- + RISCV_INSN_SHA256SIG1, + //--------------------- RISCV_MVXTYPE--------------------- + RISCV_INSN_MVX_VSLIDE1UP, + RISCV_INSN_MVX_VSLIDE1DOWN, + RISCV_INSN_MVX_VREMU, + RISCV_INSN_MVX_VREM, + RISCV_INSN_MVX_VMULHU, + RISCV_INSN_MVX_VMULHSU, + RISCV_INSN_MVX_VMULH, + RISCV_INSN_MVX_VMUL, + RISCV_INSN_MVX_VDIVU, + RISCV_INSN_MVX_VDIV, + RISCV_INSN_MVX_VASUBU, + RISCV_INSN_MVX_VASUB, + RISCV_INSN_MVX_VAADDU, + RISCV_INSN_MVX_VAADD, +}; +#endif //> Group of RISCV instructions typedef enum riscv_insn_group {