From 08d68d1b078b78fc409843b8d241ea2e3052742a 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: Fri, 25 Oct 2024 01:06:18 +0300 Subject: [PATCH] fixed code till it compiled, cstool runs successfully (although with bad output) --- CMakeLists.txt | 24 +- arch/RISCV/RISCVDetails.c | 8 +- arch/RISCV/RISCVDetails.h | 2 +- arch/RISCV/RISCVDisassembler.c | 53 + ...RISCVDisassembly.h => RISCVDisassembler.h} | 0 arch/RISCV/RISCVDisassembly.c | 15 - arch/RISCV/RISCVModule.c | 42 +- arch/RISCV/RISCVModule.h | 1 + arch/RISCV/riscv_ast.gen.inc | 1105 +- arch/RISCV/riscv_ast2str.gen.inc | 118093 ++------------- arch/RISCV/riscv_ast2str_tbls.gen.inc | 3044 + arch/RISCV/riscv_decode.gen.inc | 14776 +- arch/RISCV/riscv_helpers_ast2str.h | 235 + arch/RISCV/riscv_helpers_rvconf.h | 13 + arch/RISCV/riscv_insn_mapping.gen.inc | 598 + include/capstone/riscv.h | 279 +- include/capstone/riscv_insn.gen.inc | 974 + 17 files changed, 23666 insertions(+), 115596 deletions(-) create mode 100644 arch/RISCV/RISCVDisassembler.c rename arch/RISCV/{RISCVDisassembly.h => RISCVDisassembler.h} (100%) delete mode 100644 arch/RISCV/RISCVDisassembly.c create mode 100644 arch/RISCV/riscv_ast2str_tbls.gen.inc create mode 100644 arch/RISCV/riscv_helpers_ast2str.h create mode 100644 arch/RISCV/riscv_helpers_rvconf.h create mode 100644 arch/RISCV/riscv_insn_mapping.gen.inc create mode 100644 include/capstone/riscv_insn.gen.inc diff --git a/CMakeLists.txt b/CMakeLists.txt index e79bf7c3d00..f776e50acb7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -570,24 +570,22 @@ if(CAPSTONE_RISCV_SUPPORT) add_definitions(-DCAPSTONE_HAS_RISCV) set(SOURCES_RISCV arch/RISCV/RISCVDisassembler.c - arch/RISCV/RISCVInstPrinter.c - arch/RISCV/RISCVMapping.c + arch/RISCV/RISCVDetails.c arch/RISCV/RISCVModule.c ) set(HEADERS_RISCV - arch/RISCV/RISCVBaseInfo.h + 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/RISCVDetails.h arch/RISCV/RISCVDisassembler.h - arch/RISCV/RISCVInstPrinter.h - arch/RISCV/RISCVMapping.h + arch/RISCV/riscv_helpers_ast2str.h + arch/RISCV/riscv_helpers_rvconf.h arch/RISCV/RISCVModule.h - arch/RISCV/RISCVGenAsmWriter.inc - arch/RISCV/RISCVGenDisassemblerTables.inc - arch/RISCV/RISCVGenInsnNameMaps.inc - arch/RISCV/RISCVGenInstrInfo.inc - arch/RISCV/RISCVGenRegisterInfo.inc - arch/RISCV/RISCVGenSubtargetInfo.inc - arch/RISCV/RISCVMappingInsn.inc - arch/RISCV/RISCVMappingInsnOp.inc ) endif() diff --git a/arch/RISCV/RISCVDetails.c b/arch/RISCV/RISCVDetails.c index cbf9ef82258..b0b12e17e0e 100644 --- a/arch/RISCV/RISCVDetails.c +++ b/arch/RISCV/RISCVDetails.c @@ -21,13 +21,13 @@ The size calculation algorithm according to the RISCV spec: 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) { - if (first_byte & 0x3 != 0x3) { + if ((first_byte & 0x3) != 0x3) { insn->size = 2; - } else if ((first_byte >> 2) & 0x7 != 0x7) { + } else if (((first_byte >> 2) & 0x7) != 0x7) { insn->size = 4; - } else if ((first_byte >> 5) & 0x1 == 0x0) { + } else if (((first_byte >> 5) & 0x1) == 0x0) { insn->size = 6; - } else if ((first_byte >> 6) & 0x1 == 0x0) { + } else if (((first_byte >> 6) & 0x1) == 0x0) { insn->size = 8; } else { return false; diff --git a/arch/RISCV/RISCVDetails.h b/arch/RISCV/RISCVDetails.h index 158e42b1a1f..b04b6177ad5 100644 --- a/arch/RISCV/RISCVDetails.h +++ b/arch/RISCV/RISCVDetails.h @@ -1,3 +1,3 @@ -#include "capstone.h" +#include "../include/capstone/capstone.h" bool riscv_fill_size(cs_insn *insn, uint8_t binary); \ No newline at end of file diff --git a/arch/RISCV/RISCVDisassembler.c b/arch/RISCV/RISCVDisassembler.c new file mode 100644 index 00000000000..8d5f1d095e3 --- /dev/null +++ b/arch/RISCV/RISCVDisassembler.c @@ -0,0 +1,53 @@ +#include "RISCVDisassembler.h" +#include "RISCVDetails.h" + +#include "riscv_decode.gen.inc" +#include "riscv_insn_mapping.gen.inc" +#include "riscv_ast2str.gen.inc" + +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])) { + 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]); + + insn->id = get_insn_type(&instruction); + insn->address = address; + *size = insn->size; + memcpy(insn->bytes, code, insn->size); + + 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); + + char *curr = instruction_as_str; + uint16_t mnemonic_len = 0; + while (*curr != ' ') { + mnemonic_len++; + curr++; + } + uint16_t operand_len = 0; + while (*curr) { + operand_len++; + curr++; + } + memcpy(insn->mnemonic, instruction_as_str, mnemonic_len); + memcpy(insn->op_str, instruction_as_str + mnemonic_len + 1, operand_len); + return true; + } else { + + } + return false; +} \ No newline at end of file diff --git a/arch/RISCV/RISCVDisassembly.h b/arch/RISCV/RISCVDisassembler.h similarity index 100% rename from arch/RISCV/RISCVDisassembly.h rename to arch/RISCV/RISCVDisassembler.h diff --git a/arch/RISCV/RISCVDisassembly.c b/arch/RISCV/RISCVDisassembly.c deleted file mode 100644 index 9dbe7ac9ce9..00000000000 --- a/arch/RISCV/RISCVDisassembly.c +++ /dev/null @@ -1,15 +0,0 @@ -#include "RISCVDisassembly.h" -#include "RISCVDetails.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])) { - return false; - } - - insn->address = address; - insn->bytes = -} \ No newline at end of file diff --git a/arch/RISCV/RISCVModule.c b/arch/RISCV/RISCVModule.c index af6ed1c1921..167bafa4b20 100644 --- a/arch/RISCV/RISCVModule.c +++ b/arch/RISCV/RISCVModule.c @@ -2,26 +2,38 @@ /* RISC-V Backend By Rodrigo Cortes Porto & Shawn Chang , HardenedLinux@2018 */ -//#ifdef CAPSTONE_HAS_RISCV +#ifdef CAPSTONE_HAS_RISCV #include "RISCVModule.h" +void noop_printer(MCInst *MI, SStream *OS, void *info) { + +} + +void noop_postprinter(csh handle, cs_insn *, SStream *mnem, MCInst *mci) { + +} + +const char *noop_getname(csh handle, unsigned int id) { + return ""; +} + +void noop_getid(cs_struct *h, cs_insn *insn, unsigned int id) { + +} + cs_err RISCV_global_init(cs_struct * ud) { - MCRegisterInfo *mri; - mri = cs_mem_malloc(sizeof(*mri)); - - RISCV_init(mri); - ud->printer = RISCV_printInst; - ud->printer_info = mri; - ud->getinsn_info = mri; - ud->disasm = RISCV_getInstruction; - ud->post_printer = NULL; + ud->printer = noop_printer; + ud->printer_info = NULL; + ud->getinsn_info = NULL; + ud->disasm = riscv_get_instruction; + ud->post_printer = noop_postprinter; - ud->reg_name = RISCV_reg_name; - ud->insn_id = RISCV_get_insn_id; - ud->insn_name = RISCV_insn_name; - ud->group_name = RISCV_group_name; + ud->reg_name = noop_getname; + ud->insn_id = noop_getid; + ud->insn_name = noop_getname; + ud->group_name = noop_getname; return CS_ERR_OK; } @@ -37,4 +49,4 @@ cs_err RISCV_option(cs_struct * handle, cs_opt_type type, size_t value) return CS_ERR_OK; } -//#endif +#endif diff --git a/arch/RISCV/RISCVModule.h b/arch/RISCV/RISCVModule.h index c250db554dd..9d422aa21b9 100644 --- a/arch/RISCV/RISCVModule.h +++ b/arch/RISCV/RISCVModule.h @@ -5,6 +5,7 @@ #define CS_RISCV_MODULE_H #include "../../utils.h" +#include "RISCVDisassembler.h" cs_err RISCV_global_init(cs_struct * ud); cs_err RISCV_option(cs_struct * handle, cs_opt_type type, size_t value); diff --git a/arch/RISCV/riscv_ast.gen.inc b/arch/RISCV/riscv_ast.gen.inc index f67cf1f5205..ba8b9abda27 100644 --- a/arch/RISCV/riscv_ast.gen.inc +++ b/arch/RISCV/riscv_ast.gen.inc @@ -1,14 +1,14 @@ +#ifndef __Riscv_ast_gen_inc__ +#define __Riscv_ast_gen_inc__ #include #include #include - -enum {RISCV_false = 0, RISCV_true = 1}; - +enum { RISCV_false = 0, RISCV_true = 1 }; struct ast { - enum { + enum { RISCV_ILLEGAL, RISCV_C_ILLEGAL, RISCV_UTYPE, @@ -25,13 +25,13 @@ struct ast { RISCV_SHIFTIWOP, RISCV_FENCE, RISCV_FENCE_TSO, - RISCV_FENCEI, RISCV_ECALL, RISCV_MRET, RISCV_SRET, RISCV_EBREAK, RISCV_WFI, RISCV_SFENCE_VMA, + RISCV_FENCEI, RISCV_LOADRES, RISCV_STORECON, RISCV_AMO, @@ -76,7 +76,6 @@ struct ast { RISCV_DIVW, RISCV_REMW, RISCV_CSR, - RISCV_URET, RISCV_C_NOP_HINT, RISCV_C_ADDI_HINT, RISCV_C_LI_HINT, @@ -305,32 +304,24 @@ struct ast { RISCV_ZICBOM, RISCV_ZICBOZ } ast_node_type; - - union { + union { uint32_t illegal; uint16_t c_illegal; - struct { + struct { uint32_t imm /* bits : 20 */; uint8_t rd /* bits : 5 */; - enum uop { - RISCV_LUI, - RISCV_AUIPC - } op; - + enum uop { RISCV_LUI, RISCV_AUIPC } op; } utype; - - struct { + struct { uint32_t imm /* bits : 21 */; uint8_t rd /* bits : 5 */; } riscv_jal; - - struct { + struct { uint16_t imm /* bits : 12 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_jalr; - - struct { + struct { uint16_t imm /* bits : 13 */; uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; @@ -342,10 +333,8 @@ struct ast { RISCV_BLTU, RISCV_BGEU } op; - } btype; - - struct { + struct { uint16_t imm /* bits : 12 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; @@ -357,22 +346,14 @@ struct ast { RISCV_ORI, RISCV_ANDI } op; - } itype; - - struct { + struct { uint8_t shamt /* bits : 6 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; - enum sop { - RISCV_SLLI, - RISCV_SRLI, - RISCV_SRAI - } op; - + enum sop { RISCV_SLLI, RISCV_SRLI, RISCV_SRAI } op; } shiftiop; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; @@ -388,10 +369,8 @@ struct ast { RISCV_OR, RISCV_AND } op; - } rtype; - - struct { + struct { uint16_t imm /* bits : 12 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; @@ -402,12 +381,10 @@ struct ast { RISCV_WORD, RISCV_DOUBLE } width; - uint8_t aq /* bits : 1 */; uint8_t rl /* bits : 1 */; } load; - - struct { + struct { uint16_t imm /* bits : 12 */; uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; @@ -415,14 +392,12 @@ struct ast { uint8_t aq /* bits : 1 */; uint8_t rl /* bits : 1 */; } store; - - struct { + struct { uint16_t imm /* bits : 12 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } addiw; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; @@ -433,51 +408,33 @@ struct ast { RISCV_SRLW, RISCV_SRAW } op; - } rtypew; - - struct { + struct { uint8_t shamt /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; - enum sopw { - RISCV_SLLIW, - RISCV_SRLIW, - RISCV_SRAIW - } op; - + enum sopw { RISCV_SLLIW, RISCV_SRLIW, RISCV_SRAIW } op; } shiftiwop; - - struct { + struct { uint8_t pred /* bits : 4 */; uint8_t succ /* bits : 4 */; } fence; - - struct { + struct { uint8_t pred /* bits : 4 */; uint8_t succ /* bits : 4 */; } fence_tso; - - - - - - - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t rs2 /* bits : 5 */; } sfence_vma; - - struct { + struct { uint8_t aq /* bits : 1 */; uint8_t rl /* bits : 1 */; uint8_t rs1 /* bits : 5 */; enum word_width width; uint8_t rd /* bits : 5 */; } loadres; - - struct { + struct { uint8_t aq /* bits : 1 */; uint8_t rl /* bits : 1 */; uint8_t rs2 /* bits : 5 */; @@ -485,8 +442,7 @@ struct ast { enum word_width width; uint8_t rd /* bits : 5 */; } storecon; - - struct { + struct { enum amoop { RISCV_AMOSWAP, RISCV_AMOADD, @@ -498,7 +454,6 @@ struct ast { RISCV_AMOMINU, RISCV_AMOMAXU } op; - uint8_t aq /* bits : 1 */; uint8_t rl /* bits : 1 */; uint8_t rs2 /* bits : 5 */; @@ -506,154 +461,124 @@ struct ast { enum word_width width; uint8_t rd /* bits : 5 */; } amo; - - - struct { + struct { uint8_t rdc /* bits : 3 */; uint8_t nzimm; } c_addi4spn; - - struct { + struct { uint8_t uimm /* bits : 5 */; uint8_t rsc /* bits : 3 */; uint8_t rdc /* bits : 3 */; } c_lw; - - struct { + struct { uint8_t uimm /* bits : 5 */; uint8_t rsc /* bits : 3 */; uint8_t rdc /* bits : 3 */; } c_ld; - - struct { + struct { uint8_t uimm /* bits : 5 */; uint8_t rsc1 /* bits : 3 */; uint8_t rsc2 /* bits : 3 */; } c_sw; - - struct { + struct { uint8_t uimm /* bits : 5 */; uint8_t rsc1 /* bits : 3 */; uint8_t rsc2 /* bits : 3 */; } c_sd; - - struct { + struct { uint8_t nzi /* bits : 6 */; uint8_t rsd /* bits : 5 */; } c_addi; - uint16_t c_jal /* bits : 11 */; - struct { + struct { uint8_t imm /* bits : 6 */; uint8_t rsd /* bits : 5 */; } c_addiw; - - struct { + struct { uint8_t imm /* bits : 6 */; uint8_t rd /* bits : 5 */; } c_li; - uint8_t c_addi16sp /* bits : 6 */; - struct { + struct { uint8_t imm /* bits : 6 */; uint8_t rd /* bits : 5 */; } c_lui; - - struct { + struct { uint8_t shamt /* bits : 6 */; uint8_t rsd /* bits : 3 */; } c_srli; - - struct { + struct { uint8_t shamt /* bits : 6 */; uint8_t rsd /* bits : 3 */; } c_srai; - - struct { + struct { uint8_t imm /* bits : 6 */; uint8_t rsd /* bits : 3 */; } c_andi; - - struct { + struct { uint8_t rsd /* bits : 3 */; uint8_t rs2 /* bits : 3 */; } c_sub; - - struct { + struct { uint8_t rsd /* bits : 3 */; uint8_t rs2 /* bits : 3 */; } c_xor; - - struct { + struct { uint8_t rsd /* bits : 3 */; uint8_t rs2 /* bits : 3 */; } c_or; - - struct { + struct { uint8_t rsd /* bits : 3 */; uint8_t rs2 /* bits : 3 */; } c_and; - - struct { + struct { uint8_t rsd /* bits : 3 */; uint8_t rs2 /* bits : 3 */; } c_subw; - - struct { + struct { uint8_t rsd /* bits : 3 */; uint8_t rs2 /* bits : 3 */; } c_addw; - uint16_t c_j /* bits : 11 */; - struct { + struct { uint8_t imm; uint8_t rs /* bits : 3 */; } c_beqz; - - struct { + struct { uint8_t imm; uint8_t rs /* bits : 3 */; } c_bnez; - - struct { + struct { uint8_t shamt /* bits : 6 */; uint8_t rsd /* bits : 5 */; } c_slli; - - struct { + struct { uint8_t uimm /* bits : 6 */; uint8_t rd /* bits : 5 */; } c_lwsp; - - struct { + struct { uint8_t uimm /* bits : 6 */; uint8_t rd /* bits : 5 */; } c_ldsp; - - struct { + struct { uint8_t uimm /* bits : 6 */; uint8_t rs2 /* bits : 5 */; } c_swsp; - - struct { + struct { uint8_t uimm /* bits : 6 */; uint8_t rs2 /* bits : 5 */; } c_sdsp; - uint8_t c_jr /* bits : 5 */; uint8_t c_jalr /* bits : 5 */; - struct { + struct { uint8_t rd /* bits : 5 */; uint8_t rs2 /* bits : 5 */; } c_mv; - - - struct { + struct { uint8_t rsd /* bits : 5 */; uint8_t rs2 /* bits : 5 */; } c_add; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; @@ -662,99 +587,80 @@ struct ast { uint8_t signed_rs1 /* bits : 1 */; uint8_t signed_rs2 /* bits : 1 */; } mul_op; - } mul; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; uint8_t s /* bits : 1 */; } div; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; uint8_t s /* bits : 1 */; } rem; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } mulw; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; uint8_t s /* bits : 1 */; } divw; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; uint8_t s /* bits : 1 */; } remw; - - struct { + struct { uint16_t csr /* bits : 12 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; uint8_t is_imm /* bits : 1 */; - enum csrop { - RISCV_CSRRW, - RISCV_CSRRS, - RISCV_CSRRC - } op; - + enum csrop { RISCV_CSRRW, RISCV_CSRRS, RISCV_CSRRC } op; } csr; - - uint8_t c_nop_hint /* bits : 6 */; uint8_t c_addi_hint /* bits : 5 */; uint8_t c_li_hint /* bits : 6 */; uint8_t c_lui_hint /* bits : 6 */; uint8_t c_mv_hint /* bits : 5 */; uint8_t c_add_hint /* bits : 5 */; - struct { + struct { uint8_t shamt /* bits : 6 */; uint8_t rsd /* bits : 5 */; } c_slli_hint; - uint8_t c_srli_hint /* bits : 3 */; uint8_t c_srai_hint /* bits : 3 */; - struct { + struct { uint8_t fm /* bits : 4 */; uint8_t pred /* bits : 4 */; uint8_t succ /* bits : 4 */; uint8_t rs /* bits : 5 */; uint8_t rd /* bits : 5 */; } fence_reserved; - - struct { + struct { uint16_t imm /* bits : 12 */; uint8_t rs /* bits : 5 */; uint8_t rd /* bits : 5 */; } fencei_reserved; - - struct { + struct { uint16_t imm /* bits : 12 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; enum word_width width; } load_fp; - - struct { + struct { uint16_t imm /* bits : 12 */; uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; enum word_width width; } store_fp; - - struct { + struct { uint8_t rs3 /* bits : 5 */; uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; @@ -766,7 +672,6 @@ struct ast { RISCV_RM_RMM, RISCV_RM_DYN } rm; - uint8_t rd /* bits : 5 */; enum f_madd_op_S { RISCV_FMADD_S, @@ -774,10 +679,8 @@ struct ast { RISCV_FNMSUB_S, RISCV_FNMADD_S } op; - } f_madd_type_s; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; enum rounding_mode rm; @@ -788,10 +691,8 @@ struct ast { RISCV_FMUL_S, RISCV_FDIV_S } op; - } f_bin_rm_type_s; - - struct { + struct { uint8_t rs1 /* bits : 5 */; enum rounding_mode rm; uint8_t rd /* bits : 5 */; @@ -806,10 +707,8 @@ struct ast { RISCV_FCVT_S_L, RISCV_FCVT_S_LU } fcvt_s_lu; - } f_un_rm_type_s; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; @@ -823,43 +722,31 @@ struct ast { RISCV_FLT_S, RISCV_FLE_S } fle_s; - } f_bin_type_s; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; - enum f_un_op_S { - RISCV_FCLASS_S, - RISCV_FMV_X_W, - RISCV_FMV_W_X - } fmv_w_x; - + enum f_un_op_S { RISCV_FCLASS_S, RISCV_FMV_X_W, RISCV_FMV_W_X } fmv_w_x; } f_un_type_s; - - struct { + struct { uint8_t imm /* bits : 6 */; uint8_t rd /* bits : 5 */; } c_flwsp; - - struct { + struct { uint8_t uimm /* bits : 6 */; uint8_t rs2 /* bits : 5 */; } c_fswsp; - - struct { + struct { uint8_t uimm /* bits : 5 */; uint8_t rsc /* bits : 3 */; uint8_t rdc /* bits : 3 */; } c_flw; - - struct { + struct { uint8_t uimm /* bits : 5 */; uint8_t rsc1 /* bits : 3 */; uint8_t rsc2 /* bits : 3 */; } c_fsw; - - struct { + struct { uint8_t rs3 /* bits : 5 */; uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; @@ -871,10 +758,8 @@ struct ast { RISCV_FNMSUB_D, RISCV_FNMADD_D } op; - } f_madd_type_d; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; enum rounding_mode rm; @@ -885,10 +770,8 @@ struct ast { RISCV_FMUL_D, RISCV_FDIV_D } op; - } f_bin_rm_type_d; - - struct { + struct { uint8_t rs1 /* bits : 5 */; enum rounding_mode rm; uint8_t rd /* bits : 5 */; @@ -905,10 +788,8 @@ struct ast { RISCV_FCVT_D_L, RISCV_FCVT_D_LU } fcvt_d_lu; - } f_un_rm_type_d; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; @@ -922,56 +803,40 @@ struct ast { RISCV_FLT_D, RISCV_FLE_D } fle_d; - } f_bin_type_d; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; - enum f_un_op_D { - RISCV_FCLASS_D, - RISCV_FMV_X_D, - RISCV_FMV_D_X - } fmv_d_x; - + enum f_un_op_D { RISCV_FCLASS_D, RISCV_FMV_X_D, RISCV_FMV_D_X } fmv_d_x; } f_un_type_d; - - struct { + struct { uint8_t uimm /* bits : 6 */; uint8_t rd /* bits : 5 */; } c_fldsp; - - struct { + struct { uint8_t uimm /* bits : 6 */; uint8_t rs2 /* bits : 5 */; } c_fsdsp; - - struct { + struct { uint8_t uimm /* bits : 5 */; uint8_t rsc /* bits : 3 */; uint8_t rdc /* bits : 3 */; } c_fld; - - struct { + struct { uint8_t uimm /* bits : 5 */; uint8_t rsc1 /* bits : 3 */; uint8_t rsc2 /* bits : 3 */; } c_fsd; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t rs2 /* bits : 5 */; } sinval_vma; - - - - struct { + struct { uint8_t shamt /* bits : 6 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_slliuw; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; @@ -981,45 +846,30 @@ struct ast { RISCV_SH2ADDUW, RISCV_SH3ADDUW } op; - } zba_rtypeuw; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; - enum brop_zba { - RISCV_SH1ADD, - RISCV_SH2ADD, - RISCV_SH3ADD - } op; - + enum brop_zba { RISCV_SH1ADD, RISCV_SH2ADD, RISCV_SH3ADD } op; } zba_rtype; - - struct { + struct { uint8_t shamt /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_roriw; - - struct { + struct { uint8_t shamt /* bits : 6 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_rori; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; - enum bropw_zbb { - RISCV_ROLW, - RISCV_RORW - } op; - + enum bropw_zbb { RISCV_ROLW, RISCV_RORW } op; } zbb_rtypew; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; @@ -1034,146 +884,107 @@ struct ast { RISCV_ROL, RISCV_ROR } op; - } zbb_rtype; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; - enum extop_zbb { - RISCV_SEXTB, - RISCV_SEXTH, - RISCV_ZEXTH - } op; - + enum extop_zbb { RISCV_SEXTB, RISCV_SEXTH, RISCV_ZEXTH } op; } zbb_extop; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_rev8; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_orcb; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_cpop; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_cpopw; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_clz; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_clzw; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_ctz; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_ctzw; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_clmul; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_clmulh; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_clmulr; - - struct { + struct { uint8_t shamt /* bits : 6 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; - enum biop_zbs { - RISCV_BCLRI, - RISCV_BEXTI, - RISCV_BINVI, - RISCV_BSETI - } op; - + enum biop_zbs { RISCV_BCLRI, RISCV_BEXTI, RISCV_BINVI, RISCV_BSETI } op; } zbs_iop; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; - enum brop_zbs { - RISCV_BCLR, - RISCV_BEXT, - RISCV_BINV, - RISCV_BSET - } op; - + enum brop_zbs { RISCV_BCLR, RISCV_BEXT, RISCV_BINV, RISCV_BSET } op; } zbs_rtype; - - struct { + struct { uint8_t uimm /* bits : 2 */; uint8_t rdc /* bits : 3 */; uint8_t rs1c /* bits : 3 */; } c_lbu; - - struct { + struct { uint8_t uimm /* bits : 2 */; uint8_t rdc /* bits : 3 */; uint8_t rs1c /* bits : 3 */; } c_lhu; - - struct { + struct { uint8_t uimm /* bits : 2 */; uint8_t rdc /* bits : 3 */; uint8_t rs1c /* bits : 3 */; } c_lh; - - struct { + struct { uint8_t uimm /* bits : 2 */; uint8_t rs1c /* bits : 3 */; uint8_t rs2c /* bits : 3 */; } c_sb; - - struct { + struct { uint8_t uimm /* bits : 2 */; uint8_t rs1c /* bits : 3 */; uint8_t rs2c /* bits : 3 */; } c_sh; - uint8_t c_zext_b /* bits : 3 */; uint8_t c_sext_b /* bits : 3 */; uint8_t c_zext_h /* bits : 3 */; uint8_t c_sext_h /* bits : 3 */; uint8_t c_zext_w /* bits : 3 */; uint8_t c_not /* bits : 3 */; - struct { + struct { uint8_t rsdc /* bits : 3 */; uint8_t rs2c /* bits : 3 */; } c_mul; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; enum rounding_mode rm; @@ -1184,10 +995,8 @@ struct ast { RISCV_FMUL_H, RISCV_FDIV_H } op; - } f_bin_rm_type_h; - - struct { + struct { uint8_t rs3 /* bits : 5 */; uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; @@ -1199,10 +1008,8 @@ struct ast { RISCV_FNMSUB_H, RISCV_FNMADD_H } op; - } f_madd_type_h; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; @@ -1216,10 +1023,8 @@ struct ast { RISCV_FLT_H, RISCV_FLE_H } fle_h; - } f_bin_type_h; - - struct { + struct { uint8_t rs1 /* bits : 5 */; enum rounding_mode rm; uint8_t rd /* bits : 5 */; @@ -1238,384 +1043,307 @@ struct ast { RISCV_FCVT_H_L, RISCV_FCVT_H_LU } fcvt_h_lu; - } f_un_rm_type_h; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; - enum f_un_op_H { - RISCV_FCLASS_H, - RISCV_FMV_X_H, - RISCV_FMV_H_X - } fmv_h_x; - + enum f_un_op_H { RISCV_FCLASS_H, RISCV_FMV_X_H, RISCV_FMV_H_X } fmv_h_x; } f_un_type_h; - - struct { + struct { uint8_t constantidx /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_fli_h; - - struct { + struct { uint8_t constantidx /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_fli_s; - - struct { + struct { uint8_t constantidx /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_fli_d; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_fminm_h; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_fmaxm_h; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_fminm_s; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_fmaxm_s; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_fminm_d; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_fmaxm_d; - - struct { + struct { uint8_t rs1 /* bits : 5 */; enum rounding_mode rm; uint8_t rd /* bits : 5 */; } riscv_fround_h; - - struct { + struct { uint8_t rs1 /* bits : 5 */; enum rounding_mode rm; uint8_t rd /* bits : 5 */; } riscv_froundnx_h; - - struct { + struct { uint8_t rs1 /* bits : 5 */; enum rounding_mode rm; uint8_t rd /* bits : 5 */; } riscv_fround_s; - - struct { + struct { uint8_t rs1 /* bits : 5 */; enum rounding_mode rm; uint8_t rd /* bits : 5 */; } riscv_froundnx_s; - - struct { + struct { uint8_t rs1 /* bits : 5 */; enum rounding_mode rm; uint8_t rd /* bits : 5 */; } riscv_fround_d; - - struct { + struct { uint8_t rs1 /* bits : 5 */; enum rounding_mode rm; uint8_t rd /* bits : 5 */; } riscv_froundnx_d; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_fmvh_x_d; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_fmvp_d_x; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_fleq_h; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_fltq_h; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_fleq_s; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_fltq_s; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_fleq_d; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_fltq_d; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_fcvtmod_w_d; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } sha256sig0; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } sha256sig1; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } sha256sum0; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } sha256sum1; - - struct { + struct { uint8_t bs /* bits : 2 */; uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } aes32esmi; - - struct { + struct { uint8_t bs /* bits : 2 */; uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } aes32esi; - - struct { + struct { uint8_t bs /* bits : 2 */; uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } aes32dsmi; - - struct { + struct { uint8_t bs /* bits : 2 */; uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } aes32dsi; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } sha512sig0l; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } sha512sig0h; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } sha512sig1l; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } sha512sig1h; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } sha512sum0r; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } sha512sum1r; - - struct { + struct { uint8_t rnum /* bits : 4 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } aes64ks1i; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } aes64ks2; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } aes64im; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } aes64esm; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } aes64es; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } aes64dsm; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } aes64ds; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } sha512sig0; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } sha512sig1; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } sha512sum0; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } sha512sum1; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } sm3p0; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } sm3p1; - - struct { + struct { uint8_t bs /* bits : 2 */; uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } sm4ed; - - struct { + struct { uint8_t bs /* bits : 2 */; uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } sm4ks; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; - enum brop_zbkb { - RISCV_PACK, - RISCV_PACKH - } op; - + enum brop_zbkb { RISCV_PACK, RISCV_PACKH } op; } zbkb_rtype; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } zbkb_packw; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_zip; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_unzip; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_brev8; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_xperm8; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } riscv_xperm4; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; - enum zicondop { - RISCV_CZERO_EQZ, - RISCV_CZERO_NEZ - } riscv_czero_nez; - + enum zicondop { RISCV_CZERO_EQZ, RISCV_CZERO_NEZ } riscv_czero_nez; } zicond_rtype; - - struct { + struct { uint8_t ma /* bits : 1 */; uint8_t ta /* bits : 1 */; uint8_t sew /* bits : 3 */; @@ -1623,14 +1351,12 @@ struct ast { uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } vsetvli; - - struct { + struct { uint8_t rs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t rd /* bits : 5 */; } vsetvl; - - struct { + struct { uint8_t ma /* bits : 1 */; uint8_t ta /* bits : 1 */; uint8_t sew /* bits : 3 */; @@ -1638,8 +1364,7 @@ struct ast { uint8_t uimm /* bits : 5 */; uint8_t rd /* bits : 5 */; } vsetivli; - - struct { + struct { enum vvfunct6 { RISCV_VV_VADD, RISCV_VV_VSUB, @@ -1663,49 +1388,35 @@ struct ast { RISCV_VV_VSSRL, RISCV_VV_VSSRA } funct6; - uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t vs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } vvtype; - - struct { - enum nvsfunct6 { - RISCV_NVS_VNSRL, - RISCV_NVS_VNSRA - } funct6; - + struct { + enum nvsfunct6 { RISCV_NVS_VNSRL, RISCV_NVS_VNSRA } funct6; uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t vs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } nvstype; - - struct { - enum nvfunct6 { - RISCV_NV_VNCLIPU, - RISCV_NV_VNCLIP - } funct6; - + struct { + enum nvfunct6 { RISCV_NV_VNCLIPU, RISCV_NV_VNCLIP } funct6; uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t vs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } nvtype; - - struct { + struct { uint8_t vs2 /* bits : 5 */; uint8_t vs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } masktypev; - - struct { + struct { uint8_t vs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } movetypev; - - struct { + struct { enum vxfunct6 { RISCV_VX_VADD, RISCV_VX_VSUB, @@ -1728,62 +1439,46 @@ struct ast { RISCV_VX_VSSRL, RISCV_VX_VSSRA } funct6; - uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } vxtype; - - struct { - enum nxsfunct6 { - RISCV_NXS_VNSRL, - RISCV_NXS_VNSRA - } funct6; - + struct { + enum nxsfunct6 { RISCV_NXS_VNSRL, RISCV_NXS_VNSRA } funct6; uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } nxstype; - - struct { - enum nxfunct6 { - RISCV_NX_VNCLIPU, - RISCV_NX_VNCLIP - } funct6; - + struct { + enum nxfunct6 { RISCV_NX_VNCLIPU, RISCV_NX_VNCLIP } funct6; uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } nxtype; - - struct { + struct { enum vxsgfunct6 { RISCV_VX_VSLIDEUP, RISCV_VX_VSLIDEDOWN, RISCV_VX_VRGATHER } funct6; - uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } vxsg; - - struct { + struct { uint8_t vs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } masktypex; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } movetypex; - - struct { + struct { enum vifunct6 { RISCV_VI_VADD, RISCV_VI_VRSUB, @@ -1798,68 +1493,51 @@ struct ast { RISCV_VI_VSSRL, RISCV_VI_VSSRA } funct6; - uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t simm /* bits : 5 */; uint8_t vd /* bits : 5 */; } vitype; - - struct { - enum nisfunct6 { - RISCV_NIS_VNSRL, - RISCV_NIS_VNSRA - } funct6; - + struct { + enum nisfunct6 { RISCV_NIS_VNSRL, RISCV_NIS_VNSRA } funct6; uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t simm /* bits : 5 */; uint8_t vd /* bits : 5 */; } nistype; - - struct { - enum nifunct6 { - RISCV_NI_VNCLIPU, - RISCV_NI_VNCLIP - } funct6; - + struct { + enum nifunct6 { RISCV_NI_VNCLIPU, RISCV_NI_VNCLIP } funct6; uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t simm /* bits : 5 */; uint8_t vd /* bits : 5 */; } nitype; - - struct { + struct { enum visgfunct6 { RISCV_VI_VSLIDEUP, RISCV_VI_VSLIDEDOWN, RISCV_VI_VRGATHER } funct6; - uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t simm /* bits : 5 */; uint8_t vd /* bits : 5 */; } visg; - - struct { + struct { uint8_t vs2 /* bits : 5 */; uint8_t simm /* bits : 5 */; uint8_t vd /* bits : 5 */; } masktypei; - - struct { + struct { uint8_t vd /* bits : 5 */; uint8_t simm /* bits : 5 */; } movetypei; - - struct { + struct { uint8_t vs2 /* bits : 5 */; uint8_t simm /* bits : 5 */; uint8_t vd /* bits : 5 */; } vmvrtype; - - struct { + struct { enum mvvfunct6 { RISCV_MVV_VAADDU, RISCV_MVV_VAADD, @@ -1874,28 +1552,24 @@ struct ast { RISCV_MVV_VREMU, RISCV_MVV_VREM } funct6; - uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t vs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } mvvtype; - - struct { + struct { enum mvvmafunct6 { RISCV_MVV_VMACC, RISCV_MVV_VNMSAC, RISCV_MVV_VMADD, RISCV_MVV_VNMSUB } funct6; - uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t vs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } mvvmatype; - - struct { + struct { enum wvvfunct6 { RISCV_WVV_VADD, RISCV_WVV_VSUB, @@ -1905,85 +1579,62 @@ struct ast { RISCV_WVV_VWMULU, RISCV_WVV_VWMULSU } funct6; - uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t vs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } wvvtype; - - struct { + struct { enum wvfunct6 { RISCV_WV_VADD, RISCV_WV_VSUB, RISCV_WV_VADDU, RISCV_WV_VSUBU } funct6; - uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t vs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } wvtype; - - struct { + struct { enum wmvvfunct6 { RISCV_WMVV_VWMACCU, RISCV_WMVV_VWMACC, RISCV_WMVV_VWMACCSU } funct6; - uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t vs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } wmvvtype; - - struct { - enum vext2funct6 { - RISCV_VEXT2_ZVF2, - RISCV_VEXT2_SVF2 - } funct6; - + struct { + enum vext2funct6 { RISCV_VEXT2_ZVF2, RISCV_VEXT2_SVF2 } funct6; uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t vd /* bits : 5 */; } vext2type; - - struct { - enum vext4funct6 { - RISCV_VEXT4_ZVF4, - RISCV_VEXT4_SVF4 - } funct6; - + struct { + enum vext4funct6 { RISCV_VEXT4_ZVF4, RISCV_VEXT4_SVF4 } funct6; uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t vd /* bits : 5 */; } vext4type; - - struct { - enum vext8funct6 { - RISCV_VEXT8_ZVF8, - RISCV_VEXT8_SVF8 - } funct6; - + struct { + enum vext8funct6 { RISCV_VEXT8_ZVF8, RISCV_VEXT8_SVF8 } funct6; uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t vd /* bits : 5 */; } vext8type; - - struct { + struct { uint8_t vs2 /* bits : 5 */; uint8_t rd /* bits : 5 */; } vmvxs; - - struct { + struct { uint8_t vs2 /* bits : 5 */; uint8_t vs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } mvvcompress; - - struct { + struct { enum mvxfunct6 { RISCV_MVX_VAADDU, RISCV_MVX_VAADD, @@ -2000,28 +1651,24 @@ struct ast { RISCV_MVX_VREMU, RISCV_MVX_VREM } funct6; - uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } mvxtype; - - struct { + struct { enum mvxmafunct6 { RISCV_MVX_VMACC, RISCV_MVX_VNMSAC, RISCV_MVX_VMADD, RISCV_MVX_VNMSUB } funct6; - uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } mvxmatype; - - struct { + struct { enum wvxfunct6 { RISCV_WVX_VADD, RISCV_WVX_VSUB, @@ -2031,47 +1678,40 @@ struct ast { RISCV_WVX_VWMULU, RISCV_WVX_VWMULSU } funct6; - uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } wvxtype; - - struct { + struct { enum wxfunct6 { RISCV_WX_VADD, RISCV_WX_VSUB, RISCV_WX_VADDU, RISCV_WX_VSUBU } funct6; - uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } wxtype; - - struct { + struct { enum wmvxfunct6 { RISCV_WMVX_VWMACCU, RISCV_WMVX_VWMACC, RISCV_WMVX_VWMACCUS, RISCV_WMVX_VWMACCSU } funct6; - uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } wmvxtype; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } vmvsx; - - struct { + struct { enum fvvfunct6 { RISCV_FVV_VADD, RISCV_FVV_VSUB, @@ -2083,14 +1723,12 @@ struct ast { RISCV_FVV_VDIV, RISCV_FVV_VMUL } funct6; - uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t vs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } fvvtype; - - struct { + struct { enum fvvmafunct6 { RISCV_FVV_VMADD, RISCV_FVV_VNMADD, @@ -2101,53 +1739,42 @@ struct ast { RISCV_FVV_VMSAC, RISCV_FVV_VNMSAC } funct6; - uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t vs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } fvvmatype; - - struct { + struct { enum fwvvfunct6 { RISCV_FWVV_VADD, RISCV_FWVV_VSUB, RISCV_FWVV_VMUL } funct6; - uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t vs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } fwvvtype; - - struct { + struct { enum fwvvmafunct6 { RISCV_FWVV_VMACC, RISCV_FWVV_VNMACC, RISCV_FWVV_VMSAC, RISCV_FWVV_VNMSAC } funct6; - uint8_t vm /* bits : 1 */; uint8_t vs1 /* bits : 5 */; uint8_t vs2 /* bits : 5 */; uint8_t vd /* bits : 5 */; } fwvvmatype; - - struct { - enum fwvfunct6 { - RISCV_FWV_VADD, - RISCV_FWV_VSUB - } funct6; - + struct { + enum fwvfunct6 { RISCV_FWV_VADD, RISCV_FWV_VSUB } funct6; uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t vs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } fwvtype; - - struct { + struct { uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; enum vfunary0 { @@ -2158,11 +1785,9 @@ struct ast { RISCV_FV_CVT_RTZ_XU_F, RISCV_FV_CVT_RTZ_X_F } vfunary0; - uint8_t vd /* bits : 5 */; } vfunary0; - - struct { + struct { uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; enum vfwunary0 { @@ -2174,11 +1799,9 @@ struct ast { RISCV_FWV_CVT_RTZ_XU_F, RISCV_FWV_CVT_RTZ_X_F } vfwunary0; - uint8_t vd /* bits : 5 */; } vfwunary0; - - struct { + struct { uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; enum vfnunary0 { @@ -2191,11 +1814,9 @@ struct ast { RISCV_FNV_CVT_RTZ_XU_F, RISCV_FNV_CVT_RTZ_X_F } vfnunary0; - uint8_t vd /* bits : 5 */; } vfnunary0; - - struct { + struct { uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; enum vfunary1 { @@ -2204,16 +1825,13 @@ struct ast { RISCV_FVV_VREC7, RISCV_FVV_VCLASS } vfunary1; - uint8_t vd /* bits : 5 */; } vfunary1; - - struct { + struct { uint8_t vs2 /* bits : 5 */; uint8_t rd /* bits : 5 */; } vfmvfs; - - struct { + struct { enum fvffunct6 { RISCV_VF_VADD, RISCV_VF_VSUB, @@ -2229,14 +1847,12 @@ struct ast { RISCV_VF_VSLIDE1UP, RISCV_VF_VSLIDE1DOWN } funct6; - uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } fvftype; - - struct { + struct { enum fvfmafunct6 { RISCV_VF_VMADD, RISCV_VF_VNMADD, @@ -2247,99 +1863,76 @@ struct ast { RISCV_VF_VMSAC, RISCV_VF_VNMSAC } funct6; - uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } fvfmatype; - - struct { + struct { enum fwvffunct6 { RISCV_FWVF_VADD, RISCV_FWVF_VSUB, RISCV_FWVF_VMUL } funct6; - uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } fwvftype; - - struct { + struct { enum fwvfmafunct6 { RISCV_FWVF_VMACC, RISCV_FWVF_VNMACC, RISCV_FWVF_VMSAC, RISCV_FWVF_VNMSAC } funct6; - uint8_t vm /* bits : 1 */; uint8_t rs1 /* bits : 5 */; uint8_t vs2 /* bits : 5 */; uint8_t vd /* bits : 5 */; } fwvfmatype; - - struct { - enum fwffunct6 { - RISCV_FWF_VADD, - RISCV_FWF_VSUB - } funct6; - + struct { + enum fwffunct6 { RISCV_FWF_VADD, RISCV_FWF_VSUB } funct6; uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } fwftype; - - struct { + struct { uint8_t vs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } vfmerge; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } vfmv; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } vfmvsf; - - struct { + struct { uint8_t nf /* bits : 3 */; uint8_t vm /* bits : 1 */; uint8_t rs1 /* bits : 5 */; - enum vlewidth { - RISCV_VLE8, - RISCV_VLE16, - RISCV_VLE32, - RISCV_VLE64 - } width; - + enum vlewidth { RISCV_VLE8, RISCV_VLE16, RISCV_VLE32, RISCV_VLE64 } width; uint8_t vd /* bits : 5 */; } vlsegtype; - - struct { + struct { uint8_t nf /* bits : 3 */; uint8_t vm /* bits : 1 */; uint8_t rs1 /* bits : 5 */; enum vlewidth width; uint8_t vd /* bits : 5 */; } vlsegfftype; - - struct { + struct { uint8_t nf /* bits : 3 */; uint8_t vm /* bits : 1 */; uint8_t rs1 /* bits : 5 */; enum vlewidth width; uint8_t vs3 /* bits : 5 */; } vssegtype; - - struct { + struct { uint8_t nf /* bits : 3 */; uint8_t vm /* bits : 1 */; uint8_t rs2 /* bits : 5 */; @@ -2347,8 +1940,7 @@ struct ast { enum vlewidth width; uint8_t vd /* bits : 5 */; } vlssegtype; - - struct { + struct { uint8_t nf /* bits : 3 */; uint8_t vm /* bits : 1 */; uint8_t rs2 /* bits : 5 */; @@ -2356,8 +1948,7 @@ struct ast { enum vlewidth width; uint8_t vs3 /* bits : 5 */; } vsssegtype; - - struct { + struct { uint8_t nf /* bits : 3 */; uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; @@ -2365,8 +1956,7 @@ struct ast { enum vlewidth width; uint8_t vd /* bits : 5 */; } vluxsegtype; - - struct { + struct { uint8_t nf /* bits : 3 */; uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; @@ -2374,8 +1964,7 @@ struct ast { enum vlewidth width; uint8_t vd /* bits : 5 */; } vloxsegtype; - - struct { + struct { uint8_t nf /* bits : 3 */; uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; @@ -2383,8 +1972,7 @@ struct ast { enum vlewidth width; uint8_t vs3 /* bits : 5 */; } vsuxsegtype; - - struct { + struct { uint8_t nf /* bits : 3 */; uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; @@ -2392,31 +1980,23 @@ struct ast { enum vlewidth width; uint8_t vs3 /* bits : 5 */; } vsoxsegtype; - - struct { + struct { uint8_t nf /* bits : 3 */; uint8_t rs1 /* bits : 5 */; enum vlewidth width; uint8_t vd /* bits : 5 */; } vlretype; - - struct { + struct { uint8_t nf /* bits : 3 */; uint8_t rs1 /* bits : 5 */; uint8_t vs3 /* bits : 5 */; } vsretype; - - struct { + struct { uint8_t rs1 /* bits : 5 */; uint8_t vd_or_vs3 /* bits : 5 */; - enum vmlsop { - RISCV_VLM, - RISCV_VSM - } op; - + enum vmlsop { RISCV_VLM, RISCV_VSM } op; } vmtype; - - struct { + struct { enum mmfunct6 { RISCV_MM_VMAND, RISCV_MM_VMNAND, @@ -2427,87 +2007,63 @@ struct ast { RISCV_MM_VMORN, RISCV_MM_VMXNOR } funct6; - uint8_t vs2 /* bits : 5 */; uint8_t vs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } mmtype; - - struct { + struct { uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t rd /* bits : 5 */; } vcpop_m; - - struct { + struct { uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t rd /* bits : 5 */; } vfirst_m; - - struct { + struct { uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t vd /* bits : 5 */; } vmsbf_m; - - struct { + struct { uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t vd /* bits : 5 */; } vmsif_m; - - struct { + struct { uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t vd /* bits : 5 */; } vmsof_m; - - struct { + struct { uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t vd /* bits : 5 */; } viota_m; - - struct { + struct { uint8_t vm /* bits : 1 */; uint8_t vd /* bits : 5 */; } vid_v; - - struct { - enum vvmfunct6 { - RISCV_VVM_VMADC, - RISCV_VVM_VMSBC - } funct6; - + struct { + enum vvmfunct6 { RISCV_VVM_VMADC, RISCV_VVM_VMSBC } funct6; uint8_t vs2 /* bits : 5 */; uint8_t vs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } vvmtype; - - struct { - enum vvmcfunct6 { - RISCV_VVMC_VMADC, - RISCV_VVMC_VMSBC - } funct6; - + struct { + enum vvmcfunct6 { RISCV_VVMC_VMADC, RISCV_VVMC_VMSBC } funct6; uint8_t vs2 /* bits : 5 */; uint8_t vs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } vvmctype; - - struct { - enum vvmsfunct6 { - RISCV_VVMS_VADC, - RISCV_VVMS_VSBC - } funct6; - + struct { + enum vvmsfunct6 { RISCV_VVMS_VADC, RISCV_VVMS_VSBC } funct6; uint8_t vs2 /* bits : 5 */; uint8_t vs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } vvmstype; - - struct { + struct { enum vvcmpfunct6 { RISCV_VVCMP_VMSEQ, RISCV_VVCMP_VMSNE, @@ -2516,47 +2072,30 @@ struct ast { RISCV_VVCMP_VMSLEU, RISCV_VVCMP_VMSLE } funct6; - uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t vs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } vvcmptype; - - struct { - enum vxmfunct6 { - RISCV_VXM_VMADC, - RISCV_VXM_VMSBC - } funct6; - + struct { + enum vxmfunct6 { RISCV_VXM_VMADC, RISCV_VXM_VMSBC } funct6; uint8_t vs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } vxmtype; - - struct { - enum vxmcfunct6 { - RISCV_VXMC_VMADC, - RISCV_VXMC_VMSBC - } funct6; - + struct { + enum vxmcfunct6 { RISCV_VXMC_VMADC, RISCV_VXMC_VMSBC } funct6; uint8_t vs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } vxmctype; - - struct { - enum vxmsfunct6 { - RISCV_VXMS_VADC, - RISCV_VXMS_VSBC - } funct6; - + struct { + enum vxmsfunct6 { RISCV_VXMS_VADC, RISCV_VXMS_VSBC } funct6; uint8_t vs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } vxmstype; - - struct { + struct { enum vxcmpfunct6 { RISCV_VXCMP_VMSEQ, RISCV_VXCMP_VMSNE, @@ -2567,44 +2106,30 @@ struct ast { RISCV_VXCMP_VMSGTU, RISCV_VXCMP_VMSGT } funct6; - uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } vxcmptype; - - struct { - enum vimfunct6 { - RISCV_VIM_VMADC - } funct6; - + struct { + enum vimfunct6 { RISCV_VIM_VMADC } funct6; uint8_t vs2 /* bits : 5 */; uint8_t simm /* bits : 5 */; uint8_t vd /* bits : 5 */; } vimtype; - - struct { - enum vimcfunct6 { - RISCV_VIMC_VMADC - } funct6; - + struct { + enum vimcfunct6 { RISCV_VIMC_VMADC } funct6; uint8_t vs2 /* bits : 5 */; uint8_t simm /* bits : 5 */; uint8_t vd /* bits : 5 */; } vimctype; - - struct { - enum vimsfunct6 { - RISCV_VIMS_VADC - } funct6; - + struct { + enum vimsfunct6 { RISCV_VIMS_VADC } funct6; uint8_t vs2 /* bits : 5 */; uint8_t simm /* bits : 5 */; uint8_t vd /* bits : 5 */; } vimstype; - - struct { + struct { enum vicmpfunct6 { RISCV_VICMP_VMSEQ, RISCV_VICMP_VMSNE, @@ -2613,28 +2138,24 @@ struct ast { RISCV_VICMP_VMSGTU, RISCV_VICMP_VMSGT } funct6; - uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t simm /* bits : 5 */; uint8_t vd /* bits : 5 */; } vicmptype; - - struct { + struct { enum fvvmfunct6 { RISCV_FVVM_VMFEQ, RISCV_FVVM_VMFLE, RISCV_FVVM_VMFLT, RISCV_FVVM_VMFNE } funct6; - uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t vs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } fvvmtype; - - struct { + struct { enum fvfmfunct6 { RISCV_VFM_VMFEQ, RISCV_VFM_VMFLE, @@ -2643,26 +2164,19 @@ struct ast { RISCV_VFM_VMFGT, RISCV_VFM_VMFGE } funct6; - uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t rs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } fvfmtype; - - struct { - enum rivvfunct6 { - RISCV_IVV_VWREDSUMU, - RISCV_IVV_VWREDSUM - } funct6; - + struct { + enum rivvfunct6 { RISCV_IVV_VWREDSUMU, RISCV_IVV_VWREDSUM } funct6; uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t vs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } rivvtype; - - struct { + struct { enum rmvvfunct6 { RISCV_MVV_VREDSUM, RISCV_MVV_VREDAND, @@ -2673,14 +2187,12 @@ struct ast { RISCV_MVV_VREDMAXU, RISCV_MVV_VREDMAX } funct6; - uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t vs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } rmvvtype; - - struct { + struct { enum rfvvfunct6 { RISCV_FVV_VFREDOSUM, RISCV_FVV_VFREDUSUM, @@ -2689,24 +2201,21 @@ struct ast { RISCV_FVV_VFWREDOSUM, RISCV_FVV_VFWREDUSUM } funct6; - uint8_t vm /* bits : 1 */; uint8_t vs2 /* bits : 5 */; uint8_t vs1 /* bits : 5 */; uint8_t vd /* bits : 5 */; } rfvvtype; - - struct { + struct { enum cbop_zicbom { RISCV_CBO_CLEAN, RISCV_CBO_FLUSH, RISCV_CBO_INVAL } cbop; - uint8_t rs1 /* bits : 5 */; } riscv_zicbom; - uint8_t riscv_zicboz /* bits : 5 */; } ast_node; +}; -} ; +#endif diff --git a/arch/RISCV/riscv_ast2str.gen.inc b/arch/RISCV/riscv_ast2str.gen.inc index 01469603bb2..762c42469a0 100644 --- a/arch/RISCV/riscv_ast2str.gen.inc +++ b/arch/RISCV/riscv_ast2str.gen.inc @@ -1,108314 +1,9897 @@ +#ifndef __Riscv_ast2str_gen_inc__ +#define __Riscv_ast2str_gen_inc__ #include #include -#include #include "riscv_ast.gen.inc" +#include +#include "riscv_ast2str_tbls.gen.inc" -#define RISCV_MAX_INSTRUCTION_STR_LEN 256 +#include "riscv_helpers_ast2str.h" +#define RISCV_MAX_INSTRUCTION_STR_LEN 256 -void ast2str(struct ast *tree, char *buff) { - memset(buff, 0, RISCV_MAX_INSTRUCTION_STR_LEN); +#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) + +static 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; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - switch (tree->ast_node.utype.op) { - case RISCV_LUI:{ - s0 = "lui"; - s0_len = 3; - break; - } - case RISCV_AUIPC:{ - s0 = "auipc"; - s0_len = 5; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.utype.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - hex_bits_signed_20(tree->ast_node.utype.imm, &s4, &s4_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_JAL: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "jal"; - s0_len = 3; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_jal.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - hex_bits_signed_21(tree->ast_node.riscv_jal.imm, &s4, &s4_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_JALR: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - s0 = "jalr"; + 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; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_jalr.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - hex_bits_signed_12(tree->ast_node.riscv_jalr.imm, &s4, &s4_len); - s5 = "("; - s5_len = 1; - switch (tree->ast_node.riscv_jalr.rs1) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - s7 = ")"; - s7_len = 1; - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_BTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - switch (tree->ast_node.btype.op) { - case RISCV_BGEU:{ - s0 = "bgeu"; - s0_len = 4; - break; - } - case RISCV_BLT:{ - s0 = "blt"; - s0_len = 3; - break; - } - case RISCV_BGE:{ - s0 = "bge"; - s0_len = 3; - break; - } - case RISCV_BLTU:{ - s0 = "bltu"; - s0_len = 4; - break; - } - case RISCV_BNE:{ - s0 = "bne"; - s0_len = 3; - break; - } - case RISCV_BEQ:{ - s0 = "beq"; - s0_len = 3; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.btype.rs1) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.btype.rs2) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - hex_bits_signed_13(tree->ast_node.btype.imm, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_ITYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - switch (tree->ast_node.itype.op) { - case RISCV_ANDI:{ - s0 = "andi"; - s0_len = 4; - break; - } - case RISCV_ADDI:{ - s0 = "addi"; - s0_len = 4; - break; - } - case RISCV_XORI:{ - s0 = "xori"; - s0_len = 4; - break; - } - case RISCV_SLTI:{ - s0 = "slti"; - s0_len = 4; - break; - } - case RISCV_ORI:{ - s0 = "ori"; - s0_len = 3; - break; - } - case RISCV_SLTIU:{ - s0 = "sltiu"; - s0_len = 5; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.itype.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.itype.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - hex_bits_signed_12(tree->ast_node.itype.imm, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_SHIFTIOP: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - switch (tree->ast_node.shiftiop.op) { - case RISCV_SRAI:{ - s0 = "srai"; - s0_len = 4; - break; - } - case RISCV_SRLI:{ - s0 = "srli"; - s0_len = 4; - break; - } - case RISCV_SLLI:{ - s0 = "slli"; - s0_len = 4; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.shiftiop.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.shiftiop.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - hex_bits_6(tree->ast_node.shiftiop.shamt, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_RTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - switch (tree->ast_node.rtype.op) { - case RISCV_SLL:{ - s0 = "sll"; - s0_len = 3; - break; - } - case RISCV_SRL:{ - s0 = "srl"; - s0_len = 3; - break; - } - case RISCV_SLTU:{ - s0 = "sltu"; - s0_len = 4; - break; - } - case RISCV_ADD:{ - s0 = "add"; - s0_len = 3; - break; - } - case RISCV_XOR:{ - s0 = "xor"; - s0_len = 3; - break; - } - case RISCV_SLT:{ - s0 = "slt"; - s0_len = 3; - break; - } - case RISCV_AND:{ - s0 = "and"; - s0_len = 3; - break; - } - case RISCV_OR:{ - s0 = "or"; - s0_len = 2; - break; - } - case RISCV_SRA:{ - s0 = "sra"; - s0_len = 3; - break; - } - case RISCV_SUB:{ - s0 = "sub"; - s0_len = 3; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.rtype.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.rtype.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.rtype.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_LOAD: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - char *s9; size_t s9_len; - char *s10; size_t s10_len; - char *s11; size_t s11_len; - s0 = "l"; - s0_len = 1; - switch (tree->ast_node.load.width) { - case RISCV_BYTE:{ - s1 = "b"; - s1_len = 1; - break; - } - case RISCV_WORD:{ - s1 = "w"; - s1_len = 1; - break; - } - case RISCV_DOUBLE:{ - s1 = "d"; - s1_len = 1; - break; - } - case RISCV_HALF:{ - s1 = "h"; - s1_len = 1; - break; - } - } - 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); - switch (tree->ast_node.load.rd) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - sep( &s7, &s7_len); - hex_bits_signed_12(tree->ast_node.load.imm, &s8, &s8_len); - s9 = "("; - s9_len = 1; - switch (tree->ast_node.load.rs1) { - case 0x08:{ - s10 = "fp"; - s10_len = 2; - break; - } - case 0x15:{ - s10 = "s5"; - s10_len = 2; - break; - } - case 0x01:{ - s10 = "ra"; - s10_len = 2; - break; - } - case 0x06:{ - s10 = "t1"; - s10_len = 2; - break; - } - case 0x09:{ - s10 = "s1"; - s10_len = 2; - break; - } - case 0x10:{ - s10 = "a6"; - s10_len = 2; - break; - } - case 0x1B:{ - s10 = "s11"; - s10_len = 3; - break; - } - case 0x1C:{ - s10 = "t3"; - s10_len = 2; - break; - } - case 0x16:{ - s10 = "s6"; - s10_len = 2; - break; - } - case 0x00:{ - s10 = "zero"; - s10_len = 4; - break; - } - case 0x0A:{ - s10 = "a0"; - s10_len = 2; - break; - } - case 0x1A:{ - s10 = "s10"; - s10_len = 3; - break; - } - case 0x17:{ - s10 = "s7"; - s10_len = 2; - break; - } - case 0x0C:{ - s10 = "a2"; - s10_len = 2; - break; - } - case 0x18:{ - s10 = "s8"; - s10_len = 2; - break; - } - case 0x02:{ - s10 = "sp"; - s10_len = 2; - break; - } - case 0x1F:{ - s10 = "t6"; - s10_len = 2; - break; - } - case 0x0B:{ - s10 = "a1"; - s10_len = 2; - break; - } - case 0x07:{ - s10 = "t2"; - s10_len = 2; - break; - } - case 0x13:{ - s10 = "s3"; - s10_len = 2; - break; - } - case 0x04:{ - s10 = "tp"; - s10_len = 2; - break; - } - case 0x19:{ - s10 = "s9"; - s10_len = 2; - break; - } - case 0x12:{ - s10 = "s2"; - s10_len = 2; - break; - } - case 0x14:{ - s10 = "s4"; - s10_len = 2; - break; - } - case 0x0E:{ - s10 = "a4"; - s10_len = 2; - break; - } - case 0x1E:{ - s10 = "t5"; - s10_len = 2; - break; - } - case 0x11:{ - s10 = "a7"; - s10_len = 2; - break; - } - case 0x03:{ - s10 = "gp"; - s10_len = 2; - break; - } - case 0x05:{ - s10 = "t0"; - s10_len = 2; - break; - } - case 0x1D:{ - s10 = "t4"; - s10_len = 2; - break; - } - case 0x0D:{ - s10 = "a3"; - s10_len = 2; - break; - } - case 0x0F:{ - s10 = "a5"; - s10_len = 2; - break; - } - } - s11 = ")"; - s11_len = 1; - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len + s8_len, s9, s9_len); - 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); - 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); - } - } - break; - case RISCV_STORE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - char *s9; size_t s9_len; - char *s10; size_t s10_len; - char *s11; size_t s11_len; - char *s12; size_t s12_len; - char *s13; size_t s13_len; - s0 = "s"; - s0_len = 1; - switch (tree->ast_node.store.width) { - case RISCV_BYTE:{ - s1 = "b"; - s1_len = 1; - break; - } - case RISCV_WORD:{ - s1 = "w"; - s1_len = 1; - break; - } - case RISCV_DOUBLE:{ - s1 = "d"; - s1_len = 1; - break; - } - case RISCV_HALF:{ - s1 = "h"; - s1_len = 1; - break; - } - } - 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); - switch (tree->ast_node.store.rs2) { - case 0x08:{ - s5 = "fp"; - s5_len = 2; - break; - } - case 0x15:{ - s5 = "s5"; - s5_len = 2; - break; - } - case 0x01:{ - s5 = "ra"; - s5_len = 2; - break; - } - case 0x06:{ - s5 = "t1"; - s5_len = 2; - break; - } - case 0x09:{ - s5 = "s1"; - s5_len = 2; - break; - } - case 0x10:{ - s5 = "a6"; - s5_len = 2; - break; - } - case 0x1B:{ - s5 = "s11"; - s5_len = 3; - break; - } - case 0x1C:{ - s5 = "t3"; - s5_len = 2; - break; - } - case 0x16:{ - s5 = "s6"; - s5_len = 2; - break; - } - case 0x00:{ - s5 = "zero"; - s5_len = 4; - break; - } - case 0x0A:{ - s5 = "a0"; - s5_len = 2; - break; - } - case 0x1A:{ - s5 = "s10"; - s5_len = 3; - break; - } - case 0x17:{ - s5 = "s7"; - s5_len = 2; - break; - } - case 0x0C:{ - s5 = "a2"; - s5_len = 2; - break; - } - case 0x18:{ - s5 = "s8"; - s5_len = 2; - break; - } - case 0x02:{ - s5 = "sp"; - s5_len = 2; - break; - } - case 0x1F:{ - s5 = "t6"; - s5_len = 2; - break; - } - case 0x0B:{ - s5 = "a1"; - s5_len = 2; - break; - } - case 0x07:{ - s5 = "t2"; - s5_len = 2; - break; - } - case 0x13:{ - s5 = "s3"; - s5_len = 2; - break; - } - case 0x04:{ - s5 = "tp"; - s5_len = 2; - break; - } - case 0x19:{ - s5 = "s9"; - s5_len = 2; - break; - } - case 0x12:{ - s5 = "s2"; - s5_len = 2; - break; - } - case 0x14:{ - s5 = "s4"; - s5_len = 2; - break; - } - case 0x0E:{ - s5 = "a4"; - s5_len = 2; - break; - } - case 0x1E:{ - s5 = "t5"; - s5_len = 2; - break; - } - case 0x11:{ - s5 = "a7"; - s5_len = 2; - break; - } - case 0x03:{ - s5 = "gp"; - s5_len = 2; - break; - } - case 0x05:{ - s5 = "t0"; - s5_len = 2; - break; - } - case 0x1D:{ - s5 = "t4"; - s5_len = 2; - break; - } - case 0x0D:{ - s5 = "a3"; - s5_len = 2; - break; - } - case 0x0F:{ - s5 = "a5"; - s5_len = 2; - break; - } - } - sep( &s6, &s6_len); - hex_bits_signed_12(tree->ast_node.store.imm, &s7, &s7_len); - opt_spc( &s8, &s8_len); - s9 = "("; - s9_len = 1; - opt_spc( &s10, &s10_len); - switch (tree->ast_node.store.rs1) { - case 0x08:{ - s11 = "fp"; - s11_len = 2; - break; - } - case 0x15:{ - s11 = "s5"; - s11_len = 2; - break; - } - case 0x01:{ - s11 = "ra"; - s11_len = 2; - break; - } - case 0x06:{ - s11 = "t1"; - s11_len = 2; - break; - } - case 0x09:{ - s11 = "s1"; - s11_len = 2; - break; - } - case 0x10:{ - s11 = "a6"; - s11_len = 2; - break; - } - case 0x1B:{ - s11 = "s11"; - s11_len = 3; - break; - } - case 0x1C:{ - s11 = "t3"; - s11_len = 2; - break; - } - case 0x16:{ - s11 = "s6"; - s11_len = 2; - break; - } - case 0x00:{ - s11 = "zero"; - s11_len = 4; - break; - } - case 0x0A:{ - s11 = "a0"; - s11_len = 2; - break; - } - case 0x1A:{ - s11 = "s10"; - s11_len = 3; - break; - } - case 0x17:{ - s11 = "s7"; - s11_len = 2; - break; - } - case 0x0C:{ - s11 = "a2"; - s11_len = 2; - break; - } - case 0x18:{ - s11 = "s8"; - s11_len = 2; - break; - } - case 0x02:{ - s11 = "sp"; - s11_len = 2; - break; - } - case 0x1F:{ - s11 = "t6"; - s11_len = 2; - break; - } - case 0x0B:{ - s11 = "a1"; - s11_len = 2; - break; - } - case 0x07:{ - s11 = "t2"; - s11_len = 2; - break; - } - case 0x13:{ - s11 = "s3"; - s11_len = 2; - break; - } - case 0x04:{ - s11 = "tp"; - s11_len = 2; - break; - } - case 0x19:{ - s11 = "s9"; - s11_len = 2; - break; - } - case 0x12:{ - s11 = "s2"; - s11_len = 2; - break; - } - case 0x14:{ - s11 = "s4"; - s11_len = 2; - break; - } - case 0x0E:{ - s11 = "a4"; - s11_len = 2; - break; - } - case 0x1E:{ - s11 = "t5"; - s11_len = 2; - break; - } - case 0x11:{ - s11 = "a7"; - s11_len = 2; - break; - } - case 0x03:{ - s11 = "gp"; - s11_len = 2; - break; - } - case 0x05:{ - s11 = "t0"; - s11_len = 2; - break; - } - case 0x1D:{ - s11 = "t4"; - s11_len = 2; - break; - } - case 0x0D:{ - s11 = "a3"; - s11_len = 2; - break; - } - case 0x0F:{ - s11 = "a5"; - s11_len = 2; - break; - } - } - opt_spc( &s12, &s12_len); - s13 = ")"; - s13_len = 1; - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len + s8_len, s9, s9_len); - 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); - 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); - 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); - 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); - } - } - break; - case RISCV_ADDIW: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "addiw"; - s0_len = 5; - spc( &s1, &s1_len); - switch (tree->ast_node.addiw.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.addiw.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - hex_bits_signed_12(tree->ast_node.addiw.imm, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_RTYPEW: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - switch (tree->ast_node.rtypew.op) { - case RISCV_SRAW:{ - s0 = "sraw"; - s0_len = 4; - break; - } - case RISCV_SUBW:{ - s0 = "subw"; - s0_len = 4; - break; - } - case RISCV_SLLW:{ - s0 = "sllw"; - s0_len = 4; - break; - } - case RISCV_SRLW:{ - s0 = "srlw"; - s0_len = 4; - break; - } - case RISCV_ADDW:{ - s0 = "addw"; - s0_len = 4; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.rtypew.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.rtypew.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.rtypew.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_SHIFTIWOP: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - switch (tree->ast_node.shiftiwop.op) { - case RISCV_SRLIW:{ - s0 = "srliw"; - s0_len = 5; - break; - } - case RISCV_SLLIW:{ - s0 = "slliw"; - s0_len = 5; - break; - } - case RISCV_SRAIW:{ - s0 = "sraiw"; - s0_len = 5; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.shiftiwop.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.shiftiwop.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - hex_bits_5(tree->ast_node.shiftiwop.shamt, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_FENCE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "fence"; + } 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; - spc( &s1, &s1_len); - fence_bits(tree->ast_node.fence.pred, &s2, &s2_len); - sep( &s3, &s3_len); - fence_bits(tree->ast_node.fence.succ, &s4, &s4_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_FENCE_TSO: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "fence.tso"; - s0_len = 9; - spc( &s1, &s1_len); - fence_bits(tree->ast_node.fence_tso.pred, &s2, &s2_len); - sep( &s3, &s3_len); - fence_bits(tree->ast_node.fence_tso.succ, &s4, &s4_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_FENCEI: { -{ - char *s0; size_t s0_len; - s0 = "fence.i"; - s0_len = 7; - memcpy(buff , s0, s0_len); - } - } - break; - case RISCV_ECALL: { -{ - char *s0; size_t s0_len; - s0 = "ecall"; - s0_len = 5; - memcpy(buff , s0, s0_len); - } - } - break; - case RISCV_MRET: { -{ - char *s0; size_t s0_len; - s0 = "mret"; - s0_len = 4; - memcpy(buff , s0, s0_len); - } - } - break; - case RISCV_SRET: { -{ - char *s0; size_t s0_len; - s0 = "sret"; - s0_len = 4; - memcpy(buff , s0, s0_len); - } - } - break; - case RISCV_EBREAK: { -{ - char *s0; size_t s0_len; - s0 = "ebreak"; + } 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; - memcpy(buff , s0, s0_len); - } - } - break; - case RISCV_WFI: { -{ - char *s0; size_t s0_len; - s0 = "wfi"; - s0_len = 3; - memcpy(buff , s0, s0_len); - } - } - break; - case RISCV_SFENCE_VMA: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "sfence.vma"; - s0_len = 10; - spc( &s1, &s1_len); - switch (tree->ast_node.sfence_vma.rs1) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.sfence_vma.rs2) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_LOADRES: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - char *s9; size_t s9_len; - s0 = "lr."; - s0_len = 3; - switch (tree->ast_node.loadres.width) { - case RISCV_BYTE:{ - s1 = "b"; - s1_len = 1; - break; - } - case RISCV_WORD:{ - s1 = "w"; - s1_len = 1; - break; - } - case RISCV_DOUBLE:{ - s1 = "d"; - s1_len = 1; - break; - } - case RISCV_HALF:{ - s1 = "h"; - s1_len = 1; - break; - } - } - 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); - switch (tree->ast_node.loadres.rd) { - case 0x08:{ - s5 = "fp"; - s5_len = 2; - break; - } - case 0x15:{ - s5 = "s5"; - s5_len = 2; - break; - } - case 0x01:{ - s5 = "ra"; - s5_len = 2; - break; - } - case 0x06:{ - s5 = "t1"; - s5_len = 2; - break; - } - case 0x09:{ - s5 = "s1"; - s5_len = 2; - break; - } - case 0x10:{ - s5 = "a6"; - s5_len = 2; - break; - } - case 0x1B:{ - s5 = "s11"; - s5_len = 3; - break; - } - case 0x1C:{ - s5 = "t3"; - s5_len = 2; - break; - } - case 0x16:{ - s5 = "s6"; - s5_len = 2; - break; - } - case 0x00:{ - s5 = "zero"; - s5_len = 4; - break; - } - case 0x0A:{ - s5 = "a0"; - s5_len = 2; - break; - } - case 0x1A:{ - s5 = "s10"; - s5_len = 3; - break; - } - case 0x17:{ - s5 = "s7"; - s5_len = 2; - break; - } - case 0x0C:{ - s5 = "a2"; - s5_len = 2; - break; - } - case 0x18:{ - s5 = "s8"; - s5_len = 2; - break; - } - case 0x02:{ - s5 = "sp"; - s5_len = 2; - break; - } - case 0x1F:{ - s5 = "t6"; - s5_len = 2; - break; - } - case 0x0B:{ - s5 = "a1"; - s5_len = 2; - break; - } - case 0x07:{ - s5 = "t2"; - s5_len = 2; - break; - } - case 0x13:{ - s5 = "s3"; - s5_len = 2; - break; - } - case 0x04:{ - s5 = "tp"; - s5_len = 2; - break; - } - case 0x19:{ - s5 = "s9"; - s5_len = 2; - break; - } - case 0x12:{ - s5 = "s2"; - s5_len = 2; - break; - } - case 0x14:{ - s5 = "s4"; - s5_len = 2; - break; - } - case 0x0E:{ - s5 = "a4"; - s5_len = 2; - break; - } - case 0x1E:{ - s5 = "t5"; - s5_len = 2; - break; - } - case 0x11:{ - s5 = "a7"; - s5_len = 2; - break; - } - case 0x03:{ - s5 = "gp"; - s5_len = 2; - break; - } - case 0x05:{ - s5 = "t0"; - s5_len = 2; - break; - } - case 0x1D:{ - s5 = "t4"; - s5_len = 2; - break; - } - case 0x0D:{ - s5 = "a3"; - s5_len = 2; - break; - } - case 0x0F:{ - s5 = "a5"; - s5_len = 2; - break; - } - } - sep( &s6, &s6_len); - s7 = "("; - s7_len = 1; - switch (tree->ast_node.loadres.rs1) { - case 0x08:{ - s8 = "fp"; - s8_len = 2; - break; - } - case 0x15:{ - s8 = "s5"; - s8_len = 2; - break; - } - case 0x01:{ - s8 = "ra"; - s8_len = 2; - break; - } - case 0x06:{ - s8 = "t1"; - s8_len = 2; - break; - } - case 0x09:{ - s8 = "s1"; - s8_len = 2; - break; - } - case 0x10:{ - s8 = "a6"; - s8_len = 2; - break; - } - case 0x1B:{ - s8 = "s11"; - s8_len = 3; - break; - } - case 0x1C:{ - s8 = "t3"; - s8_len = 2; - break; - } - case 0x16:{ - s8 = "s6"; - s8_len = 2; - break; - } - case 0x00:{ - s8 = "zero"; - s8_len = 4; - break; - } - case 0x0A:{ - s8 = "a0"; - s8_len = 2; - break; - } - case 0x1A:{ - s8 = "s10"; - s8_len = 3; - break; - } - case 0x17:{ - s8 = "s7"; - s8_len = 2; - break; - } - case 0x0C:{ - s8 = "a2"; - s8_len = 2; - break; - } - case 0x18:{ - s8 = "s8"; - s8_len = 2; - break; - } - case 0x02:{ - s8 = "sp"; - s8_len = 2; - break; - } - case 0x1F:{ - s8 = "t6"; - s8_len = 2; - break; - } - case 0x0B:{ - s8 = "a1"; - s8_len = 2; - break; - } - case 0x07:{ - s8 = "t2"; - s8_len = 2; - break; - } - case 0x13:{ - s8 = "s3"; - s8_len = 2; - break; - } - case 0x04:{ - s8 = "tp"; - s8_len = 2; - break; - } - case 0x19:{ - s8 = "s9"; - s8_len = 2; - break; - } - case 0x12:{ - s8 = "s2"; - s8_len = 2; - break; - } - case 0x14:{ - s8 = "s4"; - s8_len = 2; - break; - } - case 0x0E:{ - s8 = "a4"; - s8_len = 2; - break; - } - case 0x1E:{ - s8 = "t5"; - s8_len = 2; - break; - } - case 0x11:{ - s8 = "a7"; - s8_len = 2; - break; - } - case 0x03:{ - s8 = "gp"; - s8_len = 2; - break; - } - case 0x05:{ - s8 = "t0"; - s8_len = 2; - break; - } - case 0x1D:{ - s8 = "t4"; - s8_len = 2; - break; - } - case 0x0D:{ - s8 = "a3"; - s8_len = 2; - break; - } - case 0x0F:{ - s8 = "a5"; - s8_len = 2; - break; - } - } - s9 = ")"; - s9_len = 1; - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len + s8_len, s9, s9_len); - } - } - break; - case RISCV_STORECON: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - char *s9; size_t s9_len; - char *s10; size_t s10_len; - char *s11; size_t s11_len; - s0 = "sc."; + } 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; - switch (tree->ast_node.storecon.width) { - case RISCV_BYTE:{ - s1 = "b"; - s1_len = 1; - break; - } - case RISCV_WORD:{ - s1 = "w"; - s1_len = 1; - break; - } - case RISCV_DOUBLE:{ - s1 = "d"; - s1_len = 1; - break; - } - case RISCV_HALF:{ - s1 = "h"; - s1_len = 1; - break; - } - } - 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); - switch (tree->ast_node.storecon.rd) { - case 0x08:{ - s5 = "fp"; - s5_len = 2; - break; - } - case 0x15:{ - s5 = "s5"; - s5_len = 2; - break; - } - case 0x01:{ - s5 = "ra"; - s5_len = 2; - break; - } - case 0x06:{ - s5 = "t1"; - s5_len = 2; - break; - } - case 0x09:{ - s5 = "s1"; - s5_len = 2; - break; - } - case 0x10:{ - s5 = "a6"; - s5_len = 2; - break; - } - case 0x1B:{ - s5 = "s11"; - s5_len = 3; - break; - } - case 0x1C:{ - s5 = "t3"; - s5_len = 2; - break; - } - case 0x16:{ - s5 = "s6"; - s5_len = 2; - break; - } - case 0x00:{ - s5 = "zero"; - s5_len = 4; - break; - } - case 0x0A:{ - s5 = "a0"; - s5_len = 2; - break; - } - case 0x1A:{ - s5 = "s10"; - s5_len = 3; - break; - } - case 0x17:{ - s5 = "s7"; - s5_len = 2; - break; - } - case 0x0C:{ - s5 = "a2"; - s5_len = 2; - break; - } - case 0x18:{ - s5 = "s8"; - s5_len = 2; - break; - } - case 0x02:{ - s5 = "sp"; - s5_len = 2; - break; - } - case 0x1F:{ - s5 = "t6"; - s5_len = 2; - break; - } - case 0x0B:{ - s5 = "a1"; - s5_len = 2; - break; - } - case 0x07:{ - s5 = "t2"; - s5_len = 2; - break; - } - case 0x13:{ - s5 = "s3"; - s5_len = 2; - break; - } - case 0x04:{ - s5 = "tp"; - s5_len = 2; - break; - } - case 0x19:{ - s5 = "s9"; - s5_len = 2; - break; - } - case 0x12:{ - s5 = "s2"; - s5_len = 2; - break; - } - case 0x14:{ - s5 = "s4"; - s5_len = 2; - break; - } - case 0x0E:{ - s5 = "a4"; - s5_len = 2; - break; - } - case 0x1E:{ - s5 = "t5"; - s5_len = 2; - break; - } - case 0x11:{ - s5 = "a7"; - s5_len = 2; - break; - } - case 0x03:{ - s5 = "gp"; - s5_len = 2; - break; - } - case 0x05:{ - s5 = "t0"; - s5_len = 2; - break; - } - case 0x1D:{ - s5 = "t4"; - s5_len = 2; - break; - } - case 0x0D:{ - s5 = "a3"; - s5_len = 2; - break; - } - case 0x0F:{ - s5 = "a5"; - s5_len = 2; - break; - } - } - sep( &s6, &s6_len); - switch (tree->ast_node.storecon.rs2) { - case 0x08:{ - s7 = "fp"; - s7_len = 2; - break; - } - case 0x15:{ - s7 = "s5"; - s7_len = 2; - break; - } - case 0x01:{ - s7 = "ra"; - s7_len = 2; - break; - } - case 0x06:{ - s7 = "t1"; - s7_len = 2; - break; - } - case 0x09:{ - s7 = "s1"; - s7_len = 2; - break; - } - case 0x10:{ - s7 = "a6"; - s7_len = 2; - break; - } - case 0x1B:{ - s7 = "s11"; - s7_len = 3; - break; - } - case 0x1C:{ - s7 = "t3"; - s7_len = 2; - break; - } - case 0x16:{ - s7 = "s6"; - s7_len = 2; - break; - } - case 0x00:{ - s7 = "zero"; - s7_len = 4; - break; - } - case 0x0A:{ - s7 = "a0"; - s7_len = 2; - break; - } - case 0x1A:{ - s7 = "s10"; - s7_len = 3; - break; - } - case 0x17:{ - s7 = "s7"; - s7_len = 2; - break; - } - case 0x0C:{ - s7 = "a2"; - s7_len = 2; - break; - } - case 0x18:{ - s7 = "s8"; - s7_len = 2; - break; - } - case 0x02:{ - s7 = "sp"; - s7_len = 2; - break; - } - case 0x1F:{ - s7 = "t6"; - s7_len = 2; - break; - } - case 0x0B:{ - s7 = "a1"; - s7_len = 2; - break; - } - case 0x07:{ - s7 = "t2"; - s7_len = 2; - break; - } - case 0x13:{ - s7 = "s3"; - s7_len = 2; - break; - } - case 0x04:{ - s7 = "tp"; - s7_len = 2; - break; - } - case 0x19:{ - s7 = "s9"; - s7_len = 2; - break; - } - case 0x12:{ - s7 = "s2"; - s7_len = 2; - break; - } - case 0x14:{ - s7 = "s4"; - s7_len = 2; - break; - } - case 0x0E:{ - s7 = "a4"; - s7_len = 2; - break; - } - case 0x1E:{ - s7 = "t5"; - s7_len = 2; - break; - } - case 0x11:{ - s7 = "a7"; - s7_len = 2; - break; - } - case 0x03:{ - s7 = "gp"; - s7_len = 2; - break; - } - case 0x05:{ - s7 = "t0"; - s7_len = 2; - break; - } - case 0x1D:{ - s7 = "t4"; - s7_len = 2; - break; - } - case 0x0D:{ - s7 = "a3"; - s7_len = 2; - break; - } - case 0x0F:{ - s7 = "a5"; - s7_len = 2; - break; - } - } - sep( &s8, &s8_len); - s9 = "("; - s9_len = 1; - switch (tree->ast_node.storecon.rs1) { - case 0x08:{ - s10 = "fp"; - s10_len = 2; - break; - } - case 0x15:{ - s10 = "s5"; - s10_len = 2; - break; - } - case 0x01:{ - s10 = "ra"; - s10_len = 2; - break; - } - case 0x06:{ - s10 = "t1"; - s10_len = 2; - break; - } - case 0x09:{ - s10 = "s1"; - s10_len = 2; - break; - } - case 0x10:{ - s10 = "a6"; - s10_len = 2; - break; - } - case 0x1B:{ - s10 = "s11"; - s10_len = 3; - break; - } - case 0x1C:{ - s10 = "t3"; - s10_len = 2; - break; - } - case 0x16:{ - s10 = "s6"; - s10_len = 2; - break; - } - case 0x00:{ - s10 = "zero"; - s10_len = 4; - break; - } - case 0x0A:{ - s10 = "a0"; - s10_len = 2; - break; - } - case 0x1A:{ - s10 = "s10"; - s10_len = 3; - break; - } - case 0x17:{ - s10 = "s7"; - s10_len = 2; - break; - } - case 0x0C:{ - s10 = "a2"; - s10_len = 2; - break; - } - case 0x18:{ - s10 = "s8"; - s10_len = 2; - break; - } - case 0x02:{ - s10 = "sp"; - s10_len = 2; - break; - } - case 0x1F:{ - s10 = "t6"; - s10_len = 2; - break; - } - case 0x0B:{ - s10 = "a1"; - s10_len = 2; - break; - } - case 0x07:{ - s10 = "t2"; - s10_len = 2; - break; - } - case 0x13:{ - s10 = "s3"; - s10_len = 2; - break; - } - case 0x04:{ - s10 = "tp"; - s10_len = 2; - break; - } - case 0x19:{ - s10 = "s9"; - s10_len = 2; - break; - } - case 0x12:{ - s10 = "s2"; - s10_len = 2; - break; - } - case 0x14:{ - s10 = "s4"; - s10_len = 2; - break; - } - case 0x0E:{ - s10 = "a4"; - s10_len = 2; - break; - } - case 0x1E:{ - s10 = "t5"; - s10_len = 2; - break; - } - case 0x11:{ - s10 = "a7"; - s10_len = 2; - break; - } - case 0x03:{ - s10 = "gp"; - s10_len = 2; - break; - } - case 0x05:{ - s10 = "t0"; - s10_len = 2; - break; - } - case 0x1D:{ - s10 = "t4"; - s10_len = 2; - break; - } - case 0x0D:{ - s10 = "a3"; - s10_len = 2; - break; - } - case 0x0F:{ - s10 = "a5"; - s10_len = 2; - break; - } - } - s11 = ")"; - s11_len = 1; - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len + s8_len, s9, s9_len); - 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); - 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); - } - } - break; - case RISCV_AMO: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - char *s9; size_t s9_len; - char *s10; size_t s10_len; - char *s11; size_t s11_len; - char *s12; size_t s12_len; - switch (tree->ast_node.amo.op) { - case RISCV_AMOMIN:{ - s0 = "amomin"; - s0_len = 6; - break; - } - case RISCV_AMOXOR:{ - s0 = "amoxor"; - s0_len = 6; - break; - } - case RISCV_AMOADD:{ - s0 = "amoadd"; - s0_len = 6; - break; - } - case RISCV_AMOOR:{ - s0 = "amoor"; - s0_len = 5; - break; - } - case RISCV_AMOSWAP:{ - s0 = "amoswap"; - s0_len = 7; - break; - } - case RISCV_AMOMAX:{ - s0 = "amomax"; - s0_len = 6; - break; - } - case RISCV_AMOMINU:{ - s0 = "amominu"; - s0_len = 7; - break; - } - case RISCV_AMOAND:{ - s0 = "amoand"; - s0_len = 6; - break; - } - case RISCV_AMOMAXU:{ - s0 = "amomaxu"; - s0_len = 7; - break; - } - } - s1 = "."; + } 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; - switch (tree->ast_node.amo.width) { - case RISCV_BYTE:{ - s2 = "b"; - s2_len = 1; - break; - } - case RISCV_WORD:{ - s2 = "w"; - s2_len = 1; - break; - } - case RISCV_DOUBLE:{ - s2 = "d"; - s2_len = 1; - break; - } - case RISCV_HALF:{ - s2 = "h"; - s2_len = 1; - break; - } - } - 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); - switch (tree->ast_node.amo.rd) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - sep( &s7, &s7_len); - switch (tree->ast_node.amo.rs2) { - case 0x08:{ - s8 = "fp"; - s8_len = 2; - break; - } - case 0x15:{ - s8 = "s5"; - s8_len = 2; - break; - } - case 0x01:{ - s8 = "ra"; - s8_len = 2; - break; - } - case 0x06:{ - s8 = "t1"; - s8_len = 2; - break; - } - case 0x09:{ - s8 = "s1"; - s8_len = 2; - break; - } - case 0x10:{ - s8 = "a6"; - s8_len = 2; - break; - } - case 0x1B:{ - s8 = "s11"; - s8_len = 3; - break; - } - case 0x1C:{ - s8 = "t3"; - s8_len = 2; - break; - } - case 0x16:{ - s8 = "s6"; - s8_len = 2; - break; - } - case 0x00:{ - s8 = "zero"; - s8_len = 4; - break; - } - case 0x0A:{ - s8 = "a0"; - s8_len = 2; - break; - } - case 0x1A:{ - s8 = "s10"; - s8_len = 3; - break; - } - case 0x17:{ - s8 = "s7"; - s8_len = 2; - break; - } - case 0x0C:{ - s8 = "a2"; - s8_len = 2; - break; - } - case 0x18:{ - s8 = "s8"; - s8_len = 2; - break; - } - case 0x02:{ - s8 = "sp"; - s8_len = 2; - break; - } - case 0x1F:{ - s8 = "t6"; - s8_len = 2; - break; - } - case 0x0B:{ - s8 = "a1"; - s8_len = 2; - break; - } - case 0x07:{ - s8 = "t2"; - s8_len = 2; - break; - } - case 0x13:{ - s8 = "s3"; - s8_len = 2; - break; - } - case 0x04:{ - s8 = "tp"; - s8_len = 2; - break; - } - case 0x19:{ - s8 = "s9"; - s8_len = 2; - break; - } - case 0x12:{ - s8 = "s2"; - s8_len = 2; - break; - } - case 0x14:{ - s8 = "s4"; - s8_len = 2; - break; - } - case 0x0E:{ - s8 = "a4"; - s8_len = 2; - break; - } - case 0x1E:{ - s8 = "t5"; - s8_len = 2; - break; - } - case 0x11:{ - s8 = "a7"; - s8_len = 2; - break; - } - case 0x03:{ - s8 = "gp"; - s8_len = 2; - break; - } - case 0x05:{ - s8 = "t0"; - s8_len = 2; - break; - } - case 0x1D:{ - s8 = "t4"; - s8_len = 2; - break; - } - case 0x0D:{ - s8 = "a3"; - s8_len = 2; - break; - } - case 0x0F:{ - s8 = "a5"; - s8_len = 2; - break; - } - } - sep( &s9, &s9_len); - s10 = "("; - s10_len = 1; - switch (tree->ast_node.amo.rs1) { - case 0x08:{ - s11 = "fp"; - s11_len = 2; - break; - } - case 0x15:{ - s11 = "s5"; - s11_len = 2; - break; - } - case 0x01:{ - s11 = "ra"; - s11_len = 2; - break; - } - case 0x06:{ - s11 = "t1"; - s11_len = 2; - break; - } - case 0x09:{ - s11 = "s1"; - s11_len = 2; - break; - } - case 0x10:{ - s11 = "a6"; - s11_len = 2; - break; - } - case 0x1B:{ - s11 = "s11"; - s11_len = 3; - break; - } - case 0x1C:{ - s11 = "t3"; - s11_len = 2; - break; - } - case 0x16:{ - s11 = "s6"; - s11_len = 2; - break; - } - case 0x00:{ - s11 = "zero"; - s11_len = 4; - break; - } - case 0x0A:{ - s11 = "a0"; - s11_len = 2; - break; - } - case 0x1A:{ - s11 = "s10"; - s11_len = 3; - break; - } - case 0x17:{ - s11 = "s7"; - s11_len = 2; - break; - } - case 0x0C:{ - s11 = "a2"; - s11_len = 2; - break; - } - case 0x18:{ - s11 = "s8"; - s11_len = 2; - break; - } - case 0x02:{ - s11 = "sp"; - s11_len = 2; - break; - } - case 0x1F:{ - s11 = "t6"; - s11_len = 2; - break; - } - case 0x0B:{ - s11 = "a1"; - s11_len = 2; - break; - } - case 0x07:{ - s11 = "t2"; - s11_len = 2; - break; - } - case 0x13:{ - s11 = "s3"; - s11_len = 2; - break; - } - case 0x04:{ - s11 = "tp"; - s11_len = 2; - break; - } - case 0x19:{ - s11 = "s9"; - s11_len = 2; - break; - } - case 0x12:{ - s11 = "s2"; - s11_len = 2; - break; - } - case 0x14:{ - s11 = "s4"; - s11_len = 2; - break; - } - case 0x0E:{ - s11 = "a4"; - s11_len = 2; - break; - } - case 0x1E:{ - s11 = "t5"; - s11_len = 2; - break; - } - case 0x11:{ - s11 = "a7"; - s11_len = 2; - break; - } - case 0x03:{ - s11 = "gp"; - s11_len = 2; - break; - } - case 0x05:{ - s11 = "t0"; - s11_len = 2; - break; - } - case 0x1D:{ - s11 = "t4"; - s11_len = 2; - break; - } - case 0x0D:{ - s11 = "a3"; - s11_len = 2; - break; - } - case 0x0F:{ - s11 = "a5"; - s11_len = 2; - break; - } - } - s12 = ")"; - s12_len = 1; - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len + s8_len, s9, s9_len); - 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); - 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); - 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); - } - } - break; - case RISCV_C_NOP: { -{ - char *s0; size_t s0_len; - s0 = "c.nop"; - s0_len = 5; - memcpy(buff , s0, s0_len); - } - } - break; - case RISCV_C_ADDI4SPN: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "c.addi4spn"; - s0_len = 10; - spc( &s1, &s1_len); - switch (tree->ast_node.c_addi4spn.rdc) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - hex_bits_10(tree->ast_node.c_addi4spn.nzimm << 2 | 0x0 << 0, &s4, &s4_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } } - break; - case RISCV_C_LW: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "c.lw"; - s0_len = 4; - spc( &s1, &s1_len); - switch (tree->ast_node.c_lw.rdc) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.c_lw.rsc) { - case 0x7:{ - s4 = "a5"; - s4_len = 2; - break; - } - case 0x5:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x1:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x3:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x2:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x4:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x6:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x0:{ - s4 = "s0"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - hex_bits_7(tree->ast_node.c_lw.uimm << 2 | 0x0 << 0, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_C_LD: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "c.ld"; - s0_len = 4; - spc( &s1, &s1_len); - switch (tree->ast_node.c_ld.rdc) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.c_ld.rsc) { - case 0x7:{ - s4 = "a5"; - s4_len = 2; - break; - } - case 0x5:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x1:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x3:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x2:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x4:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x6:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x0:{ - s4 = "s0"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - hex_bits_8(tree->ast_node.c_ld.uimm << 3 | 0x0 << 0, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_C_SW: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "c.sw"; - s0_len = 4; - spc( &s1, &s1_len); - switch (tree->ast_node.c_sw.rsc1) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.c_sw.rsc2) { - case 0x7:{ - s4 = "a5"; - s4_len = 2; - break; - } - case 0x5:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x1:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x3:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x2:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x4:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x6:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x0:{ - s4 = "s0"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - hex_bits_7(tree->ast_node.c_sw.uimm << 2 | 0x0 << 0, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_C_SD: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "c.sd"; - s0_len = 4; - spc( &s1, &s1_len); - switch (tree->ast_node.c_sd.rsc1) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.c_sd.rsc2) { - case 0x7:{ - s4 = "a5"; - s4_len = 2; - break; - } - case 0x5:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x1:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x3:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x2:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x4:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x6:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x0:{ - s4 = "s0"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - hex_bits_8(tree->ast_node.c_sd.uimm << 3 | 0x0 << 0, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } + 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; } - break; - case RISCV_C_ADDI: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "c.addi"; - s0_len = 6; - spc( &s1, &s1_len); - switch (tree->ast_node.c_addi.rsd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - hex_bits_signed_6(tree->ast_node.c_addi.nzi, &s4, &s4_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } + 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; } - break; - case RISCV_C_JAL: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - s0 = "c.jal"; - s0_len = 5; - spc( &s1, &s1_len); - hex_bits_signed_12(tree->ast_node.c_jal << 1 | 0x0 << 0, &s2, &s2_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - } + 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; } - break; - case RISCV_C_ADDIW: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "c.addiw"; + 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); - switch (tree->ast_node.c_addiw.rsd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - hex_bits_signed_6(tree->ast_node.c_addiw.imm, &s4, &s4_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_C_LI: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "c.li"; - s0_len = 4; - spc( &s1, &s1_len); - switch (tree->ast_node.c_li.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - hex_bits_signed_6(tree->ast_node.c_li.imm, &s4, &s4_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_C_ADDI16SP: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - s0 = "c.addi16sp"; - s0_len = 10; - spc( &s1, &s1_len); - hex_bits_signed_6(tree->ast_node.c_addi16sp, &s2, &s2_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - } - } - break; - case RISCV_C_LUI: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "c.lui"; - s0_len = 5; - spc( &s1, &s1_len); - switch (tree->ast_node.c_lui.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - hex_bits_signed_6(tree->ast_node.c_lui.imm, &s4, &s4_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_C_SRLI: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "c.srli"; - s0_len = 6; - spc( &s1, &s1_len); - switch (tree->ast_node.c_srli.rsd) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - hex_bits_6(tree->ast_node.c_srli.shamt, &s4, &s4_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_C_SRAI: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "c.srai"; - s0_len = 6; - spc( &s1, &s1_len); - switch (tree->ast_node.c_srai.rsd) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - hex_bits_6(tree->ast_node.c_srai.shamt, &s4, &s4_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_C_ANDI: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "c.andi"; - s0_len = 6; - spc( &s1, &s1_len); - switch (tree->ast_node.c_andi.rsd) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - hex_bits_signed_6(tree->ast_node.c_andi.imm, &s4, &s4_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_C_SUB: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "c.sub"; - s0_len = 5; - spc( &s1, &s1_len); - switch (tree->ast_node.c_sub.rsd) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.c_sub.rs2) { - case 0x7:{ - s4 = "a5"; - s4_len = 2; - break; - } - case 0x5:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x1:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x3:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x2:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x4:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x6:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x0:{ - s4 = "s0"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_C_XOR: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "c.xor"; - s0_len = 5; - spc( &s1, &s1_len); - switch (tree->ast_node.c_xor.rsd) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.c_xor.rs2) { - case 0x7:{ - s4 = "a5"; - s4_len = 2; - break; - } - case 0x5:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x1:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x3:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x2:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x4:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x6:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x0:{ - s4 = "s0"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_C_OR: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "c.or"; - s0_len = 4; - spc( &s1, &s1_len); - switch (tree->ast_node.c_or.rsd) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.c_or.rs2) { - case 0x7:{ - s4 = "a5"; - s4_len = 2; - break; - } - case 0x5:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x1:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x3:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x2:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x4:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x6:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x0:{ - s4 = "s0"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_C_AND: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "c.and"; - s0_len = 5; - spc( &s1, &s1_len); - switch (tree->ast_node.c_and.rsd) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.c_and.rs2) { - case 0x7:{ - s4 = "a5"; - s4_len = 2; - break; - } - case 0x5:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x1:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x3:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x2:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x4:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x6:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x0:{ - s4 = "s0"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_C_SUBW: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "c.subw"; - s0_len = 6; - spc( &s1, &s1_len); - switch (tree->ast_node.c_subw.rsd) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.c_subw.rs2) { - case 0x7:{ - s4 = "a5"; - s4_len = 2; - break; - } - case 0x5:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x1:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x3:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x2:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x4:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x6:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x0:{ - s4 = "s0"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_C_ADDW: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "c.addw"; - s0_len = 6; - spc( &s1, &s1_len); - switch (tree->ast_node.c_addw.rsd) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.c_addw.rs2) { - case 0x7:{ - s4 = "a5"; - s4_len = 2; - break; - } - case 0x5:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x1:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x3:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x2:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x4:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x6:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x0:{ - s4 = "s0"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_C_J: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - s0 = "c.j"; - s0_len = 3; - spc( &s1, &s1_len); - hex_bits_signed_11(tree->ast_node.c_j, &s2, &s2_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - } - } - break; - case RISCV_C_BEQZ: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "c.beqz"; - s0_len = 6; - spc( &s1, &s1_len); - switch (tree->ast_node.c_beqz.rs) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - hex_bits_signed_8(tree->ast_node.c_beqz.imm, &s4, &s4_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_C_BNEZ: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "c.bnez"; - s0_len = 6; - spc( &s1, &s1_len); - switch (tree->ast_node.c_bnez.rs) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - hex_bits_signed_8(tree->ast_node.c_bnez.imm, &s4, &s4_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_C_SLLI: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "c.slli"; - s0_len = 6; - spc( &s1, &s1_len); - switch (tree->ast_node.c_slli.rsd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - hex_bits_6(tree->ast_node.c_slli.shamt, &s4, &s4_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_C_LWSP: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "c.lwsp"; - s0_len = 6; - spc( &s1, &s1_len); - switch (tree->ast_node.c_lwsp.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - hex_bits_6(tree->ast_node.c_lwsp.uimm, &s4, &s4_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_C_LDSP: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "c.ldsp"; - s0_len = 6; - spc( &s1, &s1_len); - switch (tree->ast_node.c_ldsp.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - hex_bits_6(tree->ast_node.c_ldsp.uimm, &s4, &s4_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_C_SWSP: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "c.swsp"; - s0_len = 6; - spc( &s1, &s1_len); - switch (tree->ast_node.c_swsp.rs2) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - hex_bits_6(tree->ast_node.c_swsp.uimm, &s4, &s4_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_C_SDSP: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "c.sdsp"; - s0_len = 6; - spc( &s1, &s1_len); - switch (tree->ast_node.c_sdsp.rs2) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - hex_bits_6(tree->ast_node.c_sdsp.uimm, &s4, &s4_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_C_JR: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - s0 = "c.jr"; - s0_len = 4; - spc( &s1, &s1_len); - switch (tree->ast_node.c_jr) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - } - } - break; - case RISCV_C_JALR: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - s0 = "c.jalr"; - s0_len = 6; - spc( &s1, &s1_len); - switch (tree->ast_node.c_jalr) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - } - } - break; - case RISCV_C_MV: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "c.mv"; - s0_len = 4; - spc( &s1, &s1_len); - switch (tree->ast_node.c_mv.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.c_mv.rs2) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_C_EBREAK: { -{ - char *s0; size_t s0_len; - s0 = "c.ebreak"; + 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; - memcpy(buff , s0, s0_len); - } - } - break; - case RISCV_C_ADD: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "c.add"; - s0_len = 5; - spc( &s1, &s1_len); - switch (tree->ast_node.c_add.rsd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.c_add.rs2) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_MUL: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - -/* TODO */ - spc( &s1, &s1_len); - switch (tree->ast_node.mul.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.mul.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.mul.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_DIV: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - 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); - switch (tree->ast_node.div.rd) { - case 0x08:{ - s3 = "fp"; - s3_len = 2; - break; - } - case 0x15:{ - s3 = "s5"; - s3_len = 2; - break; - } - case 0x01:{ - s3 = "ra"; - s3_len = 2; - break; - } - case 0x06:{ - s3 = "t1"; - s3_len = 2; - break; - } - case 0x09:{ - s3 = "s1"; - s3_len = 2; - break; - } - case 0x10:{ - s3 = "a6"; - s3_len = 2; - break; - } - case 0x1B:{ - s3 = "s11"; - s3_len = 3; - break; - } - case 0x1C:{ - s3 = "t3"; - s3_len = 2; - break; - } - case 0x16:{ - s3 = "s6"; - s3_len = 2; - break; - } - case 0x00:{ - s3 = "zero"; - s3_len = 4; - break; - } - case 0x0A:{ - s3 = "a0"; - s3_len = 2; - break; - } - case 0x1A:{ - s3 = "s10"; - s3_len = 3; - break; - } - case 0x17:{ - s3 = "s7"; - s3_len = 2; - break; - } - case 0x0C:{ - s3 = "a2"; - s3_len = 2; - break; - } - case 0x18:{ - s3 = "s8"; - s3_len = 2; - break; - } - case 0x02:{ - s3 = "sp"; - s3_len = 2; - break; - } - case 0x1F:{ - s3 = "t6"; - s3_len = 2; - break; - } - case 0x0B:{ - s3 = "a1"; - s3_len = 2; - break; - } - case 0x07:{ - s3 = "t2"; - s3_len = 2; - break; - } - case 0x13:{ - s3 = "s3"; - s3_len = 2; - break; - } - case 0x04:{ - s3 = "tp"; - s3_len = 2; - break; - } - case 0x19:{ - s3 = "s9"; - s3_len = 2; - break; - } - case 0x12:{ - s3 = "s2"; - s3_len = 2; - break; - } - case 0x14:{ - s3 = "s4"; - s3_len = 2; - break; - } - case 0x0E:{ - s3 = "a4"; - s3_len = 2; - break; - } - case 0x1E:{ - s3 = "t5"; - s3_len = 2; - break; - } - case 0x11:{ - s3 = "a7"; - s3_len = 2; - break; - } - case 0x03:{ - s3 = "gp"; - s3_len = 2; - break; - } - case 0x05:{ - s3 = "t0"; - s3_len = 2; - break; - } - case 0x1D:{ - s3 = "t4"; - s3_len = 2; - break; - } - case 0x0D:{ - s3 = "a3"; - s3_len = 2; - break; - } - case 0x0F:{ - s3 = "a5"; - s3_len = 2; - break; - } - } - sep( &s4, &s4_len); - switch (tree->ast_node.div.rs1) { - case 0x08:{ - s5 = "fp"; - s5_len = 2; - break; - } - case 0x15:{ - s5 = "s5"; - s5_len = 2; - break; - } - case 0x01:{ - s5 = "ra"; - s5_len = 2; - break; - } - case 0x06:{ - s5 = "t1"; - s5_len = 2; - break; - } - case 0x09:{ - s5 = "s1"; - s5_len = 2; - break; - } - case 0x10:{ - s5 = "a6"; - s5_len = 2; - break; - } - case 0x1B:{ - s5 = "s11"; - s5_len = 3; - break; - } - case 0x1C:{ - s5 = "t3"; - s5_len = 2; - break; - } - case 0x16:{ - s5 = "s6"; - s5_len = 2; - break; - } - case 0x00:{ - s5 = "zero"; - s5_len = 4; - break; - } - case 0x0A:{ - s5 = "a0"; - s5_len = 2; - break; - } - case 0x1A:{ - s5 = "s10"; - s5_len = 3; - break; - } - case 0x17:{ - s5 = "s7"; - s5_len = 2; - break; - } - case 0x0C:{ - s5 = "a2"; - s5_len = 2; - break; - } - case 0x18:{ - s5 = "s8"; - s5_len = 2; - break; - } - case 0x02:{ - s5 = "sp"; - s5_len = 2; - break; - } - case 0x1F:{ - s5 = "t6"; - s5_len = 2; - break; - } - case 0x0B:{ - s5 = "a1"; - s5_len = 2; - break; - } - case 0x07:{ - s5 = "t2"; - s5_len = 2; - break; - } - case 0x13:{ - s5 = "s3"; - s5_len = 2; - break; - } - case 0x04:{ - s5 = "tp"; - s5_len = 2; - break; - } - case 0x19:{ - s5 = "s9"; - s5_len = 2; - break; - } - case 0x12:{ - s5 = "s2"; - s5_len = 2; - break; - } - case 0x14:{ - s5 = "s4"; - s5_len = 2; - break; - } - case 0x0E:{ - s5 = "a4"; - s5_len = 2; - break; - } - case 0x1E:{ - s5 = "t5"; - s5_len = 2; - break; - } - case 0x11:{ - s5 = "a7"; - s5_len = 2; - break; - } - case 0x03:{ - s5 = "gp"; - s5_len = 2; - break; - } - case 0x05:{ - s5 = "t0"; - s5_len = 2; - break; - } - case 0x1D:{ - s5 = "t4"; - s5_len = 2; - break; - } - case 0x0D:{ - s5 = "a3"; - s5_len = 2; - break; - } - case 0x0F:{ - s5 = "a5"; - s5_len = 2; - break; - } - } - sep( &s6, &s6_len); - switch (tree->ast_node.div.rs2) { - case 0x08:{ - s7 = "fp"; - s7_len = 2; - break; - } - case 0x15:{ - s7 = "s5"; - s7_len = 2; - break; - } - case 0x01:{ - s7 = "ra"; - s7_len = 2; - break; - } - case 0x06:{ - s7 = "t1"; - s7_len = 2; - break; - } - case 0x09:{ - s7 = "s1"; - s7_len = 2; - break; - } - case 0x10:{ - s7 = "a6"; - s7_len = 2; - break; - } - case 0x1B:{ - s7 = "s11"; - s7_len = 3; - break; - } - case 0x1C:{ - s7 = "t3"; - s7_len = 2; - break; - } - case 0x16:{ - s7 = "s6"; - s7_len = 2; - break; - } - case 0x00:{ - s7 = "zero"; - s7_len = 4; - break; - } - case 0x0A:{ - s7 = "a0"; - s7_len = 2; - break; - } - case 0x1A:{ - s7 = "s10"; - s7_len = 3; - break; - } - case 0x17:{ - s7 = "s7"; - s7_len = 2; - break; - } - case 0x0C:{ - s7 = "a2"; - s7_len = 2; - break; - } - case 0x18:{ - s7 = "s8"; - s7_len = 2; - break; - } - case 0x02:{ - s7 = "sp"; - s7_len = 2; - break; - } - case 0x1F:{ - s7 = "t6"; - s7_len = 2; - break; - } - case 0x0B:{ - s7 = "a1"; - s7_len = 2; - break; - } - case 0x07:{ - s7 = "t2"; - s7_len = 2; - break; - } - case 0x13:{ - s7 = "s3"; - s7_len = 2; - break; - } - case 0x04:{ - s7 = "tp"; - s7_len = 2; - break; - } - case 0x19:{ - s7 = "s9"; - s7_len = 2; - break; - } - case 0x12:{ - s7 = "s2"; - s7_len = 2; - break; - } - case 0x14:{ - s7 = "s4"; - s7_len = 2; - break; - } - case 0x0E:{ - s7 = "a4"; - s7_len = 2; - break; - } - case 0x1E:{ - s7 = "t5"; - s7_len = 2; - break; - } - case 0x11:{ - s7 = "a7"; - s7_len = 2; - break; - } - case 0x03:{ - s7 = "gp"; - s7_len = 2; - break; - } - case 0x05:{ - s7 = "t0"; - s7_len = 2; - break; - } - case 0x1D:{ - s7 = "t4"; - s7_len = 2; - break; - } - case 0x0D:{ - s7 = "a3"; - s7_len = 2; - break; - } - case 0x0F:{ - s7 = "a5"; - s7_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_REM: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - 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); - switch (tree->ast_node.rem.rd) { - case 0x08:{ - s3 = "fp"; - s3_len = 2; - break; - } - case 0x15:{ - s3 = "s5"; - s3_len = 2; - break; - } - case 0x01:{ - s3 = "ra"; - s3_len = 2; - break; - } - case 0x06:{ - s3 = "t1"; - s3_len = 2; - break; - } - case 0x09:{ - s3 = "s1"; - s3_len = 2; - break; - } - case 0x10:{ - s3 = "a6"; - s3_len = 2; - break; - } - case 0x1B:{ - s3 = "s11"; - s3_len = 3; - break; - } - case 0x1C:{ - s3 = "t3"; - s3_len = 2; - break; - } - case 0x16:{ - s3 = "s6"; - s3_len = 2; - break; - } - case 0x00:{ - s3 = "zero"; - s3_len = 4; - break; - } - case 0x0A:{ - s3 = "a0"; - s3_len = 2; - break; - } - case 0x1A:{ - s3 = "s10"; - s3_len = 3; - break; - } - case 0x17:{ - s3 = "s7"; - s3_len = 2; - break; - } - case 0x0C:{ - s3 = "a2"; - s3_len = 2; - break; - } - case 0x18:{ - s3 = "s8"; - s3_len = 2; - break; - } - case 0x02:{ - s3 = "sp"; - s3_len = 2; - break; - } - case 0x1F:{ - s3 = "t6"; - s3_len = 2; - break; - } - case 0x0B:{ - s3 = "a1"; - s3_len = 2; - break; - } - case 0x07:{ - s3 = "t2"; - s3_len = 2; - break; - } - case 0x13:{ - s3 = "s3"; - s3_len = 2; - break; - } - case 0x04:{ - s3 = "tp"; - s3_len = 2; - break; - } - case 0x19:{ - s3 = "s9"; - s3_len = 2; - break; - } - case 0x12:{ - s3 = "s2"; - s3_len = 2; - break; - } - case 0x14:{ - s3 = "s4"; - s3_len = 2; - break; - } - case 0x0E:{ - s3 = "a4"; - s3_len = 2; - break; - } - case 0x1E:{ - s3 = "t5"; - s3_len = 2; - break; - } - case 0x11:{ - s3 = "a7"; - s3_len = 2; - break; - } - case 0x03:{ - s3 = "gp"; - s3_len = 2; - break; - } - case 0x05:{ - s3 = "t0"; - s3_len = 2; - break; - } - case 0x1D:{ - s3 = "t4"; - s3_len = 2; - break; - } - case 0x0D:{ - s3 = "a3"; - s3_len = 2; - break; - } - case 0x0F:{ - s3 = "a5"; - s3_len = 2; - break; - } - } - sep( &s4, &s4_len); - switch (tree->ast_node.rem.rs1) { - case 0x08:{ - s5 = "fp"; - s5_len = 2; - break; - } - case 0x15:{ - s5 = "s5"; - s5_len = 2; - break; - } - case 0x01:{ - s5 = "ra"; - s5_len = 2; - break; - } - case 0x06:{ - s5 = "t1"; - s5_len = 2; - break; - } - case 0x09:{ - s5 = "s1"; - s5_len = 2; - break; - } - case 0x10:{ - s5 = "a6"; - s5_len = 2; - break; - } - case 0x1B:{ - s5 = "s11"; - s5_len = 3; - break; - } - case 0x1C:{ - s5 = "t3"; - s5_len = 2; - break; - } - case 0x16:{ - s5 = "s6"; - s5_len = 2; - break; - } - case 0x00:{ - s5 = "zero"; - s5_len = 4; - break; - } - case 0x0A:{ - s5 = "a0"; - s5_len = 2; - break; - } - case 0x1A:{ - s5 = "s10"; - s5_len = 3; - break; - } - case 0x17:{ - s5 = "s7"; - s5_len = 2; - break; - } - case 0x0C:{ - s5 = "a2"; - s5_len = 2; - break; - } - case 0x18:{ - s5 = "s8"; - s5_len = 2; - break; - } - case 0x02:{ - s5 = "sp"; - s5_len = 2; - break; - } - case 0x1F:{ - s5 = "t6"; - s5_len = 2; - break; - } - case 0x0B:{ - s5 = "a1"; - s5_len = 2; - break; - } - case 0x07:{ - s5 = "t2"; - s5_len = 2; - break; - } - case 0x13:{ - s5 = "s3"; - s5_len = 2; - break; - } - case 0x04:{ - s5 = "tp"; - s5_len = 2; - break; - } - case 0x19:{ - s5 = "s9"; - s5_len = 2; - break; - } - case 0x12:{ - s5 = "s2"; - s5_len = 2; - break; - } - case 0x14:{ - s5 = "s4"; - s5_len = 2; - break; - } - case 0x0E:{ - s5 = "a4"; - s5_len = 2; - break; - } - case 0x1E:{ - s5 = "t5"; - s5_len = 2; - break; - } - case 0x11:{ - s5 = "a7"; - s5_len = 2; - break; - } - case 0x03:{ - s5 = "gp"; - s5_len = 2; - break; - } - case 0x05:{ - s5 = "t0"; - s5_len = 2; - break; - } - case 0x1D:{ - s5 = "t4"; - s5_len = 2; - break; - } - case 0x0D:{ - s5 = "a3"; - s5_len = 2; - break; - } - case 0x0F:{ - s5 = "a5"; - s5_len = 2; - break; - } - } - sep( &s6, &s6_len); - switch (tree->ast_node.rem.rs2) { - case 0x08:{ - s7 = "fp"; - s7_len = 2; - break; - } - case 0x15:{ - s7 = "s5"; - s7_len = 2; - break; - } - case 0x01:{ - s7 = "ra"; - s7_len = 2; - break; - } - case 0x06:{ - s7 = "t1"; - s7_len = 2; - break; - } - case 0x09:{ - s7 = "s1"; - s7_len = 2; - break; - } - case 0x10:{ - s7 = "a6"; - s7_len = 2; - break; - } - case 0x1B:{ - s7 = "s11"; - s7_len = 3; - break; - } - case 0x1C:{ - s7 = "t3"; - s7_len = 2; - break; - } - case 0x16:{ - s7 = "s6"; - s7_len = 2; - break; - } - case 0x00:{ - s7 = "zero"; - s7_len = 4; - break; - } - case 0x0A:{ - s7 = "a0"; - s7_len = 2; - break; - } - case 0x1A:{ - s7 = "s10"; - s7_len = 3; - break; - } - case 0x17:{ - s7 = "s7"; - s7_len = 2; - break; - } - case 0x0C:{ - s7 = "a2"; - s7_len = 2; - break; - } - case 0x18:{ - s7 = "s8"; - s7_len = 2; - break; - } - case 0x02:{ - s7 = "sp"; - s7_len = 2; - break; - } - case 0x1F:{ - s7 = "t6"; - s7_len = 2; - break; - } - case 0x0B:{ - s7 = "a1"; - s7_len = 2; - break; - } - case 0x07:{ - s7 = "t2"; - s7_len = 2; - break; - } - case 0x13:{ - s7 = "s3"; - s7_len = 2; - break; - } - case 0x04:{ - s7 = "tp"; - s7_len = 2; - break; - } - case 0x19:{ - s7 = "s9"; - s7_len = 2; - break; - } - case 0x12:{ - s7 = "s2"; - s7_len = 2; - break; - } - case 0x14:{ - s7 = "s4"; - s7_len = 2; - break; - } - case 0x0E:{ - s7 = "a4"; - s7_len = 2; - break; - } - case 0x1E:{ - s7 = "t5"; - s7_len = 2; - break; - } - case 0x11:{ - s7 = "a7"; - s7_len = 2; - break; - } - case 0x03:{ - s7 = "gp"; - s7_len = 2; - break; - } - case 0x05:{ - s7 = "t0"; - s7_len = 2; - break; - } - case 0x1D:{ - s7 = "t4"; - s7_len = 2; - break; - } - case 0x0D:{ - s7 = "a3"; - s7_len = 2; - break; - } - case 0x0F:{ - s7 = "a5"; - s7_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_MULW: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "mulw"; - s0_len = 4; - spc( &s1, &s1_len); - switch (tree->ast_node.mulw.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.mulw.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.mulw.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_DIVW: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - 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); - switch (tree->ast_node.divw.rd) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.divw.rs1) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - sep( &s7, &s7_len); - switch (tree->ast_node.divw.rs2) { - case 0x08:{ - s8 = "fp"; - s8_len = 2; - break; - } - case 0x15:{ - s8 = "s5"; - s8_len = 2; - break; - } - case 0x01:{ - s8 = "ra"; - s8_len = 2; - break; - } - case 0x06:{ - s8 = "t1"; - s8_len = 2; - break; - } - case 0x09:{ - s8 = "s1"; - s8_len = 2; - break; - } - case 0x10:{ - s8 = "a6"; - s8_len = 2; - break; - } - case 0x1B:{ - s8 = "s11"; - s8_len = 3; - break; - } - case 0x1C:{ - s8 = "t3"; - s8_len = 2; - break; - } - case 0x16:{ - s8 = "s6"; - s8_len = 2; - break; - } - case 0x00:{ - s8 = "zero"; - s8_len = 4; - break; - } - case 0x0A:{ - s8 = "a0"; - s8_len = 2; - break; - } - case 0x1A:{ - s8 = "s10"; - s8_len = 3; - break; - } - case 0x17:{ - s8 = "s7"; - s8_len = 2; - break; - } - case 0x0C:{ - s8 = "a2"; - s8_len = 2; - break; - } - case 0x18:{ - s8 = "s8"; - s8_len = 2; - break; - } - case 0x02:{ - s8 = "sp"; - s8_len = 2; - break; - } - case 0x1F:{ - s8 = "t6"; - s8_len = 2; - break; - } - case 0x0B:{ - s8 = "a1"; - s8_len = 2; - break; - } - case 0x07:{ - s8 = "t2"; - s8_len = 2; - break; - } - case 0x13:{ - s8 = "s3"; - s8_len = 2; - break; - } - case 0x04:{ - s8 = "tp"; - s8_len = 2; - break; - } - case 0x19:{ - s8 = "s9"; - s8_len = 2; - break; - } - case 0x12:{ - s8 = "s2"; - s8_len = 2; - break; - } - case 0x14:{ - s8 = "s4"; - s8_len = 2; - break; - } - case 0x0E:{ - s8 = "a4"; - s8_len = 2; - break; - } - case 0x1E:{ - s8 = "t5"; - s8_len = 2; - break; - } - case 0x11:{ - s8 = "a7"; - s8_len = 2; - break; - } - case 0x03:{ - s8 = "gp"; - s8_len = 2; - break; - } - case 0x05:{ - s8 = "t0"; - s8_len = 2; - break; - } - case 0x1D:{ - s8 = "t4"; - s8_len = 2; - break; - } - case 0x0D:{ - s8 = "a3"; - s8_len = 2; - break; - } - case 0x0F:{ - s8 = "a5"; - s8_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - } - } - break; - case RISCV_REMW: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - 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); - switch (tree->ast_node.remw.rd) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.remw.rs1) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - sep( &s7, &s7_len); - switch (tree->ast_node.remw.rs2) { - case 0x08:{ - s8 = "fp"; - s8_len = 2; - break; - } - case 0x15:{ - s8 = "s5"; - s8_len = 2; - break; - } - case 0x01:{ - s8 = "ra"; - s8_len = 2; - break; - } - case 0x06:{ - s8 = "t1"; - s8_len = 2; - break; - } - case 0x09:{ - s8 = "s1"; - s8_len = 2; - break; - } - case 0x10:{ - s8 = "a6"; - s8_len = 2; - break; - } - case 0x1B:{ - s8 = "s11"; - s8_len = 3; - break; - } - case 0x1C:{ - s8 = "t3"; - s8_len = 2; - break; - } - case 0x16:{ - s8 = "s6"; - s8_len = 2; - break; - } - case 0x00:{ - s8 = "zero"; - s8_len = 4; - break; - } - case 0x0A:{ - s8 = "a0"; - s8_len = 2; - break; - } - case 0x1A:{ - s8 = "s10"; - s8_len = 3; - break; - } - case 0x17:{ - s8 = "s7"; - s8_len = 2; - break; - } - case 0x0C:{ - s8 = "a2"; - s8_len = 2; - break; - } - case 0x18:{ - s8 = "s8"; - s8_len = 2; - break; - } - case 0x02:{ - s8 = "sp"; - s8_len = 2; - break; - } - case 0x1F:{ - s8 = "t6"; - s8_len = 2; - break; - } - case 0x0B:{ - s8 = "a1"; - s8_len = 2; - break; - } - case 0x07:{ - s8 = "t2"; - s8_len = 2; - break; - } - case 0x13:{ - s8 = "s3"; - s8_len = 2; - break; - } - case 0x04:{ - s8 = "tp"; - s8_len = 2; - break; - } - case 0x19:{ - s8 = "s9"; - s8_len = 2; - break; - } - case 0x12:{ - s8 = "s2"; - s8_len = 2; - break; - } - case 0x14:{ - s8 = "s4"; - s8_len = 2; - break; - } - case 0x0E:{ - s8 = "a4"; - s8_len = 2; - break; - } - case 0x1E:{ - s8 = "t5"; - s8_len = 2; - break; - } - case 0x11:{ - s8 = "a7"; - s8_len = 2; - break; - } - case 0x03:{ - s8 = "gp"; - s8_len = 2; - break; - } - case 0x05:{ - s8 = "t0"; - s8_len = 2; - break; - } - case 0x1D:{ - s8 = "t4"; - s8_len = 2; - break; - } - case 0x0D:{ - s8 = "a3"; - s8_len = 2; - break; - } - case 0x0F:{ - s8 = "a5"; - s8_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - } - } - break; - case RISCV_CSR: { - - if (tree->ast_node.csr.is_imm == RISCV_true) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.csr.op) { - case RISCV_CSRRS:{ - s0 = "csrrs"; - s0_len = 5; - break; - } - case RISCV_CSRRW:{ - s0 = "csrrw"; - s0_len = 5; - break; - } - case RISCV_CSRRC:{ - s0 = "csrrc"; - s0_len = 5; - break; - } - } - s1 = "i"; - s1_len = 1; - spc( &s2, &s2_len); - switch (tree->ast_node.csr.rd) { - case 0x08:{ - s3 = "fp"; - s3_len = 2; - break; - } - case 0x15:{ - s3 = "s5"; - s3_len = 2; - break; - } - case 0x01:{ - s3 = "ra"; - s3_len = 2; - break; - } - case 0x06:{ - s3 = "t1"; - s3_len = 2; - break; - } - case 0x09:{ - s3 = "s1"; - s3_len = 2; - break; - } - case 0x10:{ - s3 = "a6"; - s3_len = 2; - break; - } - case 0x1B:{ - s3 = "s11"; - s3_len = 3; - break; - } - case 0x1C:{ - s3 = "t3"; - s3_len = 2; - break; - } - case 0x16:{ - s3 = "s6"; - s3_len = 2; - break; - } - case 0x00:{ - s3 = "zero"; - s3_len = 4; - break; - } - case 0x0A:{ - s3 = "a0"; - s3_len = 2; - break; - } - case 0x1A:{ - s3 = "s10"; - s3_len = 3; - break; - } - case 0x17:{ - s3 = "s7"; - s3_len = 2; - break; - } - case 0x0C:{ - s3 = "a2"; - s3_len = 2; - break; - } - case 0x18:{ - s3 = "s8"; - s3_len = 2; - break; - } - case 0x02:{ - s3 = "sp"; - s3_len = 2; - break; - } - case 0x1F:{ - s3 = "t6"; - s3_len = 2; - break; - } - case 0x0B:{ - s3 = "a1"; - s3_len = 2; - break; - } - case 0x07:{ - s3 = "t2"; - s3_len = 2; - break; - } - case 0x13:{ - s3 = "s3"; - s3_len = 2; - break; - } - case 0x04:{ - s3 = "tp"; - s3_len = 2; - break; - } - case 0x19:{ - s3 = "s9"; - s3_len = 2; - break; - } - case 0x12:{ - s3 = "s2"; - s3_len = 2; - break; - } - case 0x14:{ - s3 = "s4"; - s3_len = 2; - break; - } - case 0x0E:{ - s3 = "a4"; - s3_len = 2; - break; - } - case 0x1E:{ - s3 = "t5"; - s3_len = 2; - break; - } - case 0x11:{ - s3 = "a7"; - s3_len = 2; - break; - } - case 0x03:{ - s3 = "gp"; - s3_len = 2; - break; - } - case 0x05:{ - s3 = "t0"; - s3_len = 2; - break; - } - case 0x1D:{ - s3 = "t4"; - s3_len = 2; - break; - } - case 0x0D:{ - s3 = "a3"; - s3_len = 2; - break; - } - case 0x0F:{ - s3 = "a5"; - s3_len = 2; - break; - } - } - sep( &s4, &s4_len); - csr_name_map(tree->ast_node.csr.csr, &s5, &s5_len); - sep( &s6, &s6_len); - hex_bits_5(tree->ast_node.csr.rs1, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - if (tree->ast_node.csr.is_imm == RISCV_false) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - switch (tree->ast_node.csr.op) { - case RISCV_CSRRS:{ - s0 = "csrrs"; - s0_len = 5; - break; - } - case RISCV_CSRRW:{ - s0 = "csrrw"; - s0_len = 5; - break; - } - case RISCV_CSRRC:{ - s0 = "csrrc"; - s0_len = 5; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.csr.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - csr_name_map(tree->ast_node.csr.csr, &s4, &s4_len); - sep( &s5, &s5_len); - switch (tree->ast_node.csr.rs1) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_URET: { -{ - char *s0; size_t s0_len; - s0 = "uret"; - s0_len = 4; - memcpy(buff , s0, s0_len); - } - } - break; - case RISCV_C_NOP_HINT: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - s0 = "c.nop.hint."; - s0_len = 11; - hex_bits_6(tree->ast_node.c_nop_hint, &s1, &s1_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - } - } - break; - case RISCV_C_ADDI_HINT: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - s0 = "c.addi.hint."; - s0_len = 12; - switch (tree->ast_node.c_addi_hint) { - case 0x08:{ - s1 = "fp"; - s1_len = 2; - break; - } - case 0x15:{ - s1 = "s5"; - s1_len = 2; - break; - } - case 0x01:{ - s1 = "ra"; - s1_len = 2; - break; - } - case 0x06:{ - s1 = "t1"; - s1_len = 2; - break; - } - case 0x09:{ - s1 = "s1"; - s1_len = 2; - break; - } - case 0x10:{ - s1 = "a6"; - s1_len = 2; - break; - } - case 0x1B:{ - s1 = "s11"; - s1_len = 3; - break; - } - case 0x1C:{ - s1 = "t3"; - s1_len = 2; - break; - } - case 0x16:{ - s1 = "s6"; - s1_len = 2; - break; - } - case 0x00:{ - s1 = "zero"; - s1_len = 4; - break; - } - case 0x0A:{ - s1 = "a0"; - s1_len = 2; - break; - } - case 0x1A:{ - s1 = "s10"; - s1_len = 3; - break; - } - case 0x17:{ - s1 = "s7"; - s1_len = 2; - break; - } - case 0x0C:{ - s1 = "a2"; - s1_len = 2; - break; - } - case 0x18:{ - s1 = "s8"; - s1_len = 2; - break; - } - case 0x02:{ - s1 = "sp"; - s1_len = 2; - break; - } - case 0x1F:{ - s1 = "t6"; - s1_len = 2; - break; - } - case 0x0B:{ - s1 = "a1"; - s1_len = 2; - break; - } - case 0x07:{ - s1 = "t2"; - s1_len = 2; - break; - } - case 0x13:{ - s1 = "s3"; - s1_len = 2; - break; - } - case 0x04:{ - s1 = "tp"; - s1_len = 2; - break; - } - case 0x19:{ - s1 = "s9"; - s1_len = 2; - break; - } - case 0x12:{ - s1 = "s2"; - s1_len = 2; - break; - } - case 0x14:{ - s1 = "s4"; - s1_len = 2; - break; - } - case 0x0E:{ - s1 = "a4"; - s1_len = 2; - break; - } - case 0x1E:{ - s1 = "t5"; - s1_len = 2; - break; - } - case 0x11:{ - s1 = "a7"; - s1_len = 2; - break; - } - case 0x03:{ - s1 = "gp"; - s1_len = 2; - break; - } - case 0x05:{ - s1 = "t0"; - s1_len = 2; - break; - } - case 0x1D:{ - s1 = "t4"; - s1_len = 2; - break; - } - case 0x0D:{ - s1 = "a3"; - s1_len = 2; - break; - } - case 0x0F:{ - s1 = "a5"; - s1_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - } - } - break; - case RISCV_C_LI_HINT: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - s0 = "c.li.hint."; - s0_len = 10; - hex_bits_6(tree->ast_node.c_li_hint, &s1, &s1_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - } - } - break; - case RISCV_C_LUI_HINT: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - s0 = "c.lui.hint."; - s0_len = 11; - hex_bits_6(tree->ast_node.c_lui_hint, &s1, &s1_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - } - } - break; - case RISCV_C_MV_HINT: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - s0 = "c.mv.hint."; - s0_len = 10; - switch (tree->ast_node.c_mv_hint) { - case 0x08:{ - s1 = "fp"; - s1_len = 2; - break; - } - case 0x15:{ - s1 = "s5"; - s1_len = 2; - break; - } - case 0x01:{ - s1 = "ra"; - s1_len = 2; - break; - } - case 0x06:{ - s1 = "t1"; - s1_len = 2; - break; - } - case 0x09:{ - s1 = "s1"; - s1_len = 2; - break; - } - case 0x10:{ - s1 = "a6"; - s1_len = 2; - break; - } - case 0x1B:{ - s1 = "s11"; - s1_len = 3; - break; - } - case 0x1C:{ - s1 = "t3"; - s1_len = 2; - break; - } - case 0x16:{ - s1 = "s6"; - s1_len = 2; - break; - } - case 0x00:{ - s1 = "zero"; - s1_len = 4; - break; - } - case 0x0A:{ - s1 = "a0"; - s1_len = 2; - break; - } - case 0x1A:{ - s1 = "s10"; - s1_len = 3; - break; - } - case 0x17:{ - s1 = "s7"; - s1_len = 2; - break; - } - case 0x0C:{ - s1 = "a2"; - s1_len = 2; - break; - } - case 0x18:{ - s1 = "s8"; - s1_len = 2; - break; - } - case 0x02:{ - s1 = "sp"; - s1_len = 2; - break; - } - case 0x1F:{ - s1 = "t6"; - s1_len = 2; - break; - } - case 0x0B:{ - s1 = "a1"; - s1_len = 2; - break; - } - case 0x07:{ - s1 = "t2"; - s1_len = 2; - break; - } - case 0x13:{ - s1 = "s3"; - s1_len = 2; - break; - } - case 0x04:{ - s1 = "tp"; - s1_len = 2; - break; - } - case 0x19:{ - s1 = "s9"; - s1_len = 2; - break; - } - case 0x12:{ - s1 = "s2"; - s1_len = 2; - break; - } - case 0x14:{ - s1 = "s4"; - s1_len = 2; - break; - } - case 0x0E:{ - s1 = "a4"; - s1_len = 2; - break; - } - case 0x1E:{ - s1 = "t5"; - s1_len = 2; - break; - } - case 0x11:{ - s1 = "a7"; - s1_len = 2; - break; - } - case 0x03:{ - s1 = "gp"; - s1_len = 2; - break; - } - case 0x05:{ - s1 = "t0"; - s1_len = 2; - break; - } - case 0x1D:{ - s1 = "t4"; - s1_len = 2; - break; - } - case 0x0D:{ - s1 = "a3"; - s1_len = 2; - break; - } - case 0x0F:{ - s1 = "a5"; - s1_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - } - } - break; - case RISCV_C_ADD_HINT: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - s0 = "c.add.hint."; - s0_len = 11; - switch (tree->ast_node.c_add_hint) { - case 0x08:{ - s1 = "fp"; - s1_len = 2; - break; - } - case 0x15:{ - s1 = "s5"; - s1_len = 2; - break; - } - case 0x01:{ - s1 = "ra"; - s1_len = 2; - break; - } - case 0x06:{ - s1 = "t1"; - s1_len = 2; - break; - } - case 0x09:{ - s1 = "s1"; - s1_len = 2; - break; - } - case 0x10:{ - s1 = "a6"; - s1_len = 2; - break; - } - case 0x1B:{ - s1 = "s11"; - s1_len = 3; - break; - } - case 0x1C:{ - s1 = "t3"; - s1_len = 2; - break; - } - case 0x16:{ - s1 = "s6"; - s1_len = 2; - break; - } - case 0x00:{ - s1 = "zero"; - s1_len = 4; - break; - } - case 0x0A:{ - s1 = "a0"; - s1_len = 2; - break; - } - case 0x1A:{ - s1 = "s10"; - s1_len = 3; - break; - } - case 0x17:{ - s1 = "s7"; - s1_len = 2; - break; - } - case 0x0C:{ - s1 = "a2"; - s1_len = 2; - break; - } - case 0x18:{ - s1 = "s8"; - s1_len = 2; - break; - } - case 0x02:{ - s1 = "sp"; - s1_len = 2; - break; - } - case 0x1F:{ - s1 = "t6"; - s1_len = 2; - break; - } - case 0x0B:{ - s1 = "a1"; - s1_len = 2; - break; - } - case 0x07:{ - s1 = "t2"; - s1_len = 2; - break; - } - case 0x13:{ - s1 = "s3"; - s1_len = 2; - break; - } - case 0x04:{ - s1 = "tp"; - s1_len = 2; - break; - } - case 0x19:{ - s1 = "s9"; - s1_len = 2; - break; - } - case 0x12:{ - s1 = "s2"; - s1_len = 2; - break; - } - case 0x14:{ - s1 = "s4"; - s1_len = 2; - break; - } - case 0x0E:{ - s1 = "a4"; - s1_len = 2; - break; - } - case 0x1E:{ - s1 = "t5"; - s1_len = 2; - break; - } - case 0x11:{ - s1 = "a7"; - s1_len = 2; - break; - } - case 0x03:{ - s1 = "gp"; - s1_len = 2; - break; - } - case 0x05:{ - s1 = "t0"; - s1_len = 2; - break; - } - case 0x1D:{ - s1 = "t4"; - s1_len = 2; - break; - } - case 0x0D:{ - s1 = "a3"; - s1_len = 2; - break; - } - case 0x0F:{ - s1 = "a5"; - s1_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - } - } - break; - case RISCV_C_SLLI_HINT: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - s0 = "c.slli.hint."; - s0_len = 12; - switch (tree->ast_node.c_slli_hint.rsd) { - case 0x08:{ - s1 = "fp"; - s1_len = 2; - break; - } - case 0x15:{ - s1 = "s5"; - s1_len = 2; - break; - } - case 0x01:{ - s1 = "ra"; - s1_len = 2; - break; - } - case 0x06:{ - s1 = "t1"; - s1_len = 2; - break; - } - case 0x09:{ - s1 = "s1"; - s1_len = 2; - break; - } - case 0x10:{ - s1 = "a6"; - s1_len = 2; - break; - } - case 0x1B:{ - s1 = "s11"; - s1_len = 3; - break; - } - case 0x1C:{ - s1 = "t3"; - s1_len = 2; - break; - } - case 0x16:{ - s1 = "s6"; - s1_len = 2; - break; - } - case 0x00:{ - s1 = "zero"; - s1_len = 4; - break; - } - case 0x0A:{ - s1 = "a0"; - s1_len = 2; - break; - } - case 0x1A:{ - s1 = "s10"; - s1_len = 3; - break; - } - case 0x17:{ - s1 = "s7"; - s1_len = 2; - break; - } - case 0x0C:{ - s1 = "a2"; - s1_len = 2; - break; - } - case 0x18:{ - s1 = "s8"; - s1_len = 2; - break; - } - case 0x02:{ - s1 = "sp"; - s1_len = 2; - break; - } - case 0x1F:{ - s1 = "t6"; - s1_len = 2; - break; - } - case 0x0B:{ - s1 = "a1"; - s1_len = 2; - break; - } - case 0x07:{ - s1 = "t2"; - s1_len = 2; - break; - } - case 0x13:{ - s1 = "s3"; - s1_len = 2; - break; - } - case 0x04:{ - s1 = "tp"; - s1_len = 2; - break; - } - case 0x19:{ - s1 = "s9"; - s1_len = 2; - break; - } - case 0x12:{ - s1 = "s2"; - s1_len = 2; - break; - } - case 0x14:{ - s1 = "s4"; - s1_len = 2; - break; - } - case 0x0E:{ - s1 = "a4"; - s1_len = 2; - break; - } - case 0x1E:{ - s1 = "t5"; - s1_len = 2; - break; - } - case 0x11:{ - s1 = "a7"; - s1_len = 2; - break; - } - case 0x03:{ - s1 = "gp"; - s1_len = 2; - break; - } - case 0x05:{ - s1 = "t0"; - s1_len = 2; - break; - } - case 0x1D:{ - s1 = "t4"; - s1_len = 2; - break; - } - case 0x0D:{ - s1 = "a3"; - s1_len = 2; - break; - } - case 0x0F:{ - s1 = "a5"; - s1_len = 2; - break; - } - } - s2 = "."; - s2_len = 1; - hex_bits_6(tree->ast_node.c_slli_hint.shamt, &s3, &s3_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - } - } - break; - case RISCV_C_SRLI_HINT: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - s0 = "c.srli.hint."; - s0_len = 12; - switch (tree->ast_node.c_srli_hint) { - case 0x7:{ - s1 = "a5"; - s1_len = 2; - break; - } - case 0x5:{ - s1 = "a3"; - s1_len = 2; - break; - } - case 0x1:{ - s1 = "s1"; - s1_len = 2; - break; - } - case 0x3:{ - s1 = "a1"; - s1_len = 2; - break; - } - case 0x2:{ - s1 = "a0"; - s1_len = 2; - break; - } - case 0x4:{ - s1 = "a2"; - s1_len = 2; - break; - } - case 0x6:{ - s1 = "a4"; - s1_len = 2; - break; - } - case 0x0:{ - s1 = "s0"; - s1_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - } - } - break; - case RISCV_C_SRAI_HINT: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - s0 = "c.srai.hint."; - s0_len = 12; - switch (tree->ast_node.c_srai_hint) { - case 0x7:{ - s1 = "a5"; - s1_len = 2; - break; - } - case 0x5:{ - s1 = "a3"; - s1_len = 2; - break; - } - case 0x1:{ - s1 = "s1"; - s1_len = 2; - break; - } - case 0x3:{ - s1 = "a1"; - s1_len = 2; - break; - } - case 0x2:{ - s1 = "a0"; - s1_len = 2; - break; - } - case 0x4:{ - s1 = "a2"; - s1_len = 2; - break; - } - case 0x6:{ - s1 = "a4"; - s1_len = 2; - break; - } - case 0x0:{ - s1 = "s0"; - s1_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - } - } - break; - case RISCV_FENCE_RESERVED: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - char *s9; size_t s9_len; - s0 = "fence.reserved."; - s0_len = 15; - fence_bits(tree->ast_node.fence_reserved.pred, &s1, &s1_len); - s2 = "."; - s2_len = 1; - fence_bits(tree->ast_node.fence_reserved.succ, &s3, &s3_len); - s4 = "."; - s4_len = 1; - switch (tree->ast_node.fence_reserved.rs) { - case 0x08:{ - s5 = "fp"; - s5_len = 2; - break; - } - case 0x15:{ - s5 = "s5"; - s5_len = 2; - break; - } - case 0x01:{ - s5 = "ra"; - s5_len = 2; - break; - } - case 0x06:{ - s5 = "t1"; - s5_len = 2; - break; - } - case 0x09:{ - s5 = "s1"; - s5_len = 2; - break; - } - case 0x10:{ - s5 = "a6"; - s5_len = 2; - break; - } - case 0x1B:{ - s5 = "s11"; - s5_len = 3; - break; - } - case 0x1C:{ - s5 = "t3"; - s5_len = 2; - break; - } - case 0x16:{ - s5 = "s6"; - s5_len = 2; - break; - } - case 0x00:{ - s5 = "zero"; - s5_len = 4; - break; - } - case 0x0A:{ - s5 = "a0"; - s5_len = 2; - break; - } - case 0x1A:{ - s5 = "s10"; - s5_len = 3; - break; - } - case 0x17:{ - s5 = "s7"; - s5_len = 2; - break; - } - case 0x0C:{ - s5 = "a2"; - s5_len = 2; - break; - } - case 0x18:{ - s5 = "s8"; - s5_len = 2; - break; - } - case 0x02:{ - s5 = "sp"; - s5_len = 2; - break; - } - case 0x1F:{ - s5 = "t6"; - s5_len = 2; - break; - } - case 0x0B:{ - s5 = "a1"; - s5_len = 2; - break; - } - case 0x07:{ - s5 = "t2"; - s5_len = 2; - break; - } - case 0x13:{ - s5 = "s3"; - s5_len = 2; - break; - } - case 0x04:{ - s5 = "tp"; - s5_len = 2; - break; - } - case 0x19:{ - s5 = "s9"; - s5_len = 2; - break; - } - case 0x12:{ - s5 = "s2"; - s5_len = 2; - break; - } - case 0x14:{ - s5 = "s4"; - s5_len = 2; - break; - } - case 0x0E:{ - s5 = "a4"; - s5_len = 2; - break; - } - case 0x1E:{ - s5 = "t5"; - s5_len = 2; - break; - } - case 0x11:{ - s5 = "a7"; - s5_len = 2; - break; - } - case 0x03:{ - s5 = "gp"; - s5_len = 2; - break; - } - case 0x05:{ - s5 = "t0"; - s5_len = 2; - break; - } - case 0x1D:{ - s5 = "t4"; - s5_len = 2; - break; - } - case 0x0D:{ - s5 = "a3"; - s5_len = 2; - break; - } - case 0x0F:{ - s5 = "a5"; - s5_len = 2; - break; - } - } - s6 = "."; - s6_len = 1; - switch (tree->ast_node.fence_reserved.rd) { - case 0x08:{ - s7 = "fp"; - s7_len = 2; - break; - } - case 0x15:{ - s7 = "s5"; - s7_len = 2; - break; - } - case 0x01:{ - s7 = "ra"; - s7_len = 2; - break; - } - case 0x06:{ - s7 = "t1"; - s7_len = 2; - break; - } - case 0x09:{ - s7 = "s1"; - s7_len = 2; - break; - } - case 0x10:{ - s7 = "a6"; - s7_len = 2; - break; - } - case 0x1B:{ - s7 = "s11"; - s7_len = 3; - break; - } - case 0x1C:{ - s7 = "t3"; - s7_len = 2; - break; - } - case 0x16:{ - s7 = "s6"; - s7_len = 2; - break; - } - case 0x00:{ - s7 = "zero"; - s7_len = 4; - break; - } - case 0x0A:{ - s7 = "a0"; - s7_len = 2; - break; - } - case 0x1A:{ - s7 = "s10"; - s7_len = 3; - break; - } - case 0x17:{ - s7 = "s7"; - s7_len = 2; - break; - } - case 0x0C:{ - s7 = "a2"; - s7_len = 2; - break; - } - case 0x18:{ - s7 = "s8"; - s7_len = 2; - break; - } - case 0x02:{ - s7 = "sp"; - s7_len = 2; - break; - } - case 0x1F:{ - s7 = "t6"; - s7_len = 2; - break; - } - case 0x0B:{ - s7 = "a1"; - s7_len = 2; - break; - } - case 0x07:{ - s7 = "t2"; - s7_len = 2; - break; - } - case 0x13:{ - s7 = "s3"; - s7_len = 2; - break; - } - case 0x04:{ - s7 = "tp"; - s7_len = 2; - break; - } - case 0x19:{ - s7 = "s9"; - s7_len = 2; - break; - } - case 0x12:{ - s7 = "s2"; - s7_len = 2; - break; - } - case 0x14:{ - s7 = "s4"; - s7_len = 2; - break; - } - case 0x0E:{ - s7 = "a4"; - s7_len = 2; - break; - } - case 0x1E:{ - s7 = "t5"; - s7_len = 2; - break; - } - case 0x11:{ - s7 = "a7"; - s7_len = 2; - break; - } - case 0x03:{ - s7 = "gp"; - s7_len = 2; - break; - } - case 0x05:{ - s7 = "t0"; - s7_len = 2; - break; - } - case 0x1D:{ - s7 = "t4"; - s7_len = 2; - break; - } - case 0x0D:{ - s7 = "a3"; - s7_len = 2; - break; - } - case 0x0F:{ - s7 = "a5"; - s7_len = 2; - break; - } - } - s8 = "."; - s8_len = 1; - hex_bits_4(tree->ast_node.fence_reserved.fm, &s9, &s9_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len + s8_len, s9, s9_len); - } - } - break; - case RISCV_FENCEI_RESERVED: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - s0 = "fence.i.reserved."; - s0_len = 17; - switch (tree->ast_node.fencei_reserved.rd) { - case 0x08:{ - s1 = "fp"; - s1_len = 2; - break; - } - case 0x15:{ - s1 = "s5"; - s1_len = 2; - break; - } - case 0x01:{ - s1 = "ra"; - s1_len = 2; - break; - } - case 0x06:{ - s1 = "t1"; - s1_len = 2; - break; - } - case 0x09:{ - s1 = "s1"; - s1_len = 2; - break; - } - case 0x10:{ - s1 = "a6"; - s1_len = 2; - break; - } - case 0x1B:{ - s1 = "s11"; - s1_len = 3; - break; - } - case 0x1C:{ - s1 = "t3"; - s1_len = 2; - break; - } - case 0x16:{ - s1 = "s6"; - s1_len = 2; - break; - } - case 0x00:{ - s1 = "zero"; - s1_len = 4; - break; - } - case 0x0A:{ - s1 = "a0"; - s1_len = 2; - break; - } - case 0x1A:{ - s1 = "s10"; - s1_len = 3; - break; - } - case 0x17:{ - s1 = "s7"; - s1_len = 2; - break; - } - case 0x0C:{ - s1 = "a2"; - s1_len = 2; - break; - } - case 0x18:{ - s1 = "s8"; - s1_len = 2; - break; - } - case 0x02:{ - s1 = "sp"; - s1_len = 2; - break; - } - case 0x1F:{ - s1 = "t6"; - s1_len = 2; - break; - } - case 0x0B:{ - s1 = "a1"; - s1_len = 2; - break; - } - case 0x07:{ - s1 = "t2"; - s1_len = 2; - break; - } - case 0x13:{ - s1 = "s3"; - s1_len = 2; - break; - } - case 0x04:{ - s1 = "tp"; - s1_len = 2; - break; - } - case 0x19:{ - s1 = "s9"; - s1_len = 2; - break; - } - case 0x12:{ - s1 = "s2"; - s1_len = 2; - break; - } - case 0x14:{ - s1 = "s4"; - s1_len = 2; - break; - } - case 0x0E:{ - s1 = "a4"; - s1_len = 2; - break; - } - case 0x1E:{ - s1 = "t5"; - s1_len = 2; - break; - } - case 0x11:{ - s1 = "a7"; - s1_len = 2; - break; - } - case 0x03:{ - s1 = "gp"; - s1_len = 2; - break; - } - case 0x05:{ - s1 = "t0"; - s1_len = 2; - break; - } - case 0x1D:{ - s1 = "t4"; - s1_len = 2; - break; - } - case 0x0D:{ - s1 = "a3"; - s1_len = 2; - break; - } - case 0x0F:{ - s1 = "a5"; - s1_len = 2; - break; - } - } - s2 = "."; - s2_len = 1; - switch (tree->ast_node.fencei_reserved.rs) { - case 0x08:{ - s3 = "fp"; - s3_len = 2; - break; - } - case 0x15:{ - s3 = "s5"; - s3_len = 2; - break; - } - case 0x01:{ - s3 = "ra"; - s3_len = 2; - break; - } - case 0x06:{ - s3 = "t1"; - s3_len = 2; - break; - } - case 0x09:{ - s3 = "s1"; - s3_len = 2; - break; - } - case 0x10:{ - s3 = "a6"; - s3_len = 2; - break; - } - case 0x1B:{ - s3 = "s11"; - s3_len = 3; - break; - } - case 0x1C:{ - s3 = "t3"; - s3_len = 2; - break; - } - case 0x16:{ - s3 = "s6"; - s3_len = 2; - break; - } - case 0x00:{ - s3 = "zero"; - s3_len = 4; - break; - } - case 0x0A:{ - s3 = "a0"; - s3_len = 2; - break; - } - case 0x1A:{ - s3 = "s10"; - s3_len = 3; - break; - } - case 0x17:{ - s3 = "s7"; - s3_len = 2; - break; - } - case 0x0C:{ - s3 = "a2"; - s3_len = 2; - break; - } - case 0x18:{ - s3 = "s8"; - s3_len = 2; - break; - } - case 0x02:{ - s3 = "sp"; - s3_len = 2; - break; - } - case 0x1F:{ - s3 = "t6"; - s3_len = 2; - break; - } - case 0x0B:{ - s3 = "a1"; - s3_len = 2; - break; - } - case 0x07:{ - s3 = "t2"; - s3_len = 2; - break; - } - case 0x13:{ - s3 = "s3"; - s3_len = 2; - break; - } - case 0x04:{ - s3 = "tp"; - s3_len = 2; - break; - } - case 0x19:{ - s3 = "s9"; - s3_len = 2; - break; - } - case 0x12:{ - s3 = "s2"; - s3_len = 2; - break; - } - case 0x14:{ - s3 = "s4"; - s3_len = 2; - break; - } - case 0x0E:{ - s3 = "a4"; - s3_len = 2; - break; - } - case 0x1E:{ - s3 = "t5"; - s3_len = 2; - break; - } - case 0x11:{ - s3 = "a7"; - s3_len = 2; - break; - } - case 0x03:{ - s3 = "gp"; - s3_len = 2; - break; - } - case 0x05:{ - s3 = "t0"; - s3_len = 2; - break; - } - case 0x1D:{ - s3 = "t4"; - s3_len = 2; - break; - } - case 0x0D:{ - s3 = "a3"; - s3_len = 2; - break; - } - case 0x0F:{ - s3 = "a5"; - s3_len = 2; - break; - } - } - s4 = "."; - s4_len = 1; - hex_bits_12(tree->ast_node.fencei_reserved.imm, &s5, &s5_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - } - } - break; - case RISCV_LOAD_FP: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - char *s9; size_t s9_len; - char *s10; size_t s10_len; - char *s11; size_t s11_len; - s0 = "fl"; - s0_len = 2; - switch (tree->ast_node.load_fp.width) { - case RISCV_BYTE:{ - s1 = "b"; - s1_len = 1; - break; - } - case RISCV_WORD:{ - s1 = "w"; - s1_len = 1; - break; - } - case RISCV_DOUBLE:{ - s1 = "d"; - s1_len = 1; - break; - } - case RISCV_HALF:{ - s1 = "h"; - s1_len = 1; - break; - } - } - spc( &s2, &s2_len); - freg_or_reg_name(tree->ast_node.load_fp.rd, &s3, &s3_len); - sep( &s4, &s4_len); - hex_bits_signed_12(tree->ast_node.load_fp.imm, &s5, &s5_len); - opt_spc( &s6, &s6_len); - s7 = "("; - s7_len = 1; - opt_spc( &s8, &s8_len); - switch (tree->ast_node.load_fp.rs1) { - case 0x08:{ - s9 = "fp"; - s9_len = 2; - break; - } - case 0x15:{ - s9 = "s5"; - s9_len = 2; - break; - } - case 0x01:{ - s9 = "ra"; - s9_len = 2; - break; - } - case 0x06:{ - s9 = "t1"; - s9_len = 2; - break; - } - case 0x09:{ - s9 = "s1"; - s9_len = 2; - break; - } - case 0x10:{ - s9 = "a6"; - s9_len = 2; - break; - } - case 0x1B:{ - s9 = "s11"; - s9_len = 3; - break; - } - case 0x1C:{ - s9 = "t3"; - s9_len = 2; - break; - } - case 0x16:{ - s9 = "s6"; - s9_len = 2; - break; - } - case 0x00:{ - s9 = "zero"; - s9_len = 4; - break; - } - case 0x0A:{ - s9 = "a0"; - s9_len = 2; - break; - } - case 0x1A:{ - s9 = "s10"; - s9_len = 3; - break; - } - case 0x17:{ - s9 = "s7"; - s9_len = 2; - break; - } - case 0x0C:{ - s9 = "a2"; - s9_len = 2; - break; - } - case 0x18:{ - s9 = "s8"; - s9_len = 2; - break; - } - case 0x02:{ - s9 = "sp"; - s9_len = 2; - break; - } - case 0x1F:{ - s9 = "t6"; - s9_len = 2; - break; - } - case 0x0B:{ - s9 = "a1"; - s9_len = 2; - break; - } - case 0x07:{ - s9 = "t2"; - s9_len = 2; - break; - } - case 0x13:{ - s9 = "s3"; - s9_len = 2; - break; - } - case 0x04:{ - s9 = "tp"; - s9_len = 2; - break; - } - case 0x19:{ - s9 = "s9"; - s9_len = 2; - break; - } - case 0x12:{ - s9 = "s2"; - s9_len = 2; - break; - } - case 0x14:{ - s9 = "s4"; - s9_len = 2; - break; - } - case 0x0E:{ - s9 = "a4"; - s9_len = 2; - break; - } - case 0x1E:{ - s9 = "t5"; - s9_len = 2; - break; - } - case 0x11:{ - s9 = "a7"; - s9_len = 2; - break; - } - case 0x03:{ - s9 = "gp"; - s9_len = 2; - break; - } - case 0x05:{ - s9 = "t0"; - s9_len = 2; - break; - } - case 0x1D:{ - s9 = "t4"; - s9_len = 2; - break; - } - case 0x0D:{ - s9 = "a3"; - s9_len = 2; - break; - } - case 0x0F:{ - s9 = "a5"; - s9_len = 2; - break; - } - } - opt_spc( &s10, &s10_len); - s11 = ")"; - s11_len = 1; - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len + s8_len, s9, s9_len); - 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); - 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); - } - } - break; - case RISCV_STORE_FP: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - char *s9; size_t s9_len; - char *s10; size_t s10_len; - char *s11; size_t s11_len; - s0 = "fs"; - s0_len = 2; - switch (tree->ast_node.store_fp.width) { - case RISCV_BYTE:{ - s1 = "b"; - s1_len = 1; - break; - } - case RISCV_WORD:{ - s1 = "w"; - s1_len = 1; - break; - } - case RISCV_DOUBLE:{ - s1 = "d"; - s1_len = 1; - break; - } - case RISCV_HALF:{ - s1 = "h"; - s1_len = 1; - break; - } - } - spc( &s2, &s2_len); - switch (tree->ast_node.store_fp.rs2) { - case 0x08:{ - s3 = "fs0"; - s3_len = 3; - break; - } - case 0x15:{ - s3 = "fs5"; - s3_len = 3; - break; - } - case 0x01:{ - s3 = "ft1"; - s3_len = 3; - break; - } - case 0x06:{ - s3 = "ft6"; - s3_len = 3; - break; - } - case 0x09:{ - s3 = "fs1"; - s3_len = 3; - break; - } - case 0x10:{ - s3 = "fa6"; - s3_len = 3; - break; - } - case 0x1B:{ - s3 = "fs11"; - s3_len = 4; - break; - } - case 0x1C:{ - s3 = "ft8"; - s3_len = 3; - break; - } - case 0x16:{ - s3 = "fs6"; - s3_len = 3; - break; - } - case 0x00:{ - s3 = "ft0"; - s3_len = 3; - break; - } - case 0x0A:{ - s3 = "fa0"; - s3_len = 3; - break; - } - case 0x1A:{ - s3 = "fs10"; - s3_len = 4; - break; - } - case 0x17:{ - s3 = "fs7"; - s3_len = 3; - break; - } - case 0x0C:{ - s3 = "fa2"; - s3_len = 3; - break; - } - case 0x18:{ - s3 = "fs8"; - s3_len = 3; - break; - } - case 0x02:{ - s3 = "ft2"; - s3_len = 3; - break; - } - case 0x1F:{ - s3 = "ft11"; - s3_len = 4; - break; - } - case 0x0B:{ - s3 = "fa1"; - s3_len = 3; - break; - } - case 0x07:{ - s3 = "ft7"; - s3_len = 3; - break; - } - case 0x13:{ - s3 = "fs3"; - s3_len = 3; - break; - } - case 0x04:{ - s3 = "ft4"; - s3_len = 3; - break; - } - case 0x19:{ - s3 = "fs9"; - s3_len = 3; - break; - } - case 0x12:{ - s3 = "fs2"; - s3_len = 3; - break; - } - case 0x14:{ - s3 = "fs4"; - s3_len = 3; - break; - } - case 0x0E:{ - s3 = "fa4"; - s3_len = 3; - break; - } - case 0x1E:{ - s3 = "ft10"; - s3_len = 4; - break; - } - case 0x11:{ - s3 = "fa7"; - s3_len = 3; - break; - } - case 0x03:{ - s3 = "ft3"; - s3_len = 3; - break; - } - case 0x05:{ - s3 = "ft5"; - s3_len = 3; - break; - } - case 0x1D:{ - s3 = "ft9"; - s3_len = 3; - break; - } - case 0x0D:{ - s3 = "fa3"; - s3_len = 3; - break; - } - case 0x0F:{ - s3 = "fa5"; - s3_len = 3; - break; - } - } - sep( &s4, &s4_len); - hex_bits_signed_12(tree->ast_node.store_fp.imm, &s5, &s5_len); - opt_spc( &s6, &s6_len); - s7 = "("; - s7_len = 1; - opt_spc( &s8, &s8_len); - switch (tree->ast_node.store_fp.rs1) { - case 0x08:{ - s9 = "fp"; - s9_len = 2; - break; - } - case 0x15:{ - s9 = "s5"; - s9_len = 2; - break; - } - case 0x01:{ - s9 = "ra"; - s9_len = 2; - break; - } - case 0x06:{ - s9 = "t1"; - s9_len = 2; - break; - } - case 0x09:{ - s9 = "s1"; - s9_len = 2; - break; - } - case 0x10:{ - s9 = "a6"; - s9_len = 2; - break; - } - case 0x1B:{ - s9 = "s11"; - s9_len = 3; - break; - } - case 0x1C:{ - s9 = "t3"; - s9_len = 2; - break; - } - case 0x16:{ - s9 = "s6"; - s9_len = 2; - break; - } - case 0x00:{ - s9 = "zero"; - s9_len = 4; - break; - } - case 0x0A:{ - s9 = "a0"; - s9_len = 2; - break; - } - case 0x1A:{ - s9 = "s10"; - s9_len = 3; - break; - } - case 0x17:{ - s9 = "s7"; - s9_len = 2; - break; - } - case 0x0C:{ - s9 = "a2"; - s9_len = 2; - break; - } - case 0x18:{ - s9 = "s8"; - s9_len = 2; - break; - } - case 0x02:{ - s9 = "sp"; - s9_len = 2; - break; - } - case 0x1F:{ - s9 = "t6"; - s9_len = 2; - break; - } - case 0x0B:{ - s9 = "a1"; - s9_len = 2; - break; - } - case 0x07:{ - s9 = "t2"; - s9_len = 2; - break; - } - case 0x13:{ - s9 = "s3"; - s9_len = 2; - break; - } - case 0x04:{ - s9 = "tp"; - s9_len = 2; - break; - } - case 0x19:{ - s9 = "s9"; - s9_len = 2; - break; - } - case 0x12:{ - s9 = "s2"; - s9_len = 2; - break; - } - case 0x14:{ - s9 = "s4"; - s9_len = 2; - break; - } - case 0x0E:{ - s9 = "a4"; - s9_len = 2; - break; - } - case 0x1E:{ - s9 = "t5"; - s9_len = 2; - break; - } - case 0x11:{ - s9 = "a7"; - s9_len = 2; - break; - } - case 0x03:{ - s9 = "gp"; - s9_len = 2; - break; - } - case 0x05:{ - s9 = "t0"; - s9_len = 2; - break; - } - case 0x1D:{ - s9 = "t4"; - s9_len = 2; - break; - } - case 0x0D:{ - s9 = "a3"; - s9_len = 2; - break; - } - case 0x0F:{ - s9 = "a5"; - s9_len = 2; - break; - } - } - opt_spc( &s10, &s10_len); - s11 = ")"; - s11_len = 1; - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len + s8_len, s9, s9_len); - 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); - 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); - } - } - break; - case RISCV_F_MADD_TYPE_S: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - char *s9; size_t s9_len; - char *s10; size_t s10_len; - switch (tree->ast_node.f_madd_type_s.op) { - case RISCV_FMADD_S:{ - s0 = "fmadd.s"; - s0_len = 7; - break; - } - case RISCV_FNMADD_S:{ - s0 = "fnmadd.s"; - s0_len = 8; - break; - } - case RISCV_FNMSUB_S:{ - s0 = "fnmsub.s"; - s0_len = 8; - break; - } - case RISCV_FMSUB_S:{ - s0 = "fmsub.s"; - s0_len = 7; - break; - } - } - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_madd_type_s.rd, &s2, &s2_len); - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_madd_type_s.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - freg_or_reg_name(tree->ast_node.f_madd_type_s.rs2, &s6, &s6_len); - sep( &s7, &s7_len); - freg_or_reg_name(tree->ast_node.f_madd_type_s.rs3, &s8, &s8_len); - sep( &s9, &s9_len); - switch (tree->ast_node.f_madd_type_s.rm) { - case RISCV_RM_RNE:{ - s10 = "rne"; - s10_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s10 = "rtz"; - s10_len = 3; - break; - } - case RISCV_RM_RDN:{ - s10 = "rdn"; - s10_len = 3; - break; - } - case RISCV_RM_RMM:{ - s10 = "rmm"; - s10_len = 3; - break; - } - case RISCV_RM_RUP:{ - s10 = "rup"; - s10_len = 3; - break; - } - case RISCV_RM_DYN:{ - s10 = "dyn"; - s10_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len + s8_len, s9, s9_len); - 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); - } - } - break; - case RISCV_F_BIN_RM_TYPE_S: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - switch (tree->ast_node.f_bin_rm_type_s.op) { - case RISCV_FDIV_S:{ - s0 = "fdiv.s"; - s0_len = 6; - break; - } - case RISCV_FADD_S:{ - s0 = "fadd.s"; - s0_len = 6; - break; - } - case RISCV_FMUL_S:{ - s0 = "fmul.s"; - s0_len = 6; - break; - } - case RISCV_FSUB_S:{ - s0 = "fsub.s"; - s0_len = 6; - break; - } - } - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_bin_rm_type_s.rd, &s2, &s2_len); - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_bin_rm_type_s.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - freg_or_reg_name(tree->ast_node.f_bin_rm_type_s.rs2, &s6, &s6_len); - sep( &s7, &s7_len); - switch (tree->ast_node.f_bin_rm_type_s.rm) { - case RISCV_RM_RNE:{ - s8 = "rne"; - s8_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s8 = "rtz"; - s8_len = 3; - break; - } - case RISCV_RM_RDN:{ - s8 = "rdn"; - s8_len = 3; - break; - } - case RISCV_RM_RMM:{ - s8 = "rmm"; - s8_len = 3; - break; - } - case RISCV_RM_RUP:{ - s8 = "rup"; - s8_len = 3; - break; - } - case RISCV_RM_DYN:{ - s8 = "dyn"; - s8_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - } - } - 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; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fsqrt.s"; - s0_len = 7; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_s.rd, &s2, &s2_len); - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_s.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_s.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_un_rm_type_s.fcvt_s_lu == RISCV_FCVT_W_S) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fcvt.w.s"; - s0_len = 8; - spc( &s1, &s1_len); - switch (tree->ast_node.f_un_rm_type_s.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_s.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_s.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_un_rm_type_s.fcvt_s_lu == RISCV_FCVT_WU_S) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fcvt.wu.s"; - s0_len = 9; - spc( &s1, &s1_len); - switch (tree->ast_node.f_un_rm_type_s.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_s.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_s.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_un_rm_type_s.fcvt_s_lu == RISCV_FCVT_S_W) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fcvt.s.w"; - s0_len = 8; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_s.rd, &s2, &s2_len); - sep( &s3, &s3_len); - switch (tree->ast_node.f_un_rm_type_s.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_s.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_un_rm_type_s.fcvt_s_lu == RISCV_FCVT_S_WU) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fcvt.s.wu"; - s0_len = 9; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_s.rd, &s2, &s2_len); - sep( &s3, &s3_len); - switch (tree->ast_node.f_un_rm_type_s.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_s.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_un_rm_type_s.fcvt_s_lu == RISCV_FCVT_L_S) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fcvt.l.s"; - s0_len = 8; - spc( &s1, &s1_len); - switch (tree->ast_node.f_un_rm_type_s.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_s.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_s.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_un_rm_type_s.fcvt_s_lu == RISCV_FCVT_LU_S) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fcvt.lu.s"; - s0_len = 9; - spc( &s1, &s1_len); - switch (tree->ast_node.f_un_rm_type_s.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_s.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_s.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_un_rm_type_s.fcvt_s_lu == RISCV_FCVT_S_L) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fcvt.s.l"; - s0_len = 8; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_s.rd, &s2, &s2_len); - sep( &s3, &s3_len); - switch (tree->ast_node.f_un_rm_type_s.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_s.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_un_rm_type_s.fcvt_s_lu == RISCV_FCVT_S_LU) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fcvt.s.lu"; - s0_len = 9; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_s.rd, &s2, &s2_len); - sep( &s3, &s3_len); - switch (tree->ast_node.f_un_rm_type_s.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_s.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - 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; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fsgnj.s"; - s0_len = 7; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rd, &s2, &s2_len); - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs2, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_bin_type_s.fle_s == RISCV_FSGNJN_S) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fsgnjn.s"; - s0_len = 8; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rd, &s2, &s2_len); - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs2, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_bin_type_s.fle_s == RISCV_FSGNJX_S) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fsgnjx.s"; - s0_len = 8; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rd, &s2, &s2_len); - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs2, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_bin_type_s.fle_s == RISCV_FMIN_S) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fmin.s"; - s0_len = 6; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rd, &s2, &s2_len); - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs2, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_bin_type_s.fle_s == RISCV_FMAX_S) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fmax.s"; - s0_len = 6; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rd, &s2, &s2_len); - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs2, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_bin_type_s.fle_s == RISCV_FEQ_S) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "feq.s"; - s0_len = 5; - spc( &s1, &s1_len); - switch (tree->ast_node.f_bin_type_s.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs2, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_bin_type_s.fle_s == RISCV_FLT_S) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "flt.s"; - s0_len = 5; - spc( &s1, &s1_len); - switch (tree->ast_node.f_bin_type_s.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs2, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_bin_type_s.fle_s == RISCV_FLE_S) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fle.s"; - s0_len = 5; - spc( &s1, &s1_len); - switch (tree->ast_node.f_bin_type_s.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - freg_or_reg_name(tree->ast_node.f_bin_type_s.rs2, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - 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; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "fmv.x.w"; - s0_len = 7; - spc( &s1, &s1_len); - switch (tree->ast_node.f_un_type_s.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.f_un_type_s.rs1) { - case 0x08:{ - s4 = "fs0"; - s4_len = 3; - break; - } - case 0x15:{ - s4 = "fs5"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "ft1"; - s4_len = 3; - break; - } - case 0x06:{ - s4 = "ft6"; - s4_len = 3; - break; - } - case 0x09:{ - s4 = "fs1"; - s4_len = 3; - break; - } - case 0x10:{ - s4 = "fa6"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "fs11"; - s4_len = 4; - break; - } - case 0x1C:{ - s4 = "ft8"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "fs6"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "ft0"; - s4_len = 3; - break; - } - case 0x0A:{ - s4 = "fa0"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "fs10"; - s4_len = 4; - break; - } - case 0x17:{ - s4 = "fs7"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "fa2"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "fs8"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "ft2"; - s4_len = 3; - break; - } - case 0x1F:{ - s4 = "ft11"; - s4_len = 4; - break; - } - case 0x0B:{ - s4 = "fa1"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "ft7"; - s4_len = 3; - break; - } - case 0x13:{ - s4 = "fs3"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "ft4"; - s4_len = 3; - break; - } - case 0x19:{ - s4 = "fs9"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "fs2"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "fs4"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "fa4"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "ft10"; - s4_len = 4; - break; - } - case 0x11:{ - s4 = "fa7"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "ft3"; - s4_len = 3; - break; - } - case 0x05:{ - s4 = "ft5"; - s4_len = 3; - break; - } - case 0x1D:{ - s4 = "ft9"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "fa3"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "fa5"; - s4_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - if (tree->ast_node.f_un_type_s.fmv_w_x == RISCV_FMV_W_X) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "fmv.w.x"; - s0_len = 7; - spc( &s1, &s1_len); - switch (tree->ast_node.f_un_type_s.rd) { - case 0x08:{ - s2 = "fs0"; - s2_len = 3; - break; - } - case 0x15:{ - s2 = "fs5"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "ft1"; - s2_len = 3; - break; - } - case 0x06:{ - s2 = "ft6"; - s2_len = 3; - break; - } - case 0x09:{ - s2 = "fs1"; - s2_len = 3; - break; - } - case 0x10:{ - s2 = "fa6"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "fs11"; - s2_len = 4; - break; - } - case 0x1C:{ - s2 = "ft8"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "fs6"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "ft0"; - s2_len = 3; - break; - } - case 0x0A:{ - s2 = "fa0"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "fs10"; - s2_len = 4; - break; - } - case 0x17:{ - s2 = "fs7"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "fa2"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "fs8"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "ft2"; - s2_len = 3; - break; - } - case 0x1F:{ - s2 = "ft11"; - s2_len = 4; - break; - } - case 0x0B:{ - s2 = "fa1"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "ft7"; - s2_len = 3; - break; - } - case 0x13:{ - s2 = "fs3"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "ft4"; - s2_len = 3; - break; - } - case 0x19:{ - s2 = "fs9"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "fs2"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "fs4"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "fa4"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "ft10"; - s2_len = 4; - break; - } - case 0x11:{ - s2 = "fa7"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "ft3"; - s2_len = 3; - break; - } - case 0x05:{ - s2 = "ft5"; - s2_len = 3; - break; - } - case 0x1D:{ - s2 = "ft9"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "fa3"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "fa5"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.f_un_type_s.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - if (tree->ast_node.f_un_type_s.fmv_w_x == RISCV_FCLASS_S) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "fclass.s"; - s0_len = 8; - spc( &s1, &s1_len); - switch (tree->ast_node.f_un_type_s.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_un_type_s.rs1, &s4, &s4_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_C_FLWSP: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "c.flwsp"; - s0_len = 7; - spc( &s1, &s1_len); - switch (tree->ast_node.c_flwsp.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - hex_bits_6(tree->ast_node.c_flwsp.imm, &s4, &s4_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_C_FSWSP: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "c.fswsp"; - s0_len = 7; - spc( &s1, &s1_len); - switch (tree->ast_node.c_fswsp.rs2) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - hex_bits_6(tree->ast_node.c_fswsp.uimm, &s4, &s4_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_C_FLW: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "c.flw"; - s0_len = 5; - spc( &s1, &s1_len); - switch (tree->ast_node.c_flw.rdc) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.c_flw.rsc) { - case 0x7:{ - s4 = "a5"; - s4_len = 2; - break; - } - case 0x5:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x1:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x3:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x2:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x4:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x6:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x0:{ - s4 = "s0"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - hex_bits_7(tree->ast_node.c_flw.uimm << 2 | 0x0 << 0, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_C_FSW: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "c.fsw"; - s0_len = 5; - spc( &s1, &s1_len); - switch (tree->ast_node.c_fsw.rsc1) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.c_fsw.rsc2) { - case 0x7:{ - s4 = "a5"; - s4_len = 2; - break; - } - case 0x5:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x1:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x3:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x2:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x4:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x6:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x0:{ - s4 = "s0"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - hex_bits_7(tree->ast_node.c_fsw.uimm << 2 | 0x0 << 0, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_F_MADD_TYPE_D: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - char *s9; size_t s9_len; - char *s10; size_t s10_len; - switch (tree->ast_node.f_madd_type_d.op) { - case RISCV_FMSUB_D:{ - s0 = "fmsub.d"; - s0_len = 7; - break; - } - case RISCV_FNMSUB_D:{ - s0 = "fnmsub.d"; - s0_len = 8; - break; - } - case RISCV_FNMADD_D:{ - s0 = "fnmadd.d"; - s0_len = 8; - break; - } - case RISCV_FMADD_D:{ - s0 = "fmadd.d"; - s0_len = 7; - break; - } - } - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_madd_type_d.rd, &s2, &s2_len); - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_madd_type_d.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - freg_or_reg_name(tree->ast_node.f_madd_type_d.rs2, &s6, &s6_len); - sep( &s7, &s7_len); - freg_or_reg_name(tree->ast_node.f_madd_type_d.rs3, &s8, &s8_len); - sep( &s9, &s9_len); - switch (tree->ast_node.f_madd_type_d.rm) { - case RISCV_RM_RNE:{ - s10 = "rne"; - s10_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s10 = "rtz"; - s10_len = 3; - break; - } - case RISCV_RM_RDN:{ - s10 = "rdn"; - s10_len = 3; - break; - } - case RISCV_RM_RMM:{ - s10 = "rmm"; - s10_len = 3; - break; - } - case RISCV_RM_RUP:{ - s10 = "rup"; - s10_len = 3; - break; - } - case RISCV_RM_DYN:{ - s10 = "dyn"; - s10_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len + s8_len, s9, s9_len); - 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); - } - } - break; - case RISCV_F_BIN_RM_TYPE_D: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - switch (tree->ast_node.f_bin_rm_type_d.op) { - case RISCV_FMUL_D:{ - s0 = "fmul.d"; - s0_len = 6; - break; - } - case RISCV_FADD_D:{ - s0 = "fadd.d"; - s0_len = 6; - break; - } - case RISCV_FSUB_D:{ - s0 = "fsub.d"; - s0_len = 6; - break; - } - case RISCV_FDIV_D:{ - s0 = "fdiv.d"; - s0_len = 6; - break; - } - } - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_bin_rm_type_d.rd, &s2, &s2_len); - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_bin_rm_type_d.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - freg_or_reg_name(tree->ast_node.f_bin_rm_type_d.rs2, &s6, &s6_len); - sep( &s7, &s7_len); - switch (tree->ast_node.f_bin_rm_type_d.rm) { - case RISCV_RM_RNE:{ - s8 = "rne"; - s8_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s8 = "rtz"; - s8_len = 3; - break; - } - case RISCV_RM_RDN:{ - s8 = "rdn"; - s8_len = 3; - break; - } - case RISCV_RM_RMM:{ - s8 = "rmm"; - s8_len = 3; - break; - } - case RISCV_RM_RUP:{ - s8 = "rup"; - s8_len = 3; - break; - } - case RISCV_RM_DYN:{ - s8 = "dyn"; - s8_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - } - } - 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; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fsqrt.d"; - s0_len = 7; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rd, &s2, &s2_len); - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_d.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FCVT_W_D) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fcvt.w.d"; - s0_len = 8; - spc( &s1, &s1_len); - switch (tree->ast_node.f_un_rm_type_d.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_d.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FCVT_WU_D) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fcvt.wu.d"; - s0_len = 9; - spc( &s1, &s1_len); - switch (tree->ast_node.f_un_rm_type_d.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_d.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FCVT_D_W) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fcvt.d.w"; - s0_len = 8; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rd, &s2, &s2_len); - sep( &s3, &s3_len); - switch (tree->ast_node.f_un_rm_type_d.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_d.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FCVT_D_WU) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fcvt.d.wu"; - s0_len = 9; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rd, &s2, &s2_len); - sep( &s3, &s3_len); - switch (tree->ast_node.f_un_rm_type_d.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_d.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FCVT_L_D) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fcvt.l.d"; - s0_len = 8; - spc( &s1, &s1_len); - switch (tree->ast_node.f_un_rm_type_d.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_d.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FCVT_LU_D) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fcvt.lu.d"; - s0_len = 9; - spc( &s1, &s1_len); - switch (tree->ast_node.f_un_rm_type_d.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_d.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FCVT_D_L) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fcvt.d.l"; - s0_len = 8; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rd, &s2, &s2_len); - sep( &s3, &s3_len); - switch (tree->ast_node.f_un_rm_type_d.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_d.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FCVT_D_LU) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fcvt.d.lu"; - s0_len = 9; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rd, &s2, &s2_len); - sep( &s3, &s3_len); - switch (tree->ast_node.f_un_rm_type_d.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_d.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FCVT_S_D) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fcvt.s.d"; - s0_len = 8; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rd, &s2, &s2_len); - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_d.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_un_rm_type_d.fcvt_d_lu == RISCV_FCVT_D_S) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fcvt.d.s"; - s0_len = 8; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rd, &s2, &s2_len); - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_d.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_d.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - 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; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fsgnj.d"; - s0_len = 7; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rd, &s2, &s2_len); - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs2, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_bin_type_d.fle_d == RISCV_FSGNJN_D) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fsgnjn.d"; - s0_len = 8; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rd, &s2, &s2_len); - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs2, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_bin_type_d.fle_d == RISCV_FSGNJX_D) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fsgnjx.d"; - s0_len = 8; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rd, &s2, &s2_len); - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs2, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_bin_type_d.fle_d == RISCV_FMIN_D) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fmin.d"; - s0_len = 6; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rd, &s2, &s2_len); - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs2, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_bin_type_d.fle_d == RISCV_FMAX_D) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fmax.d"; - s0_len = 6; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rd, &s2, &s2_len); - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs2, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_bin_type_d.fle_d == RISCV_FEQ_D) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "feq.d"; - s0_len = 5; - spc( &s1, &s1_len); - switch (tree->ast_node.f_bin_type_d.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs2, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_bin_type_d.fle_d == RISCV_FLT_D) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "flt.d"; - s0_len = 5; - spc( &s1, &s1_len); - switch (tree->ast_node.f_bin_type_d.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs2, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_bin_type_d.fle_d == RISCV_FLE_D) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fle.d"; - s0_len = 5; - spc( &s1, &s1_len); - switch (tree->ast_node.f_bin_type_d.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - freg_or_reg_name(tree->ast_node.f_bin_type_d.rs2, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - 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; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "fmv.x.d"; - s0_len = 7; - spc( &s1, &s1_len); - switch (tree->ast_node.f_un_type_d.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.f_un_type_d.rs1) { - case 0x08:{ - s4 = "fs0"; - s4_len = 3; - break; - } - case 0x15:{ - s4 = "fs5"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "ft1"; - s4_len = 3; - break; - } - case 0x06:{ - s4 = "ft6"; - s4_len = 3; - break; - } - case 0x09:{ - s4 = "fs1"; - s4_len = 3; - break; - } - case 0x10:{ - s4 = "fa6"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "fs11"; - s4_len = 4; - break; - } - case 0x1C:{ - s4 = "ft8"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "fs6"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "ft0"; - s4_len = 3; - break; - } - case 0x0A:{ - s4 = "fa0"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "fs10"; - s4_len = 4; - break; - } - case 0x17:{ - s4 = "fs7"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "fa2"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "fs8"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "ft2"; - s4_len = 3; - break; - } - case 0x1F:{ - s4 = "ft11"; - s4_len = 4; - break; - } - case 0x0B:{ - s4 = "fa1"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "ft7"; - s4_len = 3; - break; - } - case 0x13:{ - s4 = "fs3"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "ft4"; - s4_len = 3; - break; - } - case 0x19:{ - s4 = "fs9"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "fs2"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "fs4"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "fa4"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "ft10"; - s4_len = 4; - break; - } - case 0x11:{ - s4 = "fa7"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "ft3"; - s4_len = 3; - break; - } - case 0x05:{ - s4 = "ft5"; - s4_len = 3; - break; - } - case 0x1D:{ - s4 = "ft9"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "fa3"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "fa5"; - s4_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - if (tree->ast_node.f_un_type_d.fmv_d_x == RISCV_FMV_D_X) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "fmv.d.x"; - s0_len = 7; - spc( &s1, &s1_len); - switch (tree->ast_node.f_un_type_d.rd) { - case 0x08:{ - s2 = "fs0"; - s2_len = 3; - break; - } - case 0x15:{ - s2 = "fs5"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "ft1"; - s2_len = 3; - break; - } - case 0x06:{ - s2 = "ft6"; - s2_len = 3; - break; - } - case 0x09:{ - s2 = "fs1"; - s2_len = 3; - break; - } - case 0x10:{ - s2 = "fa6"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "fs11"; - s2_len = 4; - break; - } - case 0x1C:{ - s2 = "ft8"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "fs6"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "ft0"; - s2_len = 3; - break; - } - case 0x0A:{ - s2 = "fa0"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "fs10"; - s2_len = 4; - break; - } - case 0x17:{ - s2 = "fs7"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "fa2"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "fs8"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "ft2"; - s2_len = 3; - break; - } - case 0x1F:{ - s2 = "ft11"; - s2_len = 4; - break; - } - case 0x0B:{ - s2 = "fa1"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "ft7"; - s2_len = 3; - break; - } - case 0x13:{ - s2 = "fs3"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "ft4"; - s2_len = 3; - break; - } - case 0x19:{ - s2 = "fs9"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "fs2"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "fs4"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "fa4"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "ft10"; - s2_len = 4; - break; - } - case 0x11:{ - s2 = "fa7"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "ft3"; - s2_len = 3; - break; - } - case 0x05:{ - s2 = "ft5"; - s2_len = 3; - break; - } - case 0x1D:{ - s2 = "ft9"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "fa3"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "fa5"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.f_un_type_d.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - if (tree->ast_node.f_un_type_d.fmv_d_x == RISCV_FCLASS_D) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "fclass.d"; - s0_len = 8; - spc( &s1, &s1_len); - switch (tree->ast_node.f_un_type_d.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_un_type_d.rs1, &s4, &s4_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_C_FLDSP: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "c.fldsp"; - s0_len = 7; - spc( &s1, &s1_len); - switch (tree->ast_node.c_fldsp.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - hex_bits_6(tree->ast_node.c_fldsp.uimm, &s4, &s4_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_C_FSDSP: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "c.fsdsp"; - s0_len = 7; - spc( &s1, &s1_len); - switch (tree->ast_node.c_fsdsp.rs2) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - hex_bits_6(tree->ast_node.c_fsdsp.uimm, &s4, &s4_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_C_FLD: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "c.fld"; - s0_len = 5; - spc( &s1, &s1_len); - switch (tree->ast_node.c_fld.rdc) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.c_fld.rsc) { - case 0x7:{ - s4 = "a5"; - s4_len = 2; - break; - } - case 0x5:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x1:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x3:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x2:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x4:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x6:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x0:{ - s4 = "s0"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - hex_bits_8(tree->ast_node.c_fld.uimm << 3 | 0x0 << 0, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_C_FSD: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "c.fsd"; - s0_len = 5; - spc( &s1, &s1_len); - switch (tree->ast_node.c_fsd.rsc1) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.c_fsd.rsc2) { - case 0x7:{ - s4 = "a5"; - s4_len = 2; - break; - } - case 0x5:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x1:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x3:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x2:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x4:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x6:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x0:{ - s4 = "s0"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - hex_bits_8(tree->ast_node.c_fsd.uimm << 3 | 0x0 << 0, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_SINVAL_VMA: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "sinval.vma"; - s0_len = 10; - spc( &s1, &s1_len); - switch (tree->ast_node.sinval_vma.rs1) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.sinval_vma.rs2) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_SFENCE_W_INVAL: { -{ - char *s0; size_t s0_len; - s0 = "sfence.w.inval"; - s0_len = 14; - memcpy(buff , s0, s0_len); - } - } - break; - case RISCV_SFENCE_INVAL_IR: { -{ - char *s0; size_t s0_len; - s0 = "sfence.inval.ir"; - s0_len = 15; - memcpy(buff , s0, s0_len); - } - } - break; - case RISCV_SLLIUW: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "slli.uw"; - s0_len = 7; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_slliuw.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_slliuw.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - hex_bits_6(tree->ast_node.riscv_slliuw.shamt, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_ZBA_RTYPEUW: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - switch (tree->ast_node.zba_rtypeuw.op) { - case RISCV_SH1ADDUW:{ - s0 = "sh1add.uw"; - s0_len = 9; - break; - } - case RISCV_SH2ADDUW:{ - s0 = "sh2add.uw"; - s0_len = 9; - break; - } - case RISCV_ADDUW:{ - s0 = "add.uw"; - s0_len = 6; - break; - } - case RISCV_SH3ADDUW:{ - s0 = "sh3add.uw"; - s0_len = 9; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.zba_rtypeuw.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.zba_rtypeuw.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.zba_rtypeuw.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_ZBA_RTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - switch (tree->ast_node.zba_rtype.op) { - case RISCV_SH3ADD:{ - s0 = "sh3add"; - s0_len = 6; - break; - } - case RISCV_SH2ADD:{ - s0 = "sh2add"; - s0_len = 6; - break; - } - case RISCV_SH1ADD:{ - s0 = "sh1add"; - s0_len = 6; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.zba_rtype.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.zba_rtype.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.zba_rtype.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_RORIW: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "roriw"; - s0_len = 5; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_roriw.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_roriw.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - hex_bits_5(tree->ast_node.riscv_roriw.shamt, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_RORI: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "rori"; - s0_len = 4; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_rori.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_rori.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - hex_bits_6(tree->ast_node.riscv_rori.shamt, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_ZBB_RTYPEW: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - switch (tree->ast_node.zbb_rtypew.op) { - case RISCV_RORW:{ - s0 = "rorw"; - s0_len = 4; - break; - } - case RISCV_ROLW:{ - s0 = "rolw"; - s0_len = 4; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.zbb_rtypew.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.zbb_rtypew.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.zbb_rtypew.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_ZBB_RTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - switch (tree->ast_node.zbb_rtype.op) { - case RISCV_ROR:{ - s0 = "ror"; - s0_len = 3; - break; - } - case RISCV_MAXU:{ - s0 = "maxu"; - s0_len = 4; - break; - } - case RISCV_MIN:{ - s0 = "min"; - s0_len = 3; - break; - } - case RISCV_MAX:{ - s0 = "max"; - s0_len = 3; - break; - } - case RISCV_ANDN:{ - s0 = "andn"; - s0_len = 4; - break; - } - case RISCV_ORN:{ - s0 = "orn"; - s0_len = 3; - break; - } - case RISCV_XNOR:{ - s0 = "xnor"; - s0_len = 4; - break; - } - case RISCV_MINU:{ - s0 = "minu"; - s0_len = 4; - break; - } - case RISCV_ROL:{ - s0 = "rol"; - s0_len = 3; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.zbb_rtype.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.zbb_rtype.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.zbb_rtype.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_ZBB_EXTOP: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - switch (tree->ast_node.zbb_extop.op) { - case RISCV_SEXTH:{ - s0 = "sext.h"; - s0_len = 6; - break; - } - case RISCV_ZEXTH:{ - s0 = "zext.h"; - s0_len = 6; - break; - } - case RISCV_SEXTB:{ - s0 = "sext.b"; - s0_len = 6; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.zbb_extop.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.zbb_extop.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_REV8: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "rev8"; - s0_len = 4; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_rev8.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_rev8.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_ORCB: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "orc.b"; - s0_len = 5; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_orcb.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_orcb.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_CPOP: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "cpop"; - s0_len = 4; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_cpop.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_cpop.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_CPOPW: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "cpopw"; - s0_len = 5; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_cpopw.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_cpopw.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_CLZ: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "clz"; - s0_len = 3; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_clz.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_clz.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_CLZW: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "clzw"; - s0_len = 4; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_clzw.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_clzw.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_CTZ: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "ctz"; - s0_len = 3; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_ctz.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_ctz.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_CTZW: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "ctzw"; - s0_len = 4; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_ctzw.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_ctzw.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_CLMUL: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "clmul"; - s0_len = 5; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_clmul.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_clmul.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.riscv_clmul.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_CLMULH: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "clmulh"; - s0_len = 6; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_clmulh.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_clmulh.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.riscv_clmulh.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_CLMULR: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "clmulr"; - s0_len = 6; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_clmulr.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_clmulr.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.riscv_clmulr.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_ZBS_IOP: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - switch (tree->ast_node.zbs_iop.op) { - case RISCV_BCLRI:{ - s0 = "bclri"; - s0_len = 5; - break; - } - case RISCV_BINVI:{ - s0 = "binvi"; - s0_len = 5; - break; - } - case RISCV_BSETI:{ - s0 = "bseti"; - s0_len = 5; - break; - } - case RISCV_BEXTI:{ - s0 = "bexti"; - s0_len = 5; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.zbs_iop.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.zbs_iop.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - hex_bits_6(tree->ast_node.zbs_iop.shamt, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_ZBS_RTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - switch (tree->ast_node.zbs_rtype.op) { - case RISCV_BEXT:{ - s0 = "bext"; - s0_len = 4; - break; - } - case RISCV_BINV:{ - s0 = "binv"; - s0_len = 4; - break; - } - case RISCV_BSET:{ - s0 = "bset"; - s0_len = 4; - break; - } - case RISCV_BCLR:{ - s0 = "bclr"; - s0_len = 4; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.zbs_rtype.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.zbs_rtype.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.zbs_rtype.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_C_LBU: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - char *s9; size_t s9_len; - char *s10; size_t s10_len; - s0 = "c.lbu"; - s0_len = 5; - spc( &s1, &s1_len); - switch (tree->ast_node.c_lbu.rdc) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - hex_bits_2(tree->ast_node.c_lbu.uimm, &s4, &s4_len); - opt_spc( &s5, &s5_len); - s6 = "("; - s6_len = 1; - opt_spc( &s7, &s7_len); - switch (tree->ast_node.c_lbu.rs1c) { - case 0x7:{ - s8 = "a5"; - s8_len = 2; - break; - } - case 0x5:{ - s8 = "a3"; - s8_len = 2; - break; - } - case 0x1:{ - s8 = "s1"; - s8_len = 2; - break; - } - case 0x3:{ - s8 = "a1"; - s8_len = 2; - break; - } - case 0x2:{ - s8 = "a0"; - s8_len = 2; - break; - } - case 0x4:{ - s8 = "a2"; - s8_len = 2; - break; - } - case 0x6:{ - s8 = "a4"; - s8_len = 2; - break; - } - case 0x0:{ - s8 = "s0"; - s8_len = 2; - break; - } - } - opt_spc( &s9, &s9_len); - s10 = ")"; - s10_len = 1; - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len + s8_len, s9, s9_len); - 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); - } - } - break; - case RISCV_C_LHU: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - char *s9; size_t s9_len; - char *s10; size_t s10_len; - s0 = "c.lhu"; - s0_len = 5; - spc( &s1, &s1_len); - switch (tree->ast_node.c_lhu.rdc) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - hex_bits_2(tree->ast_node.c_lhu.uimm, &s4, &s4_len); - opt_spc( &s5, &s5_len); - s6 = "("; - s6_len = 1; - opt_spc( &s7, &s7_len); - switch (tree->ast_node.c_lhu.rs1c) { - case 0x7:{ - s8 = "a5"; - s8_len = 2; - break; - } - case 0x5:{ - s8 = "a3"; - s8_len = 2; - break; - } - case 0x1:{ - s8 = "s1"; - s8_len = 2; - break; - } - case 0x3:{ - s8 = "a1"; - s8_len = 2; - break; - } - case 0x2:{ - s8 = "a0"; - s8_len = 2; - break; - } - case 0x4:{ - s8 = "a2"; - s8_len = 2; - break; - } - case 0x6:{ - s8 = "a4"; - s8_len = 2; - break; - } - case 0x0:{ - s8 = "s0"; - s8_len = 2; - break; - } - } - opt_spc( &s9, &s9_len); - s10 = ")"; - s10_len = 1; - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len + s8_len, s9, s9_len); - 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); - } - } - break; - case RISCV_C_LH: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - char *s9; size_t s9_len; - char *s10; size_t s10_len; - s0 = "c.lh"; - s0_len = 4; - spc( &s1, &s1_len); - switch (tree->ast_node.c_lh.rdc) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - hex_bits_2(tree->ast_node.c_lh.uimm, &s4, &s4_len); - opt_spc( &s5, &s5_len); - s6 = "("; - s6_len = 1; - opt_spc( &s7, &s7_len); - switch (tree->ast_node.c_lh.rs1c) { - case 0x7:{ - s8 = "a5"; - s8_len = 2; - break; - } - case 0x5:{ - s8 = "a3"; - s8_len = 2; - break; - } - case 0x1:{ - s8 = "s1"; - s8_len = 2; - break; - } - case 0x3:{ - s8 = "a1"; - s8_len = 2; - break; - } - case 0x2:{ - s8 = "a0"; - s8_len = 2; - break; - } - case 0x4:{ - s8 = "a2"; - s8_len = 2; - break; - } - case 0x6:{ - s8 = "a4"; - s8_len = 2; - break; - } - case 0x0:{ - s8 = "s0"; - s8_len = 2; - break; - } - } - opt_spc( &s9, &s9_len); - s10 = ")"; - s10_len = 1; - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len + s8_len, s9, s9_len); - 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); - } - } - break; - case RISCV_C_SB: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - char *s9; size_t s9_len; - char *s10; size_t s10_len; - s0 = "c.sb"; - s0_len = 4; - spc( &s1, &s1_len); - switch (tree->ast_node.c_sb.rs2c) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - hex_bits_2(tree->ast_node.c_sb.uimm, &s4, &s4_len); - opt_spc( &s5, &s5_len); - s6 = "("; - s6_len = 1; - opt_spc( &s7, &s7_len); - switch (tree->ast_node.c_sb.rs1c) { - case 0x7:{ - s8 = "a5"; - s8_len = 2; - break; - } - case 0x5:{ - s8 = "a3"; - s8_len = 2; - break; - } - case 0x1:{ - s8 = "s1"; - s8_len = 2; - break; - } - case 0x3:{ - s8 = "a1"; - s8_len = 2; - break; - } - case 0x2:{ - s8 = "a0"; - s8_len = 2; - break; - } - case 0x4:{ - s8 = "a2"; - s8_len = 2; - break; - } - case 0x6:{ - s8 = "a4"; - s8_len = 2; - break; - } - case 0x0:{ - s8 = "s0"; - s8_len = 2; - break; - } - } - opt_spc( &s9, &s9_len); - s10 = ")"; - s10_len = 1; - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len + s8_len, s9, s9_len); - 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); - } - } - break; - case RISCV_C_SH: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - char *s9; size_t s9_len; - char *s10; size_t s10_len; - s0 = "c.sh"; - s0_len = 4; - spc( &s1, &s1_len); - switch (tree->ast_node.c_sh.rs1c) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - hex_bits_2(tree->ast_node.c_sh.uimm, &s4, &s4_len); - opt_spc( &s5, &s5_len); - s6 = "("; - s6_len = 1; - opt_spc( &s7, &s7_len); - switch (tree->ast_node.c_sh.rs2c) { - case 0x7:{ - s8 = "a5"; - s8_len = 2; - break; - } - case 0x5:{ - s8 = "a3"; - s8_len = 2; - break; - } - case 0x1:{ - s8 = "s1"; - s8_len = 2; - break; - } - case 0x3:{ - s8 = "a1"; - s8_len = 2; - break; - } - case 0x2:{ - s8 = "a0"; - s8_len = 2; - break; - } - case 0x4:{ - s8 = "a2"; - s8_len = 2; - break; - } - case 0x6:{ - s8 = "a4"; - s8_len = 2; - break; - } - case 0x0:{ - s8 = "s0"; - s8_len = 2; - break; - } - } - opt_spc( &s9, &s9_len); - s10 = ")"; - s10_len = 1; - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len + s8_len, s9, s9_len); - 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); - } - } - break; - case RISCV_C_ZEXT_B: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - s0 = "c.zext.b"; + 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); - switch (tree->ast_node.c_zext_b) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - } - } - break; - case RISCV_C_SEXT_B: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - s0 = "c.sext.b"; + 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); - switch (tree->ast_node.c_sext_b) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - } - } - break; - case RISCV_C_ZEXT_H: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - s0 = "c.zext.h"; + 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); - switch (tree->ast_node.c_zext_h) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - } - } - break; - case RISCV_C_SEXT_H: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - s0 = "c.sext.h"; + 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); - switch (tree->ast_node.c_sext_h) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - } - } - break; - case RISCV_C_ZEXT_W: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - s0 = "c.zext.w"; + 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); - switch (tree->ast_node.c_zext_w) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - } - } - break; - case RISCV_C_NOT: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - s0 = "c.not"; - s0_len = 5; - spc( &s1, &s1_len); - switch (tree->ast_node.c_not) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - } - } - break; - case RISCV_C_MUL: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "c.mul"; - s0_len = 5; - spc( &s1, &s1_len); - switch (tree->ast_node.c_mul.rsdc) { - case 0x7:{ - s2 = "a5"; - s2_len = 2; - break; - } - case 0x5:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x1:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x3:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x2:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x4:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x6:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x0:{ - s2 = "s0"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.c_mul.rs2c) { - case 0x7:{ - s4 = "a5"; - s4_len = 2; - break; - } - case 0x5:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x1:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x3:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x2:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x4:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x6:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x0:{ - s4 = "s0"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_F_BIN_RM_TYPE_H: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - switch (tree->ast_node.f_bin_rm_type_h.op) { - case RISCV_FDIV_H:{ - s0 = "fdiv.h"; - s0_len = 6; - break; - } - case RISCV_FADD_H:{ - s0 = "fadd.h"; - s0_len = 6; - break; - } - case RISCV_FMUL_H:{ - s0 = "fmul.h"; - s0_len = 6; - break; - } - case RISCV_FSUB_H:{ - s0 = "fsub.h"; - s0_len = 6; - break; - } - } - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_bin_rm_type_h.rd, &s2, &s2_len); - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_bin_rm_type_h.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - freg_or_reg_name(tree->ast_node.f_bin_rm_type_h.rs2, &s6, &s6_len); - sep( &s7, &s7_len); - switch (tree->ast_node.f_bin_rm_type_h.rm) { - case RISCV_RM_RNE:{ - s8 = "rne"; - s8_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s8 = "rtz"; - s8_len = 3; - break; - } - case RISCV_RM_RDN:{ - s8 = "rdn"; - s8_len = 3; - break; - } - case RISCV_RM_RMM:{ - s8 = "rmm"; - s8_len = 3; - break; - } - case RISCV_RM_RUP:{ - s8 = "rup"; - s8_len = 3; - break; - } - case RISCV_RM_DYN:{ - s8 = "dyn"; - s8_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - } - } - break; - case RISCV_F_MADD_TYPE_H: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - char *s9; size_t s9_len; - char *s10; size_t s10_len; - switch (tree->ast_node.f_madd_type_h.op) { - case RISCV_FNMSUB_H:{ - s0 = "fnmsub.h"; - s0_len = 8; - break; - } - case RISCV_FMSUB_H:{ - s0 = "fmsub.h"; - s0_len = 7; - break; - } - case RISCV_FNMADD_H:{ - s0 = "fnmadd.h"; - s0_len = 8; - break; - } - case RISCV_FMADD_H:{ - s0 = "fmadd.h"; - s0_len = 7; - break; - } - } - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_madd_type_h.rd, &s2, &s2_len); - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_madd_type_h.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - freg_or_reg_name(tree->ast_node.f_madd_type_h.rs2, &s6, &s6_len); - sep( &s7, &s7_len); - freg_or_reg_name(tree->ast_node.f_madd_type_h.rs3, &s8, &s8_len); - sep( &s9, &s9_len); - switch (tree->ast_node.f_madd_type_h.rm) { - case RISCV_RM_RNE:{ - s10 = "rne"; - s10_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s10 = "rtz"; - s10_len = 3; - break; - } - case RISCV_RM_RDN:{ - s10 = "rdn"; - s10_len = 3; - break; - } - case RISCV_RM_RMM:{ - s10 = "rmm"; - s10_len = 3; - break; - } - case RISCV_RM_RUP:{ - s10 = "rup"; - s10_len = 3; - break; - } - case RISCV_RM_DYN:{ - s10 = "dyn"; - s10_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len + s8_len, s9, s9_len); - 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); - } - } - 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; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fsgnj.h"; - s0_len = 7; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rd, &s2, &s2_len); - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs2, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_bin_type_h.fle_h == RISCV_FSGNJN_H) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fsgnjn.h"; - s0_len = 8; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rd, &s2, &s2_len); - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs2, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_bin_type_h.fle_h == RISCV_FSGNJX_H) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fsgnjx.h"; - s0_len = 8; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rd, &s2, &s2_len); - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs2, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_bin_type_h.fle_h == RISCV_FMIN_H) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fmin.h"; - s0_len = 6; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rd, &s2, &s2_len); - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs2, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_bin_type_h.fle_h == RISCV_FMAX_H) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fmax.h"; - s0_len = 6; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rd, &s2, &s2_len); - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs2, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_bin_type_h.fle_h == RISCV_FEQ_H) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "feq.h"; - s0_len = 5; - spc( &s1, &s1_len); - switch (tree->ast_node.f_bin_type_h.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs2, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_bin_type_h.fle_h == RISCV_FLT_H) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "flt.h"; - s0_len = 5; - spc( &s1, &s1_len); - switch (tree->ast_node.f_bin_type_h.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs2, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_bin_type_h.fle_h == RISCV_FLE_H) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fle.h"; - s0_len = 5; - spc( &s1, &s1_len); - switch (tree->ast_node.f_bin_type_h.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - freg_or_reg_name(tree->ast_node.f_bin_type_h.rs2, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - 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; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fsqrt.h"; - s0_len = 7; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rd, &s2, &s2_len); - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_h.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_W_H) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fcvt.w.h"; - s0_len = 8; - spc( &s1, &s1_len); - switch (tree->ast_node.f_un_rm_type_h.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_h.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_WU_H) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fcvt.wu.h"; - s0_len = 9; - spc( &s1, &s1_len); - switch (tree->ast_node.f_un_rm_type_h.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_h.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_H_W) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fcvt.h.w"; - s0_len = 8; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rd, &s2, &s2_len); - sep( &s3, &s3_len); - switch (tree->ast_node.f_un_rm_type_h.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_h.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_H_WU) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fcvt.h.wu"; - s0_len = 9; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rd, &s2, &s2_len); - sep( &s3, &s3_len); - switch (tree->ast_node.f_un_rm_type_h.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_h.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_L_H) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fcvt.l.h"; - s0_len = 8; - spc( &s1, &s1_len); - switch (tree->ast_node.f_un_rm_type_h.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_h.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_LU_H) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fcvt.lu.h"; - s0_len = 9; - spc( &s1, &s1_len); - switch (tree->ast_node.f_un_rm_type_h.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_h.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_H_L) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fcvt.h.l"; - s0_len = 8; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rd, &s2, &s2_len); - sep( &s3, &s3_len); - switch (tree->ast_node.f_un_rm_type_h.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_h.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_H_LU) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fcvt.h.lu"; - s0_len = 9; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rd, &s2, &s2_len); - sep( &s3, &s3_len); - switch (tree->ast_node.f_un_rm_type_h.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_h.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_H_S) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fcvt.h.s"; - s0_len = 8; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rd, &s2, &s2_len); - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_h.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_H_D) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fcvt.h.d"; - s0_len = 8; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rd, &s2, &s2_len); - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_h.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_S_H) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fcvt.s.h"; - s0_len = 8; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rd, &s2, &s2_len); - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_h.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - if (tree->ast_node.f_un_rm_type_h.fcvt_h_lu == RISCV_FCVT_D_H) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fcvt.d.h"; - s0_len = 8; - spc( &s1, &s1_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rd, &s2, &s2_len); - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_un_rm_type_h.rs1, &s4, &s4_len); - sep( &s5, &s5_len); - switch (tree->ast_node.f_un_rm_type_h.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - 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; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "fmv.x.h"; - s0_len = 7; - spc( &s1, &s1_len); - switch (tree->ast_node.f_un_type_h.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.f_un_type_h.rs1) { - case 0x08:{ - s4 = "fs0"; - s4_len = 3; - break; - } - case 0x15:{ - s4 = "fs5"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "ft1"; - s4_len = 3; - break; - } - case 0x06:{ - s4 = "ft6"; - s4_len = 3; - break; - } - case 0x09:{ - s4 = "fs1"; - s4_len = 3; - break; - } - case 0x10:{ - s4 = "fa6"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "fs11"; - s4_len = 4; - break; - } - case 0x1C:{ - s4 = "ft8"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "fs6"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "ft0"; - s4_len = 3; - break; - } - case 0x0A:{ - s4 = "fa0"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "fs10"; - s4_len = 4; - break; - } - case 0x17:{ - s4 = "fs7"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "fa2"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "fs8"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "ft2"; - s4_len = 3; - break; - } - case 0x1F:{ - s4 = "ft11"; - s4_len = 4; - break; - } - case 0x0B:{ - s4 = "fa1"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "ft7"; - s4_len = 3; - break; - } - case 0x13:{ - s4 = "fs3"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "ft4"; - s4_len = 3; - break; - } - case 0x19:{ - s4 = "fs9"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "fs2"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "fs4"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "fa4"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "ft10"; - s4_len = 4; - break; - } - case 0x11:{ - s4 = "fa7"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "ft3"; - s4_len = 3; - break; - } - case 0x05:{ - s4 = "ft5"; - s4_len = 3; - break; - } - case 0x1D:{ - s4 = "ft9"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "fa3"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "fa5"; - s4_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - if (tree->ast_node.f_un_type_h.fmv_h_x == RISCV_FMV_H_X) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "fmv.h.x"; - s0_len = 7; - spc( &s1, &s1_len); - switch (tree->ast_node.f_un_type_h.rd) { - case 0x08:{ - s2 = "fs0"; - s2_len = 3; - break; - } - case 0x15:{ - s2 = "fs5"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "ft1"; - s2_len = 3; - break; - } - case 0x06:{ - s2 = "ft6"; - s2_len = 3; - break; - } - case 0x09:{ - s2 = "fs1"; - s2_len = 3; - break; - } - case 0x10:{ - s2 = "fa6"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "fs11"; - s2_len = 4; - break; - } - case 0x1C:{ - s2 = "ft8"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "fs6"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "ft0"; - s2_len = 3; - break; - } - case 0x0A:{ - s2 = "fa0"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "fs10"; - s2_len = 4; - break; - } - case 0x17:{ - s2 = "fs7"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "fa2"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "fs8"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "ft2"; - s2_len = 3; - break; - } - case 0x1F:{ - s2 = "ft11"; - s2_len = 4; - break; - } - case 0x0B:{ - s2 = "fa1"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "ft7"; - s2_len = 3; - break; - } - case 0x13:{ - s2 = "fs3"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "ft4"; - s2_len = 3; - break; - } - case 0x19:{ - s2 = "fs9"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "fs2"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "fs4"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "fa4"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "ft10"; - s2_len = 4; - break; - } - case 0x11:{ - s2 = "fa7"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "ft3"; - s2_len = 3; - break; - } - case 0x05:{ - s2 = "ft5"; - s2_len = 3; - break; - } - case 0x1D:{ - s2 = "ft9"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "fa3"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "fa5"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.f_un_type_h.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - if (tree->ast_node.f_un_type_h.fmv_h_x == RISCV_FCLASS_H) { - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "fclass.h"; - s0_len = 8; - spc( &s1, &s1_len); - switch (tree->ast_node.f_un_type_h.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - freg_or_reg_name(tree->ast_node.f_un_type_h.rs1, &s4, &s4_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_FLI_H: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "fli.h"; + 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); - switch (tree->ast_node.riscv_fli_h.rd) { - case 0x08:{ - s2 = "fs0"; - s2_len = 3; - break; - } - case 0x15:{ - s2 = "fs5"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "ft1"; - s2_len = 3; - break; - } - case 0x06:{ - s2 = "ft6"; - s2_len = 3; - break; - } - case 0x09:{ - s2 = "fs1"; - s2_len = 3; - break; - } - case 0x10:{ - s2 = "fa6"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "fs11"; - s2_len = 4; - break; - } - case 0x1C:{ - s2 = "ft8"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "fs6"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "ft0"; - s2_len = 3; - break; - } - case 0x0A:{ - s2 = "fa0"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "fs10"; - s2_len = 4; - break; - } - case 0x17:{ - s2 = "fs7"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "fa2"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "fs8"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "ft2"; - s2_len = 3; - break; - } - case 0x1F:{ - s2 = "ft11"; - s2_len = 4; - break; - } - case 0x0B:{ - s2 = "fa1"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "ft7"; - s2_len = 3; - break; - } - case 0x13:{ - s2 = "fs3"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "ft4"; - s2_len = 3; - break; - } - case 0x19:{ - s2 = "fs9"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "fs2"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "fs4"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "fa4"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "ft10"; - s2_len = 4; - break; - } - case 0x11:{ - s2 = "fa7"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "ft3"; - s2_len = 3; - break; - } - case 0x05:{ - s2 = "ft5"; - s2_len = 3; - break; - } - case 0x1D:{ - s2 = "ft9"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "fa3"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "fa5"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - hex_bits_5(tree->ast_node.riscv_fli_h.constantidx, &s4, &s4_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_FLI_S: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "fli.s"; + 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); - switch (tree->ast_node.riscv_fli_s.rd) { - case 0x08:{ - s2 = "fs0"; - s2_len = 3; - break; - } - case 0x15:{ - s2 = "fs5"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "ft1"; - s2_len = 3; - break; - } - case 0x06:{ - s2 = "ft6"; - s2_len = 3; - break; - } - case 0x09:{ - s2 = "fs1"; - s2_len = 3; - break; - } - case 0x10:{ - s2 = "fa6"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "fs11"; - s2_len = 4; - break; - } - case 0x1C:{ - s2 = "ft8"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "fs6"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "ft0"; - s2_len = 3; - break; - } - case 0x0A:{ - s2 = "fa0"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "fs10"; - s2_len = 4; - break; - } - case 0x17:{ - s2 = "fs7"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "fa2"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "fs8"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "ft2"; - s2_len = 3; - break; - } - case 0x1F:{ - s2 = "ft11"; - s2_len = 4; - break; - } - case 0x0B:{ - s2 = "fa1"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "ft7"; - s2_len = 3; - break; - } - case 0x13:{ - s2 = "fs3"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "ft4"; - s2_len = 3; - break; - } - case 0x19:{ - s2 = "fs9"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "fs2"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "fs4"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "fa4"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "ft10"; - s2_len = 4; - break; - } - case 0x11:{ - s2 = "fa7"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "ft3"; - s2_len = 3; - break; - } - case 0x05:{ - s2 = "ft5"; - s2_len = 3; - break; - } - case 0x1D:{ - s2 = "ft9"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "fa3"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "fa5"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - hex_bits_5(tree->ast_node.riscv_fli_s.constantidx, &s4, &s4_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_FLI_D: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "fli.d"; + 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); - switch (tree->ast_node.riscv_fli_d.rd) { - case 0x08:{ - s2 = "fs0"; - s2_len = 3; - break; - } - case 0x15:{ - s2 = "fs5"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "ft1"; - s2_len = 3; - break; - } - case 0x06:{ - s2 = "ft6"; - s2_len = 3; - break; - } - case 0x09:{ - s2 = "fs1"; - s2_len = 3; - break; - } - case 0x10:{ - s2 = "fa6"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "fs11"; - s2_len = 4; - break; - } - case 0x1C:{ - s2 = "ft8"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "fs6"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "ft0"; - s2_len = 3; - break; - } - case 0x0A:{ - s2 = "fa0"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "fs10"; - s2_len = 4; - break; - } - case 0x17:{ - s2 = "fs7"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "fa2"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "fs8"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "ft2"; - s2_len = 3; - break; - } - case 0x1F:{ - s2 = "ft11"; - s2_len = 4; - break; - } - case 0x0B:{ - s2 = "fa1"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "ft7"; - s2_len = 3; - break; - } - case 0x13:{ - s2 = "fs3"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "ft4"; - s2_len = 3; - break; - } - case 0x19:{ - s2 = "fs9"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "fs2"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "fs4"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "fa4"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "ft10"; - s2_len = 4; - break; - } - case 0x11:{ - s2 = "fa7"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "ft3"; - s2_len = 3; - break; - } - case 0x05:{ - s2 = "ft5"; - s2_len = 3; - break; - } - case 0x1D:{ - s2 = "ft9"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "fa3"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "fa5"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - hex_bits_5(tree->ast_node.riscv_fli_d.constantidx, &s4, &s4_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_FMINM_H: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fminm.h"; - s0_len = 7; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_fminm_h.rd) { - case 0x08:{ - s2 = "fs0"; - s2_len = 3; - break; - } - case 0x15:{ - s2 = "fs5"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "ft1"; - s2_len = 3; - break; - } - case 0x06:{ - s2 = "ft6"; - s2_len = 3; - break; - } - case 0x09:{ - s2 = "fs1"; - s2_len = 3; - break; - } - case 0x10:{ - s2 = "fa6"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "fs11"; - s2_len = 4; - break; - } - case 0x1C:{ - s2 = "ft8"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "fs6"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "ft0"; - s2_len = 3; - break; - } - case 0x0A:{ - s2 = "fa0"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "fs10"; - s2_len = 4; - break; - } - case 0x17:{ - s2 = "fs7"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "fa2"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "fs8"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "ft2"; - s2_len = 3; - break; - } - case 0x1F:{ - s2 = "ft11"; - s2_len = 4; - break; - } - case 0x0B:{ - s2 = "fa1"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "ft7"; - s2_len = 3; - break; - } - case 0x13:{ - s2 = "fs3"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "ft4"; - s2_len = 3; - break; - } - case 0x19:{ - s2 = "fs9"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "fs2"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "fs4"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "fa4"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "ft10"; - s2_len = 4; - break; - } - case 0x11:{ - s2 = "fa7"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "ft3"; - s2_len = 3; - break; - } - case 0x05:{ - s2 = "ft5"; - s2_len = 3; - break; - } - case 0x1D:{ - s2 = "ft9"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "fa3"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "fa5"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_fminm_h.rs1) { - case 0x08:{ - s4 = "fs0"; - s4_len = 3; - break; - } - case 0x15:{ - s4 = "fs5"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "ft1"; - s4_len = 3; - break; - } - case 0x06:{ - s4 = "ft6"; - s4_len = 3; - break; - } - case 0x09:{ - s4 = "fs1"; - s4_len = 3; - break; - } - case 0x10:{ - s4 = "fa6"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "fs11"; - s4_len = 4; - break; - } - case 0x1C:{ - s4 = "ft8"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "fs6"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "ft0"; - s4_len = 3; - break; - } - case 0x0A:{ - s4 = "fa0"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "fs10"; - s4_len = 4; - break; - } - case 0x17:{ - s4 = "fs7"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "fa2"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "fs8"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "ft2"; - s4_len = 3; - break; - } - case 0x1F:{ - s4 = "ft11"; - s4_len = 4; - break; - } - case 0x0B:{ - s4 = "fa1"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "ft7"; - s4_len = 3; - break; - } - case 0x13:{ - s4 = "fs3"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "ft4"; - s4_len = 3; - break; - } - case 0x19:{ - s4 = "fs9"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "fs2"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "fs4"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "fa4"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "ft10"; - s4_len = 4; - break; - } - case 0x11:{ - s4 = "fa7"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "ft3"; - s4_len = 3; - break; - } - case 0x05:{ - s4 = "ft5"; - s4_len = 3; - break; - } - case 0x1D:{ - s4 = "ft9"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "fa3"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "fa5"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.riscv_fminm_h.rs2) { - case 0x08:{ - s6 = "fs0"; - s6_len = 3; - break; - } - case 0x15:{ - s6 = "fs5"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "ft1"; - s6_len = 3; - break; - } - case 0x06:{ - s6 = "ft6"; - s6_len = 3; - break; - } - case 0x09:{ - s6 = "fs1"; - s6_len = 3; - break; - } - case 0x10:{ - s6 = "fa6"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "fs11"; - s6_len = 4; - break; - } - case 0x1C:{ - s6 = "ft8"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "fs6"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "ft0"; - s6_len = 3; - break; - } - case 0x0A:{ - s6 = "fa0"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "fs10"; - s6_len = 4; - break; - } - case 0x17:{ - s6 = "fs7"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "fa2"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "fs8"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "ft2"; - s6_len = 3; - break; - } - case 0x1F:{ - s6 = "ft11"; - s6_len = 4; - break; - } - case 0x0B:{ - s6 = "fa1"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "ft7"; - s6_len = 3; - break; - } - case 0x13:{ - s6 = "fs3"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "ft4"; - s6_len = 3; - break; - } - case 0x19:{ - s6 = "fs9"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "fs2"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "fs4"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "fa4"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "ft10"; - s6_len = 4; - break; - } - case 0x11:{ - s6 = "fa7"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "ft3"; - s6_len = 3; - break; - } - case 0x05:{ - s6 = "ft5"; - s6_len = 3; - break; - } - case 0x1D:{ - s6 = "ft9"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "fa3"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "fa5"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_FMAXM_H: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fmaxm.h"; - s0_len = 7; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_fmaxm_h.rd) { - case 0x08:{ - s2 = "fs0"; - s2_len = 3; - break; - } - case 0x15:{ - s2 = "fs5"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "ft1"; - s2_len = 3; - break; - } - case 0x06:{ - s2 = "ft6"; - s2_len = 3; - break; - } - case 0x09:{ - s2 = "fs1"; - s2_len = 3; - break; - } - case 0x10:{ - s2 = "fa6"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "fs11"; - s2_len = 4; - break; - } - case 0x1C:{ - s2 = "ft8"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "fs6"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "ft0"; - s2_len = 3; - break; - } - case 0x0A:{ - s2 = "fa0"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "fs10"; - s2_len = 4; - break; - } - case 0x17:{ - s2 = "fs7"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "fa2"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "fs8"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "ft2"; - s2_len = 3; - break; - } - case 0x1F:{ - s2 = "ft11"; - s2_len = 4; - break; - } - case 0x0B:{ - s2 = "fa1"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "ft7"; - s2_len = 3; - break; - } - case 0x13:{ - s2 = "fs3"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "ft4"; - s2_len = 3; - break; - } - case 0x19:{ - s2 = "fs9"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "fs2"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "fs4"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "fa4"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "ft10"; - s2_len = 4; - break; - } - case 0x11:{ - s2 = "fa7"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "ft3"; - s2_len = 3; - break; - } - case 0x05:{ - s2 = "ft5"; - s2_len = 3; - break; - } - case 0x1D:{ - s2 = "ft9"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "fa3"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "fa5"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_fmaxm_h.rs1) { - case 0x08:{ - s4 = "fs0"; - s4_len = 3; - break; - } - case 0x15:{ - s4 = "fs5"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "ft1"; - s4_len = 3; - break; - } - case 0x06:{ - s4 = "ft6"; - s4_len = 3; - break; - } - case 0x09:{ - s4 = "fs1"; - s4_len = 3; - break; - } - case 0x10:{ - s4 = "fa6"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "fs11"; - s4_len = 4; - break; - } - case 0x1C:{ - s4 = "ft8"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "fs6"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "ft0"; - s4_len = 3; - break; - } - case 0x0A:{ - s4 = "fa0"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "fs10"; - s4_len = 4; - break; - } - case 0x17:{ - s4 = "fs7"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "fa2"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "fs8"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "ft2"; - s4_len = 3; - break; - } - case 0x1F:{ - s4 = "ft11"; - s4_len = 4; - break; - } - case 0x0B:{ - s4 = "fa1"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "ft7"; - s4_len = 3; - break; - } - case 0x13:{ - s4 = "fs3"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "ft4"; - s4_len = 3; - break; - } - case 0x19:{ - s4 = "fs9"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "fs2"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "fs4"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "fa4"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "ft10"; - s4_len = 4; - break; - } - case 0x11:{ - s4 = "fa7"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "ft3"; - s4_len = 3; - break; - } - case 0x05:{ - s4 = "ft5"; - s4_len = 3; - break; - } - case 0x1D:{ - s4 = "ft9"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "fa3"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "fa5"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.riscv_fmaxm_h.rs2) { - case 0x08:{ - s6 = "fs0"; - s6_len = 3; - break; - } - case 0x15:{ - s6 = "fs5"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "ft1"; - s6_len = 3; - break; - } - case 0x06:{ - s6 = "ft6"; - s6_len = 3; - break; - } - case 0x09:{ - s6 = "fs1"; - s6_len = 3; - break; - } - case 0x10:{ - s6 = "fa6"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "fs11"; - s6_len = 4; - break; - } - case 0x1C:{ - s6 = "ft8"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "fs6"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "ft0"; - s6_len = 3; - break; - } - case 0x0A:{ - s6 = "fa0"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "fs10"; - s6_len = 4; - break; - } - case 0x17:{ - s6 = "fs7"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "fa2"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "fs8"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "ft2"; - s6_len = 3; - break; - } - case 0x1F:{ - s6 = "ft11"; - s6_len = 4; - break; - } - case 0x0B:{ - s6 = "fa1"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "ft7"; - s6_len = 3; - break; - } - case 0x13:{ - s6 = "fs3"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "ft4"; - s6_len = 3; - break; - } - case 0x19:{ - s6 = "fs9"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "fs2"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "fs4"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "fa4"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "ft10"; - s6_len = 4; - break; - } - case 0x11:{ - s6 = "fa7"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "ft3"; - s6_len = 3; - break; - } - case 0x05:{ - s6 = "ft5"; - s6_len = 3; - break; - } - case 0x1D:{ - s6 = "ft9"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "fa3"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "fa5"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_FMINM_S: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fminm.s"; - s0_len = 7; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_fminm_s.rd) { - case 0x08:{ - s2 = "fs0"; - s2_len = 3; - break; - } - case 0x15:{ - s2 = "fs5"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "ft1"; - s2_len = 3; - break; - } - case 0x06:{ - s2 = "ft6"; - s2_len = 3; - break; - } - case 0x09:{ - s2 = "fs1"; - s2_len = 3; - break; - } - case 0x10:{ - s2 = "fa6"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "fs11"; - s2_len = 4; - break; - } - case 0x1C:{ - s2 = "ft8"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "fs6"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "ft0"; - s2_len = 3; - break; - } - case 0x0A:{ - s2 = "fa0"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "fs10"; - s2_len = 4; - break; - } - case 0x17:{ - s2 = "fs7"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "fa2"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "fs8"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "ft2"; - s2_len = 3; - break; - } - case 0x1F:{ - s2 = "ft11"; - s2_len = 4; - break; - } - case 0x0B:{ - s2 = "fa1"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "ft7"; - s2_len = 3; - break; - } - case 0x13:{ - s2 = "fs3"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "ft4"; - s2_len = 3; - break; - } - case 0x19:{ - s2 = "fs9"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "fs2"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "fs4"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "fa4"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "ft10"; - s2_len = 4; - break; - } - case 0x11:{ - s2 = "fa7"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "ft3"; - s2_len = 3; - break; - } - case 0x05:{ - s2 = "ft5"; - s2_len = 3; - break; - } - case 0x1D:{ - s2 = "ft9"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "fa3"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "fa5"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_fminm_s.rs1) { - case 0x08:{ - s4 = "fs0"; - s4_len = 3; - break; - } - case 0x15:{ - s4 = "fs5"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "ft1"; - s4_len = 3; - break; - } - case 0x06:{ - s4 = "ft6"; - s4_len = 3; - break; - } - case 0x09:{ - s4 = "fs1"; - s4_len = 3; - break; - } - case 0x10:{ - s4 = "fa6"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "fs11"; - s4_len = 4; - break; - } - case 0x1C:{ - s4 = "ft8"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "fs6"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "ft0"; - s4_len = 3; - break; - } - case 0x0A:{ - s4 = "fa0"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "fs10"; - s4_len = 4; - break; - } - case 0x17:{ - s4 = "fs7"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "fa2"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "fs8"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "ft2"; - s4_len = 3; - break; - } - case 0x1F:{ - s4 = "ft11"; - s4_len = 4; - break; - } - case 0x0B:{ - s4 = "fa1"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "ft7"; - s4_len = 3; - break; - } - case 0x13:{ - s4 = "fs3"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "ft4"; - s4_len = 3; - break; - } - case 0x19:{ - s4 = "fs9"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "fs2"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "fs4"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "fa4"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "ft10"; - s4_len = 4; - break; - } - case 0x11:{ - s4 = "fa7"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "ft3"; - s4_len = 3; - break; - } - case 0x05:{ - s4 = "ft5"; - s4_len = 3; - break; - } - case 0x1D:{ - s4 = "ft9"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "fa3"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "fa5"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.riscv_fminm_s.rs2) { - case 0x08:{ - s6 = "fs0"; - s6_len = 3; - break; - } - case 0x15:{ - s6 = "fs5"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "ft1"; - s6_len = 3; - break; - } - case 0x06:{ - s6 = "ft6"; - s6_len = 3; - break; - } - case 0x09:{ - s6 = "fs1"; - s6_len = 3; - break; - } - case 0x10:{ - s6 = "fa6"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "fs11"; - s6_len = 4; - break; - } - case 0x1C:{ - s6 = "ft8"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "fs6"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "ft0"; - s6_len = 3; - break; - } - case 0x0A:{ - s6 = "fa0"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "fs10"; - s6_len = 4; - break; - } - case 0x17:{ - s6 = "fs7"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "fa2"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "fs8"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "ft2"; - s6_len = 3; - break; - } - case 0x1F:{ - s6 = "ft11"; - s6_len = 4; - break; - } - case 0x0B:{ - s6 = "fa1"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "ft7"; - s6_len = 3; - break; - } - case 0x13:{ - s6 = "fs3"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "ft4"; - s6_len = 3; - break; - } - case 0x19:{ - s6 = "fs9"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "fs2"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "fs4"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "fa4"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "ft10"; - s6_len = 4; - break; - } - case 0x11:{ - s6 = "fa7"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "ft3"; - s6_len = 3; - break; - } - case 0x05:{ - s6 = "ft5"; - s6_len = 3; - break; - } - case 0x1D:{ - s6 = "ft9"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "fa3"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "fa5"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_FMAXM_S: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fmaxm.s"; - s0_len = 7; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_fmaxm_s.rd) { - case 0x08:{ - s2 = "fs0"; - s2_len = 3; - break; - } - case 0x15:{ - s2 = "fs5"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "ft1"; - s2_len = 3; - break; - } - case 0x06:{ - s2 = "ft6"; - s2_len = 3; - break; - } - case 0x09:{ - s2 = "fs1"; - s2_len = 3; - break; - } - case 0x10:{ - s2 = "fa6"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "fs11"; - s2_len = 4; - break; - } - case 0x1C:{ - s2 = "ft8"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "fs6"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "ft0"; - s2_len = 3; - break; - } - case 0x0A:{ - s2 = "fa0"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "fs10"; - s2_len = 4; - break; - } - case 0x17:{ - s2 = "fs7"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "fa2"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "fs8"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "ft2"; - s2_len = 3; - break; - } - case 0x1F:{ - s2 = "ft11"; - s2_len = 4; - break; - } - case 0x0B:{ - s2 = "fa1"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "ft7"; - s2_len = 3; - break; - } - case 0x13:{ - s2 = "fs3"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "ft4"; - s2_len = 3; - break; - } - case 0x19:{ - s2 = "fs9"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "fs2"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "fs4"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "fa4"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "ft10"; - s2_len = 4; - break; - } - case 0x11:{ - s2 = "fa7"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "ft3"; - s2_len = 3; - break; - } - case 0x05:{ - s2 = "ft5"; - s2_len = 3; - break; - } - case 0x1D:{ - s2 = "ft9"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "fa3"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "fa5"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_fmaxm_s.rs1) { - case 0x08:{ - s4 = "fs0"; - s4_len = 3; - break; - } - case 0x15:{ - s4 = "fs5"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "ft1"; - s4_len = 3; - break; - } - case 0x06:{ - s4 = "ft6"; - s4_len = 3; - break; - } - case 0x09:{ - s4 = "fs1"; - s4_len = 3; - break; - } - case 0x10:{ - s4 = "fa6"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "fs11"; - s4_len = 4; - break; - } - case 0x1C:{ - s4 = "ft8"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "fs6"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "ft0"; - s4_len = 3; - break; - } - case 0x0A:{ - s4 = "fa0"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "fs10"; - s4_len = 4; - break; - } - case 0x17:{ - s4 = "fs7"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "fa2"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "fs8"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "ft2"; - s4_len = 3; - break; - } - case 0x1F:{ - s4 = "ft11"; - s4_len = 4; - break; - } - case 0x0B:{ - s4 = "fa1"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "ft7"; - s4_len = 3; - break; - } - case 0x13:{ - s4 = "fs3"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "ft4"; - s4_len = 3; - break; - } - case 0x19:{ - s4 = "fs9"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "fs2"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "fs4"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "fa4"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "ft10"; - s4_len = 4; - break; - } - case 0x11:{ - s4 = "fa7"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "ft3"; - s4_len = 3; - break; - } - case 0x05:{ - s4 = "ft5"; - s4_len = 3; - break; - } - case 0x1D:{ - s4 = "ft9"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "fa3"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "fa5"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.riscv_fmaxm_s.rs2) { - case 0x08:{ - s6 = "fs0"; - s6_len = 3; - break; - } - case 0x15:{ - s6 = "fs5"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "ft1"; - s6_len = 3; - break; - } - case 0x06:{ - s6 = "ft6"; - s6_len = 3; - break; - } - case 0x09:{ - s6 = "fs1"; - s6_len = 3; - break; - } - case 0x10:{ - s6 = "fa6"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "fs11"; - s6_len = 4; - break; - } - case 0x1C:{ - s6 = "ft8"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "fs6"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "ft0"; - s6_len = 3; - break; - } - case 0x0A:{ - s6 = "fa0"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "fs10"; - s6_len = 4; - break; - } - case 0x17:{ - s6 = "fs7"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "fa2"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "fs8"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "ft2"; - s6_len = 3; - break; - } - case 0x1F:{ - s6 = "ft11"; - s6_len = 4; - break; - } - case 0x0B:{ - s6 = "fa1"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "ft7"; - s6_len = 3; - break; - } - case 0x13:{ - s6 = "fs3"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "ft4"; - s6_len = 3; - break; - } - case 0x19:{ - s6 = "fs9"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "fs2"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "fs4"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "fa4"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "ft10"; - s6_len = 4; - break; - } - case 0x11:{ - s6 = "fa7"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "ft3"; - s6_len = 3; - break; - } - case 0x05:{ - s6 = "ft5"; - s6_len = 3; - break; - } - case 0x1D:{ - s6 = "ft9"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "fa3"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "fa5"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_FMINM_D: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fminm.d"; + 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); - switch (tree->ast_node.riscv_fminm_d.rd) { - case 0x08:{ - s2 = "fs0"; - s2_len = 3; - break; - } - case 0x15:{ - s2 = "fs5"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "ft1"; - s2_len = 3; - break; - } - case 0x06:{ - s2 = "ft6"; - s2_len = 3; - break; - } - case 0x09:{ - s2 = "fs1"; - s2_len = 3; - break; - } - case 0x10:{ - s2 = "fa6"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "fs11"; - s2_len = 4; - break; - } - case 0x1C:{ - s2 = "ft8"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "fs6"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "ft0"; - s2_len = 3; - break; - } - case 0x0A:{ - s2 = "fa0"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "fs10"; - s2_len = 4; - break; - } - case 0x17:{ - s2 = "fs7"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "fa2"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "fs8"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "ft2"; - s2_len = 3; - break; - } - case 0x1F:{ - s2 = "ft11"; - s2_len = 4; - break; - } - case 0x0B:{ - s2 = "fa1"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "ft7"; - s2_len = 3; - break; - } - case 0x13:{ - s2 = "fs3"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "ft4"; - s2_len = 3; - break; - } - case 0x19:{ - s2 = "fs9"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "fs2"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "fs4"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "fa4"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "ft10"; - s2_len = 4; - break; - } - case 0x11:{ - s2 = "fa7"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "ft3"; - s2_len = 3; - break; - } - case 0x05:{ - s2 = "ft5"; - s2_len = 3; - break; - } - case 0x1D:{ - s2 = "ft9"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "fa3"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "fa5"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_fminm_d.rs1) { - case 0x08:{ - s4 = "fs0"; - s4_len = 3; - break; - } - case 0x15:{ - s4 = "fs5"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "ft1"; - s4_len = 3; - break; - } - case 0x06:{ - s4 = "ft6"; - s4_len = 3; - break; - } - case 0x09:{ - s4 = "fs1"; - s4_len = 3; - break; - } - case 0x10:{ - s4 = "fa6"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "fs11"; - s4_len = 4; - break; - } - case 0x1C:{ - s4 = "ft8"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "fs6"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "ft0"; - s4_len = 3; - break; - } - case 0x0A:{ - s4 = "fa0"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "fs10"; - s4_len = 4; - break; - } - case 0x17:{ - s4 = "fs7"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "fa2"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "fs8"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "ft2"; - s4_len = 3; - break; - } - case 0x1F:{ - s4 = "ft11"; - s4_len = 4; - break; - } - case 0x0B:{ - s4 = "fa1"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "ft7"; - s4_len = 3; - break; - } - case 0x13:{ - s4 = "fs3"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "ft4"; - s4_len = 3; - break; - } - case 0x19:{ - s4 = "fs9"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "fs2"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "fs4"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "fa4"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "ft10"; - s4_len = 4; - break; - } - case 0x11:{ - s4 = "fa7"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "ft3"; - s4_len = 3; - break; - } - case 0x05:{ - s4 = "ft5"; - s4_len = 3; - break; - } - case 0x1D:{ - s4 = "ft9"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "fa3"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "fa5"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.riscv_fminm_d.rs2) { - case 0x08:{ - s6 = "fs0"; - s6_len = 3; - break; - } - case 0x15:{ - s6 = "fs5"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "ft1"; - s6_len = 3; - break; - } - case 0x06:{ - s6 = "ft6"; - s6_len = 3; - break; - } - case 0x09:{ - s6 = "fs1"; - s6_len = 3; - break; - } - case 0x10:{ - s6 = "fa6"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "fs11"; - s6_len = 4; - break; - } - case 0x1C:{ - s6 = "ft8"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "fs6"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "ft0"; - s6_len = 3; - break; - } - case 0x0A:{ - s6 = "fa0"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "fs10"; - s6_len = 4; - break; - } - case 0x17:{ - s6 = "fs7"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "fa2"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "fs8"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "ft2"; - s6_len = 3; - break; - } - case 0x1F:{ - s6 = "ft11"; - s6_len = 4; - break; - } - case 0x0B:{ - s6 = "fa1"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "ft7"; - s6_len = 3; - break; - } - case 0x13:{ - s6 = "fs3"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "ft4"; - s6_len = 3; - break; - } - case 0x19:{ - s6 = "fs9"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "fs2"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "fs4"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "fa4"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "ft10"; - s6_len = 4; - break; - } - case 0x11:{ - s6 = "fa7"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "ft3"; - s6_len = 3; - break; - } - case 0x05:{ - s6 = "ft5"; - s6_len = 3; - break; - } - case 0x1D:{ - s6 = "ft9"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "fa3"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "fa5"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_FMAXM_D: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fmaxm.d"; + 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); - switch (tree->ast_node.riscv_fmaxm_d.rd) { - case 0x08:{ - s2 = "fs0"; - s2_len = 3; - break; - } - case 0x15:{ - s2 = "fs5"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "ft1"; - s2_len = 3; - break; - } - case 0x06:{ - s2 = "ft6"; - s2_len = 3; - break; - } - case 0x09:{ - s2 = "fs1"; - s2_len = 3; - break; - } - case 0x10:{ - s2 = "fa6"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "fs11"; - s2_len = 4; - break; - } - case 0x1C:{ - s2 = "ft8"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "fs6"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "ft0"; - s2_len = 3; - break; - } - case 0x0A:{ - s2 = "fa0"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "fs10"; - s2_len = 4; - break; - } - case 0x17:{ - s2 = "fs7"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "fa2"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "fs8"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "ft2"; - s2_len = 3; - break; - } - case 0x1F:{ - s2 = "ft11"; - s2_len = 4; - break; - } - case 0x0B:{ - s2 = "fa1"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "ft7"; - s2_len = 3; - break; - } - case 0x13:{ - s2 = "fs3"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "ft4"; - s2_len = 3; - break; - } - case 0x19:{ - s2 = "fs9"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "fs2"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "fs4"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "fa4"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "ft10"; - s2_len = 4; - break; - } - case 0x11:{ - s2 = "fa7"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "ft3"; - s2_len = 3; - break; - } - case 0x05:{ - s2 = "ft5"; - s2_len = 3; - break; - } - case 0x1D:{ - s2 = "ft9"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "fa3"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "fa5"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_fmaxm_d.rs1) { - case 0x08:{ - s4 = "fs0"; - s4_len = 3; - break; - } - case 0x15:{ - s4 = "fs5"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "ft1"; - s4_len = 3; - break; - } - case 0x06:{ - s4 = "ft6"; - s4_len = 3; - break; - } - case 0x09:{ - s4 = "fs1"; - s4_len = 3; - break; - } - case 0x10:{ - s4 = "fa6"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "fs11"; - s4_len = 4; - break; - } - case 0x1C:{ - s4 = "ft8"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "fs6"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "ft0"; - s4_len = 3; - break; - } - case 0x0A:{ - s4 = "fa0"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "fs10"; - s4_len = 4; - break; - } - case 0x17:{ - s4 = "fs7"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "fa2"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "fs8"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "ft2"; - s4_len = 3; - break; - } - case 0x1F:{ - s4 = "ft11"; - s4_len = 4; - break; - } - case 0x0B:{ - s4 = "fa1"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "ft7"; - s4_len = 3; - break; - } - case 0x13:{ - s4 = "fs3"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "ft4"; - s4_len = 3; - break; - } - case 0x19:{ - s4 = "fs9"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "fs2"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "fs4"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "fa4"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "ft10"; - s4_len = 4; - break; - } - case 0x11:{ - s4 = "fa7"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "ft3"; - s4_len = 3; - break; - } - case 0x05:{ - s4 = "ft5"; - s4_len = 3; - break; - } - case 0x1D:{ - s4 = "ft9"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "fa3"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "fa5"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.riscv_fmaxm_d.rs2) { - case 0x08:{ - s6 = "fs0"; - s6_len = 3; - break; - } - case 0x15:{ - s6 = "fs5"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "ft1"; - s6_len = 3; - break; - } - case 0x06:{ - s6 = "ft6"; - s6_len = 3; - break; - } - case 0x09:{ - s6 = "fs1"; - s6_len = 3; - break; - } - case 0x10:{ - s6 = "fa6"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "fs11"; - s6_len = 4; - break; - } - case 0x1C:{ - s6 = "ft8"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "fs6"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "ft0"; - s6_len = 3; - break; - } - case 0x0A:{ - s6 = "fa0"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "fs10"; - s6_len = 4; - break; - } - case 0x17:{ - s6 = "fs7"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "fa2"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "fs8"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "ft2"; - s6_len = 3; - break; - } - case 0x1F:{ - s6 = "ft11"; - s6_len = 4; - break; - } - case 0x0B:{ - s6 = "fa1"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "ft7"; - s6_len = 3; - break; - } - case 0x13:{ - s6 = "fs3"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "ft4"; - s6_len = 3; - break; - } - case 0x19:{ - s6 = "fs9"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "fs2"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "fs4"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "fa4"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "ft10"; - s6_len = 4; - break; - } - case 0x11:{ - s6 = "fa7"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "ft3"; - s6_len = 3; - break; - } - case 0x05:{ - s6 = "ft5"; - s6_len = 3; - break; - } - case 0x1D:{ - s6 = "ft9"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "fa3"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "fa5"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_FROUND_H: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fround.h"; + 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); - switch (tree->ast_node.riscv_fround_h.rd) { - case 0x08:{ - s2 = "fs0"; - s2_len = 3; - break; - } - case 0x15:{ - s2 = "fs5"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "ft1"; - s2_len = 3; - break; - } - case 0x06:{ - s2 = "ft6"; - s2_len = 3; - break; - } - case 0x09:{ - s2 = "fs1"; - s2_len = 3; - break; - } - case 0x10:{ - s2 = "fa6"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "fs11"; - s2_len = 4; - break; - } - case 0x1C:{ - s2 = "ft8"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "fs6"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "ft0"; - s2_len = 3; - break; - } - case 0x0A:{ - s2 = "fa0"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "fs10"; - s2_len = 4; - break; - } - case 0x17:{ - s2 = "fs7"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "fa2"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "fs8"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "ft2"; - s2_len = 3; - break; - } - case 0x1F:{ - s2 = "ft11"; - s2_len = 4; - break; - } - case 0x0B:{ - s2 = "fa1"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "ft7"; - s2_len = 3; - break; - } - case 0x13:{ - s2 = "fs3"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "ft4"; - s2_len = 3; - break; - } - case 0x19:{ - s2 = "fs9"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "fs2"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "fs4"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "fa4"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "ft10"; - s2_len = 4; - break; - } - case 0x11:{ - s2 = "fa7"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "ft3"; - s2_len = 3; - break; - } - case 0x05:{ - s2 = "ft5"; - s2_len = 3; - break; - } - case 0x1D:{ - s2 = "ft9"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "fa3"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "fa5"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_fround_h.rs1) { - case 0x08:{ - s4 = "fs0"; - s4_len = 3; - break; - } - case 0x15:{ - s4 = "fs5"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "ft1"; - s4_len = 3; - break; - } - case 0x06:{ - s4 = "ft6"; - s4_len = 3; - break; - } - case 0x09:{ - s4 = "fs1"; - s4_len = 3; - break; - } - case 0x10:{ - s4 = "fa6"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "fs11"; - s4_len = 4; - break; - } - case 0x1C:{ - s4 = "ft8"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "fs6"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "ft0"; - s4_len = 3; - break; - } - case 0x0A:{ - s4 = "fa0"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "fs10"; - s4_len = 4; - break; - } - case 0x17:{ - s4 = "fs7"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "fa2"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "fs8"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "ft2"; - s4_len = 3; - break; - } - case 0x1F:{ - s4 = "ft11"; - s4_len = 4; - break; - } - case 0x0B:{ - s4 = "fa1"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "ft7"; - s4_len = 3; - break; - } - case 0x13:{ - s4 = "fs3"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "ft4"; - s4_len = 3; - break; - } - case 0x19:{ - s4 = "fs9"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "fs2"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "fs4"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "fa4"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "ft10"; - s4_len = 4; - break; - } - case 0x11:{ - s4 = "fa7"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "ft3"; - s4_len = 3; - break; - } - case 0x05:{ - s4 = "ft5"; - s4_len = 3; - break; - } - case 0x1D:{ - s4 = "ft9"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "fa3"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "fa5"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.riscv_fround_h.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_FROUNDNX_H: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "froundnx.h"; - s0_len = 10; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_froundnx_h.rd) { - case 0x08:{ - s2 = "fs0"; - s2_len = 3; - break; - } - case 0x15:{ - s2 = "fs5"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "ft1"; - s2_len = 3; - break; - } - case 0x06:{ - s2 = "ft6"; - s2_len = 3; - break; - } - case 0x09:{ - s2 = "fs1"; - s2_len = 3; - break; - } - case 0x10:{ - s2 = "fa6"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "fs11"; - s2_len = 4; - break; - } - case 0x1C:{ - s2 = "ft8"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "fs6"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "ft0"; - s2_len = 3; - break; - } - case 0x0A:{ - s2 = "fa0"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "fs10"; - s2_len = 4; - break; - } - case 0x17:{ - s2 = "fs7"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "fa2"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "fs8"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "ft2"; - s2_len = 3; - break; - } - case 0x1F:{ - s2 = "ft11"; - s2_len = 4; - break; - } - case 0x0B:{ - s2 = "fa1"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "ft7"; - s2_len = 3; - break; - } - case 0x13:{ - s2 = "fs3"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "ft4"; - s2_len = 3; - break; - } - case 0x19:{ - s2 = "fs9"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "fs2"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "fs4"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "fa4"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "ft10"; - s2_len = 4; - break; - } - case 0x11:{ - s2 = "fa7"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "ft3"; - s2_len = 3; - break; - } - case 0x05:{ - s2 = "ft5"; - s2_len = 3; - break; - } - case 0x1D:{ - s2 = "ft9"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "fa3"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "fa5"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_froundnx_h.rs1) { - case 0x08:{ - s4 = "fs0"; - s4_len = 3; - break; - } - case 0x15:{ - s4 = "fs5"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "ft1"; - s4_len = 3; - break; - } - case 0x06:{ - s4 = "ft6"; - s4_len = 3; - break; - } - case 0x09:{ - s4 = "fs1"; - s4_len = 3; - break; - } - case 0x10:{ - s4 = "fa6"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "fs11"; - s4_len = 4; - break; - } - case 0x1C:{ - s4 = "ft8"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "fs6"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "ft0"; - s4_len = 3; - break; - } - case 0x0A:{ - s4 = "fa0"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "fs10"; - s4_len = 4; - break; - } - case 0x17:{ - s4 = "fs7"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "fa2"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "fs8"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "ft2"; - s4_len = 3; - break; - } - case 0x1F:{ - s4 = "ft11"; - s4_len = 4; - break; - } - case 0x0B:{ - s4 = "fa1"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "ft7"; - s4_len = 3; - break; - } - case 0x13:{ - s4 = "fs3"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "ft4"; - s4_len = 3; - break; - } - case 0x19:{ - s4 = "fs9"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "fs2"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "fs4"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "fa4"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "ft10"; - s4_len = 4; - break; - } - case 0x11:{ - s4 = "fa7"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "ft3"; - s4_len = 3; - break; - } - case 0x05:{ - s4 = "ft5"; - s4_len = 3; - break; - } - case 0x1D:{ - s4 = "ft9"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "fa3"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "fa5"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.riscv_froundnx_h.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_FROUND_S: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fround.s"; - s0_len = 8; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_fround_s.rd) { - case 0x08:{ - s2 = "fs0"; - s2_len = 3; - break; - } - case 0x15:{ - s2 = "fs5"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "ft1"; - s2_len = 3; - break; - } - case 0x06:{ - s2 = "ft6"; - s2_len = 3; - break; - } - case 0x09:{ - s2 = "fs1"; - s2_len = 3; - break; - } - case 0x10:{ - s2 = "fa6"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "fs11"; - s2_len = 4; - break; - } - case 0x1C:{ - s2 = "ft8"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "fs6"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "ft0"; - s2_len = 3; - break; - } - case 0x0A:{ - s2 = "fa0"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "fs10"; - s2_len = 4; - break; - } - case 0x17:{ - s2 = "fs7"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "fa2"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "fs8"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "ft2"; - s2_len = 3; - break; - } - case 0x1F:{ - s2 = "ft11"; - s2_len = 4; - break; - } - case 0x0B:{ - s2 = "fa1"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "ft7"; - s2_len = 3; - break; - } - case 0x13:{ - s2 = "fs3"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "ft4"; - s2_len = 3; - break; - } - case 0x19:{ - s2 = "fs9"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "fs2"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "fs4"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "fa4"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "ft10"; - s2_len = 4; - break; - } - case 0x11:{ - s2 = "fa7"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "ft3"; - s2_len = 3; - break; - } - case 0x05:{ - s2 = "ft5"; - s2_len = 3; - break; - } - case 0x1D:{ - s2 = "ft9"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "fa3"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "fa5"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_fround_s.rs1) { - case 0x08:{ - s4 = "fs0"; - s4_len = 3; - break; - } - case 0x15:{ - s4 = "fs5"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "ft1"; - s4_len = 3; - break; - } - case 0x06:{ - s4 = "ft6"; - s4_len = 3; - break; - } - case 0x09:{ - s4 = "fs1"; - s4_len = 3; - break; - } - case 0x10:{ - s4 = "fa6"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "fs11"; - s4_len = 4; - break; - } - case 0x1C:{ - s4 = "ft8"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "fs6"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "ft0"; - s4_len = 3; - break; - } - case 0x0A:{ - s4 = "fa0"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "fs10"; - s4_len = 4; - break; - } - case 0x17:{ - s4 = "fs7"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "fa2"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "fs8"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "ft2"; - s4_len = 3; - break; - } - case 0x1F:{ - s4 = "ft11"; - s4_len = 4; - break; - } - case 0x0B:{ - s4 = "fa1"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "ft7"; - s4_len = 3; - break; - } - case 0x13:{ - s4 = "fs3"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "ft4"; - s4_len = 3; - break; - } - case 0x19:{ - s4 = "fs9"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "fs2"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "fs4"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "fa4"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "ft10"; - s4_len = 4; - break; - } - case 0x11:{ - s4 = "fa7"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "ft3"; - s4_len = 3; - break; - } - case 0x05:{ - s4 = "ft5"; - s4_len = 3; - break; - } - case 0x1D:{ - s4 = "ft9"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "fa3"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "fa5"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.riscv_fround_s.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_FROUNDNX_S: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "froundnx.s"; - s0_len = 10; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_froundnx_s.rd) { - case 0x08:{ - s2 = "fs0"; - s2_len = 3; - break; - } - case 0x15:{ - s2 = "fs5"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "ft1"; - s2_len = 3; - break; - } - case 0x06:{ - s2 = "ft6"; - s2_len = 3; - break; - } - case 0x09:{ - s2 = "fs1"; - s2_len = 3; - break; - } - case 0x10:{ - s2 = "fa6"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "fs11"; - s2_len = 4; - break; - } - case 0x1C:{ - s2 = "ft8"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "fs6"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "ft0"; - s2_len = 3; - break; - } - case 0x0A:{ - s2 = "fa0"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "fs10"; - s2_len = 4; - break; - } - case 0x17:{ - s2 = "fs7"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "fa2"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "fs8"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "ft2"; - s2_len = 3; - break; - } - case 0x1F:{ - s2 = "ft11"; - s2_len = 4; - break; - } - case 0x0B:{ - s2 = "fa1"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "ft7"; - s2_len = 3; - break; - } - case 0x13:{ - s2 = "fs3"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "ft4"; - s2_len = 3; - break; - } - case 0x19:{ - s2 = "fs9"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "fs2"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "fs4"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "fa4"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "ft10"; - s2_len = 4; - break; - } - case 0x11:{ - s2 = "fa7"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "ft3"; - s2_len = 3; - break; - } - case 0x05:{ - s2 = "ft5"; - s2_len = 3; - break; - } - case 0x1D:{ - s2 = "ft9"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "fa3"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "fa5"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_froundnx_s.rs1) { - case 0x08:{ - s4 = "fs0"; - s4_len = 3; - break; - } - case 0x15:{ - s4 = "fs5"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "ft1"; - s4_len = 3; - break; - } - case 0x06:{ - s4 = "ft6"; - s4_len = 3; - break; - } - case 0x09:{ - s4 = "fs1"; - s4_len = 3; - break; - } - case 0x10:{ - s4 = "fa6"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "fs11"; - s4_len = 4; - break; - } - case 0x1C:{ - s4 = "ft8"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "fs6"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "ft0"; - s4_len = 3; - break; - } - case 0x0A:{ - s4 = "fa0"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "fs10"; - s4_len = 4; - break; - } - case 0x17:{ - s4 = "fs7"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "fa2"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "fs8"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "ft2"; - s4_len = 3; - break; - } - case 0x1F:{ - s4 = "ft11"; - s4_len = 4; - break; - } - case 0x0B:{ - s4 = "fa1"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "ft7"; - s4_len = 3; - break; - } - case 0x13:{ - s4 = "fs3"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "ft4"; - s4_len = 3; - break; - } - case 0x19:{ - s4 = "fs9"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "fs2"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "fs4"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "fa4"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "ft10"; - s4_len = 4; - break; - } - case 0x11:{ - s4 = "fa7"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "ft3"; - s4_len = 3; - break; - } - case 0x05:{ - s4 = "ft5"; - s4_len = 3; - break; - } - case 0x1D:{ - s4 = "ft9"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "fa3"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "fa5"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.riscv_froundnx_s.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_FROUND_D: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fround.d"; - s0_len = 8; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_fround_d.rd) { - case 0x08:{ - s2 = "fs0"; - s2_len = 3; - break; - } - case 0x15:{ - s2 = "fs5"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "ft1"; - s2_len = 3; - break; - } - case 0x06:{ - s2 = "ft6"; - s2_len = 3; - break; - } - case 0x09:{ - s2 = "fs1"; - s2_len = 3; - break; - } - case 0x10:{ - s2 = "fa6"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "fs11"; - s2_len = 4; - break; - } - case 0x1C:{ - s2 = "ft8"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "fs6"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "ft0"; - s2_len = 3; - break; - } - case 0x0A:{ - s2 = "fa0"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "fs10"; - s2_len = 4; - break; - } - case 0x17:{ - s2 = "fs7"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "fa2"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "fs8"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "ft2"; - s2_len = 3; - break; - } - case 0x1F:{ - s2 = "ft11"; - s2_len = 4; - break; - } - case 0x0B:{ - s2 = "fa1"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "ft7"; - s2_len = 3; - break; - } - case 0x13:{ - s2 = "fs3"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "ft4"; - s2_len = 3; - break; - } - case 0x19:{ - s2 = "fs9"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "fs2"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "fs4"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "fa4"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "ft10"; - s2_len = 4; - break; - } - case 0x11:{ - s2 = "fa7"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "ft3"; - s2_len = 3; - break; - } - case 0x05:{ - s2 = "ft5"; - s2_len = 3; - break; - } - case 0x1D:{ - s2 = "ft9"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "fa3"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "fa5"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_fround_d.rs1) { - case 0x08:{ - s4 = "fs0"; - s4_len = 3; - break; - } - case 0x15:{ - s4 = "fs5"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "ft1"; - s4_len = 3; - break; - } - case 0x06:{ - s4 = "ft6"; - s4_len = 3; - break; - } - case 0x09:{ - s4 = "fs1"; - s4_len = 3; - break; - } - case 0x10:{ - s4 = "fa6"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "fs11"; - s4_len = 4; - break; - } - case 0x1C:{ - s4 = "ft8"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "fs6"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "ft0"; - s4_len = 3; - break; - } - case 0x0A:{ - s4 = "fa0"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "fs10"; - s4_len = 4; - break; - } - case 0x17:{ - s4 = "fs7"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "fa2"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "fs8"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "ft2"; - s4_len = 3; - break; - } - case 0x1F:{ - s4 = "ft11"; - s4_len = 4; - break; - } - case 0x0B:{ - s4 = "fa1"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "ft7"; - s4_len = 3; - break; - } - case 0x13:{ - s4 = "fs3"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "ft4"; - s4_len = 3; - break; - } - case 0x19:{ - s4 = "fs9"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "fs2"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "fs4"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "fa4"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "ft10"; - s4_len = 4; - break; - } - case 0x11:{ - s4 = "fa7"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "ft3"; - s4_len = 3; - break; - } - case 0x05:{ - s4 = "ft5"; - s4_len = 3; - break; - } - case 0x1D:{ - s4 = "ft9"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "fa3"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "fa5"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.riscv_fround_d.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_FROUNDNX_D: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "froundnx.d"; - s0_len = 10; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_froundnx_d.rd) { - case 0x08:{ - s2 = "fs0"; - s2_len = 3; - break; - } - case 0x15:{ - s2 = "fs5"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "ft1"; - s2_len = 3; - break; - } - case 0x06:{ - s2 = "ft6"; - s2_len = 3; - break; - } - case 0x09:{ - s2 = "fs1"; - s2_len = 3; - break; - } - case 0x10:{ - s2 = "fa6"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "fs11"; - s2_len = 4; - break; - } - case 0x1C:{ - s2 = "ft8"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "fs6"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "ft0"; - s2_len = 3; - break; - } - case 0x0A:{ - s2 = "fa0"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "fs10"; - s2_len = 4; - break; - } - case 0x17:{ - s2 = "fs7"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "fa2"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "fs8"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "ft2"; - s2_len = 3; - break; - } - case 0x1F:{ - s2 = "ft11"; - s2_len = 4; - break; - } - case 0x0B:{ - s2 = "fa1"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "ft7"; - s2_len = 3; - break; - } - case 0x13:{ - s2 = "fs3"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "ft4"; - s2_len = 3; - break; - } - case 0x19:{ - s2 = "fs9"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "fs2"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "fs4"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "fa4"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "ft10"; - s2_len = 4; - break; - } - case 0x11:{ - s2 = "fa7"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "ft3"; - s2_len = 3; - break; - } - case 0x05:{ - s2 = "ft5"; - s2_len = 3; - break; - } - case 0x1D:{ - s2 = "ft9"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "fa3"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "fa5"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_froundnx_d.rs1) { - case 0x08:{ - s4 = "fs0"; - s4_len = 3; - break; - } - case 0x15:{ - s4 = "fs5"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "ft1"; - s4_len = 3; - break; - } - case 0x06:{ - s4 = "ft6"; - s4_len = 3; - break; - } - case 0x09:{ - s4 = "fs1"; - s4_len = 3; - break; - } - case 0x10:{ - s4 = "fa6"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "fs11"; - s4_len = 4; - break; - } - case 0x1C:{ - s4 = "ft8"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "fs6"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "ft0"; - s4_len = 3; - break; - } - case 0x0A:{ - s4 = "fa0"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "fs10"; - s4_len = 4; - break; - } - case 0x17:{ - s4 = "fs7"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "fa2"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "fs8"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "ft2"; - s4_len = 3; - break; - } - case 0x1F:{ - s4 = "ft11"; - s4_len = 4; - break; - } - case 0x0B:{ - s4 = "fa1"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "ft7"; - s4_len = 3; - break; - } - case 0x13:{ - s4 = "fs3"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "ft4"; - s4_len = 3; - break; - } - case 0x19:{ - s4 = "fs9"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "fs2"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "fs4"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "fa4"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "ft10"; - s4_len = 4; - break; - } - case 0x11:{ - s4 = "fa7"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "ft3"; - s4_len = 3; - break; - } - case 0x05:{ - s4 = "ft5"; - s4_len = 3; - break; - } - case 0x1D:{ - s4 = "ft9"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "fa3"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "fa5"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.riscv_froundnx_d.rm) { - case RISCV_RM_RNE:{ - s6 = "rne"; - s6_len = 3; - break; - } - case RISCV_RM_RTZ:{ - s6 = "rtz"; - s6_len = 3; - break; - } - case RISCV_RM_RDN:{ - s6 = "rdn"; - s6_len = 3; - break; - } - case RISCV_RM_RMM:{ - s6 = "rmm"; - s6_len = 3; - break; - } - case RISCV_RM_RUP:{ - s6 = "rup"; - s6_len = 3; - break; - } - case RISCV_RM_DYN:{ - s6 = "dyn"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_FMVH_X_D: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "fmvh.x.d"; + 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); - switch (tree->ast_node.riscv_fmvh_x_d.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_fmvh_x_d.rs1) { - case 0x08:{ - s4 = "fs0"; - s4_len = 3; - break; - } - case 0x15:{ - s4 = "fs5"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "ft1"; - s4_len = 3; - break; - } - case 0x06:{ - s4 = "ft6"; - s4_len = 3; - break; - } - case 0x09:{ - s4 = "fs1"; - s4_len = 3; - break; - } - case 0x10:{ - s4 = "fa6"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "fs11"; - s4_len = 4; - break; - } - case 0x1C:{ - s4 = "ft8"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "fs6"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "ft0"; - s4_len = 3; - break; - } - case 0x0A:{ - s4 = "fa0"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "fs10"; - s4_len = 4; - break; - } - case 0x17:{ - s4 = "fs7"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "fa2"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "fs8"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "ft2"; - s4_len = 3; - break; - } - case 0x1F:{ - s4 = "ft11"; - s4_len = 4; - break; - } - case 0x0B:{ - s4 = "fa1"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "ft7"; - s4_len = 3; - break; - } - case 0x13:{ - s4 = "fs3"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "ft4"; - s4_len = 3; - break; - } - case 0x19:{ - s4 = "fs9"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "fs2"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "fs4"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "fa4"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "ft10"; - s4_len = 4; - break; - } - case 0x11:{ - s4 = "fa7"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "ft3"; - s4_len = 3; - break; - } - case 0x05:{ - s4 = "ft5"; - s4_len = 3; - break; - } - case 0x1D:{ - s4 = "ft9"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "fa3"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "fa5"; - s4_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_FMVP_D_X: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fmvp.d.x"; + 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); - switch (tree->ast_node.riscv_fmvp_d_x.rd) { - case 0x08:{ - s2 = "fs0"; - s2_len = 3; - break; - } - case 0x15:{ - s2 = "fs5"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "ft1"; - s2_len = 3; - break; - } - case 0x06:{ - s2 = "ft6"; - s2_len = 3; - break; - } - case 0x09:{ - s2 = "fs1"; - s2_len = 3; - break; - } - case 0x10:{ - s2 = "fa6"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "fs11"; - s2_len = 4; - break; - } - case 0x1C:{ - s2 = "ft8"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "fs6"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "ft0"; - s2_len = 3; - break; - } - case 0x0A:{ - s2 = "fa0"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "fs10"; - s2_len = 4; - break; - } - case 0x17:{ - s2 = "fs7"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "fa2"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "fs8"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "ft2"; - s2_len = 3; - break; - } - case 0x1F:{ - s2 = "ft11"; - s2_len = 4; - break; - } - case 0x0B:{ - s2 = "fa1"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "ft7"; - s2_len = 3; - break; - } - case 0x13:{ - s2 = "fs3"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "ft4"; - s2_len = 3; - break; - } - case 0x19:{ - s2 = "fs9"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "fs2"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "fs4"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "fa4"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "ft10"; - s2_len = 4; - break; - } - case 0x11:{ - s2 = "fa7"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "ft3"; - s2_len = 3; - break; - } - case 0x05:{ - s2 = "ft5"; - s2_len = 3; - break; - } - case 0x1D:{ - s2 = "ft9"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "fa3"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "fa5"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_fmvp_d_x.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.riscv_fmvp_d_x.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_FLEQ_H: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fleq.h"; - s0_len = 6; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_fleq_h.rd) { - case 0x08:{ - s2 = "fs0"; - s2_len = 3; - break; - } - case 0x15:{ - s2 = "fs5"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "ft1"; - s2_len = 3; - break; - } - case 0x06:{ - s2 = "ft6"; - s2_len = 3; - break; - } - case 0x09:{ - s2 = "fs1"; - s2_len = 3; - break; - } - case 0x10:{ - s2 = "fa6"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "fs11"; - s2_len = 4; - break; - } - case 0x1C:{ - s2 = "ft8"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "fs6"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "ft0"; - s2_len = 3; - break; - } - case 0x0A:{ - s2 = "fa0"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "fs10"; - s2_len = 4; - break; - } - case 0x17:{ - s2 = "fs7"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "fa2"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "fs8"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "ft2"; - s2_len = 3; - break; - } - case 0x1F:{ - s2 = "ft11"; - s2_len = 4; - break; - } - case 0x0B:{ - s2 = "fa1"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "ft7"; - s2_len = 3; - break; - } - case 0x13:{ - s2 = "fs3"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "ft4"; - s2_len = 3; - break; - } - case 0x19:{ - s2 = "fs9"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "fs2"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "fs4"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "fa4"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "ft10"; - s2_len = 4; - break; - } - case 0x11:{ - s2 = "fa7"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "ft3"; - s2_len = 3; - break; - } - case 0x05:{ - s2 = "ft5"; - s2_len = 3; - break; - } - case 0x1D:{ - s2 = "ft9"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "fa3"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "fa5"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_fleq_h.rs1) { - case 0x08:{ - s4 = "fs0"; - s4_len = 3; - break; - } - case 0x15:{ - s4 = "fs5"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "ft1"; - s4_len = 3; - break; - } - case 0x06:{ - s4 = "ft6"; - s4_len = 3; - break; - } - case 0x09:{ - s4 = "fs1"; - s4_len = 3; - break; - } - case 0x10:{ - s4 = "fa6"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "fs11"; - s4_len = 4; - break; - } - case 0x1C:{ - s4 = "ft8"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "fs6"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "ft0"; - s4_len = 3; - break; - } - case 0x0A:{ - s4 = "fa0"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "fs10"; - s4_len = 4; - break; - } - case 0x17:{ - s4 = "fs7"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "fa2"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "fs8"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "ft2"; - s4_len = 3; - break; - } - case 0x1F:{ - s4 = "ft11"; - s4_len = 4; - break; - } - case 0x0B:{ - s4 = "fa1"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "ft7"; - s4_len = 3; - break; - } - case 0x13:{ - s4 = "fs3"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "ft4"; - s4_len = 3; - break; - } - case 0x19:{ - s4 = "fs9"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "fs2"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "fs4"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "fa4"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "ft10"; - s4_len = 4; - break; - } - case 0x11:{ - s4 = "fa7"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "ft3"; - s4_len = 3; - break; - } - case 0x05:{ - s4 = "ft5"; - s4_len = 3; - break; - } - case 0x1D:{ - s4 = "ft9"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "fa3"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "fa5"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.riscv_fleq_h.rs2) { - case 0x08:{ - s6 = "fs0"; - s6_len = 3; - break; - } - case 0x15:{ - s6 = "fs5"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "ft1"; - s6_len = 3; - break; - } - case 0x06:{ - s6 = "ft6"; - s6_len = 3; - break; - } - case 0x09:{ - s6 = "fs1"; - s6_len = 3; - break; - } - case 0x10:{ - s6 = "fa6"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "fs11"; - s6_len = 4; - break; - } - case 0x1C:{ - s6 = "ft8"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "fs6"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "ft0"; - s6_len = 3; - break; - } - case 0x0A:{ - s6 = "fa0"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "fs10"; - s6_len = 4; - break; - } - case 0x17:{ - s6 = "fs7"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "fa2"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "fs8"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "ft2"; - s6_len = 3; - break; - } - case 0x1F:{ - s6 = "ft11"; - s6_len = 4; - break; - } - case 0x0B:{ - s6 = "fa1"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "ft7"; - s6_len = 3; - break; - } - case 0x13:{ - s6 = "fs3"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "ft4"; - s6_len = 3; - break; - } - case 0x19:{ - s6 = "fs9"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "fs2"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "fs4"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "fa4"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "ft10"; - s6_len = 4; - break; - } - case 0x11:{ - s6 = "fa7"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "ft3"; - s6_len = 3; - break; - } - case 0x05:{ - s6 = "ft5"; - s6_len = 3; - break; - } - case 0x1D:{ - s6 = "ft9"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "fa3"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "fa5"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_FLTQ_H: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fltq.h"; - s0_len = 6; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_fltq_h.rd) { - case 0x08:{ - s2 = "fs0"; - s2_len = 3; - break; - } - case 0x15:{ - s2 = "fs5"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "ft1"; - s2_len = 3; - break; - } - case 0x06:{ - s2 = "ft6"; - s2_len = 3; - break; - } - case 0x09:{ - s2 = "fs1"; - s2_len = 3; - break; - } - case 0x10:{ - s2 = "fa6"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "fs11"; - s2_len = 4; - break; - } - case 0x1C:{ - s2 = "ft8"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "fs6"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "ft0"; - s2_len = 3; - break; - } - case 0x0A:{ - s2 = "fa0"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "fs10"; - s2_len = 4; - break; - } - case 0x17:{ - s2 = "fs7"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "fa2"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "fs8"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "ft2"; - s2_len = 3; - break; - } - case 0x1F:{ - s2 = "ft11"; - s2_len = 4; - break; - } - case 0x0B:{ - s2 = "fa1"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "ft7"; - s2_len = 3; - break; - } - case 0x13:{ - s2 = "fs3"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "ft4"; - s2_len = 3; - break; - } - case 0x19:{ - s2 = "fs9"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "fs2"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "fs4"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "fa4"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "ft10"; - s2_len = 4; - break; - } - case 0x11:{ - s2 = "fa7"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "ft3"; - s2_len = 3; - break; - } - case 0x05:{ - s2 = "ft5"; - s2_len = 3; - break; - } - case 0x1D:{ - s2 = "ft9"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "fa3"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "fa5"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_fltq_h.rs1) { - case 0x08:{ - s4 = "fs0"; - s4_len = 3; - break; - } - case 0x15:{ - s4 = "fs5"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "ft1"; - s4_len = 3; - break; - } - case 0x06:{ - s4 = "ft6"; - s4_len = 3; - break; - } - case 0x09:{ - s4 = "fs1"; - s4_len = 3; - break; - } - case 0x10:{ - s4 = "fa6"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "fs11"; - s4_len = 4; - break; - } - case 0x1C:{ - s4 = "ft8"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "fs6"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "ft0"; - s4_len = 3; - break; - } - case 0x0A:{ - s4 = "fa0"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "fs10"; - s4_len = 4; - break; - } - case 0x17:{ - s4 = "fs7"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "fa2"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "fs8"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "ft2"; - s4_len = 3; - break; - } - case 0x1F:{ - s4 = "ft11"; - s4_len = 4; - break; - } - case 0x0B:{ - s4 = "fa1"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "ft7"; - s4_len = 3; - break; - } - case 0x13:{ - s4 = "fs3"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "ft4"; - s4_len = 3; - break; - } - case 0x19:{ - s4 = "fs9"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "fs2"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "fs4"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "fa4"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "ft10"; - s4_len = 4; - break; - } - case 0x11:{ - s4 = "fa7"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "ft3"; - s4_len = 3; - break; - } - case 0x05:{ - s4 = "ft5"; - s4_len = 3; - break; - } - case 0x1D:{ - s4 = "ft9"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "fa3"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "fa5"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.riscv_fltq_h.rs2) { - case 0x08:{ - s6 = "fs0"; - s6_len = 3; - break; - } - case 0x15:{ - s6 = "fs5"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "ft1"; - s6_len = 3; - break; - } - case 0x06:{ - s6 = "ft6"; - s6_len = 3; - break; - } - case 0x09:{ - s6 = "fs1"; - s6_len = 3; - break; - } - case 0x10:{ - s6 = "fa6"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "fs11"; - s6_len = 4; - break; - } - case 0x1C:{ - s6 = "ft8"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "fs6"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "ft0"; - s6_len = 3; - break; - } - case 0x0A:{ - s6 = "fa0"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "fs10"; - s6_len = 4; - break; - } - case 0x17:{ - s6 = "fs7"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "fa2"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "fs8"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "ft2"; - s6_len = 3; - break; - } - case 0x1F:{ - s6 = "ft11"; - s6_len = 4; - break; - } - case 0x0B:{ - s6 = "fa1"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "ft7"; - s6_len = 3; - break; - } - case 0x13:{ - s6 = "fs3"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "ft4"; - s6_len = 3; - break; - } - case 0x19:{ - s6 = "fs9"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "fs2"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "fs4"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "fa4"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "ft10"; - s6_len = 4; - break; - } - case 0x11:{ - s6 = "fa7"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "ft3"; - s6_len = 3; - break; - } - case 0x05:{ - s6 = "ft5"; - s6_len = 3; - break; - } - case 0x1D:{ - s6 = "ft9"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "fa3"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "fa5"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_FLEQ_S: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fleq.s"; - s0_len = 6; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_fleq_s.rd) { - case 0x08:{ - s2 = "fs0"; - s2_len = 3; - break; - } - case 0x15:{ - s2 = "fs5"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "ft1"; - s2_len = 3; - break; - } - case 0x06:{ - s2 = "ft6"; - s2_len = 3; - break; - } - case 0x09:{ - s2 = "fs1"; - s2_len = 3; - break; - } - case 0x10:{ - s2 = "fa6"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "fs11"; - s2_len = 4; - break; - } - case 0x1C:{ - s2 = "ft8"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "fs6"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "ft0"; - s2_len = 3; - break; - } - case 0x0A:{ - s2 = "fa0"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "fs10"; - s2_len = 4; - break; - } - case 0x17:{ - s2 = "fs7"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "fa2"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "fs8"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "ft2"; - s2_len = 3; - break; - } - case 0x1F:{ - s2 = "ft11"; - s2_len = 4; - break; - } - case 0x0B:{ - s2 = "fa1"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "ft7"; - s2_len = 3; - break; - } - case 0x13:{ - s2 = "fs3"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "ft4"; - s2_len = 3; - break; - } - case 0x19:{ - s2 = "fs9"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "fs2"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "fs4"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "fa4"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "ft10"; - s2_len = 4; - break; - } - case 0x11:{ - s2 = "fa7"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "ft3"; - s2_len = 3; - break; - } - case 0x05:{ - s2 = "ft5"; - s2_len = 3; - break; - } - case 0x1D:{ - s2 = "ft9"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "fa3"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "fa5"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_fleq_s.rs1) { - case 0x08:{ - s4 = "fs0"; - s4_len = 3; - break; - } - case 0x15:{ - s4 = "fs5"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "ft1"; - s4_len = 3; - break; - } - case 0x06:{ - s4 = "ft6"; - s4_len = 3; - break; - } - case 0x09:{ - s4 = "fs1"; - s4_len = 3; - break; - } - case 0x10:{ - s4 = "fa6"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "fs11"; - s4_len = 4; - break; - } - case 0x1C:{ - s4 = "ft8"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "fs6"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "ft0"; - s4_len = 3; - break; - } - case 0x0A:{ - s4 = "fa0"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "fs10"; - s4_len = 4; - break; - } - case 0x17:{ - s4 = "fs7"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "fa2"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "fs8"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "ft2"; - s4_len = 3; - break; - } - case 0x1F:{ - s4 = "ft11"; - s4_len = 4; - break; - } - case 0x0B:{ - s4 = "fa1"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "ft7"; - s4_len = 3; - break; - } - case 0x13:{ - s4 = "fs3"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "ft4"; - s4_len = 3; - break; - } - case 0x19:{ - s4 = "fs9"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "fs2"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "fs4"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "fa4"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "ft10"; - s4_len = 4; - break; - } - case 0x11:{ - s4 = "fa7"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "ft3"; - s4_len = 3; - break; - } - case 0x05:{ - s4 = "ft5"; - s4_len = 3; - break; - } - case 0x1D:{ - s4 = "ft9"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "fa3"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "fa5"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.riscv_fleq_s.rs2) { - case 0x08:{ - s6 = "fs0"; - s6_len = 3; - break; - } - case 0x15:{ - s6 = "fs5"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "ft1"; - s6_len = 3; - break; - } - case 0x06:{ - s6 = "ft6"; - s6_len = 3; - break; - } - case 0x09:{ - s6 = "fs1"; - s6_len = 3; - break; - } - case 0x10:{ - s6 = "fa6"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "fs11"; - s6_len = 4; - break; - } - case 0x1C:{ - s6 = "ft8"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "fs6"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "ft0"; - s6_len = 3; - break; - } - case 0x0A:{ - s6 = "fa0"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "fs10"; - s6_len = 4; - break; - } - case 0x17:{ - s6 = "fs7"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "fa2"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "fs8"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "ft2"; - s6_len = 3; - break; - } - case 0x1F:{ - s6 = "ft11"; - s6_len = 4; - break; - } - case 0x0B:{ - s6 = "fa1"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "ft7"; - s6_len = 3; - break; - } - case 0x13:{ - s6 = "fs3"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "ft4"; - s6_len = 3; - break; - } - case 0x19:{ - s6 = "fs9"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "fs2"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "fs4"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "fa4"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "ft10"; - s6_len = 4; - break; - } - case 0x11:{ - s6 = "fa7"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "ft3"; - s6_len = 3; - break; - } - case 0x05:{ - s6 = "ft5"; - s6_len = 3; - break; - } - case 0x1D:{ - s6 = "ft9"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "fa3"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "fa5"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_FLTQ_S: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fltq.s"; - s0_len = 6; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_fltq_s.rd) { - case 0x08:{ - s2 = "fs0"; - s2_len = 3; - break; - } - case 0x15:{ - s2 = "fs5"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "ft1"; - s2_len = 3; - break; - } - case 0x06:{ - s2 = "ft6"; - s2_len = 3; - break; - } - case 0x09:{ - s2 = "fs1"; - s2_len = 3; - break; - } - case 0x10:{ - s2 = "fa6"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "fs11"; - s2_len = 4; - break; - } - case 0x1C:{ - s2 = "ft8"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "fs6"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "ft0"; - s2_len = 3; - break; - } - case 0x0A:{ - s2 = "fa0"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "fs10"; - s2_len = 4; - break; - } - case 0x17:{ - s2 = "fs7"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "fa2"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "fs8"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "ft2"; - s2_len = 3; - break; - } - case 0x1F:{ - s2 = "ft11"; - s2_len = 4; - break; - } - case 0x0B:{ - s2 = "fa1"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "ft7"; - s2_len = 3; - break; - } - case 0x13:{ - s2 = "fs3"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "ft4"; - s2_len = 3; - break; - } - case 0x19:{ - s2 = "fs9"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "fs2"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "fs4"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "fa4"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "ft10"; - s2_len = 4; - break; - } - case 0x11:{ - s2 = "fa7"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "ft3"; - s2_len = 3; - break; - } - case 0x05:{ - s2 = "ft5"; - s2_len = 3; - break; - } - case 0x1D:{ - s2 = "ft9"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "fa3"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "fa5"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_fltq_s.rs1) { - case 0x08:{ - s4 = "fs0"; - s4_len = 3; - break; - } - case 0x15:{ - s4 = "fs5"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "ft1"; - s4_len = 3; - break; - } - case 0x06:{ - s4 = "ft6"; - s4_len = 3; - break; - } - case 0x09:{ - s4 = "fs1"; - s4_len = 3; - break; - } - case 0x10:{ - s4 = "fa6"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "fs11"; - s4_len = 4; - break; - } - case 0x1C:{ - s4 = "ft8"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "fs6"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "ft0"; - s4_len = 3; - break; - } - case 0x0A:{ - s4 = "fa0"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "fs10"; - s4_len = 4; - break; - } - case 0x17:{ - s4 = "fs7"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "fa2"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "fs8"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "ft2"; - s4_len = 3; - break; - } - case 0x1F:{ - s4 = "ft11"; - s4_len = 4; - break; - } - case 0x0B:{ - s4 = "fa1"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "ft7"; - s4_len = 3; - break; - } - case 0x13:{ - s4 = "fs3"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "ft4"; - s4_len = 3; - break; - } - case 0x19:{ - s4 = "fs9"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "fs2"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "fs4"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "fa4"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "ft10"; - s4_len = 4; - break; - } - case 0x11:{ - s4 = "fa7"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "ft3"; - s4_len = 3; - break; - } - case 0x05:{ - s4 = "ft5"; - s4_len = 3; - break; - } - case 0x1D:{ - s4 = "ft9"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "fa3"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "fa5"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.riscv_fltq_s.rs2) { - case 0x08:{ - s6 = "fs0"; - s6_len = 3; - break; - } - case 0x15:{ - s6 = "fs5"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "ft1"; - s6_len = 3; - break; - } - case 0x06:{ - s6 = "ft6"; - s6_len = 3; - break; - } - case 0x09:{ - s6 = "fs1"; - s6_len = 3; - break; - } - case 0x10:{ - s6 = "fa6"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "fs11"; - s6_len = 4; - break; - } - case 0x1C:{ - s6 = "ft8"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "fs6"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "ft0"; - s6_len = 3; - break; - } - case 0x0A:{ - s6 = "fa0"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "fs10"; - s6_len = 4; - break; - } - case 0x17:{ - s6 = "fs7"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "fa2"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "fs8"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "ft2"; - s6_len = 3; - break; - } - case 0x1F:{ - s6 = "ft11"; - s6_len = 4; - break; - } - case 0x0B:{ - s6 = "fa1"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "ft7"; - s6_len = 3; - break; - } - case 0x13:{ - s6 = "fs3"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "ft4"; - s6_len = 3; - break; - } - case 0x19:{ - s6 = "fs9"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "fs2"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "fs4"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "fa4"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "ft10"; - s6_len = 4; - break; - } - case 0x11:{ - s6 = "fa7"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "ft3"; - s6_len = 3; - break; - } - case 0x05:{ - s6 = "ft5"; - s6_len = 3; - break; - } - case 0x1D:{ - s6 = "ft9"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "fa3"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "fa5"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_FLEQ_D: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fleq.d"; - s0_len = 6; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_fleq_d.rd) { - case 0x08:{ - s2 = "fs0"; - s2_len = 3; - break; - } - case 0x15:{ - s2 = "fs5"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "ft1"; - s2_len = 3; - break; - } - case 0x06:{ - s2 = "ft6"; - s2_len = 3; - break; - } - case 0x09:{ - s2 = "fs1"; - s2_len = 3; - break; - } - case 0x10:{ - s2 = "fa6"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "fs11"; - s2_len = 4; - break; - } - case 0x1C:{ - s2 = "ft8"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "fs6"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "ft0"; - s2_len = 3; - break; - } - case 0x0A:{ - s2 = "fa0"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "fs10"; - s2_len = 4; - break; - } - case 0x17:{ - s2 = "fs7"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "fa2"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "fs8"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "ft2"; - s2_len = 3; - break; - } - case 0x1F:{ - s2 = "ft11"; - s2_len = 4; - break; - } - case 0x0B:{ - s2 = "fa1"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "ft7"; - s2_len = 3; - break; - } - case 0x13:{ - s2 = "fs3"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "ft4"; - s2_len = 3; - break; - } - case 0x19:{ - s2 = "fs9"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "fs2"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "fs4"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "fa4"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "ft10"; - s2_len = 4; - break; - } - case 0x11:{ - s2 = "fa7"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "ft3"; - s2_len = 3; - break; - } - case 0x05:{ - s2 = "ft5"; - s2_len = 3; - break; - } - case 0x1D:{ - s2 = "ft9"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "fa3"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "fa5"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_fleq_d.rs1) { - case 0x08:{ - s4 = "fs0"; - s4_len = 3; - break; - } - case 0x15:{ - s4 = "fs5"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "ft1"; - s4_len = 3; - break; - } - case 0x06:{ - s4 = "ft6"; - s4_len = 3; - break; - } - case 0x09:{ - s4 = "fs1"; - s4_len = 3; - break; - } - case 0x10:{ - s4 = "fa6"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "fs11"; - s4_len = 4; - break; - } - case 0x1C:{ - s4 = "ft8"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "fs6"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "ft0"; - s4_len = 3; - break; - } - case 0x0A:{ - s4 = "fa0"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "fs10"; - s4_len = 4; - break; - } - case 0x17:{ - s4 = "fs7"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "fa2"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "fs8"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "ft2"; - s4_len = 3; - break; - } - case 0x1F:{ - s4 = "ft11"; - s4_len = 4; - break; - } - case 0x0B:{ - s4 = "fa1"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "ft7"; - s4_len = 3; - break; - } - case 0x13:{ - s4 = "fs3"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "ft4"; - s4_len = 3; - break; - } - case 0x19:{ - s4 = "fs9"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "fs2"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "fs4"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "fa4"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "ft10"; - s4_len = 4; - break; - } - case 0x11:{ - s4 = "fa7"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "ft3"; - s4_len = 3; - break; - } - case 0x05:{ - s4 = "ft5"; - s4_len = 3; - break; - } - case 0x1D:{ - s4 = "ft9"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "fa3"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "fa5"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.riscv_fleq_d.rs2) { - case 0x08:{ - s6 = "fs0"; - s6_len = 3; - break; - } - case 0x15:{ - s6 = "fs5"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "ft1"; - s6_len = 3; - break; - } - case 0x06:{ - s6 = "ft6"; - s6_len = 3; - break; - } - case 0x09:{ - s6 = "fs1"; - s6_len = 3; - break; - } - case 0x10:{ - s6 = "fa6"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "fs11"; - s6_len = 4; - break; - } - case 0x1C:{ - s6 = "ft8"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "fs6"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "ft0"; - s6_len = 3; - break; - } - case 0x0A:{ - s6 = "fa0"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "fs10"; - s6_len = 4; - break; - } - case 0x17:{ - s6 = "fs7"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "fa2"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "fs8"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "ft2"; - s6_len = 3; - break; - } - case 0x1F:{ - s6 = "ft11"; - s6_len = 4; - break; - } - case 0x0B:{ - s6 = "fa1"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "ft7"; - s6_len = 3; - break; - } - case 0x13:{ - s6 = "fs3"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "ft4"; - s6_len = 3; - break; - } - case 0x19:{ - s6 = "fs9"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "fs2"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "fs4"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "fa4"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "ft10"; - s6_len = 4; - break; - } - case 0x11:{ - s6 = "fa7"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "ft3"; - s6_len = 3; - break; - } - case 0x05:{ - s6 = "ft5"; - s6_len = 3; - break; - } - case 0x1D:{ - s6 = "ft9"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "fa3"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "fa5"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_FLTQ_D: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "fltq.d"; - s0_len = 6; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_fltq_d.rd) { - case 0x08:{ - s2 = "fs0"; - s2_len = 3; - break; - } - case 0x15:{ - s2 = "fs5"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "ft1"; - s2_len = 3; - break; - } - case 0x06:{ - s2 = "ft6"; - s2_len = 3; - break; - } - case 0x09:{ - s2 = "fs1"; - s2_len = 3; - break; - } - case 0x10:{ - s2 = "fa6"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "fs11"; - s2_len = 4; - break; - } - case 0x1C:{ - s2 = "ft8"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "fs6"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "ft0"; - s2_len = 3; - break; - } - case 0x0A:{ - s2 = "fa0"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "fs10"; - s2_len = 4; - break; - } - case 0x17:{ - s2 = "fs7"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "fa2"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "fs8"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "ft2"; - s2_len = 3; - break; - } - case 0x1F:{ - s2 = "ft11"; - s2_len = 4; - break; - } - case 0x0B:{ - s2 = "fa1"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "ft7"; - s2_len = 3; - break; - } - case 0x13:{ - s2 = "fs3"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "ft4"; - s2_len = 3; - break; - } - case 0x19:{ - s2 = "fs9"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "fs2"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "fs4"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "fa4"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "ft10"; - s2_len = 4; - break; - } - case 0x11:{ - s2 = "fa7"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "ft3"; - s2_len = 3; - break; - } - case 0x05:{ - s2 = "ft5"; - s2_len = 3; - break; - } - case 0x1D:{ - s2 = "ft9"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "fa3"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "fa5"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_fltq_d.rs1) { - case 0x08:{ - s4 = "fs0"; - s4_len = 3; - break; - } - case 0x15:{ - s4 = "fs5"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "ft1"; - s4_len = 3; - break; - } - case 0x06:{ - s4 = "ft6"; - s4_len = 3; - break; - } - case 0x09:{ - s4 = "fs1"; - s4_len = 3; - break; - } - case 0x10:{ - s4 = "fa6"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "fs11"; - s4_len = 4; - break; - } - case 0x1C:{ - s4 = "ft8"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "fs6"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "ft0"; - s4_len = 3; - break; - } - case 0x0A:{ - s4 = "fa0"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "fs10"; - s4_len = 4; - break; - } - case 0x17:{ - s4 = "fs7"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "fa2"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "fs8"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "ft2"; - s4_len = 3; - break; - } - case 0x1F:{ - s4 = "ft11"; - s4_len = 4; - break; - } - case 0x0B:{ - s4 = "fa1"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "ft7"; - s4_len = 3; - break; - } - case 0x13:{ - s4 = "fs3"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "ft4"; - s4_len = 3; - break; - } - case 0x19:{ - s4 = "fs9"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "fs2"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "fs4"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "fa4"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "ft10"; - s4_len = 4; - break; - } - case 0x11:{ - s4 = "fa7"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "ft3"; - s4_len = 3; - break; - } - case 0x05:{ - s4 = "ft5"; - s4_len = 3; - break; - } - case 0x1D:{ - s4 = "ft9"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "fa3"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "fa5"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.riscv_fltq_d.rs2) { - case 0x08:{ - s6 = "fs0"; - s6_len = 3; - break; - } - case 0x15:{ - s6 = "fs5"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "ft1"; - s6_len = 3; - break; - } - case 0x06:{ - s6 = "ft6"; - s6_len = 3; - break; - } - case 0x09:{ - s6 = "fs1"; - s6_len = 3; - break; - } - case 0x10:{ - s6 = "fa6"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "fs11"; - s6_len = 4; - break; - } - case 0x1C:{ - s6 = "ft8"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "fs6"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "ft0"; - s6_len = 3; - break; - } - case 0x0A:{ - s6 = "fa0"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "fs10"; - s6_len = 4; - break; - } - case 0x17:{ - s6 = "fs7"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "fa2"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "fs8"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "ft2"; - s6_len = 3; - break; - } - case 0x1F:{ - s6 = "ft11"; - s6_len = 4; - break; - } - case 0x0B:{ - s6 = "fa1"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "ft7"; - s6_len = 3; - break; - } - case 0x13:{ - s6 = "fs3"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "ft4"; - s6_len = 3; - break; - } - case 0x19:{ - s6 = "fs9"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "fs2"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "fs4"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "fa4"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "ft10"; - s6_len = 4; - break; - } - case 0x11:{ - s6 = "fa7"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "ft3"; - s6_len = 3; - break; - } - case 0x05:{ - s6 = "ft5"; - s6_len = 3; - break; - } - case 0x1D:{ - s6 = "ft9"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "fa3"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "fa5"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_FCVTMOD_W_D: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "fcvtmod.w.d"; - s0_len = 11; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_fcvtmod_w_d.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_fcvtmod_w_d.rs1) { - case 0x08:{ - s4 = "fs0"; - s4_len = 3; - break; - } - case 0x15:{ - s4 = "fs5"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "ft1"; - s4_len = 3; - break; - } - case 0x06:{ - s4 = "ft6"; - s4_len = 3; - break; - } - case 0x09:{ - s4 = "fs1"; - s4_len = 3; - break; - } - case 0x10:{ - s4 = "fa6"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "fs11"; - s4_len = 4; - break; - } - case 0x1C:{ - s4 = "ft8"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "fs6"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "ft0"; - s4_len = 3; - break; - } - case 0x0A:{ - s4 = "fa0"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "fs10"; - s4_len = 4; - break; - } - case 0x17:{ - s4 = "fs7"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "fa2"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "fs8"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "ft2"; - s4_len = 3; - break; - } - case 0x1F:{ - s4 = "ft11"; - s4_len = 4; - break; - } - case 0x0B:{ - s4 = "fa1"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "ft7"; - s4_len = 3; - break; - } - case 0x13:{ - s4 = "fs3"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "ft4"; - s4_len = 3; - break; - } - case 0x19:{ - s4 = "fs9"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "fs2"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "fs4"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "fa4"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "ft10"; - s4_len = 4; - break; - } - case 0x11:{ - s4 = "fa7"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "ft3"; - s4_len = 3; - break; - } - case 0x05:{ - s4 = "ft5"; - s4_len = 3; - break; - } - case 0x1D:{ - s4 = "ft9"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "fa3"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "fa5"; - s4_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_SHA256SIG0: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "sha256sig0"; - s0_len = 10; - spc( &s1, &s1_len); - switch (tree->ast_node.sha256sig0.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.sha256sig0.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_SHA256SIG1: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "sha256sig1"; - s0_len = 10; - spc( &s1, &s1_len); - switch (tree->ast_node.sha256sig1.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.sha256sig1.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_SHA256SUM0: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "sha256sum0"; - s0_len = 10; - spc( &s1, &s1_len); - switch (tree->ast_node.sha256sum0.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.sha256sum0.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_SHA256SUM1: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "sha256sum1"; - s0_len = 10; - spc( &s1, &s1_len); - switch (tree->ast_node.sha256sum1.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.sha256sum1.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_AES32ESMI: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - s0 = "aes32esmi"; + 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); - switch (tree->ast_node.aes32esmi.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.aes32esmi.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.aes32esmi.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - sep( &s7, &s7_len); - hex_bits_2(tree->ast_node.aes32esmi.bs, &s8, &s8_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - } - } - break; - case RISCV_AES32ESI: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - s0 = "aes32esi"; + 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); - switch (tree->ast_node.aes32esi.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.aes32esi.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.aes32esi.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - sep( &s7, &s7_len); - hex_bits_2(tree->ast_node.aes32esi.bs, &s8, &s8_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - } - } - break; - case RISCV_AES32DSMI: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - s0 = "aes32dsmi"; + 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); - switch (tree->ast_node.aes32dsmi.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.aes32dsmi.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.aes32dsmi.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - sep( &s7, &s7_len); - hex_bits_2(tree->ast_node.aes32dsmi.bs, &s8, &s8_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - } - } - break; - case RISCV_AES32DSI: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - s0 = "aes32dsi"; + 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); - switch (tree->ast_node.aes32dsi.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.aes32dsi.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.aes32dsi.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - sep( &s7, &s7_len); - hex_bits_2(tree->ast_node.aes32dsi.bs, &s8, &s8_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - } - } - break; - case RISCV_SHA512SIG0L: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "sha512sig0l"; - s0_len = 11; - spc( &s1, &s1_len); - switch (tree->ast_node.sha512sig0l.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.sha512sig0l.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.sha512sig0l.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_SHA512SIG0H: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "sha512sig0h"; - s0_len = 11; - spc( &s1, &s1_len); - switch (tree->ast_node.sha512sig0h.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.sha512sig0h.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.sha512sig0h.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_SHA512SIG1L: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "sha512sig1l"; - s0_len = 11; - spc( &s1, &s1_len); - switch (tree->ast_node.sha512sig1l.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.sha512sig1l.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.sha512sig1l.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_SHA512SIG1H: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "sha512sig1h"; - s0_len = 11; - spc( &s1, &s1_len); - switch (tree->ast_node.sha512sig1h.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.sha512sig1h.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.sha512sig1h.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_SHA512SUM0R: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "sha512sum0r"; - s0_len = 11; - spc( &s1, &s1_len); - switch (tree->ast_node.sha512sum0r.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.sha512sum0r.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.sha512sum0r.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_SHA512SUM1R: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "sha512sum1r"; - s0_len = 11; - spc( &s1, &s1_len); - switch (tree->ast_node.sha512sum1r.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.sha512sum1r.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.sha512sum1r.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_AES64KS1I: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "aes64ks1i"; + 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); - switch (tree->ast_node.aes64ks1i.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.aes64ks1i.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - hex_bits_4(tree->ast_node.aes64ks1i.rnum, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_AES64KS2: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "aes64ks2"; + 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); - switch (tree->ast_node.aes64ks2.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.aes64ks2.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.aes64ks2.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_AES64IM: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "aes64im"; - s0_len = 7; - spc( &s1, &s1_len); - switch (tree->ast_node.aes64im.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.aes64im.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_AES64ESM: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "aes64esm"; + 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); - switch (tree->ast_node.aes64esm.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.aes64esm.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.aes64esm.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_AES64ES: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "aes64es"; + 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); - switch (tree->ast_node.aes64es.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.aes64es.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.aes64es.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_AES64DSM: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "aes64dsm"; + 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); - switch (tree->ast_node.aes64dsm.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.aes64dsm.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.aes64dsm.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_AES64DS: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "aes64ds"; - s0_len = 7; - spc( &s1, &s1_len); - switch (tree->ast_node.aes64ds.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.aes64ds.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.aes64ds.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_SHA512SIG0: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "sha512sig0"; - s0_len = 10; - spc( &s1, &s1_len); - switch (tree->ast_node.sha512sig0.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.sha512sig0.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_SHA512SIG1: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "sha512sig1"; - s0_len = 10; - spc( &s1, &s1_len); - switch (tree->ast_node.sha512sig1.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.sha512sig1.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_SHA512SUM0: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "sha512sum0"; - s0_len = 10; - spc( &s1, &s1_len); - switch (tree->ast_node.sha512sum0.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.sha512sum0.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_SHA512SUM1: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "sha512sum1"; - s0_len = 10; - spc( &s1, &s1_len); - switch (tree->ast_node.sha512sum1.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.sha512sum1.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_SM3P0: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "sm3p0"; - s0_len = 5; - spc( &s1, &s1_len); - switch (tree->ast_node.sm3p0.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.sm3p0.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_SM3P1: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "sm3p1"; + 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); - switch (tree->ast_node.sm3p1.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.sm3p1.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_SM4ED: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - s0 = "sm4ed"; + 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); - switch (tree->ast_node.sm4ed.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.sm4ed.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.sm4ed.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - sep( &s7, &s7_len); - hex_bits_2(tree->ast_node.sm4ed.bs, &s8, &s8_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - } - } - break; - case RISCV_SM4KS: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - s0 = "sm4ks"; + 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); - switch (tree->ast_node.sm4ks.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.sm4ks.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.sm4ks.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - sep( &s7, &s7_len); - hex_bits_2(tree->ast_node.sm4ks.bs, &s8, &s8_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - } - } - break; - case RISCV_ZBKB_RTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - switch (tree->ast_node.zbkb_rtype.op) { - case RISCV_PACKH:{ - s0 = "packh"; - s0_len = 5; - break; - } - case RISCV_PACK:{ - s0 = "pack"; - s0_len = 4; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.zbkb_rtype.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.zbkb_rtype.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.zbkb_rtype.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_ZBKB_PACKW: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "packw"; + 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); - switch (tree->ast_node.zbkb_packw.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.zbkb_packw.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.zbkb_packw.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_ZIP: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "zip"; - s0_len = 3; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_zip.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_zip.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_UNZIP: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "unzip"; + 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); - switch (tree->ast_node.riscv_unzip.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_unzip.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_BREV8: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "brev8"; + 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); - switch (tree->ast_node.riscv_brev8.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_brev8.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_XPERM8: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "xperm8"; - s0_len = 6; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_xperm8.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_xperm8.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.riscv_xperm8.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_XPERM4: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "xperm4"; - s0_len = 6; - spc( &s1, &s1_len); - switch (tree->ast_node.riscv_xperm4.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.riscv_xperm4.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.riscv_xperm4.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_ZICOND_RTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - switch (tree->ast_node.zicond_rtype.riscv_czero_nez) { - case RISCV_CZERO_EQZ:{ - s0 = "czero.eqz"; - s0_len = 9; - break; - } - case RISCV_CZERO_NEZ:{ - s0 = "czero.nez"; - s0_len = 9; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.zicond_rtype.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.zicond_rtype.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.zicond_rtype.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_VSETVLI: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - char *s9; size_t s9_len; - s0 = "vsetvli"; + 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); - switch (tree->ast_node.vsetvli.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vsetvli.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.vsetvli.sew) { - case 0x1:{ - s6 = "e16"; - s6_len = 3; - break; - } - case 0x3:{ - s6 = "e64"; - s6_len = 3; - break; - } - case 0x2:{ - s6 = "e32"; - s6_len = 3; - break; - } - case 0x0:{ - s6 = "e8"; - s6_len = 2; - break; - } - } - maybe_lmul_flag(tree->ast_node.vsetvli.lmul, &s7, &s7_len); - maybe_ta_flag(tree->ast_node.vsetvli.ta, &s8, &s8_len); - maybe_ma_flag(tree->ast_node.vsetvli.ma, &s9, &s9_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len + s8_len, s9, s9_len); - } - } - break; - case RISCV_VSETVL: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "vsetvl"; - s0_len = 6; - spc( &s1, &s1_len); - switch (tree->ast_node.vsetvl.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vsetvl.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.vsetvl.rs2) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_VSETIVLI: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - char *s9; size_t s9_len; - s0 = "vsetivli"; + 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); - switch (tree->ast_node.vsetivli.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - hex_bits_5(tree->ast_node.vsetivli.uimm, &s4, &s4_len); - sep( &s5, &s5_len); - switch (tree->ast_node.vsetivli.sew) { - case 0x1:{ - s6 = "e16"; - s6_len = 3; - break; - } - case 0x3:{ - s6 = "e64"; - s6_len = 3; - break; - } - case 0x2:{ - s6 = "e32"; - s6_len = 3; - break; - } - case 0x0:{ - s6 = "e8"; - s6_len = 2; - break; - } - } - maybe_lmul_flag(tree->ast_node.vsetivli.lmul, &s7, &s7_len); - maybe_ta_flag(tree->ast_node.vsetivli.ta, &s8, &s8_len); - maybe_ma_flag(tree->ast_node.vsetivli.ma, &s9, &s9_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len + s8_len, s9, s9_len); - } - } - break; - case RISCV_VVTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.vvtype.funct6) { - case RISCV_VV_VSSRA:{ - s0 = "vssra.vv"; - s0_len = 8; - break; - } - case RISCV_VV_VXOR:{ - s0 = "vxor.vv"; - s0_len = 7; - break; - } - case RISCV_VV_VSMUL:{ - s0 = "vsmul.vv"; - s0_len = 8; - break; - } - case RISCV_VV_VAND:{ - s0 = "vand.vv"; - s0_len = 7; - break; - } - case RISCV_VV_VSSUB:{ - s0 = "vssub.vv"; - s0_len = 8; - break; - } - case RISCV_VV_VSUB:{ - s0 = "vsub.vv"; - s0_len = 7; - break; - } - case RISCV_VV_VSLL:{ - s0 = "vsll.vv"; - s0_len = 7; - break; - } - case RISCV_VV_VSSRL:{ - s0 = "vssrl.vv"; - s0_len = 8; - break; - } - case RISCV_VV_VSADD:{ - s0 = "vsadd.vv"; - s0_len = 8; - break; - } - case RISCV_VV_VSSUBU:{ - s0 = "vssubu.vv"; - s0_len = 9; - break; - } - case RISCV_VV_VMAX:{ - s0 = "vmax.vv"; - s0_len = 7; - break; - } - case RISCV_VV_VADD:{ - s0 = "vadd.vv"; - s0_len = 7; - break; - } - case RISCV_VV_VSRL:{ - s0 = "vsrl.vv"; - s0_len = 7; - break; - } - case RISCV_VV_VMAXU:{ - s0 = "vmaxu.vv"; - s0_len = 8; - break; - } - case RISCV_VV_VRGATHER:{ - s0 = "vrgather.vv"; - s0_len = 11; - break; - } - case RISCV_VV_VSRA:{ - s0 = "vsra.vv"; - s0_len = 7; - break; - } - case RISCV_VV_VRGATHEREI16:{ - s0 = "vrgatherei16.vv"; - s0_len = 15; - break; - } - case RISCV_VV_VMINU:{ - s0 = "vminu.vv"; - s0_len = 8; - break; - } - case RISCV_VV_VSADDU:{ - s0 = "vsaddu.vv"; - s0_len = 9; - break; - } - case RISCV_VV_VMIN:{ - s0 = "vmin.vv"; - s0_len = 7; - break; - } - case RISCV_VV_VOR:{ - s0 = "vor.vv"; - s0_len = 6; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.vvtype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vvtype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.vvtype.vs1) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.vvtype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_NVSTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.nvstype.funct6) { - case RISCV_NVS_VNSRL:{ - s0 = "vnsrl.wv"; - s0_len = 8; - break; - } - case RISCV_NVS_VNSRA:{ - s0 = "vnsra.wv"; - s0_len = 8; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.nvstype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.nvstype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.nvstype.vs1) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.nvstype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_NVTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.nvtype.funct6) { - case RISCV_NV_VNCLIP:{ - s0 = "vnclip.wv"; - s0_len = 9; - break; - } - case RISCV_NV_VNCLIPU:{ - s0 = "vnclipu.wv"; - s0_len = 10; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.nvtype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.nvtype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.nvtype.vs1) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.nvtype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_MASKTYPEV: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - s0 = "vmerge.vvm"; - s0_len = 10; - spc( &s1, &s1_len); - switch (tree->ast_node.masktypev.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.masktypev.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.masktypev.vs1) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - sep( &s7, &s7_len); - s8 = "v0"; - s8_len = 2; - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - } - } - break; - case RISCV_MOVETYPEV: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "vmv.v.v"; - s0_len = 7; - spc( &s1, &s1_len); - switch (tree->ast_node.movetypev.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.movetypev.vs1) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_VXTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.vxtype.funct6) { - case RISCV_VX_VSRA:{ - s0 = "vsra.vx"; - s0_len = 7; - break; - } - case RISCV_VX_VOR:{ - s0 = "vor.vx"; - s0_len = 6; - break; - } - case RISCV_VX_VADD:{ - s0 = "vadd.vx"; - s0_len = 7; - break; - } - case RISCV_VX_VSADDU:{ - s0 = "vsaddu.vx"; - s0_len = 9; - break; - } - case RISCV_VX_VMAX:{ - s0 = "vmax.vx"; - s0_len = 7; - break; - } - case RISCV_VX_VSSRA:{ - s0 = "vssra.vx"; - s0_len = 8; - break; - } - case RISCV_VX_VXOR:{ - s0 = "vxor.vx"; - s0_len = 7; - break; - } - case RISCV_VX_VSSRL:{ - s0 = "vssrl.vx"; - s0_len = 8; - break; - } - case RISCV_VX_VRSUB:{ - s0 = "vrsub.vx"; - s0_len = 8; - break; - } - case RISCV_VX_VSUB:{ - s0 = "vsub.vx"; - s0_len = 7; - break; - } - case RISCV_VX_VSADD:{ - s0 = "vsadd.vx"; - s0_len = 8; - break; - } - case RISCV_VX_VSSUBU:{ - s0 = "vssubu.vx"; - s0_len = 9; - break; - } - case RISCV_VX_VMIN:{ - s0 = "vmin.vx"; - s0_len = 7; - break; - } - case RISCV_VX_VSLL:{ - s0 = "vsll.vx"; - s0_len = 7; - break; - } - case RISCV_VX_VSMUL:{ - s0 = "vsmul.vx"; - s0_len = 8; - break; - } - case RISCV_VX_VMINU:{ - s0 = "vminu.vx"; - s0_len = 8; - break; - } - case RISCV_VX_VMAXU:{ - s0 = "vmaxu.vx"; - s0_len = 8; - break; - } - case RISCV_VX_VAND:{ - s0 = "vand.vx"; - s0_len = 7; - break; - } - case RISCV_VX_VSSUB:{ - s0 = "vssub.vx"; - s0_len = 8; - break; - } - case RISCV_VX_VSRL:{ - s0 = "vsrl.vx"; - s0_len = 7; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.vxtype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vxtype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.vxtype.rs1) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - maybe_vmask(tree->ast_node.vxtype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_NXSTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.nxstype.funct6) { - case RISCV_NXS_VNSRA:{ - s0 = "vnsra.wx"; - s0_len = 8; - break; - } - case RISCV_NXS_VNSRL:{ - s0 = "vnsrl.wx"; - s0_len = 8; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.nxstype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.nxstype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.nxstype.rs1) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - maybe_vmask(tree->ast_node.nxstype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_NXTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.nxtype.funct6) { - case RISCV_NX_VNCLIP:{ - s0 = "vnclip.wx"; - s0_len = 9; - break; - } - case RISCV_NX_VNCLIPU:{ - s0 = "vnclipu.wx"; - s0_len = 10; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.nxtype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.nxtype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.nxtype.rs1) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - maybe_vmask(tree->ast_node.nxtype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_VXSG: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.vxsg.funct6) { - case RISCV_VX_VSLIDEDOWN:{ - s0 = "vslidedown.vx"; - s0_len = 13; - break; - } - case RISCV_VX_VSLIDEUP:{ - s0 = "vslideup.vx"; - s0_len = 11; - break; - } - case RISCV_VX_VRGATHER:{ - s0 = "vrgather.vx"; - s0_len = 11; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.vxsg.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vxsg.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.vxsg.rs1) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - maybe_vmask(tree->ast_node.vxsg.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_MASKTYPEX: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - s0 = "vmerge.vxm"; - s0_len = 10; - spc( &s1, &s1_len); - switch (tree->ast_node.masktypex.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.masktypex.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.masktypex.rs1) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - sep( &s7, &s7_len); - s8 = "v0"; - s8_len = 2; - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - } - } - break; - case RISCV_MOVETYPEX: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "vmv.v.x"; - s0_len = 7; - spc( &s1, &s1_len); - switch (tree->ast_node.movetypex.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.movetypex.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_VITYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.vitype.funct6) { - case RISCV_VI_VSRL:{ - s0 = "vsrl.vi"; - s0_len = 7; - break; - } - case RISCV_VI_VAND:{ - s0 = "vand.vi"; - s0_len = 7; - break; - } - case RISCV_VI_VXOR:{ - s0 = "vxor.vi"; - s0_len = 7; - break; - } - case RISCV_VI_VSADD:{ - s0 = "vsadd.vi"; - s0_len = 8; - break; - } - case RISCV_VI_VSRA:{ - s0 = "vsra.vi"; - s0_len = 7; - break; - } - case RISCV_VI_VSSRL:{ - s0 = "vssrl.vi"; - s0_len = 8; - break; - } - case RISCV_VI_VSADDU:{ - s0 = "vsaddu.vi"; - s0_len = 9; - break; - } - case RISCV_VI_VSLL:{ - s0 = "vsll.vi"; - s0_len = 7; - break; - } - case RISCV_VI_VRSUB:{ - s0 = "vrsub.vi"; - s0_len = 8; - break; - } - case RISCV_VI_VADD:{ - s0 = "vadd.vi"; - s0_len = 7; - break; - } - case RISCV_VI_VOR:{ - s0 = "vor.vi"; - s0_len = 6; - break; - } - case RISCV_VI_VSSRA:{ - s0 = "vssra.vi"; - s0_len = 8; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.vitype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vitype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - hex_bits_5(tree->ast_node.vitype.simm, &s6, &s6_len); - maybe_vmask(tree->ast_node.vitype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_NISTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.nistype.funct6) { - case RISCV_NIS_VNSRL:{ - s0 = "vnsrl.wi"; - s0_len = 8; - break; - } - case RISCV_NIS_VNSRA:{ - s0 = "vnsra.wi"; - s0_len = 8; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.nistype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.nistype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - hex_bits_5(tree->ast_node.nistype.simm, &s6, &s6_len); - maybe_vmask(tree->ast_node.nistype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_NITYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.nitype.funct6) { - case RISCV_NI_VNCLIPU:{ - s0 = "vnclipu.wi"; - s0_len = 10; - break; - } - case RISCV_NI_VNCLIP:{ - s0 = "vnclip.wi"; - s0_len = 9; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.nitype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.nitype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - hex_bits_5(tree->ast_node.nitype.simm, &s6, &s6_len); - maybe_vmask(tree->ast_node.nitype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_VISG: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.visg.funct6) { - case RISCV_VI_VRGATHER:{ - s0 = "vrgather.vi"; - s0_len = 11; - break; - } - case RISCV_VI_VSLIDEDOWN:{ - s0 = "vslidedown.vi"; - s0_len = 13; - break; - } - case RISCV_VI_VSLIDEUP:{ - s0 = "vslideup.vi"; - s0_len = 11; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.visg.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.visg.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.visg.simm) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - maybe_vmask(tree->ast_node.visg.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_MASKTYPEI: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - s0 = "vmerge.vim"; - s0_len = 10; - spc( &s1, &s1_len); - switch (tree->ast_node.masktypei.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.masktypei.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - hex_bits_5(tree->ast_node.masktypei.simm, &s6, &s6_len); - sep( &s7, &s7_len); - s8 = "v0"; - s8_len = 2; - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - } - } - break; - case RISCV_MOVETYPEI: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "vmv.v.i"; - s0_len = 7; - spc( &s1, &s1_len); - switch (tree->ast_node.movetypei.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - hex_bits_5(tree->ast_node.movetypei.simm, &s4, &s4_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_VMVRTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "vmv"; - s0_len = 3; - switch (tree->ast_node.vmvrtype.simm) { - case 0x01:{ - s1 = "2"; - s1_len = 1; - break; - } - case 0x07:{ - s1 = "8"; - s1_len = 1; - break; - } - case 0x00:{ - s1 = "1"; - s1_len = 1; - break; - } - case 0x03:{ - s1 = "4"; - s1_len = 1; - break; - } - } - s2 = "r.v"; - s2_len = 3; - spc( &s3, &s3_len); - switch (tree->ast_node.vmvrtype.vd) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.vmvrtype.vs2) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_MVVTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.mvvtype.funct6) { - case RISCV_MVV_VDIV:{ - s0 = "vdiv.vv"; - s0_len = 7; - break; - } - case RISCV_MVV_VREMU:{ - s0 = "vremu.vv"; - s0_len = 8; - break; - } - case RISCV_MVV_VAADDU:{ - s0 = "vaaddu.vv"; - s0_len = 9; - break; - } - case RISCV_MVV_VMULHSU:{ - s0 = "vmulhsu.vv"; - s0_len = 10; - break; - } - case RISCV_MVV_VASUB:{ - s0 = "vasub.vv"; - s0_len = 8; - break; - } - case RISCV_MVV_VMULHU:{ - s0 = "vmulhu.vv"; - s0_len = 9; - break; - } - case RISCV_MVV_VDIVU:{ - s0 = "vdivu.vv"; - s0_len = 8; - break; - } - case RISCV_MVV_VMULH:{ - s0 = "vmulh.vv"; - s0_len = 8; - break; - } - case RISCV_MVV_VAADD:{ - s0 = "vaadd.vv"; - s0_len = 8; - break; - } - case RISCV_MVV_VMUL:{ - s0 = "vmul.vv"; - s0_len = 7; - break; - } - case RISCV_MVV_VREM:{ - s0 = "vrem.vv"; - s0_len = 7; - break; - } - case RISCV_MVV_VASUBU:{ - s0 = "vasubu.vv"; - s0_len = 9; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.mvvtype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.mvvtype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.mvvtype.vs1) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.mvvtype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_MVVMATYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.mvvmatype.funct6) { - case RISCV_MVV_VMACC:{ - s0 = "vmacc.vv"; - s0_len = 8; - break; - } - case RISCV_MVV_VNMSUB:{ - s0 = "vnmsub.vv"; - s0_len = 9; - break; - } - case RISCV_MVV_VNMSAC:{ - s0 = "vnmsac.vv"; - s0_len = 9; - break; - } - case RISCV_MVV_VMADD:{ - s0 = "vmadd.vv"; - s0_len = 8; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.mvvmatype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.mvvmatype.vs1) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.mvvmatype.vs2) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.mvvmatype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_WVVTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.wvvtype.funct6) { - case RISCV_WVV_VSUBU:{ - s0 = "vwsubu.vv"; - s0_len = 9; - break; - } - case RISCV_WVV_VWMULSU:{ - s0 = "vwmulsu.vv"; - s0_len = 10; - break; - } - case RISCV_WVV_VADD:{ - s0 = "vwadd.vv"; - s0_len = 8; - break; - } - case RISCV_WVV_VWMUL:{ - s0 = "vwmul.vv"; - s0_len = 8; - break; - } - case RISCV_WVV_VADDU:{ - s0 = "vwaddu.vv"; - s0_len = 9; - break; - } - case RISCV_WVV_VWMULU:{ - s0 = "vwmulu.vv"; - s0_len = 9; - break; - } - case RISCV_WVV_VSUB:{ - s0 = "vwsub.vv"; - s0_len = 8; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.wvvtype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.wvvtype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.wvvtype.vs1) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.wvvtype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_WVTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.wvtype.funct6) { - case RISCV_WV_VSUB:{ - s0 = "vwsub.wv"; - s0_len = 8; - break; - } - case RISCV_WV_VADDU:{ - s0 = "vwaddu.wv"; - s0_len = 9; - break; - } - case RISCV_WV_VSUBU:{ - s0 = "vwsubu.wv"; - s0_len = 9; - break; - } - case RISCV_WV_VADD:{ - s0 = "vwadd.wv"; - s0_len = 8; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.wvtype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.wvtype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.wvtype.vs1) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.wvtype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_WMVVTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.wmvvtype.funct6) { - case RISCV_WMVV_VWMACCU:{ - s0 = "vwmaccu.vv"; - s0_len = 10; - break; - } - case RISCV_WMVV_VWMACCSU:{ - s0 = "vwmaccsu.vv"; - s0_len = 11; - break; - } - case RISCV_WMVV_VWMACC:{ - s0 = "vwmacc.vv"; - s0_len = 9; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.wmvvtype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.wmvvtype.vs1) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.wmvvtype.vs2) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.wmvvtype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_VEXT2TYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - switch (tree->ast_node.vext2type.funct6) { - case RISCV_VEXT2_SVF2:{ - s0 = "vsext.vf2"; - s0_len = 9; - break; - } - case RISCV_VEXT2_ZVF2:{ - s0 = "vzext.vf2"; - s0_len = 9; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.vext2type.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vext2type.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.vext2type.vm, &s5, &s5_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - } - } - break; - case RISCV_VEXT4TYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - switch (tree->ast_node.vext4type.funct6) { - case RISCV_VEXT4_ZVF4:{ - s0 = "vzext.vf4"; - s0_len = 9; - break; - } - case RISCV_VEXT4_SVF4:{ - s0 = "vsext.vf4"; - s0_len = 9; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.vext4type.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vext4type.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.vext4type.vm, &s5, &s5_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - } - } - break; - case RISCV_VEXT8TYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - switch (tree->ast_node.vext8type.funct6) { - case RISCV_VEXT8_SVF8:{ - s0 = "vsext.vf8"; - s0_len = 9; - break; - } - case RISCV_VEXT8_ZVF8:{ - s0 = "vzext.vf8"; - s0_len = 9; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.vext8type.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vext8type.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.vext8type.vm, &s5, &s5_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - } - } - break; - case RISCV_VMVXS: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "vmv.x.s"; - s0_len = 7; - spc( &s1, &s1_len); - switch (tree->ast_node.vmvxs.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vmvxs.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_MVVCOMPRESS: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "vcompress.vm"; - s0_len = 12; - spc( &s1, &s1_len); - switch (tree->ast_node.mvvcompress.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.mvvcompress.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.mvvcompress.vs1) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_MVXTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.mvxtype.funct6) { - case RISCV_MVX_VMUL:{ - s0 = "vmul.vx"; - s0_len = 7; - break; - } - case RISCV_MVX_VREM:{ - s0 = "vrem.vx"; - s0_len = 7; - break; - } - case RISCV_MVX_VMULH:{ - s0 = "vmulh.vx"; - s0_len = 8; - break; - } - case RISCV_MVX_VDIV:{ - s0 = "vdiv.vx"; - s0_len = 7; - break; - } - case RISCV_MVX_VAADDU:{ - s0 = "vaaddu.vx"; - s0_len = 9; - break; - } - case RISCV_MVX_VSLIDE1DOWN:{ - s0 = "vslide1down.vx"; - s0_len = 14; - break; - } - case RISCV_MVX_VMULHSU:{ - s0 = "vmulhsu.vx"; - s0_len = 10; - break; - } - case RISCV_MVX_VSLIDE1UP:{ - s0 = "vslide1up.vx"; - s0_len = 12; - break; - } - case RISCV_MVX_VMULHU:{ - s0 = "vmulhu.vx"; - s0_len = 9; - break; - } - case RISCV_MVX_VASUBU:{ - s0 = "vasubu.vx"; - s0_len = 9; - break; - } - case RISCV_MVX_VREMU:{ - s0 = "vremu.vx"; - s0_len = 8; - break; - } - case RISCV_MVX_VDIVU:{ - s0 = "vdivu.vx"; - s0_len = 8; - break; - } - case RISCV_MVX_VAADD:{ - s0 = "vaadd.vx"; - s0_len = 8; - break; - } - case RISCV_MVX_VASUB:{ - s0 = "vasub.vx"; - s0_len = 8; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.mvxtype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.mvxtype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.mvxtype.rs1) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - maybe_vmask(tree->ast_node.mvxtype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_MVXMATYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.mvxmatype.funct6) { - case RISCV_MVX_VNMSAC:{ - s0 = "vnmsac.vx"; - s0_len = 9; - break; - } - case RISCV_MVX_VMADD:{ - s0 = "vmadd.vx"; - s0_len = 8; - break; - } - case RISCV_MVX_VMACC:{ - s0 = "vmacc.vx"; - s0_len = 8; - break; - } - case RISCV_MVX_VNMSUB:{ - s0 = "vnmsub.vx"; - s0_len = 9; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.mvxmatype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.mvxmatype.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.mvxmatype.vs2) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.mvxmatype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_WVXTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.wvxtype.funct6) { - case RISCV_WVX_VSUB:{ - s0 = "vwsub.vx"; - s0_len = 8; - break; - } - case RISCV_WVX_VADDU:{ - s0 = "vwaddu.vx"; - s0_len = 9; - break; - } - case RISCV_WVX_VADD:{ - s0 = "vwadd.vx"; - s0_len = 8; - break; - } - case RISCV_WVX_VSUBU:{ - s0 = "vwsubu.vx"; - s0_len = 9; - break; - } - case RISCV_WVX_VWMULSU:{ - s0 = "vwmulsu.vx"; - s0_len = 10; - break; - } - case RISCV_WVX_VWMUL:{ - s0 = "vwmul.vx"; - s0_len = 8; - break; - } - case RISCV_WVX_VWMULU:{ - s0 = "vwmulu.vx"; - s0_len = 9; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.wvxtype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.wvxtype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.wvxtype.rs1) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - maybe_vmask(tree->ast_node.wvxtype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_WXTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.wxtype.funct6) { - case RISCV_WX_VSUB:{ - s0 = "vwsub.wx"; - s0_len = 8; - break; - } - case RISCV_WX_VSUBU:{ - s0 = "vwsubu.wx"; - s0_len = 9; - break; - } - case RISCV_WX_VADD:{ - s0 = "vwadd.wx"; - s0_len = 8; - break; - } - case RISCV_WX_VADDU:{ - s0 = "vwaddu.wx"; - s0_len = 9; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.wxtype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.wxtype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.wxtype.rs1) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - maybe_vmask(tree->ast_node.wxtype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_WMVXTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.wmvxtype.funct6) { - case RISCV_WMVX_VWMACCU:{ - s0 = "vwmaccu.vx"; - s0_len = 10; - break; - } - case RISCV_WMVX_VWMACCSU:{ - s0 = "vwmaccsu.vx"; - s0_len = 11; - break; - } - case RISCV_WMVX_VWMACCUS:{ - s0 = "vwmaccus.vx"; - s0_len = 11; - break; - } - case RISCV_WMVX_VWMACC:{ - s0 = "vwmacc.vx"; - s0_len = 9; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.wmvxtype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.wmvxtype.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.wmvxtype.vs2) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.wmvxtype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_VMVSX: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "vmv.s.x"; - s0_len = 7; - spc( &s1, &s1_len); - switch (tree->ast_node.vmvsx.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vmvsx.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_FVVTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.fvvtype.funct6) { - case RISCV_FVV_VSGNJ:{ - s0 = "vfsgnj.vv"; - s0_len = 9; - break; - } - case RISCV_FVV_VMIN:{ - s0 = "vfmin.vv"; - s0_len = 8; - break; - } - case RISCV_FVV_VDIV:{ - s0 = "vfdiv.vv"; - s0_len = 8; - break; - } - case RISCV_FVV_VMAX:{ - s0 = "vfmax.vv"; - s0_len = 8; - break; - } - case RISCV_FVV_VADD:{ - s0 = "vfadd.vv"; - s0_len = 8; - break; - } - case RISCV_FVV_VSUB:{ - s0 = "vfsub.vv"; - s0_len = 8; - break; - } - case RISCV_FVV_VSGNJN:{ - s0 = "vfsgnjn.vv"; - s0_len = 10; - break; - } - case RISCV_FVV_VSGNJX:{ - s0 = "vfsgnjx.vv"; - s0_len = 10; - break; - } - case RISCV_FVV_VMUL:{ - s0 = "vfmul.vv"; - s0_len = 8; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.fvvtype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.fvvtype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.fvvtype.vs1) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.fvvtype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_FVVMATYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.fvvmatype.funct6) { - case RISCV_FVV_VNMSAC:{ - s0 = "vfnmsac.vv"; - s0_len = 10; - break; - } - case RISCV_FVV_VMACC:{ - s0 = "vfmacc.vv"; - s0_len = 9; - break; - } - case RISCV_FVV_VNMSUB:{ - s0 = "vfnmsub.vv"; - s0_len = 10; - break; - } - case RISCV_FVV_VMSAC:{ - s0 = "vfmsac.vv"; - s0_len = 9; - break; - } - case RISCV_FVV_VMADD:{ - s0 = "vfmadd.vv"; - s0_len = 9; - break; - } - case RISCV_FVV_VMSUB:{ - s0 = "vfmsub.vv"; - s0_len = 9; - break; - } - case RISCV_FVV_VNMACC:{ - s0 = "vfnmacc.vv"; - s0_len = 10; - break; - } - case RISCV_FVV_VNMADD:{ - s0 = "vfnmadd.vv"; - s0_len = 10; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.fvvmatype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.fvvmatype.vs1) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.fvvmatype.vs2) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.fvvmatype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_FWVVTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.fwvvtype.funct6) { - case RISCV_FWVV_VADD:{ - s0 = "vfwadd.vv"; - s0_len = 9; - break; - } - case RISCV_FWVV_VSUB:{ - s0 = "vfwsub.vv"; - s0_len = 9; - break; - } - case RISCV_FWVV_VMUL:{ - s0 = "vfwmul.vv"; - s0_len = 9; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.fwvvtype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.fwvvtype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.fwvvtype.vs1) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.fwvvtype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_FWVVMATYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.fwvvmatype.funct6) { - case RISCV_FWVV_VMSAC:{ - s0 = "vfwmsac.vv"; - s0_len = 10; - break; - } - case RISCV_FWVV_VNMACC:{ - s0 = "vfwnmacc.vv"; - s0_len = 11; - break; - } - case RISCV_FWVV_VNMSAC:{ - s0 = "vfwnmsac.vv"; - s0_len = 11; - break; - } - case RISCV_FWVV_VMACC:{ - s0 = "vfwmacc.vv"; - s0_len = 10; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.fwvvmatype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.fwvvmatype.vs1) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.fwvvmatype.vs2) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.fwvvmatype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_FWVTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.fwvtype.funct6) { - case RISCV_FWV_VADD:{ - s0 = "vfwadd.wv"; - s0_len = 9; - break; - } - case RISCV_FWV_VSUB:{ - s0 = "vfwsub.wv"; - s0_len = 9; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.fwvtype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.fwvtype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.fwvtype.vs1) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.fwvtype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_VFUNARY0: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - switch (tree->ast_node.vfunary0.vfunary0) { - case RISCV_FV_CVT_F_X:{ - s0 = "vfcvt.f.x.v"; - s0_len = 11; - break; - } - case RISCV_FV_CVT_X_F:{ - s0 = "vfcvt.x.f.v"; - s0_len = 11; - break; - } - case RISCV_FV_CVT_XU_F:{ - s0 = "vfcvt.xu.f.v"; - s0_len = 12; - break; - } - case RISCV_FV_CVT_RTZ_XU_F:{ - s0 = "vfcvt.rtz.xu.f.v"; - s0_len = 16; - break; - } - case RISCV_FV_CVT_RTZ_X_F:{ - s0 = "vfcvt.rtz.x.f.v"; - s0_len = 15; - break; - } - case RISCV_FV_CVT_F_XU:{ - s0 = "vfcvt.f.xu.v"; - s0_len = 12; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.vfunary0.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vfunary0.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.vfunary0.vm, &s5, &s5_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - } - } - break; - case RISCV_VFWUNARY0: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - switch (tree->ast_node.vfwunary0.vfwunary0) { - case RISCV_FWV_CVT_F_X:{ - s0 = "vfwcvt.f.x.v"; - s0_len = 12; - break; - } - case RISCV_FWV_CVT_F_XU:{ - s0 = "vfwcvt.f.xu.v"; - s0_len = 13; - break; - } - case RISCV_FWV_CVT_F_F:{ - s0 = "vfwcvt.f.f.v"; - s0_len = 12; - break; - } - case RISCV_FWV_CVT_X_F:{ - s0 = "vfwcvt.x.f.v"; - s0_len = 12; - break; - } - case RISCV_FWV_CVT_RTZ_XU_F:{ - s0 = "vfwcvt.rtz.xu.f.v"; - s0_len = 17; - break; - } - case RISCV_FWV_CVT_RTZ_X_F:{ - s0 = "vfwcvt.rtz.x.f.v"; - s0_len = 16; - break; - } - case RISCV_FWV_CVT_XU_F:{ - s0 = "vfwcvt.xu.f.v"; - s0_len = 13; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.vfwunary0.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vfwunary0.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.vfwunary0.vm, &s5, &s5_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - } - } - break; - case RISCV_VFNUNARY0: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - switch (tree->ast_node.vfnunary0.vfnunary0) { - case RISCV_FNV_CVT_F_F:{ - s0 = "vfncvt.f.f.w"; - s0_len = 12; - break; - } - case RISCV_FNV_CVT_RTZ_XU_F:{ - s0 = "vfncvt.rtz.xu.f.w"; - s0_len = 17; - break; - } - case RISCV_FNV_CVT_F_XU:{ - s0 = "vfncvt.f.xu.w"; - s0_len = 13; - break; - } - case RISCV_FNV_CVT_F_X:{ - s0 = "vfncvt.f.x.w"; - s0_len = 12; - break; - } - case RISCV_FNV_CVT_RTZ_X_F:{ - s0 = "vfncvt.rtz.x.f.w"; - s0_len = 16; - break; - } - case RISCV_FNV_CVT_XU_F:{ - s0 = "vfncvt.xu.f.w"; - s0_len = 13; - break; - } - case RISCV_FNV_CVT_X_F:{ - s0 = "vfncvt.x.f.w"; - s0_len = 12; - break; - } - case RISCV_FNV_CVT_ROD_F_F:{ - s0 = "vfncvt.rod.f.f.w"; - s0_len = 16; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.vfnunary0.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vfnunary0.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.vfnunary0.vm, &s5, &s5_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - } - } - break; - case RISCV_VFUNARY1: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - switch (tree->ast_node.vfunary1.vfunary1) { - case RISCV_FVV_VCLASS:{ - s0 = "vfclass.v"; - s0_len = 9; - break; - } - case RISCV_FVV_VREC7:{ - s0 = "vfrec7.v"; - s0_len = 8; - break; - } - case RISCV_FVV_VRSQRT7:{ - s0 = "vfrsqrt7.v"; - s0_len = 10; - break; - } - case RISCV_FVV_VSQRT:{ - s0 = "vfsqrt.v"; - s0_len = 8; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.vfunary1.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vfunary1.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.vfunary1.vm, &s5, &s5_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - } - } - break; - case RISCV_VFMVFS: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "vfmv.f.s"; + 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); - switch (tree->ast_node.vfmvfs.rd) { - case 0x08:{ - s2 = "fs0"; - s2_len = 3; - break; - } - case 0x15:{ - s2 = "fs5"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "ft1"; - s2_len = 3; - break; - } - case 0x06:{ - s2 = "ft6"; - s2_len = 3; - break; - } - case 0x09:{ - s2 = "fs1"; - s2_len = 3; - break; - } - case 0x10:{ - s2 = "fa6"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "fs11"; - s2_len = 4; - break; - } - case 0x1C:{ - s2 = "ft8"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "fs6"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "ft0"; - s2_len = 3; - break; - } - case 0x0A:{ - s2 = "fa0"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "fs10"; - s2_len = 4; - break; - } - case 0x17:{ - s2 = "fs7"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "fa2"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "fs8"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "ft2"; - s2_len = 3; - break; - } - case 0x1F:{ - s2 = "ft11"; - s2_len = 4; - break; - } - case 0x0B:{ - s2 = "fa1"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "ft7"; - s2_len = 3; - break; - } - case 0x13:{ - s2 = "fs3"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "ft4"; - s2_len = 3; - break; - } - case 0x19:{ - s2 = "fs9"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "fs2"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "fs4"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "fa4"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "ft10"; - s2_len = 4; - break; - } - case 0x11:{ - s2 = "fa7"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "ft3"; - s2_len = 3; - break; - } - case 0x05:{ - s2 = "ft5"; - s2_len = 3; - break; - } - case 0x1D:{ - s2 = "ft9"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "fa3"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "fa5"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vfmvfs.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_FVFTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.fvftype.funct6) { - case RISCV_VF_VMIN:{ - s0 = "vfmin.vf"; - s0_len = 8; - break; - } - case RISCV_VF_VSGNJ:{ - s0 = "vfsgnj.vf"; - s0_len = 9; - break; - } - case RISCV_VF_VSLIDE1UP:{ - s0 = "vfslide1up.vf"; - s0_len = 13; - break; - } - case RISCV_VF_VRSUB:{ - s0 = "vfrsub.vf"; - s0_len = 9; - break; - } - case RISCV_VF_VADD:{ - s0 = "vfadd.vf"; - s0_len = 8; - break; - } - case RISCV_VF_VSGNJX:{ - s0 = "vfsgnjx.vf"; - s0_len = 10; - break; - } - case RISCV_VF_VDIV:{ - s0 = "vfdiv.vf"; - s0_len = 8; - break; - } - case RISCV_VF_VSUB:{ - s0 = "vfsub.vf"; - s0_len = 8; - break; - } - case RISCV_VF_VRDIV:{ - s0 = "vfrdiv.vf"; - s0_len = 9; - break; - } - case RISCV_VF_VMUL:{ - s0 = "vfmul.vf"; - s0_len = 8; - break; - } - case RISCV_VF_VSGNJN:{ - s0 = "vfsgnjn.vf"; - s0_len = 10; - break; - } - case RISCV_VF_VMAX:{ - s0 = "vfmax.vf"; - s0_len = 8; - break; - } - case RISCV_VF_VSLIDE1DOWN:{ - s0 = "vfslide1down.vf"; - s0_len = 15; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.fvftype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.fvftype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.fvftype.rs1) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - maybe_vmask(tree->ast_node.fvftype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_FVFMATYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.fvfmatype.funct6) { - case RISCV_VF_VNMADD:{ - s0 = "vfnmadd.vf"; - s0_len = 10; - break; - } - case RISCV_VF_VMSUB:{ - s0 = "vfmsub.vf"; - s0_len = 9; - break; - } - case RISCV_VF_VMACC:{ - s0 = "vfmacc.vf"; - s0_len = 9; - break; - } - case RISCV_VF_VMADD:{ - s0 = "vfmadd.vf"; - s0_len = 9; - break; - } - case RISCV_VF_VNMSAC:{ - s0 = "vfnmsac.vf"; - s0_len = 10; - break; - } - case RISCV_VF_VMSAC:{ - s0 = "vfmsac.vf"; - s0_len = 9; - break; - } - case RISCV_VF_VNMACC:{ - s0 = "vfnmacc.vf"; - s0_len = 10; - break; - } - case RISCV_VF_VNMSUB:{ - s0 = "vfnmsub.vf"; - s0_len = 10; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.fvfmatype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.fvfmatype.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.fvfmatype.vs2) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.fvfmatype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_FWVFTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.fwvftype.funct6) { - case RISCV_FWVF_VADD:{ - s0 = "vfwadd.vf"; - s0_len = 9; - break; - } - case RISCV_FWVF_VSUB:{ - s0 = "vfwsub.vf"; - s0_len = 9; - break; - } - case RISCV_FWVF_VMUL:{ - s0 = "vfwmul.vf"; - s0_len = 9; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.fwvftype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.fwvftype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.fwvftype.rs1) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - maybe_vmask(tree->ast_node.fwvftype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_FWVFMATYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.fwvfmatype.funct6) { - case RISCV_FWVF_VNMACC:{ - s0 = "vfwnmacc.vf"; - s0_len = 11; - break; - } - case RISCV_FWVF_VMACC:{ - s0 = "vfwmacc.vf"; - s0_len = 10; - break; - } - case RISCV_FWVF_VNMSAC:{ - s0 = "vfwnmsac.vf"; - s0_len = 11; - break; - } - case RISCV_FWVF_VMSAC:{ - s0 = "vfwmsac.vf"; - s0_len = 10; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.fwvfmatype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.fwvfmatype.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.fwvfmatype.vs2) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.fwvfmatype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_FWFTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.fwftype.funct6) { - case RISCV_FWF_VSUB:{ - s0 = "vfwsub.wf"; - s0_len = 9; - break; - } - case RISCV_FWF_VADD:{ - s0 = "vfwadd.wf"; - s0_len = 9; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.fwftype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.fwftype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.fwftype.rs1) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - maybe_vmask(tree->ast_node.fwftype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_VFMERGE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - s0 = "vfmerge.vfm"; - s0_len = 11; - spc( &s1, &s1_len); - switch (tree->ast_node.vfmerge.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vfmerge.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.vfmerge.rs1) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - sep( &s7, &s7_len); - s8 = "v0"; - s8_len = 2; - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - } - } - break; - case RISCV_VFMV: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "vfmv.v.f"; + 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); - switch (tree->ast_node.vfmv.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vfmv.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_VFMVSF: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - s0 = "vfmv.s.f"; + 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); - switch (tree->ast_node.vfmvsf.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vfmvsf.rs1) { - case 0x08:{ - s4 = "fs0"; - s4_len = 3; - break; - } - case 0x15:{ - s4 = "fs5"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "ft1"; - s4_len = 3; - break; - } - case 0x06:{ - s4 = "ft6"; - s4_len = 3; - break; - } - case 0x09:{ - s4 = "fs1"; - s4_len = 3; - break; - } - case 0x10:{ - s4 = "fa6"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "fs11"; - s4_len = 4; - break; - } - case 0x1C:{ - s4 = "ft8"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "fs6"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "ft0"; - s4_len = 3; - break; - } - case 0x0A:{ - s4 = "fa0"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "fs10"; - s4_len = 4; - break; - } - case 0x17:{ - s4 = "fs7"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "fa2"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "fs8"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "ft2"; - s4_len = 3; - break; - } - case 0x1F:{ - s4 = "ft11"; - s4_len = 4; - break; - } - case 0x0B:{ - s4 = "fa1"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "ft7"; - s4_len = 3; - break; - } - case 0x13:{ - s4 = "fs3"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "ft4"; - s4_len = 3; - break; - } - case 0x19:{ - s4 = "fs9"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "fs2"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "fs4"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "fa4"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "ft10"; - s4_len = 4; - break; - } - case 0x11:{ - s4 = "fa7"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "ft3"; - s4_len = 3; - break; - } - case 0x05:{ - s4 = "ft5"; - s4_len = 3; - break; - } - case 0x1D:{ - s4 = "ft9"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "fa3"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "fa5"; - s4_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - } - } - break; - case RISCV_VLSEGTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - char *s9; size_t s9_len; - char *s10; size_t s10_len; - char *s11; size_t s11_len; - s0 = "vl"; - s0_len = 2; - switch (tree->ast_node.vlsegtype.nf) { - case 0x7:{ - s1 = "seg8"; - s1_len = 4; - break; - } - case 0x5:{ - s1 = "seg6"; - s1_len = 4; - break; - } - case 0x1:{ - s1 = "seg2"; - s1_len = 4; - break; - } - case 0x3:{ - s1 = "seg4"; - s1_len = 4; - break; - } - case 0x2:{ - s1 = "seg3"; - s1_len = 4; - break; - } - case 0x4:{ - s1 = "seg5"; - s1_len = 4; - break; - } - case 0x6:{ - s1 = "seg7"; - s1_len = 4; - break; - } - case 0x0:{ - s1 = ""; - s1_len = 0; - break; - } - } - s2 = "e"; - s2_len = 1; - switch (tree->ast_node.vlsegtype.width) { - case RISCV_VLE16:{ - s3 = "16"; - s3_len = 2; - break; - } - case RISCV_VLE32:{ - s3 = "32"; - s3_len = 2; - break; - } - case RISCV_VLE64:{ - s3 = "64"; - s3_len = 2; - break; - } - case RISCV_VLE8:{ - s3 = "8"; - s3_len = 1; - break; - } - } - s4 = ".v"; - s4_len = 2; - spc( &s5, &s5_len); - switch (tree->ast_node.vlsegtype.vd) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - sep( &s7, &s7_len); - s8 = "("; - s8_len = 1; - switch (tree->ast_node.vlsegtype.rs1) { - case 0x08:{ - s9 = "fp"; - s9_len = 2; - break; - } - case 0x15:{ - s9 = "s5"; - s9_len = 2; - break; - } - case 0x01:{ - s9 = "ra"; - s9_len = 2; - break; - } - case 0x06:{ - s9 = "t1"; - s9_len = 2; - break; - } - case 0x09:{ - s9 = "s1"; - s9_len = 2; - break; - } - case 0x10:{ - s9 = "a6"; - s9_len = 2; - break; - } - case 0x1B:{ - s9 = "s11"; - s9_len = 3; - break; - } - case 0x1C:{ - s9 = "t3"; - s9_len = 2; - break; - } - case 0x16:{ - s9 = "s6"; - s9_len = 2; - break; - } - case 0x00:{ - s9 = "zero"; - s9_len = 4; - break; - } - case 0x0A:{ - s9 = "a0"; - s9_len = 2; - break; - } - case 0x1A:{ - s9 = "s10"; - s9_len = 3; - break; - } - case 0x17:{ - s9 = "s7"; - s9_len = 2; - break; - } - case 0x0C:{ - s9 = "a2"; - s9_len = 2; - break; - } - case 0x18:{ - s9 = "s8"; - s9_len = 2; - break; - } - case 0x02:{ - s9 = "sp"; - s9_len = 2; - break; - } - case 0x1F:{ - s9 = "t6"; - s9_len = 2; - break; - } - case 0x0B:{ - s9 = "a1"; - s9_len = 2; - break; - } - case 0x07:{ - s9 = "t2"; - s9_len = 2; - break; - } - case 0x13:{ - s9 = "s3"; - s9_len = 2; - break; - } - case 0x04:{ - s9 = "tp"; - s9_len = 2; - break; - } - case 0x19:{ - s9 = "s9"; - s9_len = 2; - break; - } - case 0x12:{ - s9 = "s2"; - s9_len = 2; - break; - } - case 0x14:{ - s9 = "s4"; - s9_len = 2; - break; - } - case 0x0E:{ - s9 = "a4"; - s9_len = 2; - break; - } - case 0x1E:{ - s9 = "t5"; - s9_len = 2; - break; - } - case 0x11:{ - s9 = "a7"; - s9_len = 2; - break; - } - case 0x03:{ - s9 = "gp"; - s9_len = 2; - break; - } - case 0x05:{ - s9 = "t0"; - s9_len = 2; - break; - } - case 0x1D:{ - s9 = "t4"; - s9_len = 2; - break; - } - case 0x0D:{ - s9 = "a3"; - s9_len = 2; - break; - } - case 0x0F:{ - s9 = "a5"; - s9_len = 2; - break; - } - } - s10 = ")"; - s10_len = 1; - maybe_vmask(tree->ast_node.vlsegtype.vm, &s11, &s11_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len + s8_len, s9, s9_len); - 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); - 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); - } - } - break; - case RISCV_VLSEGFFTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - char *s9; size_t s9_len; - char *s10; size_t s10_len; - char *s11; size_t s11_len; - s0 = "vl"; - s0_len = 2; - switch (tree->ast_node.vlsegfftype.nf) { - case 0x7:{ - s1 = "seg8"; - s1_len = 4; - break; - } - case 0x5:{ - s1 = "seg6"; - s1_len = 4; - break; - } - case 0x1:{ - s1 = "seg2"; - s1_len = 4; - break; - } - case 0x3:{ - s1 = "seg4"; - s1_len = 4; - break; - } - case 0x2:{ - s1 = "seg3"; - s1_len = 4; - break; - } - case 0x4:{ - s1 = "seg5"; - s1_len = 4; - break; - } - case 0x6:{ - s1 = "seg7"; - s1_len = 4; - break; - } - case 0x0:{ - s1 = ""; - s1_len = 0; - break; - } - } - s2 = "e"; - s2_len = 1; - switch (tree->ast_node.vlsegfftype.width) { - case RISCV_VLE16:{ - s3 = "16"; - s3_len = 2; - break; - } - case RISCV_VLE32:{ - s3 = "32"; - s3_len = 2; - break; - } - case RISCV_VLE64:{ - s3 = "64"; - s3_len = 2; - break; - } - case RISCV_VLE8:{ - s3 = "8"; - s3_len = 1; - break; - } - } - s4 = "ff.v"; - s4_len = 4; - spc( &s5, &s5_len); - switch (tree->ast_node.vlsegfftype.vd) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - sep( &s7, &s7_len); - s8 = "("; - s8_len = 1; - switch (tree->ast_node.vlsegfftype.rs1) { - case 0x08:{ - s9 = "fp"; - s9_len = 2; - break; - } - case 0x15:{ - s9 = "s5"; - s9_len = 2; - break; - } - case 0x01:{ - s9 = "ra"; - s9_len = 2; - break; - } - case 0x06:{ - s9 = "t1"; - s9_len = 2; - break; - } - case 0x09:{ - s9 = "s1"; - s9_len = 2; - break; - } - case 0x10:{ - s9 = "a6"; - s9_len = 2; - break; - } - case 0x1B:{ - s9 = "s11"; - s9_len = 3; - break; - } - case 0x1C:{ - s9 = "t3"; - s9_len = 2; - break; - } - case 0x16:{ - s9 = "s6"; - s9_len = 2; - break; - } - case 0x00:{ - s9 = "zero"; - s9_len = 4; - break; - } - case 0x0A:{ - s9 = "a0"; - s9_len = 2; - break; - } - case 0x1A:{ - s9 = "s10"; - s9_len = 3; - break; - } - case 0x17:{ - s9 = "s7"; - s9_len = 2; - break; - } - case 0x0C:{ - s9 = "a2"; - s9_len = 2; - break; - } - case 0x18:{ - s9 = "s8"; - s9_len = 2; - break; - } - case 0x02:{ - s9 = "sp"; - s9_len = 2; - break; - } - case 0x1F:{ - s9 = "t6"; - s9_len = 2; - break; - } - case 0x0B:{ - s9 = "a1"; - s9_len = 2; - break; - } - case 0x07:{ - s9 = "t2"; - s9_len = 2; - break; - } - case 0x13:{ - s9 = "s3"; - s9_len = 2; - break; - } - case 0x04:{ - s9 = "tp"; - s9_len = 2; - break; - } - case 0x19:{ - s9 = "s9"; - s9_len = 2; - break; - } - case 0x12:{ - s9 = "s2"; - s9_len = 2; - break; - } - case 0x14:{ - s9 = "s4"; - s9_len = 2; - break; - } - case 0x0E:{ - s9 = "a4"; - s9_len = 2; - break; - } - case 0x1E:{ - s9 = "t5"; - s9_len = 2; - break; - } - case 0x11:{ - s9 = "a7"; - s9_len = 2; - break; - } - case 0x03:{ - s9 = "gp"; - s9_len = 2; - break; - } - case 0x05:{ - s9 = "t0"; - s9_len = 2; - break; - } - case 0x1D:{ - s9 = "t4"; - s9_len = 2; - break; - } - case 0x0D:{ - s9 = "a3"; - s9_len = 2; - break; - } - case 0x0F:{ - s9 = "a5"; - s9_len = 2; - break; - } - } - s10 = ")"; - s10_len = 1; - maybe_vmask(tree->ast_node.vlsegfftype.vm, &s11, &s11_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len + s8_len, s9, s9_len); - 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); - 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); - } - } - break; - case RISCV_VSSEGTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - char *s9; size_t s9_len; - char *s10; size_t s10_len; - char *s11; size_t s11_len; - s0 = "vs"; - s0_len = 2; - switch (tree->ast_node.vssegtype.nf) { - case 0x7:{ - s1 = "seg8"; - s1_len = 4; - break; - } - case 0x5:{ - s1 = "seg6"; - s1_len = 4; - break; - } - case 0x1:{ - s1 = "seg2"; - s1_len = 4; - break; - } - case 0x3:{ - s1 = "seg4"; - s1_len = 4; - break; - } - case 0x2:{ - s1 = "seg3"; - s1_len = 4; - break; - } - case 0x4:{ - s1 = "seg5"; - s1_len = 4; - break; - } - case 0x6:{ - s1 = "seg7"; - s1_len = 4; - break; - } - case 0x0:{ - s1 = ""; - s1_len = 0; - break; - } - } - s2 = "e"; - s2_len = 1; - switch (tree->ast_node.vssegtype.width) { - case RISCV_VLE16:{ - s3 = "16"; - s3_len = 2; - break; - } - case RISCV_VLE32:{ - s3 = "32"; - s3_len = 2; - break; - } - case RISCV_VLE64:{ - s3 = "64"; - s3_len = 2; - break; - } - case RISCV_VLE8:{ - s3 = "8"; - s3_len = 1; - break; - } - } - s4 = ".v"; - s4_len = 2; - spc( &s5, &s5_len); - switch (tree->ast_node.vssegtype.vs3) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - sep( &s7, &s7_len); - s8 = "("; - s8_len = 1; - switch (tree->ast_node.vssegtype.rs1) { - case 0x08:{ - s9 = "fp"; - s9_len = 2; - break; - } - case 0x15:{ - s9 = "s5"; - s9_len = 2; - break; - } - case 0x01:{ - s9 = "ra"; - s9_len = 2; - break; - } - case 0x06:{ - s9 = "t1"; - s9_len = 2; - break; - } - case 0x09:{ - s9 = "s1"; - s9_len = 2; - break; - } - case 0x10:{ - s9 = "a6"; - s9_len = 2; - break; - } - case 0x1B:{ - s9 = "s11"; - s9_len = 3; - break; - } - case 0x1C:{ - s9 = "t3"; - s9_len = 2; - break; - } - case 0x16:{ - s9 = "s6"; - s9_len = 2; - break; - } - case 0x00:{ - s9 = "zero"; - s9_len = 4; - break; - } - case 0x0A:{ - s9 = "a0"; - s9_len = 2; - break; - } - case 0x1A:{ - s9 = "s10"; - s9_len = 3; - break; - } - case 0x17:{ - s9 = "s7"; - s9_len = 2; - break; - } - case 0x0C:{ - s9 = "a2"; - s9_len = 2; - break; - } - case 0x18:{ - s9 = "s8"; - s9_len = 2; - break; - } - case 0x02:{ - s9 = "sp"; - s9_len = 2; - break; - } - case 0x1F:{ - s9 = "t6"; - s9_len = 2; - break; - } - case 0x0B:{ - s9 = "a1"; - s9_len = 2; - break; - } - case 0x07:{ - s9 = "t2"; - s9_len = 2; - break; - } - case 0x13:{ - s9 = "s3"; - s9_len = 2; - break; - } - case 0x04:{ - s9 = "tp"; - s9_len = 2; - break; - } - case 0x19:{ - s9 = "s9"; - s9_len = 2; - break; - } - case 0x12:{ - s9 = "s2"; - s9_len = 2; - break; - } - case 0x14:{ - s9 = "s4"; - s9_len = 2; - break; - } - case 0x0E:{ - s9 = "a4"; - s9_len = 2; - break; - } - case 0x1E:{ - s9 = "t5"; - s9_len = 2; - break; - } - case 0x11:{ - s9 = "a7"; - s9_len = 2; - break; - } - case 0x03:{ - s9 = "gp"; - s9_len = 2; - break; - } - case 0x05:{ - s9 = "t0"; - s9_len = 2; - break; - } - case 0x1D:{ - s9 = "t4"; - s9_len = 2; - break; - } - case 0x0D:{ - s9 = "a3"; - s9_len = 2; - break; - } - case 0x0F:{ - s9 = "a5"; - s9_len = 2; - break; - } - } - s10 = ")"; - s10_len = 1; - maybe_vmask(tree->ast_node.vssegtype.vm, &s11, &s11_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len + s8_len, s9, s9_len); - 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); - 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); - } - } - break; - case RISCV_VLSSEGTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - char *s9; size_t s9_len; - char *s10; size_t s10_len; - char *s11; size_t s11_len; - char *s12; size_t s12_len; - char *s13; size_t s13_len; - s0 = "vls"; - s0_len = 3; - switch (tree->ast_node.vlssegtype.nf) { - case 0x7:{ - s1 = "seg8"; - s1_len = 4; - break; - } - case 0x5:{ - s1 = "seg6"; - s1_len = 4; - break; - } - case 0x1:{ - s1 = "seg2"; - s1_len = 4; - break; - } - case 0x3:{ - s1 = "seg4"; - s1_len = 4; - break; - } - case 0x2:{ - s1 = "seg3"; - s1_len = 4; - break; - } - case 0x4:{ - s1 = "seg5"; - s1_len = 4; - break; - } - case 0x6:{ - s1 = "seg7"; - s1_len = 4; - break; - } - case 0x0:{ - s1 = ""; - s1_len = 0; - break; - } - } - s2 = "e"; - s2_len = 1; - switch (tree->ast_node.vlssegtype.width) { - case RISCV_VLE16:{ - s3 = "16"; - s3_len = 2; - break; - } - case RISCV_VLE32:{ - s3 = "32"; - s3_len = 2; - break; - } - case RISCV_VLE64:{ - s3 = "64"; - s3_len = 2; - break; - } - case RISCV_VLE8:{ - s3 = "8"; - s3_len = 1; - break; - } - } - s4 = ".v"; - s4_len = 2; - spc( &s5, &s5_len); - switch (tree->ast_node.vlssegtype.vd) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - sep( &s7, &s7_len); - s8 = "("; - s8_len = 1; - switch (tree->ast_node.vlssegtype.rs1) { - case 0x08:{ - s9 = "fp"; - s9_len = 2; - break; - } - case 0x15:{ - s9 = "s5"; - s9_len = 2; - break; - } - case 0x01:{ - s9 = "ra"; - s9_len = 2; - break; - } - case 0x06:{ - s9 = "t1"; - s9_len = 2; - break; - } - case 0x09:{ - s9 = "s1"; - s9_len = 2; - break; - } - case 0x10:{ - s9 = "a6"; - s9_len = 2; - break; - } - case 0x1B:{ - s9 = "s11"; - s9_len = 3; - break; - } - case 0x1C:{ - s9 = "t3"; - s9_len = 2; - break; - } - case 0x16:{ - s9 = "s6"; - s9_len = 2; - break; - } - case 0x00:{ - s9 = "zero"; - s9_len = 4; - break; - } - case 0x0A:{ - s9 = "a0"; - s9_len = 2; - break; - } - case 0x1A:{ - s9 = "s10"; - s9_len = 3; - break; - } - case 0x17:{ - s9 = "s7"; - s9_len = 2; - break; - } - case 0x0C:{ - s9 = "a2"; - s9_len = 2; - break; - } - case 0x18:{ - s9 = "s8"; - s9_len = 2; - break; - } - case 0x02:{ - s9 = "sp"; - s9_len = 2; - break; - } - case 0x1F:{ - s9 = "t6"; - s9_len = 2; - break; - } - case 0x0B:{ - s9 = "a1"; - s9_len = 2; - break; - } - case 0x07:{ - s9 = "t2"; - s9_len = 2; - break; - } - case 0x13:{ - s9 = "s3"; - s9_len = 2; - break; - } - case 0x04:{ - s9 = "tp"; - s9_len = 2; - break; - } - case 0x19:{ - s9 = "s9"; - s9_len = 2; - break; - } - case 0x12:{ - s9 = "s2"; - s9_len = 2; - break; - } - case 0x14:{ - s9 = "s4"; - s9_len = 2; - break; - } - case 0x0E:{ - s9 = "a4"; - s9_len = 2; - break; - } - case 0x1E:{ - s9 = "t5"; - s9_len = 2; - break; - } - case 0x11:{ - s9 = "a7"; - s9_len = 2; - break; - } - case 0x03:{ - s9 = "gp"; - s9_len = 2; - break; - } - case 0x05:{ - s9 = "t0"; - s9_len = 2; - break; - } - case 0x1D:{ - s9 = "t4"; - s9_len = 2; - break; - } - case 0x0D:{ - s9 = "a3"; - s9_len = 2; - break; - } - case 0x0F:{ - s9 = "a5"; - s9_len = 2; - break; - } - } - s10 = ")"; - s10_len = 1; - sep( &s11, &s11_len); - switch (tree->ast_node.vlssegtype.rs2) { - case 0x08:{ - s12 = "fp"; - s12_len = 2; - break; - } - case 0x15:{ - s12 = "s5"; - s12_len = 2; - break; - } - case 0x01:{ - s12 = "ra"; - s12_len = 2; - break; - } - case 0x06:{ - s12 = "t1"; - s12_len = 2; - break; - } - case 0x09:{ - s12 = "s1"; - s12_len = 2; - break; - } - case 0x10:{ - s12 = "a6"; - s12_len = 2; - break; - } - case 0x1B:{ - s12 = "s11"; - s12_len = 3; - break; - } - case 0x1C:{ - s12 = "t3"; - s12_len = 2; - break; - } - case 0x16:{ - s12 = "s6"; - s12_len = 2; - break; - } - case 0x00:{ - s12 = "zero"; - s12_len = 4; - break; - } - case 0x0A:{ - s12 = "a0"; - s12_len = 2; - break; - } - case 0x1A:{ - s12 = "s10"; - s12_len = 3; - break; - } - case 0x17:{ - s12 = "s7"; - s12_len = 2; - break; - } - case 0x0C:{ - s12 = "a2"; - s12_len = 2; - break; - } - case 0x18:{ - s12 = "s8"; - s12_len = 2; - break; - } - case 0x02:{ - s12 = "sp"; - s12_len = 2; - break; - } - case 0x1F:{ - s12 = "t6"; - s12_len = 2; - break; - } - case 0x0B:{ - s12 = "a1"; - s12_len = 2; - break; - } - case 0x07:{ - s12 = "t2"; - s12_len = 2; - break; - } - case 0x13:{ - s12 = "s3"; - s12_len = 2; - break; - } - case 0x04:{ - s12 = "tp"; - s12_len = 2; - break; - } - case 0x19:{ - s12 = "s9"; - s12_len = 2; - break; - } - case 0x12:{ - s12 = "s2"; - s12_len = 2; - break; - } - case 0x14:{ - s12 = "s4"; - s12_len = 2; - break; - } - case 0x0E:{ - s12 = "a4"; - s12_len = 2; - break; - } - case 0x1E:{ - s12 = "t5"; - s12_len = 2; - break; - } - case 0x11:{ - s12 = "a7"; - s12_len = 2; - break; - } - case 0x03:{ - s12 = "gp"; - s12_len = 2; - break; - } - case 0x05:{ - s12 = "t0"; - s12_len = 2; - break; - } - case 0x1D:{ - s12 = "t4"; - s12_len = 2; - break; - } - case 0x0D:{ - s12 = "a3"; - s12_len = 2; - break; - } - case 0x0F:{ - s12 = "a5"; - s12_len = 2; - break; - } - } - maybe_vmask(tree->ast_node.vlssegtype.vm, &s13, &s13_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len + s8_len, s9, s9_len); - 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); - 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); - 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); - 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); - } - } - break; - case RISCV_VSSSEGTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - char *s9; size_t s9_len; - char *s10; size_t s10_len; - char *s11; size_t s11_len; - char *s12; size_t s12_len; - char *s13; size_t s13_len; - s0 = "vss"; - s0_len = 3; - switch (tree->ast_node.vsssegtype.nf) { - case 0x7:{ - s1 = "seg8"; - s1_len = 4; - break; - } - case 0x5:{ - s1 = "seg6"; - s1_len = 4; - break; - } - case 0x1:{ - s1 = "seg2"; - s1_len = 4; - break; - } - case 0x3:{ - s1 = "seg4"; - s1_len = 4; - break; - } - case 0x2:{ - s1 = "seg3"; - s1_len = 4; - break; - } - case 0x4:{ - s1 = "seg5"; - s1_len = 4; - break; - } - case 0x6:{ - s1 = "seg7"; - s1_len = 4; - break; - } - case 0x0:{ - s1 = ""; - s1_len = 0; - break; - } - } - s2 = "e"; - s2_len = 1; - switch (tree->ast_node.vsssegtype.width) { - case RISCV_VLE16:{ - s3 = "16"; - s3_len = 2; - break; - } - case RISCV_VLE32:{ - s3 = "32"; - s3_len = 2; - break; - } - case RISCV_VLE64:{ - s3 = "64"; - s3_len = 2; - break; - } - case RISCV_VLE8:{ - s3 = "8"; - s3_len = 1; - break; - } - } - s4 = ".v"; - s4_len = 2; - spc( &s5, &s5_len); - switch (tree->ast_node.vsssegtype.vs3) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - sep( &s7, &s7_len); - s8 = "("; - s8_len = 1; - switch (tree->ast_node.vsssegtype.rs1) { - case 0x08:{ - s9 = "fp"; - s9_len = 2; - break; - } - case 0x15:{ - s9 = "s5"; - s9_len = 2; - break; - } - case 0x01:{ - s9 = "ra"; - s9_len = 2; - break; - } - case 0x06:{ - s9 = "t1"; - s9_len = 2; - break; - } - case 0x09:{ - s9 = "s1"; - s9_len = 2; - break; - } - case 0x10:{ - s9 = "a6"; - s9_len = 2; - break; - } - case 0x1B:{ - s9 = "s11"; - s9_len = 3; - break; - } - case 0x1C:{ - s9 = "t3"; - s9_len = 2; - break; - } - case 0x16:{ - s9 = "s6"; - s9_len = 2; - break; - } - case 0x00:{ - s9 = "zero"; - s9_len = 4; - break; - } - case 0x0A:{ - s9 = "a0"; - s9_len = 2; - break; - } - case 0x1A:{ - s9 = "s10"; - s9_len = 3; - break; - } - case 0x17:{ - s9 = "s7"; - s9_len = 2; - break; - } - case 0x0C:{ - s9 = "a2"; - s9_len = 2; - break; - } - case 0x18:{ - s9 = "s8"; - s9_len = 2; - break; - } - case 0x02:{ - s9 = "sp"; - s9_len = 2; - break; - } - case 0x1F:{ - s9 = "t6"; - s9_len = 2; - break; - } - case 0x0B:{ - s9 = "a1"; - s9_len = 2; - break; - } - case 0x07:{ - s9 = "t2"; - s9_len = 2; - break; - } - case 0x13:{ - s9 = "s3"; - s9_len = 2; - break; - } - case 0x04:{ - s9 = "tp"; - s9_len = 2; - break; - } - case 0x19:{ - s9 = "s9"; - s9_len = 2; - break; - } - case 0x12:{ - s9 = "s2"; - s9_len = 2; - break; - } - case 0x14:{ - s9 = "s4"; - s9_len = 2; - break; - } - case 0x0E:{ - s9 = "a4"; - s9_len = 2; - break; - } - case 0x1E:{ - s9 = "t5"; - s9_len = 2; - break; - } - case 0x11:{ - s9 = "a7"; - s9_len = 2; - break; - } - case 0x03:{ - s9 = "gp"; - s9_len = 2; - break; - } - case 0x05:{ - s9 = "t0"; - s9_len = 2; - break; - } - case 0x1D:{ - s9 = "t4"; - s9_len = 2; - break; - } - case 0x0D:{ - s9 = "a3"; - s9_len = 2; - break; - } - case 0x0F:{ - s9 = "a5"; - s9_len = 2; - break; - } - } - s10 = ")"; - s10_len = 1; - sep( &s11, &s11_len); - switch (tree->ast_node.vsssegtype.rs2) { - case 0x08:{ - s12 = "fp"; - s12_len = 2; - break; - } - case 0x15:{ - s12 = "s5"; - s12_len = 2; - break; - } - case 0x01:{ - s12 = "ra"; - s12_len = 2; - break; - } - case 0x06:{ - s12 = "t1"; - s12_len = 2; - break; - } - case 0x09:{ - s12 = "s1"; - s12_len = 2; - break; - } - case 0x10:{ - s12 = "a6"; - s12_len = 2; - break; - } - case 0x1B:{ - s12 = "s11"; - s12_len = 3; - break; - } - case 0x1C:{ - s12 = "t3"; - s12_len = 2; - break; - } - case 0x16:{ - s12 = "s6"; - s12_len = 2; - break; - } - case 0x00:{ - s12 = "zero"; - s12_len = 4; - break; - } - case 0x0A:{ - s12 = "a0"; - s12_len = 2; - break; - } - case 0x1A:{ - s12 = "s10"; - s12_len = 3; - break; - } - case 0x17:{ - s12 = "s7"; - s12_len = 2; - break; - } - case 0x0C:{ - s12 = "a2"; - s12_len = 2; - break; - } - case 0x18:{ - s12 = "s8"; - s12_len = 2; - break; - } - case 0x02:{ - s12 = "sp"; - s12_len = 2; - break; - } - case 0x1F:{ - s12 = "t6"; - s12_len = 2; - break; - } - case 0x0B:{ - s12 = "a1"; - s12_len = 2; - break; - } - case 0x07:{ - s12 = "t2"; - s12_len = 2; - break; - } - case 0x13:{ - s12 = "s3"; - s12_len = 2; - break; - } - case 0x04:{ - s12 = "tp"; - s12_len = 2; - break; - } - case 0x19:{ - s12 = "s9"; - s12_len = 2; - break; - } - case 0x12:{ - s12 = "s2"; - s12_len = 2; - break; - } - case 0x14:{ - s12 = "s4"; - s12_len = 2; - break; - } - case 0x0E:{ - s12 = "a4"; - s12_len = 2; - break; - } - case 0x1E:{ - s12 = "t5"; - s12_len = 2; - break; - } - case 0x11:{ - s12 = "a7"; - s12_len = 2; - break; - } - case 0x03:{ - s12 = "gp"; - s12_len = 2; - break; - } - case 0x05:{ - s12 = "t0"; - s12_len = 2; - break; - } - case 0x1D:{ - s12 = "t4"; - s12_len = 2; - break; - } - case 0x0D:{ - s12 = "a3"; - s12_len = 2; - break; - } - case 0x0F:{ - s12 = "a5"; - s12_len = 2; - break; - } - } - maybe_vmask(tree->ast_node.vsssegtype.vm, &s13, &s13_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len + s8_len, s9, s9_len); - 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); - 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); - 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); - 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); - } - } - break; - case RISCV_VLUXSEGTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - char *s9; size_t s9_len; - char *s10; size_t s10_len; - char *s11; size_t s11_len; - char *s12; size_t s12_len; - char *s13; size_t s13_len; - s0 = "vlux"; - s0_len = 4; - switch (tree->ast_node.vluxsegtype.nf) { - case 0x7:{ - s1 = "seg8"; - s1_len = 4; - break; - } - case 0x5:{ - s1 = "seg6"; - s1_len = 4; - break; - } - case 0x1:{ - s1 = "seg2"; - s1_len = 4; - break; - } - case 0x3:{ - s1 = "seg4"; - s1_len = 4; - break; - } - case 0x2:{ - s1 = "seg3"; - s1_len = 4; - break; - } - case 0x4:{ - s1 = "seg5"; - s1_len = 4; - break; - } - case 0x6:{ - s1 = "seg7"; - s1_len = 4; - break; - } - case 0x0:{ - s1 = ""; - s1_len = 0; - break; - } - } - s2 = "ei"; - s2_len = 2; - switch (tree->ast_node.vluxsegtype.width) { - case RISCV_VLE16:{ - s3 = "16"; - s3_len = 2; - break; - } - case RISCV_VLE32:{ - s3 = "32"; - s3_len = 2; - break; - } - case RISCV_VLE64:{ - s3 = "64"; - s3_len = 2; - break; - } - case RISCV_VLE8:{ - s3 = "8"; - s3_len = 1; - break; - } - } - s4 = ".v"; - s4_len = 2; - spc( &s5, &s5_len); - switch (tree->ast_node.vluxsegtype.vd) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - sep( &s7, &s7_len); - s8 = "("; - s8_len = 1; - switch (tree->ast_node.vluxsegtype.rs1) { - case 0x08:{ - s9 = "fp"; - s9_len = 2; - break; - } - case 0x15:{ - s9 = "s5"; - s9_len = 2; - break; - } - case 0x01:{ - s9 = "ra"; - s9_len = 2; - break; - } - case 0x06:{ - s9 = "t1"; - s9_len = 2; - break; - } - case 0x09:{ - s9 = "s1"; - s9_len = 2; - break; - } - case 0x10:{ - s9 = "a6"; - s9_len = 2; - break; - } - case 0x1B:{ - s9 = "s11"; - s9_len = 3; - break; - } - case 0x1C:{ - s9 = "t3"; - s9_len = 2; - break; - } - case 0x16:{ - s9 = "s6"; - s9_len = 2; - break; - } - case 0x00:{ - s9 = "zero"; - s9_len = 4; - break; - } - case 0x0A:{ - s9 = "a0"; - s9_len = 2; - break; - } - case 0x1A:{ - s9 = "s10"; - s9_len = 3; - break; - } - case 0x17:{ - s9 = "s7"; - s9_len = 2; - break; - } - case 0x0C:{ - s9 = "a2"; - s9_len = 2; - break; - } - case 0x18:{ - s9 = "s8"; - s9_len = 2; - break; - } - case 0x02:{ - s9 = "sp"; - s9_len = 2; - break; - } - case 0x1F:{ - s9 = "t6"; - s9_len = 2; - break; - } - case 0x0B:{ - s9 = "a1"; - s9_len = 2; - break; - } - case 0x07:{ - s9 = "t2"; - s9_len = 2; - break; - } - case 0x13:{ - s9 = "s3"; - s9_len = 2; - break; - } - case 0x04:{ - s9 = "tp"; - s9_len = 2; - break; - } - case 0x19:{ - s9 = "s9"; - s9_len = 2; - break; - } - case 0x12:{ - s9 = "s2"; - s9_len = 2; - break; - } - case 0x14:{ - s9 = "s4"; - s9_len = 2; - break; - } - case 0x0E:{ - s9 = "a4"; - s9_len = 2; - break; - } - case 0x1E:{ - s9 = "t5"; - s9_len = 2; - break; - } - case 0x11:{ - s9 = "a7"; - s9_len = 2; - break; - } - case 0x03:{ - s9 = "gp"; - s9_len = 2; - break; - } - case 0x05:{ - s9 = "t0"; - s9_len = 2; - break; - } - case 0x1D:{ - s9 = "t4"; - s9_len = 2; - break; - } - case 0x0D:{ - s9 = "a3"; - s9_len = 2; - break; - } - case 0x0F:{ - s9 = "a5"; - s9_len = 2; - break; - } - } - s10 = ")"; - s10_len = 1; - sep( &s11, &s11_len); - switch (tree->ast_node.vluxsegtype.vs2) { - case 0x08:{ - s12 = "fp"; - s12_len = 2; - break; - } - case 0x15:{ - s12 = "s5"; - s12_len = 2; - break; - } - case 0x01:{ - s12 = "ra"; - s12_len = 2; - break; - } - case 0x06:{ - s12 = "t1"; - s12_len = 2; - break; - } - case 0x09:{ - s12 = "s1"; - s12_len = 2; - break; - } - case 0x10:{ - s12 = "a6"; - s12_len = 2; - break; - } - case 0x1B:{ - s12 = "s11"; - s12_len = 3; - break; - } - case 0x1C:{ - s12 = "t3"; - s12_len = 2; - break; - } - case 0x16:{ - s12 = "s6"; - s12_len = 2; - break; - } - case 0x00:{ - s12 = "zero"; - s12_len = 4; - break; - } - case 0x0A:{ - s12 = "a0"; - s12_len = 2; - break; - } - case 0x1A:{ - s12 = "s10"; - s12_len = 3; - break; - } - case 0x17:{ - s12 = "s7"; - s12_len = 2; - break; - } - case 0x0C:{ - s12 = "a2"; - s12_len = 2; - break; - } - case 0x18:{ - s12 = "s8"; - s12_len = 2; - break; - } - case 0x02:{ - s12 = "sp"; - s12_len = 2; - break; - } - case 0x1F:{ - s12 = "t6"; - s12_len = 2; - break; - } - case 0x0B:{ - s12 = "a1"; - s12_len = 2; - break; - } - case 0x07:{ - s12 = "t2"; - s12_len = 2; - break; - } - case 0x13:{ - s12 = "s3"; - s12_len = 2; - break; - } - case 0x04:{ - s12 = "tp"; - s12_len = 2; - break; - } - case 0x19:{ - s12 = "s9"; - s12_len = 2; - break; - } - case 0x12:{ - s12 = "s2"; - s12_len = 2; - break; - } - case 0x14:{ - s12 = "s4"; - s12_len = 2; - break; - } - case 0x0E:{ - s12 = "a4"; - s12_len = 2; - break; - } - case 0x1E:{ - s12 = "t5"; - s12_len = 2; - break; - } - case 0x11:{ - s12 = "a7"; - s12_len = 2; - break; - } - case 0x03:{ - s12 = "gp"; - s12_len = 2; - break; - } - case 0x05:{ - s12 = "t0"; - s12_len = 2; - break; - } - case 0x1D:{ - s12 = "t4"; - s12_len = 2; - break; - } - case 0x0D:{ - s12 = "a3"; - s12_len = 2; - break; - } - case 0x0F:{ - s12 = "a5"; - s12_len = 2; - break; - } - } - maybe_vmask(tree->ast_node.vluxsegtype.vm, &s13, &s13_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len + s8_len, s9, s9_len); - 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); - 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); - 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); - 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); - } - } - break; - case RISCV_VLOXSEGTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - char *s9; size_t s9_len; - char *s10; size_t s10_len; - char *s11; size_t s11_len; - char *s12; size_t s12_len; - char *s13; size_t s13_len; - s0 = "vlox"; - s0_len = 4; - switch (tree->ast_node.vloxsegtype.nf) { - case 0x7:{ - s1 = "seg8"; - s1_len = 4; - break; - } - case 0x5:{ - s1 = "seg6"; - s1_len = 4; - break; - } - case 0x1:{ - s1 = "seg2"; - s1_len = 4; - break; - } - case 0x3:{ - s1 = "seg4"; - s1_len = 4; - break; - } - case 0x2:{ - s1 = "seg3"; - s1_len = 4; - break; - } - case 0x4:{ - s1 = "seg5"; - s1_len = 4; - break; - } - case 0x6:{ - s1 = "seg7"; - s1_len = 4; - break; - } - case 0x0:{ - s1 = ""; - s1_len = 0; - break; - } - } - s2 = "ei"; - s2_len = 2; - switch (tree->ast_node.vloxsegtype.width) { - case RISCV_VLE16:{ - s3 = "16"; - s3_len = 2; - break; - } - case RISCV_VLE32:{ - s3 = "32"; - s3_len = 2; - break; - } - case RISCV_VLE64:{ - s3 = "64"; - s3_len = 2; - break; - } - case RISCV_VLE8:{ - s3 = "8"; - s3_len = 1; - break; - } - } - s4 = ".v"; - s4_len = 2; - spc( &s5, &s5_len); - switch (tree->ast_node.vloxsegtype.vd) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - sep( &s7, &s7_len); - s8 = "("; - s8_len = 1; - switch (tree->ast_node.vloxsegtype.rs1) { - case 0x08:{ - s9 = "fp"; - s9_len = 2; - break; - } - case 0x15:{ - s9 = "s5"; - s9_len = 2; - break; - } - case 0x01:{ - s9 = "ra"; - s9_len = 2; - break; - } - case 0x06:{ - s9 = "t1"; - s9_len = 2; - break; - } - case 0x09:{ - s9 = "s1"; - s9_len = 2; - break; - } - case 0x10:{ - s9 = "a6"; - s9_len = 2; - break; - } - case 0x1B:{ - s9 = "s11"; - s9_len = 3; - break; - } - case 0x1C:{ - s9 = "t3"; - s9_len = 2; - break; - } - case 0x16:{ - s9 = "s6"; - s9_len = 2; - break; - } - case 0x00:{ - s9 = "zero"; - s9_len = 4; - break; - } - case 0x0A:{ - s9 = "a0"; - s9_len = 2; - break; - } - case 0x1A:{ - s9 = "s10"; - s9_len = 3; - break; - } - case 0x17:{ - s9 = "s7"; - s9_len = 2; - break; - } - case 0x0C:{ - s9 = "a2"; - s9_len = 2; - break; - } - case 0x18:{ - s9 = "s8"; - s9_len = 2; - break; - } - case 0x02:{ - s9 = "sp"; - s9_len = 2; - break; - } - case 0x1F:{ - s9 = "t6"; - s9_len = 2; - break; - } - case 0x0B:{ - s9 = "a1"; - s9_len = 2; - break; - } - case 0x07:{ - s9 = "t2"; - s9_len = 2; - break; - } - case 0x13:{ - s9 = "s3"; - s9_len = 2; - break; - } - case 0x04:{ - s9 = "tp"; - s9_len = 2; - break; - } - case 0x19:{ - s9 = "s9"; - s9_len = 2; - break; - } - case 0x12:{ - s9 = "s2"; - s9_len = 2; - break; - } - case 0x14:{ - s9 = "s4"; - s9_len = 2; - break; - } - case 0x0E:{ - s9 = "a4"; - s9_len = 2; - break; - } - case 0x1E:{ - s9 = "t5"; - s9_len = 2; - break; - } - case 0x11:{ - s9 = "a7"; - s9_len = 2; - break; - } - case 0x03:{ - s9 = "gp"; - s9_len = 2; - break; - } - case 0x05:{ - s9 = "t0"; - s9_len = 2; - break; - } - case 0x1D:{ - s9 = "t4"; - s9_len = 2; - break; - } - case 0x0D:{ - s9 = "a3"; - s9_len = 2; - break; - } - case 0x0F:{ - s9 = "a5"; - s9_len = 2; - break; - } - } - s10 = ")"; - s10_len = 1; - sep( &s11, &s11_len); - switch (tree->ast_node.vloxsegtype.vs2) { - case 0x08:{ - s12 = "fp"; - s12_len = 2; - break; - } - case 0x15:{ - s12 = "s5"; - s12_len = 2; - break; - } - case 0x01:{ - s12 = "ra"; - s12_len = 2; - break; - } - case 0x06:{ - s12 = "t1"; - s12_len = 2; - break; - } - case 0x09:{ - s12 = "s1"; - s12_len = 2; - break; - } - case 0x10:{ - s12 = "a6"; - s12_len = 2; - break; - } - case 0x1B:{ - s12 = "s11"; - s12_len = 3; - break; - } - case 0x1C:{ - s12 = "t3"; - s12_len = 2; - break; - } - case 0x16:{ - s12 = "s6"; - s12_len = 2; - break; - } - case 0x00:{ - s12 = "zero"; - s12_len = 4; - break; - } - case 0x0A:{ - s12 = "a0"; - s12_len = 2; - break; - } - case 0x1A:{ - s12 = "s10"; - s12_len = 3; - break; - } - case 0x17:{ - s12 = "s7"; - s12_len = 2; - break; - } - case 0x0C:{ - s12 = "a2"; - s12_len = 2; - break; - } - case 0x18:{ - s12 = "s8"; - s12_len = 2; - break; - } - case 0x02:{ - s12 = "sp"; - s12_len = 2; - break; - } - case 0x1F:{ - s12 = "t6"; - s12_len = 2; - break; - } - case 0x0B:{ - s12 = "a1"; - s12_len = 2; - break; - } - case 0x07:{ - s12 = "t2"; - s12_len = 2; - break; - } - case 0x13:{ - s12 = "s3"; - s12_len = 2; - break; - } - case 0x04:{ - s12 = "tp"; - s12_len = 2; - break; - } - case 0x19:{ - s12 = "s9"; - s12_len = 2; - break; - } - case 0x12:{ - s12 = "s2"; - s12_len = 2; - break; - } - case 0x14:{ - s12 = "s4"; - s12_len = 2; - break; - } - case 0x0E:{ - s12 = "a4"; - s12_len = 2; - break; - } - case 0x1E:{ - s12 = "t5"; - s12_len = 2; - break; - } - case 0x11:{ - s12 = "a7"; - s12_len = 2; - break; - } - case 0x03:{ - s12 = "gp"; - s12_len = 2; - break; - } - case 0x05:{ - s12 = "t0"; - s12_len = 2; - break; - } - case 0x1D:{ - s12 = "t4"; - s12_len = 2; - break; - } - case 0x0D:{ - s12 = "a3"; - s12_len = 2; - break; - } - case 0x0F:{ - s12 = "a5"; - s12_len = 2; - break; - } - } - maybe_vmask(tree->ast_node.vloxsegtype.vm, &s13, &s13_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len + s8_len, s9, s9_len); - 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); - 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); - 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); - 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); - } - } - break; - case RISCV_VSUXSEGTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - char *s9; size_t s9_len; - char *s10; size_t s10_len; - char *s11; size_t s11_len; - char *s12; size_t s12_len; - char *s13; size_t s13_len; - s0 = "vsux"; - s0_len = 4; - switch (tree->ast_node.vsuxsegtype.nf) { - case 0x7:{ - s1 = "seg8"; - s1_len = 4; - break; - } - case 0x5:{ - s1 = "seg6"; - s1_len = 4; - break; - } - case 0x1:{ - s1 = "seg2"; - s1_len = 4; - break; - } - case 0x3:{ - s1 = "seg4"; - s1_len = 4; - break; - } - case 0x2:{ - s1 = "seg3"; - s1_len = 4; - break; - } - case 0x4:{ - s1 = "seg5"; - s1_len = 4; - break; - } - case 0x6:{ - s1 = "seg7"; - s1_len = 4; - break; - } - case 0x0:{ - s1 = ""; - s1_len = 0; - break; - } - } - s2 = "ei"; - s2_len = 2; - switch (tree->ast_node.vsuxsegtype.width) { - case RISCV_VLE16:{ - s3 = "16"; - s3_len = 2; - break; - } - case RISCV_VLE32:{ - s3 = "32"; - s3_len = 2; - break; - } - case RISCV_VLE64:{ - s3 = "64"; - s3_len = 2; - break; - } - case RISCV_VLE8:{ - s3 = "8"; - s3_len = 1; - break; - } - } - s4 = ".v"; - s4_len = 2; - spc( &s5, &s5_len); - switch (tree->ast_node.vsuxsegtype.vs3) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - sep( &s7, &s7_len); - s8 = "("; - s8_len = 1; - switch (tree->ast_node.vsuxsegtype.rs1) { - case 0x08:{ - s9 = "fp"; - s9_len = 2; - break; - } - case 0x15:{ - s9 = "s5"; - s9_len = 2; - break; - } - case 0x01:{ - s9 = "ra"; - s9_len = 2; - break; - } - case 0x06:{ - s9 = "t1"; - s9_len = 2; - break; - } - case 0x09:{ - s9 = "s1"; - s9_len = 2; - break; - } - case 0x10:{ - s9 = "a6"; - s9_len = 2; - break; - } - case 0x1B:{ - s9 = "s11"; - s9_len = 3; - break; - } - case 0x1C:{ - s9 = "t3"; - s9_len = 2; - break; - } - case 0x16:{ - s9 = "s6"; - s9_len = 2; - break; - } - case 0x00:{ - s9 = "zero"; - s9_len = 4; - break; - } - case 0x0A:{ - s9 = "a0"; - s9_len = 2; - break; - } - case 0x1A:{ - s9 = "s10"; - s9_len = 3; - break; - } - case 0x17:{ - s9 = "s7"; - s9_len = 2; - break; - } - case 0x0C:{ - s9 = "a2"; - s9_len = 2; - break; - } - case 0x18:{ - s9 = "s8"; - s9_len = 2; - break; - } - case 0x02:{ - s9 = "sp"; - s9_len = 2; - break; - } - case 0x1F:{ - s9 = "t6"; - s9_len = 2; - break; - } - case 0x0B:{ - s9 = "a1"; - s9_len = 2; - break; - } - case 0x07:{ - s9 = "t2"; - s9_len = 2; - break; - } - case 0x13:{ - s9 = "s3"; - s9_len = 2; - break; - } - case 0x04:{ - s9 = "tp"; - s9_len = 2; - break; - } - case 0x19:{ - s9 = "s9"; - s9_len = 2; - break; - } - case 0x12:{ - s9 = "s2"; - s9_len = 2; - break; - } - case 0x14:{ - s9 = "s4"; - s9_len = 2; - break; - } - case 0x0E:{ - s9 = "a4"; - s9_len = 2; - break; - } - case 0x1E:{ - s9 = "t5"; - s9_len = 2; - break; - } - case 0x11:{ - s9 = "a7"; - s9_len = 2; - break; - } - case 0x03:{ - s9 = "gp"; - s9_len = 2; - break; - } - case 0x05:{ - s9 = "t0"; - s9_len = 2; - break; - } - case 0x1D:{ - s9 = "t4"; - s9_len = 2; - break; - } - case 0x0D:{ - s9 = "a3"; - s9_len = 2; - break; - } - case 0x0F:{ - s9 = "a5"; - s9_len = 2; - break; - } - } - s10 = ")"; - s10_len = 1; - sep( &s11, &s11_len); - switch (tree->ast_node.vsuxsegtype.vs2) { - case 0x08:{ - s12 = "fp"; - s12_len = 2; - break; - } - case 0x15:{ - s12 = "s5"; - s12_len = 2; - break; - } - case 0x01:{ - s12 = "ra"; - s12_len = 2; - break; - } - case 0x06:{ - s12 = "t1"; - s12_len = 2; - break; - } - case 0x09:{ - s12 = "s1"; - s12_len = 2; - break; - } - case 0x10:{ - s12 = "a6"; - s12_len = 2; - break; - } - case 0x1B:{ - s12 = "s11"; - s12_len = 3; - break; - } - case 0x1C:{ - s12 = "t3"; - s12_len = 2; - break; - } - case 0x16:{ - s12 = "s6"; - s12_len = 2; - break; - } - case 0x00:{ - s12 = "zero"; - s12_len = 4; - break; - } - case 0x0A:{ - s12 = "a0"; - s12_len = 2; - break; - } - case 0x1A:{ - s12 = "s10"; - s12_len = 3; - break; - } - case 0x17:{ - s12 = "s7"; - s12_len = 2; - break; - } - case 0x0C:{ - s12 = "a2"; - s12_len = 2; - break; - } - case 0x18:{ - s12 = "s8"; - s12_len = 2; - break; - } - case 0x02:{ - s12 = "sp"; - s12_len = 2; - break; - } - case 0x1F:{ - s12 = "t6"; - s12_len = 2; - break; - } - case 0x0B:{ - s12 = "a1"; - s12_len = 2; - break; - } - case 0x07:{ - s12 = "t2"; - s12_len = 2; - break; - } - case 0x13:{ - s12 = "s3"; - s12_len = 2; - break; - } - case 0x04:{ - s12 = "tp"; - s12_len = 2; - break; - } - case 0x19:{ - s12 = "s9"; - s12_len = 2; - break; - } - case 0x12:{ - s12 = "s2"; - s12_len = 2; - break; - } - case 0x14:{ - s12 = "s4"; - s12_len = 2; - break; - } - case 0x0E:{ - s12 = "a4"; - s12_len = 2; - break; - } - case 0x1E:{ - s12 = "t5"; - s12_len = 2; - break; - } - case 0x11:{ - s12 = "a7"; - s12_len = 2; - break; - } - case 0x03:{ - s12 = "gp"; - s12_len = 2; - break; - } - case 0x05:{ - s12 = "t0"; - s12_len = 2; - break; - } - case 0x1D:{ - s12 = "t4"; - s12_len = 2; - break; - } - case 0x0D:{ - s12 = "a3"; - s12_len = 2; - break; - } - case 0x0F:{ - s12 = "a5"; - s12_len = 2; - break; - } - } - maybe_vmask(tree->ast_node.vsuxsegtype.vm, &s13, &s13_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len + s8_len, s9, s9_len); - 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); - 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); - 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); - 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); - }{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - char *s9; size_t s9_len; - char *s10; size_t s10_len; - char *s11; size_t s11_len; - char *s12; size_t s12_len; - char *s13; size_t s13_len; - s0 = "vsox"; - s0_len = 4; - switch (tree->ast_node.vsuxsegtype.nf) { - case 0x7:{ - s1 = "seg8"; - s1_len = 4; - break; - } - case 0x5:{ - s1 = "seg6"; - s1_len = 4; - break; - } - case 0x1:{ - s1 = "seg2"; - s1_len = 4; - break; - } - case 0x3:{ - s1 = "seg4"; - s1_len = 4; - break; - } - case 0x2:{ - s1 = "seg3"; - s1_len = 4; - break; - } - case 0x4:{ - s1 = "seg5"; - s1_len = 4; - break; - } - case 0x6:{ - s1 = "seg7"; - s1_len = 4; - break; - } - case 0x0:{ - s1 = ""; - s1_len = 0; - break; - } - } - s2 = "ei"; - s2_len = 2; - switch (tree->ast_node.vsuxsegtype.width) { - case RISCV_VLE16:{ - s3 = "16"; - s3_len = 2; - break; - } - case RISCV_VLE32:{ - s3 = "32"; - s3_len = 2; - break; - } - case RISCV_VLE64:{ - s3 = "64"; - s3_len = 2; - break; - } - case RISCV_VLE8:{ - s3 = "8"; - s3_len = 1; - break; - } - } - s4 = ".v"; - s4_len = 2; - spc( &s5, &s5_len); - switch (tree->ast_node.vsuxsegtype.vs3) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - sep( &s7, &s7_len); - s8 = "("; - s8_len = 1; - switch (tree->ast_node.vsuxsegtype.rs1) { - case 0x08:{ - s9 = "fp"; - s9_len = 2; - break; - } - case 0x15:{ - s9 = "s5"; - s9_len = 2; - break; - } - case 0x01:{ - s9 = "ra"; - s9_len = 2; - break; - } - case 0x06:{ - s9 = "t1"; - s9_len = 2; - break; - } - case 0x09:{ - s9 = "s1"; - s9_len = 2; - break; - } - case 0x10:{ - s9 = "a6"; - s9_len = 2; - break; - } - case 0x1B:{ - s9 = "s11"; - s9_len = 3; - break; - } - case 0x1C:{ - s9 = "t3"; - s9_len = 2; - break; - } - case 0x16:{ - s9 = "s6"; - s9_len = 2; - break; - } - case 0x00:{ - s9 = "zero"; - s9_len = 4; - break; - } - case 0x0A:{ - s9 = "a0"; - s9_len = 2; - break; - } - case 0x1A:{ - s9 = "s10"; - s9_len = 3; - break; - } - case 0x17:{ - s9 = "s7"; - s9_len = 2; - break; - } - case 0x0C:{ - s9 = "a2"; - s9_len = 2; - break; - } - case 0x18:{ - s9 = "s8"; - s9_len = 2; - break; - } - case 0x02:{ - s9 = "sp"; - s9_len = 2; - break; - } - case 0x1F:{ - s9 = "t6"; - s9_len = 2; - break; - } - case 0x0B:{ - s9 = "a1"; - s9_len = 2; - break; - } - case 0x07:{ - s9 = "t2"; - s9_len = 2; - break; - } - case 0x13:{ - s9 = "s3"; - s9_len = 2; - break; - } - case 0x04:{ - s9 = "tp"; - s9_len = 2; - break; - } - case 0x19:{ - s9 = "s9"; - s9_len = 2; - break; - } - case 0x12:{ - s9 = "s2"; - s9_len = 2; - break; - } - case 0x14:{ - s9 = "s4"; - s9_len = 2; - break; - } - case 0x0E:{ - s9 = "a4"; - s9_len = 2; - break; - } - case 0x1E:{ - s9 = "t5"; - s9_len = 2; - break; - } - case 0x11:{ - s9 = "a7"; - s9_len = 2; - break; - } - case 0x03:{ - s9 = "gp"; - s9_len = 2; - break; - } - case 0x05:{ - s9 = "t0"; - s9_len = 2; - break; - } - case 0x1D:{ - s9 = "t4"; - s9_len = 2; - break; - } - case 0x0D:{ - s9 = "a3"; - s9_len = 2; - break; - } - case 0x0F:{ - s9 = "a5"; - s9_len = 2; - break; - } - } - s10 = ")"; - s10_len = 1; - sep( &s11, &s11_len); - switch (tree->ast_node.vsuxsegtype.vs2) { - case 0x08:{ - s12 = "fp"; - s12_len = 2; - break; - } - case 0x15:{ - s12 = "s5"; - s12_len = 2; - break; - } - case 0x01:{ - s12 = "ra"; - s12_len = 2; - break; - } - case 0x06:{ - s12 = "t1"; - s12_len = 2; - break; - } - case 0x09:{ - s12 = "s1"; - s12_len = 2; - break; - } - case 0x10:{ - s12 = "a6"; - s12_len = 2; - break; - } - case 0x1B:{ - s12 = "s11"; - s12_len = 3; - break; - } - case 0x1C:{ - s12 = "t3"; - s12_len = 2; - break; - } - case 0x16:{ - s12 = "s6"; - s12_len = 2; - break; - } - case 0x00:{ - s12 = "zero"; - s12_len = 4; - break; - } - case 0x0A:{ - s12 = "a0"; - s12_len = 2; - break; - } - case 0x1A:{ - s12 = "s10"; - s12_len = 3; - break; - } - case 0x17:{ - s12 = "s7"; - s12_len = 2; - break; - } - case 0x0C:{ - s12 = "a2"; - s12_len = 2; - break; - } - case 0x18:{ - s12 = "s8"; - s12_len = 2; - break; - } - case 0x02:{ - s12 = "sp"; - s12_len = 2; - break; - } - case 0x1F:{ - s12 = "t6"; - s12_len = 2; - break; - } - case 0x0B:{ - s12 = "a1"; - s12_len = 2; - break; - } - case 0x07:{ - s12 = "t2"; - s12_len = 2; - break; - } - case 0x13:{ - s12 = "s3"; - s12_len = 2; - break; - } - case 0x04:{ - s12 = "tp"; - s12_len = 2; - break; - } - case 0x19:{ - s12 = "s9"; - s12_len = 2; - break; - } - case 0x12:{ - s12 = "s2"; - s12_len = 2; - break; - } - case 0x14:{ - s12 = "s4"; - s12_len = 2; - break; - } - case 0x0E:{ - s12 = "a4"; - s12_len = 2; - break; - } - case 0x1E:{ - s12 = "t5"; - s12_len = 2; - break; - } - case 0x11:{ - s12 = "a7"; - s12_len = 2; - break; - } - case 0x03:{ - s12 = "gp"; - s12_len = 2; - break; - } - case 0x05:{ - s12 = "t0"; - s12_len = 2; - break; - } - case 0x1D:{ - s12 = "t4"; - s12_len = 2; - break; - } - case 0x0D:{ - s12 = "a3"; - s12_len = 2; - break; - } - case 0x0F:{ - s12 = "a5"; - s12_len = 2; - break; - } - } - maybe_vmask(tree->ast_node.vsuxsegtype.vm, &s13, &s13_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len + s8_len, s9, s9_len); - 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); - 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); - 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); - 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); - } - } - break; - case RISCV_VLRETYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - char *s9; size_t s9_len; - char *s10; size_t s10_len; - s0 = "vl"; - s0_len = 2; - switch (tree->ast_node.vlretype.nf) { - case 0x7:{ - s1 = "seg8"; - s1_len = 4; - break; - } - case 0x5:{ - s1 = "seg6"; - s1_len = 4; - break; - } - case 0x1:{ - s1 = "seg2"; - s1_len = 4; - break; - } - case 0x3:{ - s1 = "seg4"; - s1_len = 4; - break; - } - case 0x2:{ - s1 = "seg3"; - s1_len = 4; - break; - } - case 0x4:{ - s1 = "seg5"; - s1_len = 4; - break; - } - case 0x6:{ - s1 = "seg7"; - s1_len = 4; - break; - } - case 0x0:{ - s1 = ""; - s1_len = 0; - break; - } - } - s2 = "re"; - s2_len = 2; - switch (tree->ast_node.vlretype.width) { - case RISCV_VLE16:{ - s3 = "16"; - s3_len = 2; - break; - } - case RISCV_VLE32:{ - s3 = "32"; - s3_len = 2; - break; - } - case RISCV_VLE64:{ - s3 = "64"; - s3_len = 2; - break; - } - case RISCV_VLE8:{ - s3 = "8"; - s3_len = 1; - break; - } - } - s4 = ".v"; - s4_len = 2; - spc( &s5, &s5_len); - switch (tree->ast_node.vlretype.vd) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - sep( &s7, &s7_len); - s8 = "("; - s8_len = 1; - switch (tree->ast_node.vlretype.rs1) { - case 0x08:{ - s9 = "fp"; - s9_len = 2; - break; - } - case 0x15:{ - s9 = "s5"; - s9_len = 2; - break; - } - case 0x01:{ - s9 = "ra"; - s9_len = 2; - break; - } - case 0x06:{ - s9 = "t1"; - s9_len = 2; - break; - } - case 0x09:{ - s9 = "s1"; - s9_len = 2; - break; - } - case 0x10:{ - s9 = "a6"; - s9_len = 2; - break; - } - case 0x1B:{ - s9 = "s11"; - s9_len = 3; - break; - } - case 0x1C:{ - s9 = "t3"; - s9_len = 2; - break; - } - case 0x16:{ - s9 = "s6"; - s9_len = 2; - break; - } - case 0x00:{ - s9 = "zero"; - s9_len = 4; - break; - } - case 0x0A:{ - s9 = "a0"; - s9_len = 2; - break; - } - case 0x1A:{ - s9 = "s10"; - s9_len = 3; - break; - } - case 0x17:{ - s9 = "s7"; - s9_len = 2; - break; - } - case 0x0C:{ - s9 = "a2"; - s9_len = 2; - break; - } - case 0x18:{ - s9 = "s8"; - s9_len = 2; - break; - } - case 0x02:{ - s9 = "sp"; - s9_len = 2; - break; - } - case 0x1F:{ - s9 = "t6"; - s9_len = 2; - break; - } - case 0x0B:{ - s9 = "a1"; - s9_len = 2; - break; - } - case 0x07:{ - s9 = "t2"; - s9_len = 2; - break; - } - case 0x13:{ - s9 = "s3"; - s9_len = 2; - break; - } - case 0x04:{ - s9 = "tp"; - s9_len = 2; - break; - } - case 0x19:{ - s9 = "s9"; - s9_len = 2; - break; - } - case 0x12:{ - s9 = "s2"; - s9_len = 2; - break; - } - case 0x14:{ - s9 = "s4"; - s9_len = 2; - break; - } - case 0x0E:{ - s9 = "a4"; - s9_len = 2; - break; - } - case 0x1E:{ - s9 = "t5"; - s9_len = 2; - break; - } - case 0x11:{ - s9 = "a7"; - s9_len = 2; - break; - } - case 0x03:{ - s9 = "gp"; - s9_len = 2; - break; - } - case 0x05:{ - s9 = "t0"; - s9_len = 2; - break; - } - case 0x1D:{ - s9 = "t4"; - s9_len = 2; - break; - } - case 0x0D:{ - s9 = "a3"; - s9_len = 2; - break; - } - case 0x0F:{ - s9 = "a5"; - s9_len = 2; - break; - } - } - s10 = ")"; - s10_len = 1; - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len + s8_len, s9, s9_len); - 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); - } - } - break; - case RISCV_VSRETYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - s0 = "vs"; - s0_len = 2; - switch (tree->ast_node.vsretype.nf) { - case 0x7:{ - s1 = "seg8"; - s1_len = 4; - break; - } - case 0x5:{ - s1 = "seg6"; - s1_len = 4; - break; - } - case 0x1:{ - s1 = "seg2"; - s1_len = 4; - break; - } - case 0x3:{ - s1 = "seg4"; - s1_len = 4; - break; - } - case 0x2:{ - s1 = "seg3"; - s1_len = 4; - break; - } - case 0x4:{ - s1 = "seg5"; - s1_len = 4; - break; - } - case 0x6:{ - s1 = "seg7"; - s1_len = 4; - break; - } - case 0x0:{ - s1 = ""; - s1_len = 0; - break; - } - } - s2 = "r.v"; - s2_len = 3; - spc( &s3, &s3_len); - switch (tree->ast_node.vsretype.vs3) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - s6 = "("; - s6_len = 1; - switch (tree->ast_node.vsretype.rs1) { - case 0x08:{ - s7 = "fp"; - s7_len = 2; - break; - } - case 0x15:{ - s7 = "s5"; - s7_len = 2; - break; - } - case 0x01:{ - s7 = "ra"; - s7_len = 2; - break; - } - case 0x06:{ - s7 = "t1"; - s7_len = 2; - break; - } - case 0x09:{ - s7 = "s1"; - s7_len = 2; - break; - } - case 0x10:{ - s7 = "a6"; - s7_len = 2; - break; - } - case 0x1B:{ - s7 = "s11"; - s7_len = 3; - break; - } - case 0x1C:{ - s7 = "t3"; - s7_len = 2; - break; - } - case 0x16:{ - s7 = "s6"; - s7_len = 2; - break; - } - case 0x00:{ - s7 = "zero"; - s7_len = 4; - break; - } - case 0x0A:{ - s7 = "a0"; - s7_len = 2; - break; - } - case 0x1A:{ - s7 = "s10"; - s7_len = 3; - break; - } - case 0x17:{ - s7 = "s7"; - s7_len = 2; - break; - } - case 0x0C:{ - s7 = "a2"; - s7_len = 2; - break; - } - case 0x18:{ - s7 = "s8"; - s7_len = 2; - break; - } - case 0x02:{ - s7 = "sp"; - s7_len = 2; - break; - } - case 0x1F:{ - s7 = "t6"; - s7_len = 2; - break; - } - case 0x0B:{ - s7 = "a1"; - s7_len = 2; - break; - } - case 0x07:{ - s7 = "t2"; - s7_len = 2; - break; - } - case 0x13:{ - s7 = "s3"; - s7_len = 2; - break; - } - case 0x04:{ - s7 = "tp"; - s7_len = 2; - break; - } - case 0x19:{ - s7 = "s9"; - s7_len = 2; - break; - } - case 0x12:{ - s7 = "s2"; - s7_len = 2; - break; - } - case 0x14:{ - s7 = "s4"; - s7_len = 2; - break; - } - case 0x0E:{ - s7 = "a4"; - s7_len = 2; - break; - } - case 0x1E:{ - s7 = "t5"; - s7_len = 2; - break; - } - case 0x11:{ - s7 = "a7"; - s7_len = 2; - break; - } - case 0x03:{ - s7 = "gp"; - s7_len = 2; - break; - } - case 0x05:{ - s7 = "t0"; - s7_len = 2; - break; - } - case 0x1D:{ - s7 = "t4"; - s7_len = 2; - break; - } - case 0x0D:{ - s7 = "a3"; - s7_len = 2; - break; - } - case 0x0F:{ - s7 = "a5"; - s7_len = 2; - break; - } - } - s8 = ")"; - s8_len = 1; - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - } - } - break; - case RISCV_VMTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - switch (tree->ast_node.vmtype.op) { - case RISCV_VLM:{ - s0 = "vlm.v"; - s0_len = 5; - break; - } - case RISCV_VSM:{ - s0 = "vsm.v"; - s0_len = 5; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.vmtype.vd_or_vs3) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - s4 = "("; - s4_len = 1; - switch (tree->ast_node.vmtype.rs1) { - case 0x08:{ - s5 = "fp"; - s5_len = 2; - break; - } - case 0x15:{ - s5 = "s5"; - s5_len = 2; - break; - } - case 0x01:{ - s5 = "ra"; - s5_len = 2; - break; - } - case 0x06:{ - s5 = "t1"; - s5_len = 2; - break; - } - case 0x09:{ - s5 = "s1"; - s5_len = 2; - break; - } - case 0x10:{ - s5 = "a6"; - s5_len = 2; - break; - } - case 0x1B:{ - s5 = "s11"; - s5_len = 3; - break; - } - case 0x1C:{ - s5 = "t3"; - s5_len = 2; - break; - } - case 0x16:{ - s5 = "s6"; - s5_len = 2; - break; - } - case 0x00:{ - s5 = "zero"; - s5_len = 4; - break; - } - case 0x0A:{ - s5 = "a0"; - s5_len = 2; - break; - } - case 0x1A:{ - s5 = "s10"; - s5_len = 3; - break; - } - case 0x17:{ - s5 = "s7"; - s5_len = 2; - break; - } - case 0x0C:{ - s5 = "a2"; - s5_len = 2; - break; - } - case 0x18:{ - s5 = "s8"; - s5_len = 2; - break; - } - case 0x02:{ - s5 = "sp"; - s5_len = 2; - break; - } - case 0x1F:{ - s5 = "t6"; - s5_len = 2; - break; - } - case 0x0B:{ - s5 = "a1"; - s5_len = 2; - break; - } - case 0x07:{ - s5 = "t2"; - s5_len = 2; - break; - } - case 0x13:{ - s5 = "s3"; - s5_len = 2; - break; - } - case 0x04:{ - s5 = "tp"; - s5_len = 2; - break; - } - case 0x19:{ - s5 = "s9"; - s5_len = 2; - break; - } - case 0x12:{ - s5 = "s2"; - s5_len = 2; - break; - } - case 0x14:{ - s5 = "s4"; - s5_len = 2; - break; - } - case 0x0E:{ - s5 = "a4"; - s5_len = 2; - break; - } - case 0x1E:{ - s5 = "t5"; - s5_len = 2; - break; - } - case 0x11:{ - s5 = "a7"; - s5_len = 2; - break; - } - case 0x03:{ - s5 = "gp"; - s5_len = 2; - break; - } - case 0x05:{ - s5 = "t0"; - s5_len = 2; - break; - } - case 0x1D:{ - s5 = "t4"; - s5_len = 2; - break; - } - case 0x0D:{ - s5 = "a3"; - s5_len = 2; - break; - } - case 0x0F:{ - s5 = "a5"; - s5_len = 2; - break; - } - } - s6 = ")"; - s6_len = 1; - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_MMTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - switch (tree->ast_node.mmtype.funct6) { - case RISCV_MM_VMANDN:{ - s0 = "vmandn.mm"; - s0_len = 9; - break; - } - case RISCV_MM_VMOR:{ - s0 = "vmor.mm"; - s0_len = 7; - break; - } - case RISCV_MM_VMXOR:{ - s0 = "vmxor.mm"; - s0_len = 8; - break; - } - case RISCV_MM_VMNOR:{ - s0 = "vmnor.mm"; - s0_len = 8; - break; - } - case RISCV_MM_VMORN:{ - s0 = "vmorn.mm"; - s0_len = 8; - break; - } - case RISCV_MM_VMAND:{ - s0 = "vmand.mm"; - s0_len = 8; - break; - } - case RISCV_MM_VMXNOR:{ - s0 = "vmxnor.mm"; - s0_len = 9; - break; - } - case RISCV_MM_VMNAND:{ - s0 = "vmnand.mm"; - s0_len = 9; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.mmtype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.mmtype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.mmtype.vs1) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_VCPOP_M: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - s0 = "vpopc.m"; - s0_len = 7; - spc( &s1, &s1_len); - switch (tree->ast_node.vcpop_m.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vcpop_m.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.vcpop_m.vm, &s5, &s5_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - } - } - break; - case RISCV_VFIRST_M: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - s0 = "vfirst.m"; + 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); - switch (tree->ast_node.vfirst_m.rd) { - case 0x08:{ - s2 = "fp"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "s5"; - s2_len = 2; - break; - } - case 0x01:{ - s2 = "ra"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "t1"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "s1"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "a6"; - s2_len = 2; - break; - } - case 0x1B:{ - s2 = "s11"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "t3"; - s2_len = 2; - break; - } - case 0x16:{ - s2 = "s6"; - s2_len = 2; - break; - } - case 0x00:{ - s2 = "zero"; - s2_len = 4; - break; - } - case 0x0A:{ - s2 = "a0"; - s2_len = 2; - break; - } - case 0x1A:{ - s2 = "s10"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "s7"; - s2_len = 2; - break; - } - case 0x0C:{ - s2 = "a2"; - s2_len = 2; - break; - } - case 0x18:{ - s2 = "s8"; - s2_len = 2; - break; - } - case 0x02:{ - s2 = "sp"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "t6"; - s2_len = 2; - break; - } - case 0x0B:{ - s2 = "a1"; - s2_len = 2; - break; - } - case 0x07:{ - s2 = "t2"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "s3"; - s2_len = 2; - break; - } - case 0x04:{ - s2 = "tp"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "s9"; - s2_len = 2; - break; - } - case 0x12:{ - s2 = "s2"; - s2_len = 2; - break; - } - case 0x14:{ - s2 = "s4"; - s2_len = 2; - break; - } - case 0x0E:{ - s2 = "a4"; - s2_len = 2; - break; - } - case 0x1E:{ - s2 = "t5"; - s2_len = 2; - break; - } - case 0x11:{ - s2 = "a7"; - s2_len = 2; - break; - } - case 0x03:{ - s2 = "gp"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "t0"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "t4"; - s2_len = 2; - break; - } - case 0x0D:{ - s2 = "a3"; - s2_len = 2; - break; - } - case 0x0F:{ - s2 = "a5"; - s2_len = 2; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vfirst_m.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.vfirst_m.vm, &s5, &s5_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - } - } - break; - case RISCV_VMSBF_M: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - s0 = "vmsbf.m"; - s0_len = 7; - spc( &s1, &s1_len); - switch (tree->ast_node.vmsbf_m.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vmsbf_m.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.vmsbf_m.vm, &s5, &s5_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - } - } - break; - case RISCV_VMSIF_M: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - s0 = "vmsif.m"; - s0_len = 7; - spc( &s1, &s1_len); - switch (tree->ast_node.vmsif_m.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vmsif_m.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.vmsif_m.vm, &s5, &s5_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - } - } - break; - case RISCV_VMSOF_M: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - s0 = "vmsof.m"; + 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); - switch (tree->ast_node.vmsof_m.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vmsof_m.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.vmsof_m.vm, &s5, &s5_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - } - } - break; - case RISCV_VIOTA_M: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - s0 = "viota.m"; + 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); - switch (tree->ast_node.viota_m.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.viota_m.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.viota_m.vm, &s5, &s5_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - } - } - break; - case RISCV_VID_V: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - s0 = "vid.v"; - s0_len = 5; - spc( &s1, &s1_len); - switch (tree->ast_node.vid_v.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.vid_v.vm, &s3, &s3_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - } - } - break; - case RISCV_VVMTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - switch (tree->ast_node.vvmtype.funct6) { - case RISCV_VVM_VMADC:{ - s0 = "vmadc.vvm"; - s0_len = 9; - break; - } - case RISCV_VVM_VMSBC:{ - s0 = "vmsbc.vvm"; - s0_len = 9; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.vvmtype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vvmtype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.vvmtype.vs1) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - sep( &s7, &s7_len); - s8 = "v0"; - s8_len = 2; - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - } - } - break; - case RISCV_VVMCTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - switch (tree->ast_node.vvmctype.funct6) { - case RISCV_VVMC_VMADC:{ - s0 = "vmadc.vv"; - s0_len = 8; - break; - } - case RISCV_VVMC_VMSBC:{ - s0 = "vmsbc.vv"; - s0_len = 8; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.vvmctype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vvmctype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.vvmctype.vs1) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_VVMSTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - switch (tree->ast_node.vvmstype.funct6) { - case RISCV_VVMS_VSBC:{ - s0 = "vsbc.vvm"; - s0_len = 8; - break; - } - case RISCV_VVMS_VADC:{ - s0 = "vadc.vvm"; - s0_len = 8; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.vvmstype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vvmstype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.vvmstype.vs1) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - sep( &s7, &s7_len); - s8 = "v0"; - s8_len = 2; - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - } - } - break; - case RISCV_VVCMPTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.vvcmptype.funct6) { - case RISCV_VVCMP_VMSEQ:{ - s0 = "vmseq.vv"; - s0_len = 8; - break; - } - case RISCV_VVCMP_VMSLTU:{ - s0 = "vmsltu.vv"; - s0_len = 9; - break; - } - case RISCV_VVCMP_VMSLE:{ - s0 = "vmsle.vv"; - s0_len = 8; - break; - } - case RISCV_VVCMP_VMSLEU:{ - s0 = "vmsleu.vv"; - s0_len = 9; - break; - } - case RISCV_VVCMP_VMSNE:{ - s0 = "vmsne.vv"; - s0_len = 8; - break; - } - case RISCV_VVCMP_VMSLT:{ - s0 = "vmslt.vv"; - s0_len = 8; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.vvcmptype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vvcmptype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.vvcmptype.vs1) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.vvcmptype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_VXMTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - switch (tree->ast_node.vxmtype.funct6) { - case RISCV_VXM_VMSBC:{ - s0 = "vmsbc.vxm"; - s0_len = 9; - break; - } - case RISCV_VXM_VMADC:{ - s0 = "vmadc.vxm"; - s0_len = 9; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.vxmtype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vxmtype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.vxmtype.rs1) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - sep( &s7, &s7_len); - s8 = "v0"; - s8_len = 2; - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - } - } - break; - case RISCV_VXMCTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - switch (tree->ast_node.vxmctype.funct6) { - case RISCV_VXMC_VMSBC:{ - s0 = "vmsbc.vx"; - s0_len = 8; - break; - } - case RISCV_VXMC_VMADC:{ - s0 = "vmadc.vx"; - s0_len = 8; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.vxmctype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vxmctype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.vxmctype.rs1) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_VXMSTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - switch (tree->ast_node.vxmstype.funct6) { - case RISCV_VXMS_VADC:{ - s0 = "vadc.vxm"; - s0_len = 8; - break; - } - case RISCV_VXMS_VSBC:{ - s0 = "vsbc.vxm"; - s0_len = 8; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.vxmstype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vxmstype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.vxmstype.rs1) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - sep( &s7, &s7_len); - s8 = "v0"; - s8_len = 2; - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - } - } - break; - case RISCV_VXCMPTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.vxcmptype.funct6) { - case RISCV_VXCMP_VMSLTU:{ - s0 = "vmsltu.vx"; - s0_len = 9; - break; - } - case RISCV_VXCMP_VMSLEU:{ - s0 = "vmsleu.vx"; - s0_len = 9; - break; - } - case RISCV_VXCMP_VMSNE:{ - s0 = "vmsne.vx"; - s0_len = 8; - break; - } - case RISCV_VXCMP_VMSGT:{ - s0 = "vmsgt.vx"; - s0_len = 8; - break; - } - case RISCV_VXCMP_VMSEQ:{ - s0 = "vmseq.vx"; - s0_len = 8; - break; - } - case RISCV_VXCMP_VMSGTU:{ - s0 = "vmsgtu.vx"; - s0_len = 9; - break; - } - case RISCV_VXCMP_VMSLT:{ - s0 = "vmslt.vx"; - s0_len = 8; - break; - } - case RISCV_VXCMP_VMSLE:{ - s0 = "vmsle.vx"; - s0_len = 8; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.vxcmptype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vxcmptype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.vxcmptype.rs1) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - maybe_vmask(tree->ast_node.vxcmptype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_VIMTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - switch (tree->ast_node.vimtype.funct6) { - case RISCV_VIM_VMADC:{ - s0 = "vmadc.vim"; - s0_len = 9; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.vimtype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vimtype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - hex_bits_5(tree->ast_node.vimtype.simm, &s6, &s6_len); - sep( &s7, &s7_len); - s8 = "v0"; - s8_len = 2; - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - } - } - break; - case RISCV_VIMCTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - switch (tree->ast_node.vimctype.funct6) { - case RISCV_VIMC_VMADC:{ - s0 = "vmadc.vi"; - s0_len = 8; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.vimctype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vimctype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - hex_bits_5(tree->ast_node.vimctype.simm, &s6, &s6_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_VIMSTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - char *s8; size_t s8_len; - switch (tree->ast_node.vimstype.funct6) { - case RISCV_VIMS_VADC:{ - s0 = "vadc.vim"; - s0_len = 8; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.vimstype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vimstype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - hex_bits_5(tree->ast_node.vimstype.simm, &s6, &s6_len); - sep( &s7, &s7_len); - s8 = "v0"; - s8_len = 2; - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len, s8, s8_len); - } - } - break; - case RISCV_VICMPTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.vicmptype.funct6) { - case RISCV_VICMP_VMSEQ:{ - s0 = "vmseq.vi"; - s0_len = 8; - break; - } - case RISCV_VICMP_VMSGTU:{ - s0 = "vmsgtu.vi"; - s0_len = 9; - break; - } - case RISCV_VICMP_VMSLEU:{ - s0 = "vmsleu.vi"; - s0_len = 9; - break; - } - case RISCV_VICMP_VMSLE:{ - s0 = "vmsle.vi"; - s0_len = 8; - break; - } - case RISCV_VICMP_VMSNE:{ - s0 = "vmsne.vi"; - s0_len = 8; - break; - } - case RISCV_VICMP_VMSGT:{ - s0 = "vmsgt.vi"; - s0_len = 8; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.vicmptype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.vicmptype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - hex_bits_5(tree->ast_node.vicmptype.simm, &s6, &s6_len); - maybe_vmask(tree->ast_node.vicmptype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_FVVMTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.fvvmtype.funct6) { - case RISCV_FVVM_VMFNE:{ - s0 = "vmfne.vv"; - s0_len = 8; - break; - } - case RISCV_FVVM_VMFEQ:{ - s0 = "vmfeq.vv"; - s0_len = 8; - break; - } - case RISCV_FVVM_VMFLT:{ - s0 = "vmflt.vv"; - s0_len = 8; - break; - } - case RISCV_FVVM_VMFLE:{ - s0 = "vmfle.vv"; - s0_len = 8; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.fvvmtype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.fvvmtype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.fvvmtype.vs1) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.fvvmtype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_FVFMTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.fvfmtype.funct6) { - case RISCV_VFM_VMFNE:{ - s0 = "vmfne.vf"; - s0_len = 8; - break; - } - case RISCV_VFM_VMFGT:{ - s0 = "vmfgt.vf"; - s0_len = 8; - break; - } - case RISCV_VFM_VMFLT:{ - s0 = "vmflt.vf"; - s0_len = 8; - break; - } - case RISCV_VFM_VMFEQ:{ - s0 = "vmfeq.vf"; - s0_len = 8; - break; - } - case RISCV_VFM_VMFLE:{ - s0 = "vmfle.vf"; - s0_len = 8; - break; - } - case RISCV_VFM_VMFGE:{ - s0 = "vmfge.vf"; - s0_len = 8; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.fvfmtype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.fvfmtype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.fvfmtype.rs1) { - case 0x08:{ - s6 = "fp"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "s5"; - s6_len = 2; - break; - } - case 0x01:{ - s6 = "ra"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "t1"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "s1"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "a6"; - s6_len = 2; - break; - } - case 0x1B:{ - s6 = "s11"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "t3"; - s6_len = 2; - break; - } - case 0x16:{ - s6 = "s6"; - s6_len = 2; - break; - } - case 0x00:{ - s6 = "zero"; - s6_len = 4; - break; - } - case 0x0A:{ - s6 = "a0"; - s6_len = 2; - break; - } - case 0x1A:{ - s6 = "s10"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "s7"; - s6_len = 2; - break; - } - case 0x0C:{ - s6 = "a2"; - s6_len = 2; - break; - } - case 0x18:{ - s6 = "s8"; - s6_len = 2; - break; - } - case 0x02:{ - s6 = "sp"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "t6"; - s6_len = 2; - break; - } - case 0x0B:{ - s6 = "a1"; - s6_len = 2; - break; - } - case 0x07:{ - s6 = "t2"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "s3"; - s6_len = 2; - break; - } - case 0x04:{ - s6 = "tp"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "s9"; - s6_len = 2; - break; - } - case 0x12:{ - s6 = "s2"; - s6_len = 2; - break; - } - case 0x14:{ - s6 = "s4"; - s6_len = 2; - break; - } - case 0x0E:{ - s6 = "a4"; - s6_len = 2; - break; - } - case 0x1E:{ - s6 = "t5"; - s6_len = 2; - break; - } - case 0x11:{ - s6 = "a7"; - s6_len = 2; - break; - } - case 0x03:{ - s6 = "gp"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "t0"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "t4"; - s6_len = 2; - break; - } - case 0x0D:{ - s6 = "a3"; - s6_len = 2; - break; - } - case 0x0F:{ - s6 = "a5"; - s6_len = 2; - break; - } - } - maybe_vmask(tree->ast_node.fvfmtype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_RIVVTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.rivvtype.funct6) { - case RISCV_IVV_VWREDSUMU:{ - s0 = "vwredsumu.vs"; - s0_len = 12; - break; - } - case RISCV_IVV_VWREDSUM:{ - s0 = "vwredsum.vs"; - s0_len = 11; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.rivvtype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.rivvtype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.rivvtype.vs1) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.rivvtype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_RMVVTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.rmvvtype.funct6) { - case RISCV_MVV_VREDAND:{ - s0 = "vredand.vs"; - s0_len = 10; - break; - } - case RISCV_MVV_VREDXOR:{ - s0 = "vredxor.vs"; - s0_len = 10; - break; - } - case RISCV_MVV_VREDOR:{ - s0 = "vredor.vs"; - s0_len = 9; - break; - } - case RISCV_MVV_VREDMIN:{ - s0 = "vredmin.vs"; - s0_len = 10; - break; - } - case RISCV_MVV_VREDMAXU:{ - s0 = "vredmaxu.vs"; - s0_len = 11; - break; - } - case RISCV_MVV_VREDMINU:{ - s0 = "vredminu.vs"; - s0_len = 11; - break; - } - case RISCV_MVV_VREDSUM:{ - s0 = "vredsum.vs"; - s0_len = 10; - break; - } - case RISCV_MVV_VREDMAX:{ - s0 = "vredmax.vs"; - s0_len = 10; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.rmvvtype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.rmvvtype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.rmvvtype.vs1) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.rmvvtype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_RFVVTYPE: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - char *s7; size_t s7_len; - switch (tree->ast_node.rfvvtype.funct6) { - case RISCV_FVV_VFWREDOSUM:{ - s0 = "vfwredosum.vs"; - s0_len = 13; - break; - } - case RISCV_FVV_VFREDOSUM:{ - s0 = "vfredosum.vs"; - s0_len = 12; - break; - } - case RISCV_FVV_VFREDUSUM:{ - s0 = "vfredusum.vs"; - s0_len = 12; - break; - } - case RISCV_FVV_VFREDMIN:{ - s0 = "vfredmin.vs"; - s0_len = 11; - break; - } - case RISCV_FVV_VFWREDUSUM:{ - s0 = "vfwredusum.vs"; - s0_len = 13; - break; - } - case RISCV_FVV_VFREDMAX:{ - s0 = "vfredmax.vs"; - s0_len = 11; - break; - } - } - spc( &s1, &s1_len); - switch (tree->ast_node.rfvvtype.vd) { - case 0x08:{ - s2 = "v8"; - s2_len = 2; - break; - } - case 0x15:{ - s2 = "v21"; - s2_len = 3; - break; - } - case 0x01:{ - s2 = "v1"; - s2_len = 2; - break; - } - case 0x06:{ - s2 = "v6"; - s2_len = 2; - break; - } - case 0x09:{ - s2 = "v9"; - s2_len = 2; - break; - } - case 0x10:{ - s2 = "v16"; - s2_len = 3; - break; - } - case 0x1B:{ - s2 = "v27"; - s2_len = 3; - break; - } - case 0x1C:{ - s2 = "v28"; - s2_len = 3; - break; - } - case 0x16:{ - s2 = "v22"; - s2_len = 3; - break; - } - case 0x00:{ - s2 = "v0"; - s2_len = 2; - break; - } - case 0x0A:{ - s2 = "v10"; - s2_len = 3; - break; - } - case 0x1A:{ - s2 = "v26"; - s2_len = 3; - break; - } - case 0x17:{ - s2 = "v23"; - s2_len = 3; - break; - } - case 0x0C:{ - s2 = "v12"; - s2_len = 3; - break; - } - case 0x18:{ - s2 = "v24"; - s2_len = 3; - break; - } - case 0x02:{ - s2 = "v2"; - s2_len = 2; - break; - } - case 0x1F:{ - s2 = "v31"; - s2_len = 3; - break; - } - case 0x0B:{ - s2 = "v11"; - s2_len = 3; - break; - } - case 0x07:{ - s2 = "v7"; - s2_len = 2; - break; - } - case 0x13:{ - s2 = "v19"; - s2_len = 3; - break; - } - case 0x04:{ - s2 = "v4"; - s2_len = 2; - break; - } - case 0x19:{ - s2 = "v25"; - s2_len = 3; - break; - } - case 0x12:{ - s2 = "v18"; - s2_len = 3; - break; - } - case 0x14:{ - s2 = "v20"; - s2_len = 3; - break; - } - case 0x0E:{ - s2 = "v14"; - s2_len = 3; - break; - } - case 0x1E:{ - s2 = "v30"; - s2_len = 3; - break; - } - case 0x11:{ - s2 = "v17"; - s2_len = 3; - break; - } - case 0x03:{ - s2 = "v3"; - s2_len = 2; - break; - } - case 0x05:{ - s2 = "v5"; - s2_len = 2; - break; - } - case 0x1D:{ - s2 = "v29"; - s2_len = 3; - break; - } - case 0x0D:{ - s2 = "v13"; - s2_len = 3; - break; - } - case 0x0F:{ - s2 = "v15"; - s2_len = 3; - break; - } - } - sep( &s3, &s3_len); - switch (tree->ast_node.rfvvtype.vs2) { - case 0x08:{ - s4 = "v8"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "v21"; - s4_len = 3; - break; - } - case 0x01:{ - s4 = "v1"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "v6"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "v9"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "v16"; - s4_len = 3; - break; - } - case 0x1B:{ - s4 = "v27"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "v28"; - s4_len = 3; - break; - } - case 0x16:{ - s4 = "v22"; - s4_len = 3; - break; - } - case 0x00:{ - s4 = "v0"; - s4_len = 2; - break; - } - case 0x0A:{ - s4 = "v10"; - s4_len = 3; - break; - } - case 0x1A:{ - s4 = "v26"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "v23"; - s4_len = 3; - break; - } - case 0x0C:{ - s4 = "v12"; - s4_len = 3; - break; - } - case 0x18:{ - s4 = "v24"; - s4_len = 3; - break; - } - case 0x02:{ - s4 = "v2"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "v31"; - s4_len = 3; - break; - } - case 0x0B:{ - s4 = "v11"; - s4_len = 3; - break; - } - case 0x07:{ - s4 = "v7"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "v19"; - s4_len = 3; - break; - } - case 0x04:{ - s4 = "v4"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "v25"; - s4_len = 3; - break; - } - case 0x12:{ - s4 = "v18"; - s4_len = 3; - break; - } - case 0x14:{ - s4 = "v20"; - s4_len = 3; - break; - } - case 0x0E:{ - s4 = "v14"; - s4_len = 3; - break; - } - case 0x1E:{ - s4 = "v30"; - s4_len = 3; - break; - } - case 0x11:{ - s4 = "v17"; - s4_len = 3; - break; - } - case 0x03:{ - s4 = "v3"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "v5"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "v29"; - s4_len = 3; - break; - } - case 0x0D:{ - s4 = "v13"; - s4_len = 3; - break; - } - case 0x0F:{ - s4 = "v15"; - s4_len = 3; - break; - } - } - sep( &s5, &s5_len); - switch (tree->ast_node.rfvvtype.vs1) { - case 0x08:{ - s6 = "v8"; - s6_len = 2; - break; - } - case 0x15:{ - s6 = "v21"; - s6_len = 3; - break; - } - case 0x01:{ - s6 = "v1"; - s6_len = 2; - break; - } - case 0x06:{ - s6 = "v6"; - s6_len = 2; - break; - } - case 0x09:{ - s6 = "v9"; - s6_len = 2; - break; - } - case 0x10:{ - s6 = "v16"; - s6_len = 3; - break; - } - case 0x1B:{ - s6 = "v27"; - s6_len = 3; - break; - } - case 0x1C:{ - s6 = "v28"; - s6_len = 3; - break; - } - case 0x16:{ - s6 = "v22"; - s6_len = 3; - break; - } - case 0x00:{ - s6 = "v0"; - s6_len = 2; - break; - } - case 0x0A:{ - s6 = "v10"; - s6_len = 3; - break; - } - case 0x1A:{ - s6 = "v26"; - s6_len = 3; - break; - } - case 0x17:{ - s6 = "v23"; - s6_len = 3; - break; - } - case 0x0C:{ - s6 = "v12"; - s6_len = 3; - break; - } - case 0x18:{ - s6 = "v24"; - s6_len = 3; - break; - } - case 0x02:{ - s6 = "v2"; - s6_len = 2; - break; - } - case 0x1F:{ - s6 = "v31"; - s6_len = 3; - break; - } - case 0x0B:{ - s6 = "v11"; - s6_len = 3; - break; - } - case 0x07:{ - s6 = "v7"; - s6_len = 2; - break; - } - case 0x13:{ - s6 = "v19"; - s6_len = 3; - break; - } - case 0x04:{ - s6 = "v4"; - s6_len = 2; - break; - } - case 0x19:{ - s6 = "v25"; - s6_len = 3; - break; - } - case 0x12:{ - s6 = "v18"; - s6_len = 3; - break; - } - case 0x14:{ - s6 = "v20"; - s6_len = 3; - break; - } - case 0x0E:{ - s6 = "v14"; - s6_len = 3; - break; - } - case 0x1E:{ - s6 = "v30"; - s6_len = 3; - break; - } - case 0x11:{ - s6 = "v17"; - s6_len = 3; - break; - } - case 0x03:{ - s6 = "v3"; - s6_len = 2; - break; - } - case 0x05:{ - s6 = "v5"; - s6_len = 2; - break; - } - case 0x1D:{ - s6 = "v29"; - s6_len = 3; - break; - } - case 0x0D:{ - s6 = "v13"; - s6_len = 3; - break; - } - case 0x0F:{ - s6 = "v15"; - s6_len = 3; - break; - } - } - maybe_vmask(tree->ast_node.rfvvtype.vm, &s7, &s7_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len + s6_len, s7, s7_len); - } - } - break; - case RISCV_ZICBOM: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - switch (tree->ast_node.riscv_zicbom.cbop) { - case RISCV_CBO_INVAL:{ - s0 = "cbo.inval"; - s0_len = 9; - break; - } - case RISCV_CBO_CLEAN:{ - s0 = "cbo.clean"; - s0_len = 9; - break; - } - case RISCV_CBO_FLUSH:{ - s0 = "cbo.flush"; - s0_len = 9; - break; - } - } - spc( &s1, &s1_len); - s2 = "("; - s2_len = 1; - opt_spc( &s3, &s3_len); - switch (tree->ast_node.riscv_zicbom.rs1) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - opt_spc( &s5, &s5_len); - s6 = ")"; - s6_len = 1; - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_ZICBOZ: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - char *s3; size_t s3_len; - char *s4; size_t s4_len; - char *s5; size_t s5_len; - char *s6; size_t s6_len; - s0 = "cbo.zero"; + 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); - s2 = "("; - s2_len = 1; - opt_spc( &s3, &s3_len); - switch (tree->ast_node.riscv_zicboz) { - case 0x08:{ - s4 = "fp"; - s4_len = 2; - break; - } - case 0x15:{ - s4 = "s5"; - s4_len = 2; - break; - } - case 0x01:{ - s4 = "ra"; - s4_len = 2; - break; - } - case 0x06:{ - s4 = "t1"; - s4_len = 2; - break; - } - case 0x09:{ - s4 = "s1"; - s4_len = 2; - break; - } - case 0x10:{ - s4 = "a6"; - s4_len = 2; - break; - } - case 0x1B:{ - s4 = "s11"; - s4_len = 3; - break; - } - case 0x1C:{ - s4 = "t3"; - s4_len = 2; - break; - } - case 0x16:{ - s4 = "s6"; - s4_len = 2; - break; - } - case 0x00:{ - s4 = "zero"; - s4_len = 4; - break; - } - case 0x0A:{ - s4 = "a0"; - s4_len = 2; - break; - } - case 0x1A:{ - s4 = "s10"; - s4_len = 3; - break; - } - case 0x17:{ - s4 = "s7"; - s4_len = 2; - break; - } - case 0x0C:{ - s4 = "a2"; - s4_len = 2; - break; - } - case 0x18:{ - s4 = "s8"; - s4_len = 2; - break; - } - case 0x02:{ - s4 = "sp"; - s4_len = 2; - break; - } - case 0x1F:{ - s4 = "t6"; - s4_len = 2; - break; - } - case 0x0B:{ - s4 = "a1"; - s4_len = 2; - break; - } - case 0x07:{ - s4 = "t2"; - s4_len = 2; - break; - } - case 0x13:{ - s4 = "s3"; - s4_len = 2; - break; - } - case 0x04:{ - s4 = "tp"; - s4_len = 2; - break; - } - case 0x19:{ - s4 = "s9"; - s4_len = 2; - break; - } - case 0x12:{ - s4 = "s2"; - s4_len = 2; - break; - } - case 0x14:{ - s4 = "s4"; - s4_len = 2; - break; - } - case 0x0E:{ - s4 = "a4"; - s4_len = 2; - break; - } - case 0x1E:{ - s4 = "t5"; - s4_len = 2; - break; - } - case 0x11:{ - s4 = "a7"; - s4_len = 2; - break; - } - case 0x03:{ - s4 = "gp"; - s4_len = 2; - break; - } - case 0x05:{ - s4 = "t0"; - s4_len = 2; - break; - } - case 0x1D:{ - s4 = "t4"; - s4_len = 2; - break; - } - case 0x0D:{ - s4 = "a3"; - s4_len = 2; - break; - } - case 0x0F:{ - s4 = "a5"; - s4_len = 2; - break; - } - } - opt_spc( &s5, &s5_len); - s6 = ")"; - s6_len = 1; - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - memcpy(buff + s0_len + s1_len + s2_len, s3, s3_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len, s4, s4_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len, s5, s5_len); - memcpy(buff + s0_len + s1_len + s2_len + s3_len + s4_len + s5_len, s6, s6_len); - } - } - break; - case RISCV_ILLEGAL: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - s0 = "illegal"; - s0_len = 7; - spc( &s1, &s1_len); - hex_bits_32(tree->ast_node.illegal, &s2, &s2_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - } - } - break; - case RISCV_C_ILLEGAL: { -{ - char *s0; size_t s0_len; - char *s1; size_t s1_len; - char *s2; size_t s2_len; - s0 = "c.illegal"; - s0_len = 9; - spc( &s1, &s1_len); - hex_bits_16(tree->ast_node.c_illegal, &s2, &s2_len); - memcpy(buff , s0, s0_len); - memcpy(buff + s0_len, s1, s1_len); - memcpy(buff + s0_len + s1_len, s2, s2_len); - } - } - break; - + 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; } -} \ No newline at end of file +} + +#endif diff --git a/arch/RISCV/riscv_ast2str_tbls.gen.inc b/arch/RISCV/riscv_ast2str_tbls.gen.inc new file mode 100644 index 00000000000..58ba21e4a75 --- /dev/null +++ b/arch/RISCV/riscv_ast2str_tbls.gen.inc @@ -0,0 +1,3044 @@ +#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_decode.gen.inc b/arch/RISCV/riscv_decode.gen.inc index ac1bc2cfa14..c483d830df1 100644 --- a/arch/RISCV/riscv_decode.gen.inc +++ b/arch/RISCV/riscv_decode.gen.inc @@ -1,7056 +1,9398 @@ +#ifndef __Riscv_decode_gen_inc__ +#define __Riscv_decode_gen_inc__ #include #include -#include #include "riscv_ast.gen.inc" +#include - -void decode(struct ast *tree, uint64_t binary_stream) { - uint64_t op = 0xFFFFFFFFFFFFFFFF ; +static void decode(struct ast *tree, uint64_t binary_stream) { + // ---------------------------UTYPE------------------------------- + { + uint64_t op = 0xFFFFFFFFFFFFFFFF; switch (binary_stream & 0x000000000000007F) { - case 0x37: - op = RISCV_LUI ; - break; - case 0x17: - op = RISCV_AUIPC ; - break; - - } - if (op != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t imm = (binary_stream & 0x00000000FFFFF000)>>12 ; - tree->ast_node_type = RISCV_UTYPE ; - tree->ast_node.utype.imm = imm; - tree->ast_node.utype.rd = rd; - tree->ast_node.utype.op = op; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x6F)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t imm_7_0 = (binary_stream & 0x00000000000FF000)>>12 ; - uint64_t imm_8 = (binary_stream & 0x0000000000100000)>>20 ; - uint64_t imm_12_9 = (binary_stream & 0x0000000001E00000)>>21 ; - uint64_t imm_18_13 = (binary_stream & 0x000000007E000000)>>25 ; - uint64_t imm_19 = (binary_stream & 0x0000000080000000)>>31 ; - tree->ast_node_type = RISCV_JAL ; - tree->ast_node.riscv_jal.imm = (imm_19 << 23) | (imm_7_0 << 15) | (imm_8 << 14) | (imm_18_13 << 8) | (imm_12_9 << 4) | (0x0 << 0); + case 0x37: + op = RISCV_LUI; + break; + case 0x17: + op = RISCV_AUIPC; + break; + } + if (op != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t imm = (binary_stream & 0x00000000FFFFF000) >> 12; + tree->ast_node_type = RISCV_UTYPE; + tree->ast_node.utype.imm = imm; + tree->ast_node.utype.rd = rd; + tree->ast_node.utype.op = op; + return; + } + } + //------------------------------------------------------------ + + // ---------------------------RISCV_JAL------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x6F)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t imm_7_0 = (binary_stream & 0x00000000000FF000) >> 12; + uint64_t imm_8 = (binary_stream & 0x0000000000100000) >> 20; + uint64_t imm_12_9 = (binary_stream & 0x0000000001E00000) >> 21; + uint64_t imm_18_13 = (binary_stream & 0x000000007E000000) >> 25; + uint64_t imm_19 = (binary_stream & 0x0000000080000000) >> 31; + tree->ast_node_type = RISCV_JAL; + tree->ast_node.riscv_jal.imm = (imm_19 << 23) | (imm_7_0 << 15) | + (imm_8 << 14) | (imm_18_13 << 8) | + (imm_12_9 << 4) | (0x0 << 0); tree->ast_node.riscv_jal.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x67) && ((binary_stream & 0x0000000000007000)>>12 == 0x0)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t imm = (binary_stream & 0x00000000FFF00000)>>20 ; - tree->ast_node_type = RISCV_JALR ; + //------------------------------------------------------------ + + // ---------------------------RISCV_JALR------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x67) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t imm = (binary_stream & 0x00000000FFF00000) >> 20; + tree->ast_node_type = RISCV_JALR; tree->ast_node.riscv_jalr.imm = imm; tree->ast_node.riscv_jalr.rs1 = rs1; tree->ast_node.riscv_jalr.rd = rd; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x63)) { - uint64_t op = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - op = RISCV_BGEU ; - break; - case 0x5: - op = RISCV_BGE ; - break; - case 0x1: - op = RISCV_BNE ; - break; - case 0x4: - op = RISCV_BLT ; - break; - case 0x6: - op = RISCV_BLTU ; - break; - case 0x0: - op = RISCV_BEQ ; - break; - - } - if (op != 0xFFFFFFFFFFFFFFFF) { - uint64_t imm5_0 = (binary_stream & 0x0000000000000080)>>7 ; - uint64_t imm5_4_1 = (binary_stream & 0x0000000000000F00)>>8 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t imm7_5_0 = (binary_stream & 0x000000007E000000)>>25 ; - uint64_t imm7_6 = (binary_stream & 0x0000000080000000)>>31 ; - tree->ast_node_type = RISCV_BTYPE ; - tree->ast_node.btype.imm = (imm7_6 << 15) | (imm5_0 << 14) | (imm7_5_0 << 8) | (imm5_4_1 << 4) | (0x0 << 0); - tree->ast_node.btype.rs2 = rs2; - tree->ast_node.btype.rs1 = rs1; - tree->ast_node.btype.op = op; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x13)) { - uint64_t op = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - op = RISCV_ANDI ; - break; - case 0x3: - op = RISCV_SLTIU ; - break; - case 0x2: - op = RISCV_SLTI ; - break; - case 0x6: - op = RISCV_ORI ; - break; - case 0x4: - op = RISCV_XORI ; - break; - case 0x0: - op = RISCV_ADDI ; - break; - - } - if (op != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t imm = (binary_stream & 0x00000000FFF00000)>>20 ; - tree->ast_node_type = RISCV_ITYPE ; - tree->ast_node.itype.imm = imm; - tree->ast_node.itype.rs1 = rs1; - tree->ast_node.itype.rd = rd; - tree->ast_node.itype.op = op; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FC000000)>>26 == 0x00)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t shamt = (binary_stream & 0x0000000003F00000)>>20 ; - tree->ast_node_type = RISCV_SHIFTIOP ; + return; + } + } + //------------------------------------------------------------ + + // ---------------------------BTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x63)) { + uint64_t op = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + op = RISCV_BGEU; + break; + case 0x5: + op = RISCV_BGE; + break; + case 0x1: + op = RISCV_BNE; + break; + case 0x4: + op = RISCV_BLT; + break; + case 0x6: + op = RISCV_BLTU; + break; + case 0x0: + op = RISCV_BEQ; + break; + } + if (op != 0xFFFFFFFFFFFFFFFF) { + uint64_t imm5_0 = (binary_stream & 0x0000000000000080) >> 7; + uint64_t imm5_4_1 = (binary_stream & 0x0000000000000F00) >> 8; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t imm7_5_0 = (binary_stream & 0x000000007E000000) >> 25; + uint64_t imm7_6 = (binary_stream & 0x0000000080000000) >> 31; + tree->ast_node_type = RISCV_BTYPE; + tree->ast_node.btype.imm = (imm7_6 << 15) | (imm5_0 << 14) | + (imm7_5_0 << 8) | (imm5_4_1 << 4) | + (0x0 << 0); + tree->ast_node.btype.rs2 = rs2; + tree->ast_node.btype.rs1 = rs1; + tree->ast_node.btype.op = op; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------ITYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13)) { + uint64_t op = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + op = RISCV_ANDI; + break; + case 0x3: + op = RISCV_SLTIU; + break; + case 0x2: + op = RISCV_SLTI; + break; + case 0x6: + op = RISCV_ORI; + break; + case 0x4: + op = RISCV_XORI; + break; + case 0x0: + op = RISCV_ADDI; + break; + } + if (op != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t imm = (binary_stream & 0x00000000FFF00000) >> 20; + tree->ast_node_type = RISCV_ITYPE; + tree->ast_node.itype.imm = imm; + tree->ast_node.itype.rs1 = rs1; + tree->ast_node.itype.rd = rd; + tree->ast_node.itype.op = op; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------SHIFTIOP------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x00)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t shamt = (binary_stream & 0x0000000003F00000) >> 20; + tree->ast_node_type = RISCV_SHIFTIOP; tree->ast_node.shiftiop.shamt = shamt; tree->ast_node.shiftiop.rs1 = rs1; tree->ast_node.shiftiop.rd = rd; tree->ast_node.shiftiop.op = RISCV_SLLI; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x5) && ((binary_stream & 0x00000000FC000000)>>26 == 0x00)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t shamt = (binary_stream & 0x0000000003F00000)>>20 ; - tree->ast_node_type = RISCV_SHIFTIOP ; + //------------------------------------------------------------ + + // ---------------------------SHIFTIOP------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x00)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t shamt = (binary_stream & 0x0000000003F00000) >> 20; + tree->ast_node_type = RISCV_SHIFTIOP; tree->ast_node.shiftiop.shamt = shamt; tree->ast_node.shiftiop.rs1 = rs1; tree->ast_node.shiftiop.rd = rd; tree->ast_node.shiftiop.op = RISCV_SRLI; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x5) && ((binary_stream & 0x00000000FC000000)>>26 == 0x10)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t shamt = (binary_stream & 0x0000000003F00000)>>20 ; - tree->ast_node_type = RISCV_SHIFTIOP ; + //------------------------------------------------------------ + + // ---------------------------SHIFTIOP------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x10)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t shamt = (binary_stream & 0x0000000003F00000) >> 20; + tree->ast_node_type = RISCV_SHIFTIOP; tree->ast_node.shiftiop.shamt = shamt; tree->ast_node.shiftiop.rs1 = rs1; tree->ast_node.shiftiop.rd = rd; tree->ast_node.shiftiop.op = RISCV_SRAI; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x00000000FE000000)>>25 == 0x00)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_RTYPE ; + //------------------------------------------------------------ + + // ---------------------------RTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x00)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_RTYPE; tree->ast_node.rtype.rs2 = rs2; tree->ast_node.rtype.rs1 = rs1; tree->ast_node.rtype.rd = rd; tree->ast_node.rtype.op = RISCV_ADD; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x2) && ((binary_stream & 0x00000000FE000000)>>25 == 0x00)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_RTYPE ; + //------------------------------------------------------------ + + // ---------------------------RTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x00)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_RTYPE; tree->ast_node.rtype.rs2 = rs2; tree->ast_node.rtype.rs1 = rs1; tree->ast_node.rtype.rd = rd; tree->ast_node.rtype.op = RISCV_SLT; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x3) && ((binary_stream & 0x00000000FE000000)>>25 == 0x00)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_RTYPE ; + //------------------------------------------------------------ + + // ---------------------------RTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x3) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x00)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_RTYPE; tree->ast_node.rtype.rs2 = rs2; tree->ast_node.rtype.rs1 = rs1; tree->ast_node.rtype.rd = rd; tree->ast_node.rtype.op = RISCV_SLTU; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x7) && ((binary_stream & 0x00000000FE000000)>>25 == 0x00)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_RTYPE ; + //------------------------------------------------------------ + + // ---------------------------RTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x7) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x00)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_RTYPE; tree->ast_node.rtype.rs2 = rs2; tree->ast_node.rtype.rs1 = rs1; tree->ast_node.rtype.rd = rd; tree->ast_node.rtype.op = RISCV_AND; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x6) && ((binary_stream & 0x00000000FE000000)>>25 == 0x00)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_RTYPE ; + //------------------------------------------------------------ + + // ---------------------------RTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x6) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x00)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_RTYPE; tree->ast_node.rtype.rs2 = rs2; tree->ast_node.rtype.rs1 = rs1; tree->ast_node.rtype.rd = rd; tree->ast_node.rtype.op = RISCV_OR; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x4) && ((binary_stream & 0x00000000FE000000)>>25 == 0x00)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_RTYPE ; + //------------------------------------------------------------ + + // ---------------------------RTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x4) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x00)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_RTYPE; tree->ast_node.rtype.rs2 = rs2; tree->ast_node.rtype.rs1 = rs1; tree->ast_node.rtype.rd = rd; tree->ast_node.rtype.op = RISCV_XOR; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FE000000)>>25 == 0x00)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_RTYPE ; + //------------------------------------------------------------ + + // ---------------------------RTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x00)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_RTYPE; tree->ast_node.rtype.rs2 = rs2; tree->ast_node.rtype.rs1 = rs1; tree->ast_node.rtype.rd = rd; tree->ast_node.rtype.op = RISCV_SLL; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x5) && ((binary_stream & 0x00000000FE000000)>>25 == 0x00)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_RTYPE ; + //------------------------------------------------------------ + + // ---------------------------RTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x00)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_RTYPE; tree->ast_node.rtype.rs2 = rs2; tree->ast_node.rtype.rs1 = rs1; tree->ast_node.rtype.rd = rd; tree->ast_node.rtype.op = RISCV_SRL; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x00000000FE000000)>>25 == 0x20)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_RTYPE ; + //------------------------------------------------------------ + + // ---------------------------RTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x20)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_RTYPE; tree->ast_node.rtype.rs2 = rs2; tree->ast_node.rtype.rs1 = rs1; tree->ast_node.rtype.rd = rd; tree->ast_node.rtype.op = RISCV_SUB; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x5) && ((binary_stream & 0x00000000FE000000)>>25 == 0x20)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_RTYPE ; + //------------------------------------------------------------ + + // ---------------------------RTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x20)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_RTYPE; tree->ast_node.rtype.rs2 = rs2; tree->ast_node.rtype.rs1 = rs1; tree->ast_node.rtype.rd = rd; tree->ast_node.rtype.op = RISCV_SRA; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x03)) { - uint64_t size = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000003000)>>12) { - case 0x1: - size = RISCV_HALF ; - break; - case 0x3: - size = RISCV_DOUBLE ; - break; - case 0x2: - size = RISCV_WORD ; - break; - case 0x0: - size = RISCV_BYTE ; - break; - - } - if (size != 0xFFFFFFFFFFFFFFFF) { - uint64_t is_unsigned = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000004000)>>14) { - case 0x1: - is_unsigned = RISCV_true ; - break; - case 0x0: - is_unsigned = RISCV_false ; - break; - - } - if (is_unsigned != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t imm = (binary_stream & 0x00000000FFF00000)>>20 ; - tree->ast_node_type = RISCV_LOAD ; - tree->ast_node.load.imm = imm; - tree->ast_node.load.rs1 = rs1; - tree->ast_node.load.rd = rd; - tree->ast_node.load.is_unsigned = is_unsigned; - tree->ast_node.load.width = size; - tree->ast_node.load.aq = 0; - tree->ast_node.load.rl = 0; - return ; - } + return; + } + } + //------------------------------------------------------------ + + // ---------------------------LOAD------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x03)) { + uint64_t size = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000003000) >> 12) { + case 0x1: + size = RISCV_HALF; + break; + case 0x3: + size = RISCV_DOUBLE; + break; + case 0x2: + size = RISCV_WORD; + break; + case 0x0: + size = RISCV_BYTE; + break; + } + if (size != 0xFFFFFFFFFFFFFFFF) { + uint64_t is_unsigned = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000004000) >> 14) { + case 0x1: + is_unsigned = RISCV_true; + break; + case 0x0: + is_unsigned = RISCV_false; + break; + } + if (is_unsigned != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t imm = (binary_stream & 0x00000000FFF00000) >> 20; + tree->ast_node_type = RISCV_LOAD; + tree->ast_node.load.imm = imm; + tree->ast_node.load.rs1 = rs1; + tree->ast_node.load.rd = rd; + tree->ast_node.load.is_unsigned = is_unsigned; + tree->ast_node.load.width = size; + tree->ast_node.load.aq = 0; + tree->ast_node.load.rl = 0; + return; + } + } + } + } + //------------------------------------------------------------ + + // ---------------------------STORE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x23) && + (((binary_stream & 0x0000000000004000) >> 14) == 0x0)) { + uint64_t size = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000003000) >> 12) { + case 0x1: + size = RISCV_HALF; + break; + case 0x3: + size = RISCV_DOUBLE; + break; + case 0x2: + size = RISCV_WORD; + break; + case 0x0: + size = RISCV_BYTE; + break; + } + if (size != 0xFFFFFFFFFFFFFFFF) { + uint64_t imm5 = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t imm7 = (binary_stream & 0x00000000FE000000) >> 25; + tree->ast_node_type = RISCV_STORE; + tree->ast_node.store.imm = (imm7 << 5) | (imm5 << 0); + tree->ast_node.store.rs2 = rs2; + tree->ast_node.store.rs1 = rs1; + tree->ast_node.store.width = size; + tree->ast_node.store.aq = 0; + tree->ast_node.store.rl = 0; + return; } + } } - if ((binary_stream & 0x000000000000007F == 0x23) && ((binary_stream & 0x0000000000004000)>>14 == 0x0)) { - uint64_t size = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000003000)>>12) { - case 0x1: - size = RISCV_HALF ; - break; - case 0x3: - size = RISCV_DOUBLE ; - break; - case 0x2: - size = RISCV_WORD ; - break; - case 0x0: - size = RISCV_BYTE ; - break; - - } - if (size != 0xFFFFFFFFFFFFFFFF) { - uint64_t imm5 = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t imm7 = (binary_stream & 0x00000000FE000000)>>25 ; - tree->ast_node_type = RISCV_STORE ; - tree->ast_node.store.imm = (imm7 << 5) | (imm5 << 0); - tree->ast_node.store.rs2 = rs2; - tree->ast_node.store.rs1 = rs1; - tree->ast_node.store.width = size; - tree->ast_node.store.aq = 0; - tree->ast_node.store.rl = 0; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x1B) && ((binary_stream & 0x0000000000007000)>>12 == 0x0)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t imm = (binary_stream & 0x00000000FFF00000)>>20 ; - tree->ast_node_type = RISCV_ADDIW ; + //------------------------------------------------------------ + + // ---------------------------ADDIW------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x1B) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t imm = (binary_stream & 0x00000000FFF00000) >> 20; + tree->ast_node_type = RISCV_ADDIW; tree->ast_node.addiw.imm = imm; tree->ast_node.addiw.rs1 = rs1; tree->ast_node.addiw.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x3B) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x00000000FE000000)>>25 == 0x00)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_RTYPEW ; + //------------------------------------------------------------ + + // ---------------------------RTYPEW------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x3B) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x00)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_RTYPEW; tree->ast_node.rtypew.rs2 = rs2; tree->ast_node.rtypew.rs1 = rs1; tree->ast_node.rtypew.rd = rd; tree->ast_node.rtypew.op = RISCV_ADDW; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x3B) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x00000000FE000000)>>25 == 0x20)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_RTYPEW ; + //------------------------------------------------------------ + + // ---------------------------RTYPEW------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x3B) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x20)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_RTYPEW; tree->ast_node.rtypew.rs2 = rs2; tree->ast_node.rtypew.rs1 = rs1; tree->ast_node.rtypew.rd = rd; tree->ast_node.rtypew.op = RISCV_SUBW; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x3B) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FE000000)>>25 == 0x00)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_RTYPEW ; + //------------------------------------------------------------ + + // ---------------------------RTYPEW------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x3B) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x00)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_RTYPEW; tree->ast_node.rtypew.rs2 = rs2; tree->ast_node.rtypew.rs1 = rs1; tree->ast_node.rtypew.rd = rd; tree->ast_node.rtypew.op = RISCV_SLLW; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x3B) && ((binary_stream & 0x0000000000007000)>>12 == 0x5) && ((binary_stream & 0x00000000FE000000)>>25 == 0x00)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_RTYPEW ; + //------------------------------------------------------------ + + // ---------------------------RTYPEW------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x3B) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x00)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_RTYPEW; tree->ast_node.rtypew.rs2 = rs2; tree->ast_node.rtypew.rs1 = rs1; tree->ast_node.rtypew.rd = rd; tree->ast_node.rtypew.op = RISCV_SRLW; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x3B) && ((binary_stream & 0x0000000000007000)>>12 == 0x5) && ((binary_stream & 0x00000000FE000000)>>25 == 0x20)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_RTYPEW ; + //------------------------------------------------------------ + + // ---------------------------RTYPEW------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x3B) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x20)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_RTYPEW; tree->ast_node.rtypew.rs2 = rs2; tree->ast_node.rtypew.rs1 = rs1; tree->ast_node.rtypew.rd = rd; tree->ast_node.rtypew.op = RISCV_SRAW; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x1B) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FE000000)>>25 == 0x00)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t shamt = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_SHIFTIWOP ; + //------------------------------------------------------------ + + // ---------------------------SHIFTIWOP------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x1B) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x00)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t shamt = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_SHIFTIWOP; tree->ast_node.shiftiwop.shamt = shamt; tree->ast_node.shiftiwop.rs1 = rs1; tree->ast_node.shiftiwop.rd = rd; tree->ast_node.shiftiwop.op = RISCV_SLLIW; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x1B) && ((binary_stream & 0x0000000000007000)>>12 == 0x5) && ((binary_stream & 0x00000000FE000000)>>25 == 0x00)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t shamt = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_SHIFTIWOP ; + //------------------------------------------------------------ + + // ---------------------------SHIFTIWOP------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x1B) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x00)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t shamt = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_SHIFTIWOP; tree->ast_node.shiftiwop.shamt = shamt; tree->ast_node.shiftiwop.rs1 = rs1; tree->ast_node.shiftiwop.rd = rd; tree->ast_node.shiftiwop.op = RISCV_SRLIW; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x1B) && ((binary_stream & 0x0000000000007000)>>12 == 0x5) && ((binary_stream & 0x00000000FE000000)>>25 == 0x20)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t shamt = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_SHIFTIWOP ; + //------------------------------------------------------------ + + // ---------------------------SHIFTIWOP------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x1B) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x20)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t shamt = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_SHIFTIWOP; tree->ast_node.shiftiwop.shamt = shamt; tree->ast_node.shiftiwop.rs1 = rs1; tree->ast_node.shiftiwop.rd = rd; tree->ast_node.shiftiwop.op = RISCV_SRAIW; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x0F) && ((binary_stream & 0x0000000000000F80)>>7 == 0x00) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x00000000000F8000)>>15 == 0x00) && ((binary_stream & 0x00000000F0000000)>>28 == 0x0)) { - uint64_t succ = (binary_stream & 0x0000000000F00000)>>20 ; - uint64_t pred = (binary_stream & 0x000000000F000000)>>24 ; - tree->ast_node_type = RISCV_FENCE ; + //------------------------------------------------------------ + + // ---------------------------FENCE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x0F) && + (((binary_stream & 0x0000000000000F80) >> 7) == 0x00) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x00000000000F8000) >> 15) == 0x00) && + (((binary_stream & 0x00000000F0000000) >> 28) == 0x0)) { + uint64_t succ = (binary_stream & 0x0000000000F00000) >> 20; + uint64_t pred = (binary_stream & 0x000000000F000000) >> 24; + tree->ast_node_type = RISCV_FENCE; tree->ast_node.fence.pred = pred; tree->ast_node.fence.succ = succ; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x0F) && ((binary_stream & 0x0000000000000F80)>>7 == 0x00) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x00000000000F8000)>>15 == 0x00) && ((binary_stream & 0x00000000F0000000)>>28 == 0x8)) { - uint64_t succ = (binary_stream & 0x0000000000F00000)>>20 ; - uint64_t pred = (binary_stream & 0x000000000F000000)>>24 ; - tree->ast_node_type = RISCV_FENCE_TSO ; + //------------------------------------------------------------ + + // ---------------------------FENCE_TSO------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x0F) && + (((binary_stream & 0x0000000000000F80) >> 7) == 0x00) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x00000000000F8000) >> 15) == 0x00) && + (((binary_stream & 0x00000000F0000000) >> 28) == 0x8)) { + uint64_t succ = (binary_stream & 0x0000000000F00000) >> 20; + uint64_t pred = (binary_stream & 0x000000000F000000) >> 24; + tree->ast_node_type = RISCV_FENCE_TSO; tree->ast_node.fence_tso.pred = pred; tree->ast_node.fence_tso.succ = succ; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x0F) && ((binary_stream & 0x0000000000000F80)>>7 == 0x00) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000000F8000)>>15 == 0x00) && ((binary_stream & 0x00000000FFF00000)>>20 == 0x000)) { - tree->ast_node_type = RISCV_FENCEI ; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x73) && ((binary_stream & 0x0000000000000F80)>>7 == 0x00) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x00000000000F8000)>>15 == 0x00) && ((binary_stream & 0x00000000FFF00000)>>20 == 0x000)) { - tree->ast_node_type = RISCV_ECALL ; - return ; + //------------------------------------------------------------ + + // ---------------------------ECALL------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x73) && + (((binary_stream & 0x0000000000000F80) >> 7) == 0x00) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x00000000000F8000) >> 15) == 0x00) && + (((binary_stream & 0x00000000FFF00000) >> 20) == 0x000)) { + tree->ast_node_type = RISCV_ECALL; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x73) && ((binary_stream & 0x0000000000000F80)>>7 == 0x00) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x00000000000F8000)>>15 == 0x00) && ((binary_stream & 0x0000000001F00000)>>20 == 0x02) && ((binary_stream & 0x00000000FE000000)>>25 == 0x18)) { - tree->ast_node_type = RISCV_MRET ; - return ; + //------------------------------------------------------------ + + // ---------------------------MRET------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x73) && + (((binary_stream & 0x0000000000000F80) >> 7) == 0x00) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x00000000000F8000) >> 15) == 0x00) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x02) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x18)) { + tree->ast_node_type = RISCV_MRET; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x73) && ((binary_stream & 0x0000000000000F80)>>7 == 0x00) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x00000000000F8000)>>15 == 0x00) && ((binary_stream & 0x0000000001F00000)>>20 == 0x02) && ((binary_stream & 0x00000000FE000000)>>25 == 0x08)) { - tree->ast_node_type = RISCV_SRET ; - return ; + //------------------------------------------------------------ + + // ---------------------------SRET------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x73) && + (((binary_stream & 0x0000000000000F80) >> 7) == 0x00) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x00000000000F8000) >> 15) == 0x00) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x02) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x08)) { + tree->ast_node_type = RISCV_SRET; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x73) && ((binary_stream & 0x0000000000000F80)>>7 == 0x00) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x00000000000F8000)>>15 == 0x00) && ((binary_stream & 0x00000000FFF00000)>>20 == 0x001)) { - tree->ast_node_type = RISCV_EBREAK ; - return ; + //------------------------------------------------------------ + + // ---------------------------EBREAK------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x73) && + (((binary_stream & 0x0000000000000F80) >> 7) == 0x00) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x00000000000F8000) >> 15) == 0x00) && + (((binary_stream & 0x00000000FFF00000) >> 20) == 0x001)) { + tree->ast_node_type = RISCV_EBREAK; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x73) && ((binary_stream & 0x0000000000000F80)>>7 == 0x00) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x00000000000F8000)>>15 == 0x00) && ((binary_stream & 0x00000000FFF00000)>>20 == 0x105)) { - tree->ast_node_type = RISCV_WFI ; - return ; + //------------------------------------------------------------ + + // ---------------------------WFI------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x73) && + (((binary_stream & 0x0000000000000F80) >> 7) == 0x00) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x00000000000F8000) >> 15) == 0x00) && + (((binary_stream & 0x00000000FFF00000) >> 20) == 0x105)) { + tree->ast_node_type = RISCV_WFI; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x73) && ((binary_stream & 0x0000000000000F80)>>7 == 0x00) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x00000000FE000000)>>25 == 0x09)) { - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_SFENCE_VMA ; + //------------------------------------------------------------ + + // ---------------------------SFENCE_VMA------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x73) && + (((binary_stream & 0x0000000000000F80) >> 7) == 0x00) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x09)) { + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_SFENCE_VMA; tree->ast_node.sfence_vma.rs1 = rs1; tree->ast_node.sfence_vma.rs2 = rs2; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x2F) && ((binary_stream & 0x0000000000004000)>>14 == 0x0) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x00000000F8000000)>>27 == 0x02)) { - uint64_t size = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000003000)>>12) { - case 0x1: - size = RISCV_HALF ; - break; - case 0x3: - size = RISCV_DOUBLE ; - break; - case 0x2: - size = RISCV_WORD ; - break; - case 0x0: - size = RISCV_BYTE ; - break; - - } - if (size != 0xFFFFFFFFFFFFFFFF) { - uint64_t rl = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000002000000)>>25) { - case 0x1: - rl = RISCV_true ; - break; - case 0x0: - rl = RISCV_false ; - break; - + return; + } + } + //------------------------------------------------------------ + + // ---------------------------FENCEI------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x0F) && + (((binary_stream & 0x0000000000000F80) >> 7) == 0x00) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000000F8000) >> 15) == 0x00) && + (((binary_stream & 0x00000000FFF00000) >> 20) == 0x000)) { + tree->ast_node_type = RISCV_FENCEI; + return; + } + } + //------------------------------------------------------------ + + // ---------------------------LOADRES------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x2F) && + (((binary_stream & 0x0000000000004000) >> 14) == 0x0) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x00000000F8000000) >> 27) == 0x02)) { + uint64_t size = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000003000) >> 12) { + case 0x1: + size = RISCV_HALF; + break; + case 0x3: + size = RISCV_DOUBLE; + break; + case 0x2: + size = RISCV_WORD; + break; + case 0x0: + size = RISCV_BYTE; + break; + } + if (size != 0xFFFFFFFFFFFFFFFF) { + uint64_t rl = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000002000000) >> 25) { + case 0x1: + rl = RISCV_true; + break; + case 0x0: + rl = RISCV_false; + break; + } + if (rl != 0xFFFFFFFFFFFFFFFF) { + uint64_t aq = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000004000000) >> 26) { + case 0x1: + aq = RISCV_true; + break; + case 0x0: + aq = RISCV_false; + break; } - if (rl != 0xFFFFFFFFFFFFFFFF) { - uint64_t aq = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000004000000)>>26) { - case 0x1: - aq = RISCV_true ; - break; - case 0x0: - aq = RISCV_false ; - break; - - } - if (aq != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_LOADRES ; - tree->ast_node.loadres.aq = aq; - tree->ast_node.loadres.rl = rl; - tree->ast_node.loadres.rs1 = rs1; - tree->ast_node.loadres.width = size; - tree->ast_node.loadres.rd = rd; - return ; - } + if (aq != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_LOADRES; + tree->ast_node.loadres.aq = aq; + tree->ast_node.loadres.rl = rl; + tree->ast_node.loadres.rs1 = rs1; + tree->ast_node.loadres.width = size; + tree->ast_node.loadres.rd = rd; + return; } + } } + } } - if ((binary_stream & 0x000000000000007F == 0x2F) && ((binary_stream & 0x0000000000004000)>>14 == 0x0) && ((binary_stream & 0x00000000F8000000)>>27 == 0x03)) { - uint64_t size = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000003000)>>12) { - case 0x1: - size = RISCV_HALF ; - break; - case 0x3: - size = RISCV_DOUBLE ; - break; - case 0x2: - size = RISCV_WORD ; - break; - case 0x0: - size = RISCV_BYTE ; - break; - - } - if (size != 0xFFFFFFFFFFFFFFFF) { - uint64_t rl = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000002000000)>>25) { - case 0x1: - rl = RISCV_true ; - break; - case 0x0: - rl = RISCV_false ; - break; - + //------------------------------------------------------------ + + // ---------------------------STORECON------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x2F) && + (((binary_stream & 0x0000000000004000) >> 14) == 0x0) && + (((binary_stream & 0x00000000F8000000) >> 27) == 0x03)) { + uint64_t size = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000003000) >> 12) { + case 0x1: + size = RISCV_HALF; + break; + case 0x3: + size = RISCV_DOUBLE; + break; + case 0x2: + size = RISCV_WORD; + break; + case 0x0: + size = RISCV_BYTE; + break; + } + if (size != 0xFFFFFFFFFFFFFFFF) { + uint64_t rl = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000002000000) >> 25) { + case 0x1: + rl = RISCV_true; + break; + case 0x0: + rl = RISCV_false; + break; + } + if (rl != 0xFFFFFFFFFFFFFFFF) { + uint64_t aq = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000004000000) >> 26) { + case 0x1: + aq = RISCV_true; + break; + case 0x0: + aq = RISCV_false; + break; } - if (rl != 0xFFFFFFFFFFFFFFFF) { - uint64_t aq = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000004000000)>>26) { - case 0x1: - aq = RISCV_true ; - break; - case 0x0: - aq = RISCV_false ; - break; - - } - if (aq != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_STORECON ; - tree->ast_node.storecon.aq = aq; - tree->ast_node.storecon.rl = rl; - tree->ast_node.storecon.rs2 = rs2; - tree->ast_node.storecon.rs1 = rs1; - tree->ast_node.storecon.width = size; - tree->ast_node.storecon.rd = rd; - return ; - } + if (aq != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_STORECON; + tree->ast_node.storecon.aq = aq; + tree->ast_node.storecon.rl = rl; + tree->ast_node.storecon.rs2 = rs2; + tree->ast_node.storecon.rs1 = rs1; + tree->ast_node.storecon.width = size; + tree->ast_node.storecon.rd = rd; + return; } + } } + } } - if ((binary_stream & 0x000000000000007F == 0x2F) && ((binary_stream & 0x0000000000004000)>>14 == 0x0)) { - uint64_t size = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000003000)>>12) { - case 0x1: - size = RISCV_HALF ; - break; - case 0x3: - size = RISCV_DOUBLE ; - break; - case 0x2: - size = RISCV_WORD ; - break; - case 0x0: - size = RISCV_BYTE ; - break; - - } - if (size != 0xFFFFFFFFFFFFFFFF) { - uint64_t rl = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000002000000)>>25) { - case 0x1: - rl = RISCV_true ; - break; - case 0x0: - rl = RISCV_false ; - break; - + //------------------------------------------------------------ + + // ---------------------------AMO------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x2F) && + (((binary_stream & 0x0000000000004000) >> 14) == 0x0)) { + uint64_t size = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000003000) >> 12) { + case 0x1: + size = RISCV_HALF; + break; + case 0x3: + size = RISCV_DOUBLE; + break; + case 0x2: + size = RISCV_WORD; + break; + case 0x0: + size = RISCV_BYTE; + break; + } + if (size != 0xFFFFFFFFFFFFFFFF) { + uint64_t rl = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000002000000) >> 25) { + case 0x1: + rl = RISCV_true; + break; + case 0x0: + rl = RISCV_false; + break; + } + if (rl != 0xFFFFFFFFFFFFFFFF) { + uint64_t aq = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000004000000) >> 26) { + case 0x1: + aq = RISCV_true; + break; + case 0x0: + aq = RISCV_false; + break; } - if (rl != 0xFFFFFFFFFFFFFFFF) { - uint64_t aq = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000004000000)>>26) { - case 0x1: - aq = RISCV_true ; - break; - case 0x0: - aq = RISCV_false ; - break; - - } - if (aq != 0xFFFFFFFFFFFFFFFF) { - uint64_t op = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000F8000000)>>27) { - case 0x08: - op = RISCV_AMOOR ; - break; - case 0x01: - op = RISCV_AMOSWAP ; - break; - case 0x04: - op = RISCV_AMOXOR ; - break; - case 0x10: - op = RISCV_AMOMIN ; - break; - case 0x1C: - op = RISCV_AMOMAXU ; - break; - case 0x14: - op = RISCV_AMOMAX ; - break; - case 0x00: - op = RISCV_AMOADD ; - break; - case 0x0C: - op = RISCV_AMOAND ; - break; - case 0x18: - op = RISCV_AMOMINU ; - break; - - } - if (op != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_AMO ; - tree->ast_node.amo.op = op; - tree->ast_node.amo.aq = aq; - tree->ast_node.amo.rl = rl; - tree->ast_node.amo.rs2 = rs2; - tree->ast_node.amo.rs1 = rs1; - tree->ast_node.amo.width = size; - tree->ast_node.amo.rd = rd; - return ; - } - } + if (aq != 0xFFFFFFFFFFFFFFFF) { + uint64_t op = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000F8000000) >> 27) { + case 0x08: + op = RISCV_AMOOR; + break; + case 0x01: + op = RISCV_AMOSWAP; + break; + case 0x04: + op = RISCV_AMOXOR; + break; + case 0x10: + op = RISCV_AMOMIN; + break; + case 0x1C: + op = RISCV_AMOMAXU; + break; + case 0x14: + op = RISCV_AMOMAX; + break; + case 0x00: + op = RISCV_AMOADD; + break; + case 0x0C: + op = RISCV_AMOAND; + break; + case 0x18: + op = RISCV_AMOMINU; + break; + } + if (op != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_AMO; + tree->ast_node.amo.op = op; + tree->ast_node.amo.aq = aq; + tree->ast_node.amo.rl = rl; + tree->ast_node.amo.rs2 = rs2; + tree->ast_node.amo.rs1 = rs1; + tree->ast_node.amo.width = size; + tree->ast_node.amo.rd = rd; + return; + } } + } } + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x00000000FE000000)>>25 == 0x01)) { - struct mul_op mul_op ; - uint8_t mul_op_is_valid = 0 ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x1: + //------------------------------------------------------------ + + // ---------------------------MUL------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x01)) { + struct mul_op mul_op; + uint8_t mul_op_is_valid = 0; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x1: mul_op.high = 1; mul_op.signed_rs1 = 1; mul_op.signed_rs2 = 1; - mul_op_is_valid = 1 ; - break; - - case 0x3: + mul_op_is_valid = 1; + break; + case 0x3: mul_op.high = 1; mul_op.signed_rs1 = 0; mul_op.signed_rs2 = 0; - mul_op_is_valid = 1 ; - break; - - case 0x2: + mul_op_is_valid = 1; + break; + case 0x2: mul_op.high = 1; mul_op.signed_rs1 = 1; mul_op.signed_rs2 = 0; - mul_op_is_valid = 1 ; - break; - - case 0x0: + mul_op_is_valid = 1; + break; + case 0x0: mul_op.high = 0; mul_op.signed_rs1 = 1; mul_op.signed_rs2 = 1; - mul_op_is_valid = 1 ; - break; - } - if (mul_op_is_valid == 1) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_MUL ; - tree->ast_node.mul.rs2 = rs2; - tree->ast_node.mul.rs1 = rs1; - tree->ast_node.mul.rd = rd; - tree->ast_node.mul.mul_op = mul_op; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000006000)>>13 == 0x2) && ((binary_stream & 0x00000000FE000000)>>25 == 0x01)) { - uint64_t s = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000001000)>>12) { - case 0x1: - s = RISCV_false ; - break; - case 0x0: - s = RISCV_true ; - break; - - } - if (s != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_DIV ; - tree->ast_node.div.rs2 = rs2; - tree->ast_node.div.rs1 = rs1; - tree->ast_node.div.rd = rd; - tree->ast_node.div.s = s; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000006000)>>13 == 0x3) && ((binary_stream & 0x00000000FE000000)>>25 == 0x01)) { - uint64_t s = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000001000)>>12) { - case 0x1: - s = RISCV_false ; - break; - case 0x0: - s = RISCV_true ; - break; - - } - if (s != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_REM ; - tree->ast_node.rem.rs2 = rs2; - tree->ast_node.rem.rs1 = rs1; - tree->ast_node.rem.rd = rd; - tree->ast_node.rem.s = s; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x3B) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x00000000FE000000)>>25 == 0x01)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_MULW ; + mul_op_is_valid = 1; + break; + } + if (mul_op_is_valid == 1) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_MUL; + tree->ast_node.mul.rs2 = rs2; + tree->ast_node.mul.rs1 = rs1; + tree->ast_node.mul.rd = rd; + tree->ast_node.mul.mul_op = mul_op; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------DIV------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000006000) >> 13) == 0x2) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x01)) { + uint64_t s = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000001000) >> 12) { + case 0x1: + s = RISCV_false; + break; + case 0x0: + s = RISCV_true; + break; + } + if (s != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_DIV; + tree->ast_node.div.rs2 = rs2; + tree->ast_node.div.rs1 = rs1; + tree->ast_node.div.rd = rd; + tree->ast_node.div.s = s; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------REM------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000006000) >> 13) == 0x3) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x01)) { + uint64_t s = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000001000) >> 12) { + case 0x1: + s = RISCV_false; + break; + case 0x0: + s = RISCV_true; + break; + } + if (s != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_REM; + tree->ast_node.rem.rs2 = rs2; + tree->ast_node.rem.rs1 = rs1; + tree->ast_node.rem.rd = rd; + tree->ast_node.rem.s = s; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------MULW------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x3B) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x01)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_MULW; tree->ast_node.mulw.rs2 = rs2; tree->ast_node.mulw.rs1 = rs1; tree->ast_node.mulw.rd = rd; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x3B) && ((binary_stream & 0x0000000000006000)>>13 == 0x2) && ((binary_stream & 0x00000000FE000000)>>25 == 0x01)) { - uint64_t s = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000001000)>>12) { - case 0x1: - s = RISCV_false ; - break; - case 0x0: - s = RISCV_true ; - break; - - } - if (s != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_DIVW ; - tree->ast_node.divw.rs2 = rs2; - tree->ast_node.divw.rs1 = rs1; - tree->ast_node.divw.rd = rd; - tree->ast_node.divw.s = s; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x3B) && ((binary_stream & 0x0000000000006000)>>13 == 0x3) && ((binary_stream & 0x00000000FE000000)>>25 == 0x01)) { - uint64_t s = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000001000)>>12) { - case 0x1: - s = RISCV_false ; - break; - case 0x0: - s = RISCV_true ; - break; - - } - if (s != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_REMW ; - tree->ast_node.remw.rs2 = rs2; - tree->ast_node.remw.rs1 = rs1; - tree->ast_node.remw.rd = rd; - tree->ast_node.remw.s = s; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x73)) { - uint64_t op = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000003000)>>12) { - case 0x1: - op = RISCV_CSRRW ; - break; - case 0x3: - op = RISCV_CSRRC ; - break; - case 0x2: - op = RISCV_CSRRS ; - break; - - } - if (op != 0xFFFFFFFFFFFFFFFF) { - uint64_t is_imm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000004000)>>14) { - case 0x1: - is_imm = RISCV_true ; - break; - case 0x0: - is_imm = RISCV_false ; - break; - - } - if (is_imm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t csr = (binary_stream & 0x00000000FFF00000)>>20 ; - tree->ast_node_type = RISCV_CSR ; - tree->ast_node.csr.csr = csr; - tree->ast_node.csr.rs1 = rs1; - tree->ast_node.csr.rd = rd; - tree->ast_node.csr.is_imm = is_imm; - tree->ast_node.csr.op = op; - return ; - } + return; + } + } + //------------------------------------------------------------ + + // ---------------------------DIVW------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x3B) && + (((binary_stream & 0x0000000000006000) >> 13) == 0x2) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x01)) { + uint64_t s = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000001000) >> 12) { + case 0x1: + s = RISCV_false; + break; + case 0x0: + s = RISCV_true; + break; + } + if (s != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_DIVW; + tree->ast_node.divw.rs2 = rs2; + tree->ast_node.divw.rs1 = rs1; + tree->ast_node.divw.rd = rd; + tree->ast_node.divw.s = s; + return; } + } + } + //------------------------------------------------------------ + + // ---------------------------REMW------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x3B) && + (((binary_stream & 0x0000000000006000) >> 13) == 0x3) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x01)) { + uint64_t s = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000001000) >> 12) { + case 0x1: + s = RISCV_false; + break; + case 0x0: + s = RISCV_true; + break; + } + if (s != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_REMW; + tree->ast_node.remw.rs2 = rs2; + tree->ast_node.remw.rs1 = rs1; + tree->ast_node.remw.rd = rd; + tree->ast_node.remw.s = s; + return; + } + } } - if ((binary_stream & 0x000000000000007F == 0x73) && ((binary_stream & 0x0000000000000F80)>>7 == 0x00) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x00000000000F8000)>>15 == 0x00) && ((binary_stream & 0x0000000001F00000)>>20 == 0x02) && ((binary_stream & 0x00000000FE000000)>>25 == 0x00)) { - tree->ast_node_type = RISCV_URET ; - return ; + //------------------------------------------------------------ + + // ---------------------------CSR------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x73)) { + uint64_t op = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000003000) >> 12) { + case 0x1: + op = RISCV_CSRRW; + break; + case 0x3: + op = RISCV_CSRRC; + break; + case 0x2: + op = RISCV_CSRRS; + break; + } + if (op != 0xFFFFFFFFFFFFFFFF) { + uint64_t is_imm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000004000) >> 14) { + case 0x1: + is_imm = RISCV_true; + break; + case 0x0: + is_imm = RISCV_false; + break; + } + if (is_imm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t csr = (binary_stream & 0x00000000FFF00000) >> 20; + tree->ast_node_type = RISCV_CSR; + tree->ast_node.csr.csr = csr; + tree->ast_node.csr.rs1 = rs1; + tree->ast_node.csr.rd = rd; + tree->ast_node.csr.is_imm = is_imm; + tree->ast_node.csr.op = op; + return; + } + } + } } - if ((binary_stream & 0x000000000000007F == 0x0F) && ((binary_stream & 0x0000000000007000)>>12 == 0x0)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t succ = (binary_stream & 0x0000000000F00000)>>20 ; - uint64_t pred = (binary_stream & 0x000000000F000000)>>24 ; - uint64_t fm = (binary_stream & 0x00000000F0000000)>>28 ; - tree->ast_node_type = RISCV_FENCE_RESERVED ; + //------------------------------------------------------------ + + // ---------------------------FENCE_RESERVED------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x0F) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t succ = (binary_stream & 0x0000000000F00000) >> 20; + uint64_t pred = (binary_stream & 0x000000000F000000) >> 24; + uint64_t fm = (binary_stream & 0x00000000F0000000) >> 28; + tree->ast_node_type = RISCV_FENCE_RESERVED; tree->ast_node.fence_reserved.fm = fm; tree->ast_node.fence_reserved.pred = pred; tree->ast_node.fence_reserved.succ = succ; tree->ast_node.fence_reserved.rs = rs; tree->ast_node.fence_reserved.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x0F) && ((binary_stream & 0x0000000000007000)>>12 == 0x1)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t imm = (binary_stream & 0x00000000FFF00000)>>20 ; - tree->ast_node_type = RISCV_FENCEI_RESERVED ; + //------------------------------------------------------------ + + // ---------------------------FENCEI_RESERVED------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x0F) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t imm = (binary_stream & 0x00000000FFF00000) >> 20; + tree->ast_node_type = RISCV_FENCEI_RESERVED; tree->ast_node.fencei_reserved.imm = imm; tree->ast_node.fencei_reserved.rs = rs; tree->ast_node.fencei_reserved.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x07) && ((binary_stream & 0x0000000000007000)>>12 == 0x1)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t imm = (binary_stream & 0x00000000FFF00000)>>20 ; - tree->ast_node_type = RISCV_LOAD_FP ; + //------------------------------------------------------------ + + // ---------------------------LOAD_FP------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x07) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t imm = (binary_stream & 0x00000000FFF00000) >> 20; + tree->ast_node_type = RISCV_LOAD_FP; tree->ast_node.load_fp.imm = imm; tree->ast_node.load_fp.rs1 = rs1; tree->ast_node.load_fp.rd = rd; tree->ast_node.load_fp.width = RISCV_HALF; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x07) && ((binary_stream & 0x0000000000007000)>>12 == 0x2)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t imm = (binary_stream & 0x00000000FFF00000)>>20 ; - tree->ast_node_type = RISCV_LOAD_FP ; + //------------------------------------------------------------ + + // ---------------------------LOAD_FP------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x07) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t imm = (binary_stream & 0x00000000FFF00000) >> 20; + tree->ast_node_type = RISCV_LOAD_FP; tree->ast_node.load_fp.imm = imm; tree->ast_node.load_fp.rs1 = rs1; tree->ast_node.load_fp.rd = rd; tree->ast_node.load_fp.width = RISCV_WORD; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x07) && ((binary_stream & 0x0000000000007000)>>12 == 0x3)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t imm = (binary_stream & 0x00000000FFF00000)>>20 ; - tree->ast_node_type = RISCV_LOAD_FP ; + //------------------------------------------------------------ + + // ---------------------------LOAD_FP------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x07) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x3)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t imm = (binary_stream & 0x00000000FFF00000) >> 20; + tree->ast_node_type = RISCV_LOAD_FP; tree->ast_node.load_fp.imm = imm; tree->ast_node.load_fp.rs1 = rs1; tree->ast_node.load_fp.rd = rd; tree->ast_node.load_fp.width = RISCV_DOUBLE; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x27) && ((binary_stream & 0x0000000000007000)>>12 == 0x1)) { - uint64_t imm5 = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t imm7 = (binary_stream & 0x00000000FE000000)>>25 ; - tree->ast_node_type = RISCV_STORE_FP ; + return; + } + } + //------------------------------------------------------------ + + // ---------------------------STORE_FP------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x27) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1)) { + uint64_t imm5 = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t imm7 = (binary_stream & 0x00000000FE000000) >> 25; + tree->ast_node_type = RISCV_STORE_FP; tree->ast_node.store_fp.imm = (imm7 << 5) | (imm5 << 0); tree->ast_node.store_fp.rs2 = rs2; tree->ast_node.store_fp.rs1 = rs1; tree->ast_node.store_fp.width = RISCV_HALF; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x27) && ((binary_stream & 0x0000000000007000)>>12 == 0x2)) { - uint64_t imm5 = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t imm7 = (binary_stream & 0x00000000FE000000)>>25 ; - tree->ast_node_type = RISCV_STORE_FP ; + return; + } + } + //------------------------------------------------------------ + + // ---------------------------STORE_FP------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x27) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2)) { + uint64_t imm5 = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t imm7 = (binary_stream & 0x00000000FE000000) >> 25; + tree->ast_node_type = RISCV_STORE_FP; tree->ast_node.store_fp.imm = (imm7 << 5) | (imm5 << 0); tree->ast_node.store_fp.rs2 = rs2; tree->ast_node.store_fp.rs1 = rs1; tree->ast_node.store_fp.width = RISCV_WORD; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x27) && ((binary_stream & 0x0000000000007000)>>12 == 0x3)) { - uint64_t imm5 = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t imm7 = (binary_stream & 0x00000000FE000000)>>25 ; - tree->ast_node_type = RISCV_STORE_FP ; + return; + } + } + //------------------------------------------------------------ + + // ---------------------------STORE_FP------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x27) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x3)) { + uint64_t imm5 = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t imm7 = (binary_stream & 0x00000000FE000000) >> 25; + tree->ast_node_type = RISCV_STORE_FP; tree->ast_node.store_fp.imm = (imm7 << 5) | (imm5 << 0); tree->ast_node.store_fp.rs2 = rs2; tree->ast_node.store_fp.rs1 = rs1; tree->ast_node.store_fp.width = RISCV_DOUBLE; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x43) && ((binary_stream & 0x0000000006000000)>>25 == 0x0)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t rs3 = (binary_stream & 0x00000000F8000000)>>27 ; - tree->ast_node_type = RISCV_F_MADD_TYPE_S ; - tree->ast_node.f_madd_type_s.rs3 = rs3; - tree->ast_node.f_madd_type_s.rs2 = rs2; - tree->ast_node.f_madd_type_s.rs1 = rs1; - tree->ast_node.f_madd_type_s.rm = rm; - tree->ast_node.f_madd_type_s.rd = rd; - tree->ast_node.f_madd_type_s.op = RISCV_FMADD_S; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x47) && ((binary_stream & 0x0000000006000000)>>25 == 0x0)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t rs3 = (binary_stream & 0x00000000F8000000)>>27 ; - tree->ast_node_type = RISCV_F_MADD_TYPE_S ; - tree->ast_node.f_madd_type_s.rs3 = rs3; - tree->ast_node.f_madd_type_s.rs2 = rs2; - tree->ast_node.f_madd_type_s.rs1 = rs1; - tree->ast_node.f_madd_type_s.rm = rm; - tree->ast_node.f_madd_type_s.rd = rd; - tree->ast_node.f_madd_type_s.op = RISCV_FMSUB_S; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x4B) && ((binary_stream & 0x0000000006000000)>>25 == 0x0)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t rs3 = (binary_stream & 0x00000000F8000000)>>27 ; - tree->ast_node_type = RISCV_F_MADD_TYPE_S ; - tree->ast_node.f_madd_type_s.rs3 = rs3; - tree->ast_node.f_madd_type_s.rs2 = rs2; - tree->ast_node.f_madd_type_s.rs1 = rs1; - tree->ast_node.f_madd_type_s.rm = rm; - tree->ast_node.f_madd_type_s.rd = rd; - tree->ast_node.f_madd_type_s.op = RISCV_FNMSUB_S; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x4F) && ((binary_stream & 0x0000000006000000)>>25 == 0x0)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t rs3 = (binary_stream & 0x00000000F8000000)>>27 ; - tree->ast_node_type = RISCV_F_MADD_TYPE_S ; - tree->ast_node.f_madd_type_s.rs3 = rs3; - tree->ast_node.f_madd_type_s.rs2 = rs2; - tree->ast_node.f_madd_type_s.rs1 = rs1; - tree->ast_node.f_madd_type_s.rm = rm; - tree->ast_node.f_madd_type_s.rd = rd; - tree->ast_node.f_madd_type_s.op = RISCV_FNMADD_S; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x00000000FE000000)>>25 == 0x00)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_RM_TYPE_S ; - tree->ast_node.f_bin_rm_type_s.rs2 = rs2; - tree->ast_node.f_bin_rm_type_s.rs1 = rs1; - tree->ast_node.f_bin_rm_type_s.rm = rm; - tree->ast_node.f_bin_rm_type_s.rd = rd; - tree->ast_node.f_bin_rm_type_s.op = RISCV_FADD_S; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x00000000FE000000)>>25 == 0x04)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_RM_TYPE_S ; - tree->ast_node.f_bin_rm_type_s.rs2 = rs2; - tree->ast_node.f_bin_rm_type_s.rs1 = rs1; - tree->ast_node.f_bin_rm_type_s.rm = rm; - tree->ast_node.f_bin_rm_type_s.rd = rd; - tree->ast_node.f_bin_rm_type_s.op = RISCV_FSUB_S; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x00000000FE000000)>>25 == 0x08)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_RM_TYPE_S ; - tree->ast_node.f_bin_rm_type_s.rs2 = rs2; - tree->ast_node.f_bin_rm_type_s.rs1 = rs1; - tree->ast_node.f_bin_rm_type_s.rm = rm; - tree->ast_node.f_bin_rm_type_s.rd = rd; - tree->ast_node.f_bin_rm_type_s.op = RISCV_FMUL_S; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x00000000FE000000)>>25 == 0x0C)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_RM_TYPE_S ; - tree->ast_node.f_bin_rm_type_s.rs2 = rs2; - tree->ast_node.f_bin_rm_type_s.rs1 = rs1; - tree->ast_node.f_bin_rm_type_s.rm = rm; - tree->ast_node.f_bin_rm_type_s.rd = rd; - tree->ast_node.f_bin_rm_type_s.op = RISCV_FDIV_S; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x00000000FE000000)>>25 == 0x2C)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_S ; - tree->ast_node.f_un_rm_type_s.rs1 = rs1; - tree->ast_node.f_un_rm_type_s.rm = rm; - tree->ast_node.f_un_rm_type_s.rd = rd; - tree->ast_node.f_un_rm_type_s.fcvt_s_lu = RISCV_FSQRT_S; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x00000000FE000000)>>25 == 0x60)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_S ; - tree->ast_node.f_un_rm_type_s.rs1 = rs1; - tree->ast_node.f_un_rm_type_s.rm = rm; - tree->ast_node.f_un_rm_type_s.rd = rd; - tree->ast_node.f_un_rm_type_s.fcvt_s_lu = RISCV_FCVT_W_S; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x01) && ((binary_stream & 0x00000000FE000000)>>25 == 0x60)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_S ; - tree->ast_node.f_un_rm_type_s.rs1 = rs1; - tree->ast_node.f_un_rm_type_s.rm = rm; - tree->ast_node.f_un_rm_type_s.rd = rd; - tree->ast_node.f_un_rm_type_s.fcvt_s_lu = RISCV_FCVT_WU_S; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x00000000FE000000)>>25 == 0x68)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_S ; - tree->ast_node.f_un_rm_type_s.rs1 = rs1; - tree->ast_node.f_un_rm_type_s.rm = rm; - tree->ast_node.f_un_rm_type_s.rd = rd; - tree->ast_node.f_un_rm_type_s.fcvt_s_lu = RISCV_FCVT_S_W; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x01) && ((binary_stream & 0x00000000FE000000)>>25 == 0x68)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_S ; - tree->ast_node.f_un_rm_type_s.rs1 = rs1; - tree->ast_node.f_un_rm_type_s.rm = rm; - tree->ast_node.f_un_rm_type_s.rd = rd; - tree->ast_node.f_un_rm_type_s.fcvt_s_lu = RISCV_FCVT_S_WU; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x02) && ((binary_stream & 0x00000000FE000000)>>25 == 0x60)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_S ; - tree->ast_node.f_un_rm_type_s.rs1 = rs1; - tree->ast_node.f_un_rm_type_s.rm = rm; - tree->ast_node.f_un_rm_type_s.rd = rd; - tree->ast_node.f_un_rm_type_s.fcvt_s_lu = RISCV_FCVT_L_S; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x03) && ((binary_stream & 0x00000000FE000000)>>25 == 0x60)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_S ; - tree->ast_node.f_un_rm_type_s.rs1 = rs1; - tree->ast_node.f_un_rm_type_s.rm = rm; - tree->ast_node.f_un_rm_type_s.rd = rd; - tree->ast_node.f_un_rm_type_s.fcvt_s_lu = RISCV_FCVT_LU_S; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x02) && ((binary_stream & 0x00000000FE000000)>>25 == 0x68)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_S ; - tree->ast_node.f_un_rm_type_s.rs1 = rs1; - tree->ast_node.f_un_rm_type_s.rm = rm; - tree->ast_node.f_un_rm_type_s.rd = rd; - tree->ast_node.f_un_rm_type_s.fcvt_s_lu = RISCV_FCVT_S_L; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x03) && ((binary_stream & 0x00000000FE000000)>>25 == 0x68)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_S ; - tree->ast_node.f_un_rm_type_s.rs1 = rs1; - tree->ast_node.f_un_rm_type_s.rm = rm; - tree->ast_node.f_un_rm_type_s.rd = rd; - tree->ast_node.f_un_rm_type_s.fcvt_s_lu = RISCV_FCVT_S_LU; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x00000000FE000000)>>25 == 0x10)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_TYPE_S ; + return; + } + } + //------------------------------------------------------------ + + // ---------------------------F_MADD_TYPE_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x43) && + (((binary_stream & 0x0000000006000000) >> 25) == 0x0)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t rs3 = (binary_stream & 0x00000000F8000000) >> 27; + tree->ast_node_type = RISCV_F_MADD_TYPE_S; + tree->ast_node.f_madd_type_s.rs3 = rs3; + tree->ast_node.f_madd_type_s.rs2 = rs2; + tree->ast_node.f_madd_type_s.rs1 = rs1; + tree->ast_node.f_madd_type_s.rm = rm; + tree->ast_node.f_madd_type_s.rd = rd; + tree->ast_node.f_madd_type_s.op = RISCV_FMADD_S; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_MADD_TYPE_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x47) && + (((binary_stream & 0x0000000006000000) >> 25) == 0x0)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t rs3 = (binary_stream & 0x00000000F8000000) >> 27; + tree->ast_node_type = RISCV_F_MADD_TYPE_S; + tree->ast_node.f_madd_type_s.rs3 = rs3; + tree->ast_node.f_madd_type_s.rs2 = rs2; + tree->ast_node.f_madd_type_s.rs1 = rs1; + tree->ast_node.f_madd_type_s.rm = rm; + tree->ast_node.f_madd_type_s.rd = rd; + tree->ast_node.f_madd_type_s.op = RISCV_FMSUB_S; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_MADD_TYPE_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x4B) && + (((binary_stream & 0x0000000006000000) >> 25) == 0x0)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t rs3 = (binary_stream & 0x00000000F8000000) >> 27; + tree->ast_node_type = RISCV_F_MADD_TYPE_S; + tree->ast_node.f_madd_type_s.rs3 = rs3; + tree->ast_node.f_madd_type_s.rs2 = rs2; + tree->ast_node.f_madd_type_s.rs1 = rs1; + tree->ast_node.f_madd_type_s.rm = rm; + tree->ast_node.f_madd_type_s.rd = rd; + tree->ast_node.f_madd_type_s.op = RISCV_FNMSUB_S; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_MADD_TYPE_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x4F) && + (((binary_stream & 0x0000000006000000) >> 25) == 0x0)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t rs3 = (binary_stream & 0x00000000F8000000) >> 27; + tree->ast_node_type = RISCV_F_MADD_TYPE_S; + tree->ast_node.f_madd_type_s.rs3 = rs3; + tree->ast_node.f_madd_type_s.rs2 = rs2; + tree->ast_node.f_madd_type_s.rs1 = rs1; + tree->ast_node.f_madd_type_s.rm = rm; + tree->ast_node.f_madd_type_s.rd = rd; + tree->ast_node.f_madd_type_s.op = RISCV_FNMADD_S; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_BIN_RM_TYPE_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x00)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_RM_TYPE_S; + tree->ast_node.f_bin_rm_type_s.rs2 = rs2; + tree->ast_node.f_bin_rm_type_s.rs1 = rs1; + tree->ast_node.f_bin_rm_type_s.rm = rm; + tree->ast_node.f_bin_rm_type_s.rd = rd; + tree->ast_node.f_bin_rm_type_s.op = RISCV_FADD_S; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_BIN_RM_TYPE_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x04)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_RM_TYPE_S; + tree->ast_node.f_bin_rm_type_s.rs2 = rs2; + tree->ast_node.f_bin_rm_type_s.rs1 = rs1; + tree->ast_node.f_bin_rm_type_s.rm = rm; + tree->ast_node.f_bin_rm_type_s.rd = rd; + tree->ast_node.f_bin_rm_type_s.op = RISCV_FSUB_S; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_BIN_RM_TYPE_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x08)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_RM_TYPE_S; + tree->ast_node.f_bin_rm_type_s.rs2 = rs2; + tree->ast_node.f_bin_rm_type_s.rs1 = rs1; + tree->ast_node.f_bin_rm_type_s.rm = rm; + tree->ast_node.f_bin_rm_type_s.rd = rd; + tree->ast_node.f_bin_rm_type_s.op = RISCV_FMUL_S; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_BIN_RM_TYPE_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x0C)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_RM_TYPE_S; + tree->ast_node.f_bin_rm_type_s.rs2 = rs2; + tree->ast_node.f_bin_rm_type_s.rs1 = rs1; + tree->ast_node.f_bin_rm_type_s.rm = rm; + tree->ast_node.f_bin_rm_type_s.rd = rd; + tree->ast_node.f_bin_rm_type_s.op = RISCV_FDIV_S; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x2C)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_S; + tree->ast_node.f_un_rm_type_s.rs1 = rs1; + tree->ast_node.f_un_rm_type_s.rm = rm; + tree->ast_node.f_un_rm_type_s.rd = rd; + tree->ast_node.f_un_rm_type_s.fcvt_s_lu = RISCV_FSQRT_S; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x60)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_S; + tree->ast_node.f_un_rm_type_s.rs1 = rs1; + tree->ast_node.f_un_rm_type_s.rm = rm; + tree->ast_node.f_un_rm_type_s.rd = rd; + tree->ast_node.f_un_rm_type_s.fcvt_s_lu = RISCV_FCVT_W_S; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x01) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x60)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_S; + tree->ast_node.f_un_rm_type_s.rs1 = rs1; + tree->ast_node.f_un_rm_type_s.rm = rm; + tree->ast_node.f_un_rm_type_s.rd = rd; + tree->ast_node.f_un_rm_type_s.fcvt_s_lu = RISCV_FCVT_WU_S; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x68)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_S; + tree->ast_node.f_un_rm_type_s.rs1 = rs1; + tree->ast_node.f_un_rm_type_s.rm = rm; + tree->ast_node.f_un_rm_type_s.rd = rd; + tree->ast_node.f_un_rm_type_s.fcvt_s_lu = RISCV_FCVT_S_W; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x01) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x68)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_S; + tree->ast_node.f_un_rm_type_s.rs1 = rs1; + tree->ast_node.f_un_rm_type_s.rm = rm; + tree->ast_node.f_un_rm_type_s.rd = rd; + tree->ast_node.f_un_rm_type_s.fcvt_s_lu = RISCV_FCVT_S_WU; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x02) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x60)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_S; + tree->ast_node.f_un_rm_type_s.rs1 = rs1; + tree->ast_node.f_un_rm_type_s.rm = rm; + tree->ast_node.f_un_rm_type_s.rd = rd; + tree->ast_node.f_un_rm_type_s.fcvt_s_lu = RISCV_FCVT_L_S; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x03) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x60)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_S; + tree->ast_node.f_un_rm_type_s.rs1 = rs1; + tree->ast_node.f_un_rm_type_s.rm = rm; + tree->ast_node.f_un_rm_type_s.rd = rd; + tree->ast_node.f_un_rm_type_s.fcvt_s_lu = RISCV_FCVT_LU_S; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x02) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x68)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_S; + tree->ast_node.f_un_rm_type_s.rs1 = rs1; + tree->ast_node.f_un_rm_type_s.rm = rm; + tree->ast_node.f_un_rm_type_s.rd = rd; + tree->ast_node.f_un_rm_type_s.fcvt_s_lu = RISCV_FCVT_S_L; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x03) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x68)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_S; + tree->ast_node.f_un_rm_type_s.rs1 = rs1; + tree->ast_node.f_un_rm_type_s.rm = rm; + tree->ast_node.f_un_rm_type_s.rd = rd; + tree->ast_node.f_un_rm_type_s.fcvt_s_lu = RISCV_FCVT_S_LU; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_BIN_TYPE_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x10)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_TYPE_S; tree->ast_node.f_bin_type_s.rs2 = rs2; tree->ast_node.f_bin_type_s.rs1 = rs1; tree->ast_node.f_bin_type_s.rd = rd; tree->ast_node.f_bin_type_s.fle_s = RISCV_FSGNJ_S; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FE000000)>>25 == 0x10)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_TYPE_S ; + //------------------------------------------------------------ + + // ---------------------------F_BIN_TYPE_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x10)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_TYPE_S; tree->ast_node.f_bin_type_s.rs2 = rs2; tree->ast_node.f_bin_type_s.rs1 = rs1; tree->ast_node.f_bin_type_s.rd = rd; tree->ast_node.f_bin_type_s.fle_s = RISCV_FSGNJN_S; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x2) && ((binary_stream & 0x00000000FE000000)>>25 == 0x10)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_TYPE_S ; + //------------------------------------------------------------ + + // ---------------------------F_BIN_TYPE_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x10)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_TYPE_S; tree->ast_node.f_bin_type_s.rs2 = rs2; tree->ast_node.f_bin_type_s.rs1 = rs1; tree->ast_node.f_bin_type_s.rd = rd; tree->ast_node.f_bin_type_s.fle_s = RISCV_FSGNJX_S; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x00000000FE000000)>>25 == 0x14)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_TYPE_S ; + //------------------------------------------------------------ + + // ---------------------------F_BIN_TYPE_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x14)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_TYPE_S; tree->ast_node.f_bin_type_s.rs2 = rs2; tree->ast_node.f_bin_type_s.rs1 = rs1; tree->ast_node.f_bin_type_s.rd = rd; tree->ast_node.f_bin_type_s.fle_s = RISCV_FMIN_S; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FE000000)>>25 == 0x14)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_TYPE_S ; + //------------------------------------------------------------ + + // ---------------------------F_BIN_TYPE_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x14)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_TYPE_S; tree->ast_node.f_bin_type_s.rs2 = rs2; tree->ast_node.f_bin_type_s.rs1 = rs1; tree->ast_node.f_bin_type_s.rd = rd; tree->ast_node.f_bin_type_s.fle_s = RISCV_FMAX_S; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x2) && ((binary_stream & 0x00000000FE000000)>>25 == 0x50)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_TYPE_S ; + //------------------------------------------------------------ + + // ---------------------------F_BIN_TYPE_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x50)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_TYPE_S; tree->ast_node.f_bin_type_s.rs2 = rs2; tree->ast_node.f_bin_type_s.rs1 = rs1; tree->ast_node.f_bin_type_s.rd = rd; tree->ast_node.f_bin_type_s.fle_s = RISCV_FEQ_S; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FE000000)>>25 == 0x50)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_TYPE_S ; + //------------------------------------------------------------ + + // ---------------------------F_BIN_TYPE_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x50)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_TYPE_S; tree->ast_node.f_bin_type_s.rs2 = rs2; tree->ast_node.f_bin_type_s.rs1 = rs1; tree->ast_node.f_bin_type_s.rd = rd; tree->ast_node.f_bin_type_s.fle_s = RISCV_FLT_S; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x00000000FE000000)>>25 == 0x50)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_TYPE_S ; + //------------------------------------------------------------ + + // ---------------------------F_BIN_TYPE_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x50)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_TYPE_S; tree->ast_node.f_bin_type_s.rs2 = rs2; tree->ast_node.f_bin_type_s.rs1 = rs1; tree->ast_node.f_bin_type_s.rd = rd; tree->ast_node.f_bin_type_s.fle_s = RISCV_FLE_S; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x00000000FE000000)>>25 == 0x70)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_TYPE_S ; + //------------------------------------------------------------ + + // ---------------------------F_UN_TYPE_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x70)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_TYPE_S; tree->ast_node.f_un_type_s.rs1 = rs1; tree->ast_node.f_un_type_s.rd = rd; tree->ast_node.f_un_type_s.fmv_w_x = RISCV_FCLASS_S; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x00000000FE000000)>>25 == 0x70)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_TYPE_S ; + //------------------------------------------------------------ + + // ---------------------------F_UN_TYPE_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x70)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_TYPE_S; tree->ast_node.f_un_type_s.rs1 = rs1; tree->ast_node.f_un_type_s.rd = rd; tree->ast_node.f_un_type_s.fmv_w_x = RISCV_FMV_X_W; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x00000000FE000000)>>25 == 0x78)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_TYPE_S ; + //------------------------------------------------------------ + + // ---------------------------F_UN_TYPE_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x78)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_TYPE_S; tree->ast_node.f_un_type_s.rs1 = rs1; tree->ast_node.f_un_type_s.rd = rd; tree->ast_node.f_un_type_s.fmv_w_x = RISCV_FMV_W_X; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x43) && ((binary_stream & 0x0000000006000000)>>25 == 0x1)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t rs3 = (binary_stream & 0x00000000F8000000)>>27 ; - tree->ast_node_type = RISCV_F_MADD_TYPE_D ; - tree->ast_node.f_madd_type_d.rs3 = rs3; - tree->ast_node.f_madd_type_d.rs2 = rs2; - tree->ast_node.f_madd_type_d.rs1 = rs1; - tree->ast_node.f_madd_type_d.rm = rm; - tree->ast_node.f_madd_type_d.rd = rd; - tree->ast_node.f_madd_type_d.op = RISCV_FMADD_D; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x47) && ((binary_stream & 0x0000000006000000)>>25 == 0x1)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t rs3 = (binary_stream & 0x00000000F8000000)>>27 ; - tree->ast_node_type = RISCV_F_MADD_TYPE_D ; - tree->ast_node.f_madd_type_d.rs3 = rs3; - tree->ast_node.f_madd_type_d.rs2 = rs2; - tree->ast_node.f_madd_type_d.rs1 = rs1; - tree->ast_node.f_madd_type_d.rm = rm; - tree->ast_node.f_madd_type_d.rd = rd; - tree->ast_node.f_madd_type_d.op = RISCV_FMSUB_D; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x4B) && ((binary_stream & 0x0000000006000000)>>25 == 0x1)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t rs3 = (binary_stream & 0x00000000F8000000)>>27 ; - tree->ast_node_type = RISCV_F_MADD_TYPE_D ; - tree->ast_node.f_madd_type_d.rs3 = rs3; - tree->ast_node.f_madd_type_d.rs2 = rs2; - tree->ast_node.f_madd_type_d.rs1 = rs1; - tree->ast_node.f_madd_type_d.rm = rm; - tree->ast_node.f_madd_type_d.rd = rd; - tree->ast_node.f_madd_type_d.op = RISCV_FNMSUB_D; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x4F) && ((binary_stream & 0x0000000006000000)>>25 == 0x1)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t rs3 = (binary_stream & 0x00000000F8000000)>>27 ; - tree->ast_node_type = RISCV_F_MADD_TYPE_D ; - tree->ast_node.f_madd_type_d.rs3 = rs3; - tree->ast_node.f_madd_type_d.rs2 = rs2; - tree->ast_node.f_madd_type_d.rs1 = rs1; - tree->ast_node.f_madd_type_d.rm = rm; - tree->ast_node.f_madd_type_d.rd = rd; - tree->ast_node.f_madd_type_d.op = RISCV_FNMADD_D; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x00000000FE000000)>>25 == 0x01)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_RM_TYPE_D ; - tree->ast_node.f_bin_rm_type_d.rs2 = rs2; - tree->ast_node.f_bin_rm_type_d.rs1 = rs1; - tree->ast_node.f_bin_rm_type_d.rm = rm; - tree->ast_node.f_bin_rm_type_d.rd = rd; - tree->ast_node.f_bin_rm_type_d.op = RISCV_FADD_D; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x00000000FE000000)>>25 == 0x05)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_RM_TYPE_D ; - tree->ast_node.f_bin_rm_type_d.rs2 = rs2; - tree->ast_node.f_bin_rm_type_d.rs1 = rs1; - tree->ast_node.f_bin_rm_type_d.rm = rm; - tree->ast_node.f_bin_rm_type_d.rd = rd; - tree->ast_node.f_bin_rm_type_d.op = RISCV_FSUB_D; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x00000000FE000000)>>25 == 0x09)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_RM_TYPE_D ; - tree->ast_node.f_bin_rm_type_d.rs2 = rs2; - tree->ast_node.f_bin_rm_type_d.rs1 = rs1; - tree->ast_node.f_bin_rm_type_d.rm = rm; - tree->ast_node.f_bin_rm_type_d.rd = rd; - tree->ast_node.f_bin_rm_type_d.op = RISCV_FMUL_D; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x00000000FE000000)>>25 == 0x0D)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_RM_TYPE_D ; - tree->ast_node.f_bin_rm_type_d.rs2 = rs2; - tree->ast_node.f_bin_rm_type_d.rs1 = rs1; - tree->ast_node.f_bin_rm_type_d.rm = rm; - tree->ast_node.f_bin_rm_type_d.rd = rd; - tree->ast_node.f_bin_rm_type_d.op = RISCV_FDIV_D; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x00000000FE000000)>>25 == 0x2D)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_D ; - tree->ast_node.f_un_rm_type_d.rs1 = rs1; - tree->ast_node.f_un_rm_type_d.rm = rm; - tree->ast_node.f_un_rm_type_d.rd = rd; - tree->ast_node.f_un_rm_type_d.fcvt_d_lu = RISCV_FSQRT_D; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x00000000FE000000)>>25 == 0x61)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_D ; - tree->ast_node.f_un_rm_type_d.rs1 = rs1; - tree->ast_node.f_un_rm_type_d.rm = rm; - tree->ast_node.f_un_rm_type_d.rd = rd; - tree->ast_node.f_un_rm_type_d.fcvt_d_lu = RISCV_FCVT_W_D; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x01) && ((binary_stream & 0x00000000FE000000)>>25 == 0x61)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_D ; - tree->ast_node.f_un_rm_type_d.rs1 = rs1; - tree->ast_node.f_un_rm_type_d.rm = rm; - tree->ast_node.f_un_rm_type_d.rd = rd; - tree->ast_node.f_un_rm_type_d.fcvt_d_lu = RISCV_FCVT_WU_D; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x00000000FE000000)>>25 == 0x69)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_D ; - tree->ast_node.f_un_rm_type_d.rs1 = rs1; - tree->ast_node.f_un_rm_type_d.rm = rm; - tree->ast_node.f_un_rm_type_d.rd = rd; - tree->ast_node.f_un_rm_type_d.fcvt_d_lu = RISCV_FCVT_D_W; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x01) && ((binary_stream & 0x00000000FE000000)>>25 == 0x69)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_D ; - tree->ast_node.f_un_rm_type_d.rs1 = rs1; - tree->ast_node.f_un_rm_type_d.rm = rm; - tree->ast_node.f_un_rm_type_d.rd = rd; - tree->ast_node.f_un_rm_type_d.fcvt_d_lu = RISCV_FCVT_D_WU; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x01) && ((binary_stream & 0x00000000FE000000)>>25 == 0x20)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_D ; - tree->ast_node.f_un_rm_type_d.rs1 = rs1; - tree->ast_node.f_un_rm_type_d.rm = rm; - tree->ast_node.f_un_rm_type_d.rd = rd; - tree->ast_node.f_un_rm_type_d.fcvt_d_lu = RISCV_FCVT_S_D; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x00000000FE000000)>>25 == 0x21)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_D ; - tree->ast_node.f_un_rm_type_d.rs1 = rs1; - tree->ast_node.f_un_rm_type_d.rm = rm; - tree->ast_node.f_un_rm_type_d.rd = rd; - tree->ast_node.f_un_rm_type_d.fcvt_d_lu = RISCV_FCVT_D_S; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x02) && ((binary_stream & 0x00000000FE000000)>>25 == 0x61)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_D ; - tree->ast_node.f_un_rm_type_d.rs1 = rs1; - tree->ast_node.f_un_rm_type_d.rm = rm; - tree->ast_node.f_un_rm_type_d.rd = rd; - tree->ast_node.f_un_rm_type_d.fcvt_d_lu = RISCV_FCVT_L_D; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x03) && ((binary_stream & 0x00000000FE000000)>>25 == 0x61)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_D ; - tree->ast_node.f_un_rm_type_d.rs1 = rs1; - tree->ast_node.f_un_rm_type_d.rm = rm; - tree->ast_node.f_un_rm_type_d.rd = rd; - tree->ast_node.f_un_rm_type_d.fcvt_d_lu = RISCV_FCVT_LU_D; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x02) && ((binary_stream & 0x00000000FE000000)>>25 == 0x69)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_D ; - tree->ast_node.f_un_rm_type_d.rs1 = rs1; - tree->ast_node.f_un_rm_type_d.rm = rm; - tree->ast_node.f_un_rm_type_d.rd = rd; - tree->ast_node.f_un_rm_type_d.fcvt_d_lu = RISCV_FCVT_D_L; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x03) && ((binary_stream & 0x00000000FE000000)>>25 == 0x69)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_D ; - tree->ast_node.f_un_rm_type_d.rs1 = rs1; - tree->ast_node.f_un_rm_type_d.rm = rm; - tree->ast_node.f_un_rm_type_d.rd = rd; - tree->ast_node.f_un_rm_type_d.fcvt_d_lu = RISCV_FCVT_D_LU; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x00000000FE000000)>>25 == 0x11)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_TYPE_D ; - tree->ast_node.f_bin_type_d.rs2 = rs2; - tree->ast_node.f_bin_type_d.rs1 = rs1; - tree->ast_node.f_bin_type_d.rd = rd; - tree->ast_node.f_bin_type_d.fle_d = RISCV_FSGNJ_D; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FE000000)>>25 == 0x11)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_TYPE_D ; - tree->ast_node.f_bin_type_d.rs2 = rs2; - tree->ast_node.f_bin_type_d.rs1 = rs1; - tree->ast_node.f_bin_type_d.rd = rd; - tree->ast_node.f_bin_type_d.fle_d = RISCV_FSGNJN_D; - return ; + //------------------------------------------------------------ + + // ---------------------------F_MADD_TYPE_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x43) && + (((binary_stream & 0x0000000006000000) >> 25) == 0x1)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t rs3 = (binary_stream & 0x00000000F8000000) >> 27; + tree->ast_node_type = RISCV_F_MADD_TYPE_D; + tree->ast_node.f_madd_type_d.rs3 = rs3; + tree->ast_node.f_madd_type_d.rs2 = rs2; + tree->ast_node.f_madd_type_d.rs1 = rs1; + tree->ast_node.f_madd_type_d.rm = rm; + tree->ast_node.f_madd_type_d.rd = rd; + tree->ast_node.f_madd_type_d.op = RISCV_FMADD_D; + return; + } + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x2) && ((binary_stream & 0x00000000FE000000)>>25 == 0x11)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_TYPE_D ; - tree->ast_node.f_bin_type_d.rs2 = rs2; - tree->ast_node.f_bin_type_d.rs1 = rs1; - tree->ast_node.f_bin_type_d.rd = rd; - tree->ast_node.f_bin_type_d.fle_d = RISCV_FSGNJX_D; - return ; + //------------------------------------------------------------ + + // ---------------------------F_MADD_TYPE_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x47) && + (((binary_stream & 0x0000000006000000) >> 25) == 0x1)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t rs3 = (binary_stream & 0x00000000F8000000) >> 27; + tree->ast_node_type = RISCV_F_MADD_TYPE_D; + tree->ast_node.f_madd_type_d.rs3 = rs3; + tree->ast_node.f_madd_type_d.rs2 = rs2; + tree->ast_node.f_madd_type_d.rs1 = rs1; + tree->ast_node.f_madd_type_d.rm = rm; + tree->ast_node.f_madd_type_d.rd = rd; + tree->ast_node.f_madd_type_d.op = RISCV_FMSUB_D; + return; + } + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x00000000FE000000)>>25 == 0x15)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_TYPE_D ; + //------------------------------------------------------------ + + // ---------------------------F_MADD_TYPE_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x4B) && + (((binary_stream & 0x0000000006000000) >> 25) == 0x1)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t rs3 = (binary_stream & 0x00000000F8000000) >> 27; + tree->ast_node_type = RISCV_F_MADD_TYPE_D; + tree->ast_node.f_madd_type_d.rs3 = rs3; + tree->ast_node.f_madd_type_d.rs2 = rs2; + tree->ast_node.f_madd_type_d.rs1 = rs1; + tree->ast_node.f_madd_type_d.rm = rm; + tree->ast_node.f_madd_type_d.rd = rd; + tree->ast_node.f_madd_type_d.op = RISCV_FNMSUB_D; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_MADD_TYPE_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x4F) && + (((binary_stream & 0x0000000006000000) >> 25) == 0x1)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t rs3 = (binary_stream & 0x00000000F8000000) >> 27; + tree->ast_node_type = RISCV_F_MADD_TYPE_D; + tree->ast_node.f_madd_type_d.rs3 = rs3; + tree->ast_node.f_madd_type_d.rs2 = rs2; + tree->ast_node.f_madd_type_d.rs1 = rs1; + tree->ast_node.f_madd_type_d.rm = rm; + tree->ast_node.f_madd_type_d.rd = rd; + tree->ast_node.f_madd_type_d.op = RISCV_FNMADD_D; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_BIN_RM_TYPE_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x01)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_RM_TYPE_D; + tree->ast_node.f_bin_rm_type_d.rs2 = rs2; + tree->ast_node.f_bin_rm_type_d.rs1 = rs1; + tree->ast_node.f_bin_rm_type_d.rm = rm; + tree->ast_node.f_bin_rm_type_d.rd = rd; + tree->ast_node.f_bin_rm_type_d.op = RISCV_FADD_D; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_BIN_RM_TYPE_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x05)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_RM_TYPE_D; + tree->ast_node.f_bin_rm_type_d.rs2 = rs2; + tree->ast_node.f_bin_rm_type_d.rs1 = rs1; + tree->ast_node.f_bin_rm_type_d.rm = rm; + tree->ast_node.f_bin_rm_type_d.rd = rd; + tree->ast_node.f_bin_rm_type_d.op = RISCV_FSUB_D; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_BIN_RM_TYPE_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x09)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_RM_TYPE_D; + tree->ast_node.f_bin_rm_type_d.rs2 = rs2; + tree->ast_node.f_bin_rm_type_d.rs1 = rs1; + tree->ast_node.f_bin_rm_type_d.rm = rm; + tree->ast_node.f_bin_rm_type_d.rd = rd; + tree->ast_node.f_bin_rm_type_d.op = RISCV_FMUL_D; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_BIN_RM_TYPE_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x0D)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_RM_TYPE_D; + tree->ast_node.f_bin_rm_type_d.rs2 = rs2; + tree->ast_node.f_bin_rm_type_d.rs1 = rs1; + tree->ast_node.f_bin_rm_type_d.rm = rm; + tree->ast_node.f_bin_rm_type_d.rd = rd; + tree->ast_node.f_bin_rm_type_d.op = RISCV_FDIV_D; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x2D)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_D; + tree->ast_node.f_un_rm_type_d.rs1 = rs1; + tree->ast_node.f_un_rm_type_d.rm = rm; + tree->ast_node.f_un_rm_type_d.rd = rd; + tree->ast_node.f_un_rm_type_d.fcvt_d_lu = RISCV_FSQRT_D; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x61)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_D; + tree->ast_node.f_un_rm_type_d.rs1 = rs1; + tree->ast_node.f_un_rm_type_d.rm = rm; + tree->ast_node.f_un_rm_type_d.rd = rd; + tree->ast_node.f_un_rm_type_d.fcvt_d_lu = RISCV_FCVT_W_D; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x01) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x61)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_D; + tree->ast_node.f_un_rm_type_d.rs1 = rs1; + tree->ast_node.f_un_rm_type_d.rm = rm; + tree->ast_node.f_un_rm_type_d.rd = rd; + tree->ast_node.f_un_rm_type_d.fcvt_d_lu = RISCV_FCVT_WU_D; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x69)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_D; + tree->ast_node.f_un_rm_type_d.rs1 = rs1; + tree->ast_node.f_un_rm_type_d.rm = rm; + tree->ast_node.f_un_rm_type_d.rd = rd; + tree->ast_node.f_un_rm_type_d.fcvt_d_lu = RISCV_FCVT_D_W; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x01) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x69)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_D; + tree->ast_node.f_un_rm_type_d.rs1 = rs1; + tree->ast_node.f_un_rm_type_d.rm = rm; + tree->ast_node.f_un_rm_type_d.rd = rd; + tree->ast_node.f_un_rm_type_d.fcvt_d_lu = RISCV_FCVT_D_WU; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x01) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x20)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_D; + tree->ast_node.f_un_rm_type_d.rs1 = rs1; + tree->ast_node.f_un_rm_type_d.rm = rm; + tree->ast_node.f_un_rm_type_d.rd = rd; + tree->ast_node.f_un_rm_type_d.fcvt_d_lu = RISCV_FCVT_S_D; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x21)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_D; + tree->ast_node.f_un_rm_type_d.rs1 = rs1; + tree->ast_node.f_un_rm_type_d.rm = rm; + tree->ast_node.f_un_rm_type_d.rd = rd; + tree->ast_node.f_un_rm_type_d.fcvt_d_lu = RISCV_FCVT_D_S; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x02) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x61)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_D; + tree->ast_node.f_un_rm_type_d.rs1 = rs1; + tree->ast_node.f_un_rm_type_d.rm = rm; + tree->ast_node.f_un_rm_type_d.rd = rd; + tree->ast_node.f_un_rm_type_d.fcvt_d_lu = RISCV_FCVT_L_D; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x03) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x61)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_D; + tree->ast_node.f_un_rm_type_d.rs1 = rs1; + tree->ast_node.f_un_rm_type_d.rm = rm; + tree->ast_node.f_un_rm_type_d.rd = rd; + tree->ast_node.f_un_rm_type_d.fcvt_d_lu = RISCV_FCVT_LU_D; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x02) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x69)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_D; + tree->ast_node.f_un_rm_type_d.rs1 = rs1; + tree->ast_node.f_un_rm_type_d.rm = rm; + tree->ast_node.f_un_rm_type_d.rd = rd; + tree->ast_node.f_un_rm_type_d.fcvt_d_lu = RISCV_FCVT_D_L; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x03) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x69)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_D; + tree->ast_node.f_un_rm_type_d.rs1 = rs1; + tree->ast_node.f_un_rm_type_d.rm = rm; + tree->ast_node.f_un_rm_type_d.rd = rd; + tree->ast_node.f_un_rm_type_d.fcvt_d_lu = RISCV_FCVT_D_LU; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_BIN_TYPE_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x11)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_TYPE_D; + tree->ast_node.f_bin_type_d.rs2 = rs2; + tree->ast_node.f_bin_type_d.rs1 = rs1; + tree->ast_node.f_bin_type_d.rd = rd; + tree->ast_node.f_bin_type_d.fle_d = RISCV_FSGNJ_D; + return; + } + } + //------------------------------------------------------------ + + // ---------------------------F_BIN_TYPE_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x11)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_TYPE_D; + tree->ast_node.f_bin_type_d.rs2 = rs2; + tree->ast_node.f_bin_type_d.rs1 = rs1; + tree->ast_node.f_bin_type_d.rd = rd; + tree->ast_node.f_bin_type_d.fle_d = RISCV_FSGNJN_D; + return; + } + } + //------------------------------------------------------------ + + // ---------------------------F_BIN_TYPE_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x11)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_TYPE_D; + tree->ast_node.f_bin_type_d.rs2 = rs2; + tree->ast_node.f_bin_type_d.rs1 = rs1; + tree->ast_node.f_bin_type_d.rd = rd; + tree->ast_node.f_bin_type_d.fle_d = RISCV_FSGNJX_D; + return; + } + } + //------------------------------------------------------------ + + // ---------------------------F_BIN_TYPE_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x15)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_TYPE_D; tree->ast_node.f_bin_type_d.rs2 = rs2; tree->ast_node.f_bin_type_d.rs1 = rs1; tree->ast_node.f_bin_type_d.rd = rd; tree->ast_node.f_bin_type_d.fle_d = RISCV_FMIN_D; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FE000000)>>25 == 0x15)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_TYPE_D ; + //------------------------------------------------------------ + + // ---------------------------F_BIN_TYPE_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x15)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_TYPE_D; tree->ast_node.f_bin_type_d.rs2 = rs2; tree->ast_node.f_bin_type_d.rs1 = rs1; tree->ast_node.f_bin_type_d.rd = rd; tree->ast_node.f_bin_type_d.fle_d = RISCV_FMAX_D; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x2) && ((binary_stream & 0x00000000FE000000)>>25 == 0x51)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_TYPE_D ; + //------------------------------------------------------------ + + // ---------------------------F_BIN_TYPE_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x51)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_TYPE_D; tree->ast_node.f_bin_type_d.rs2 = rs2; tree->ast_node.f_bin_type_d.rs1 = rs1; tree->ast_node.f_bin_type_d.rd = rd; tree->ast_node.f_bin_type_d.fle_d = RISCV_FEQ_D; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FE000000)>>25 == 0x51)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_TYPE_D ; + //------------------------------------------------------------ + + // ---------------------------F_BIN_TYPE_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x51)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_TYPE_D; tree->ast_node.f_bin_type_d.rs2 = rs2; tree->ast_node.f_bin_type_d.rs1 = rs1; tree->ast_node.f_bin_type_d.rd = rd; tree->ast_node.f_bin_type_d.fle_d = RISCV_FLT_D; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x00000000FE000000)>>25 == 0x51)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_TYPE_D ; + //------------------------------------------------------------ + + // ---------------------------F_BIN_TYPE_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x51)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_TYPE_D; tree->ast_node.f_bin_type_d.rs2 = rs2; tree->ast_node.f_bin_type_d.rs1 = rs1; tree->ast_node.f_bin_type_d.rd = rd; tree->ast_node.f_bin_type_d.fle_d = RISCV_FLE_D; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x00000000FE000000)>>25 == 0x71)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_TYPE_D ; + //------------------------------------------------------------ + + // ---------------------------F_UN_TYPE_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x71)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_TYPE_D; tree->ast_node.f_un_type_d.rs1 = rs1; tree->ast_node.f_un_type_d.rd = rd; tree->ast_node.f_un_type_d.fmv_d_x = RISCV_FCLASS_D; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x00000000FE000000)>>25 == 0x71)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_TYPE_D ; + //------------------------------------------------------------ + + // ---------------------------F_UN_TYPE_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x71)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_TYPE_D; tree->ast_node.f_un_type_d.rs1 = rs1; tree->ast_node.f_un_type_d.rd = rd; tree->ast_node.f_un_type_d.fmv_d_x = RISCV_FMV_X_D; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x00000000FE000000)>>25 == 0x79)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_TYPE_D ; + //------------------------------------------------------------ + + // ---------------------------F_UN_TYPE_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x79)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_TYPE_D; tree->ast_node.f_un_type_d.rs1 = rs1; tree->ast_node.f_un_type_d.rd = rd; tree->ast_node.f_un_type_d.fmv_d_x = RISCV_FMV_D_X; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x73) && ((binary_stream & 0x0000000000000F80)>>7 == 0x00) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x00000000FE000000)>>25 == 0x0B)) { - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_SINVAL_VMA ; + //------------------------------------------------------------ + + // ---------------------------SINVAL_VMA------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x73) && + (((binary_stream & 0x0000000000000F80) >> 7) == 0x00) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x0B)) { + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_SINVAL_VMA; tree->ast_node.sinval_vma.rs1 = rs1; tree->ast_node.sinval_vma.rs2 = rs2; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x73) && ((binary_stream & 0x0000000000000F80)>>7 == 0x00) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x00000000000F8000)>>15 == 0x00) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x00000000FE000000)>>25 == 0x0C)) { - tree->ast_node_type = RISCV_SFENCE_W_INVAL ; - return ; + //------------------------------------------------------------ + + // ---------------------------SFENCE_W_INVAL------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x73) && + (((binary_stream & 0x0000000000000F80) >> 7) == 0x00) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x00000000000F8000) >> 15) == 0x00) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x0C)) { + tree->ast_node_type = RISCV_SFENCE_W_INVAL; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x73) && ((binary_stream & 0x0000000000000F80)>>7 == 0x00) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x00000000000F8000)>>15 == 0x00) && ((binary_stream & 0x0000000001F00000)>>20 == 0x01) && ((binary_stream & 0x00000000FE000000)>>25 == 0x0C)) { - tree->ast_node_type = RISCV_SFENCE_INVAL_IR ; - return ; + //------------------------------------------------------------ + + // ---------------------------SFENCE_INVAL_IR------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x73) && + (((binary_stream & 0x0000000000000F80) >> 7) == 0x00) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x00000000000F8000) >> 15) == 0x00) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x01) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x0C)) { + tree->ast_node_type = RISCV_SFENCE_INVAL_IR; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x1B) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FC000000)>>26 == 0x02)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t shamt = (binary_stream & 0x0000000003F00000)>>20 ; - tree->ast_node_type = RISCV_SLLIUW ; + //------------------------------------------------------------ + + // ---------------------------RISCV_SLLIUW------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x1B) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x02)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t shamt = (binary_stream & 0x0000000003F00000) >> 20; + tree->ast_node_type = RISCV_SLLIUW; tree->ast_node.riscv_slliuw.shamt = shamt; tree->ast_node.riscv_slliuw.rs1 = rs1; tree->ast_node.riscv_slliuw.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x3B) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x00000000FE000000)>>25 == 0x04)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_ZBA_RTYPEUW ; + //------------------------------------------------------------ + + // ---------------------------ZBA_RTYPEUW------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x3B) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x04)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_ZBA_RTYPEUW; tree->ast_node.zba_rtypeuw.rs2 = rs2; tree->ast_node.zba_rtypeuw.rs1 = rs1; tree->ast_node.zba_rtypeuw.rd = rd; tree->ast_node.zba_rtypeuw.op = RISCV_ADDUW; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x3B) && ((binary_stream & 0x0000000000007000)>>12 == 0x2) && ((binary_stream & 0x00000000FE000000)>>25 == 0x10)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_ZBA_RTYPEUW ; + //------------------------------------------------------------ + + // ---------------------------ZBA_RTYPEUW------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x3B) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x10)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_ZBA_RTYPEUW; tree->ast_node.zba_rtypeuw.rs2 = rs2; tree->ast_node.zba_rtypeuw.rs1 = rs1; tree->ast_node.zba_rtypeuw.rd = rd; tree->ast_node.zba_rtypeuw.op = RISCV_SH1ADDUW; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x3B) && ((binary_stream & 0x0000000000007000)>>12 == 0x4) && ((binary_stream & 0x00000000FE000000)>>25 == 0x10)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_ZBA_RTYPEUW ; + //------------------------------------------------------------ + + // ---------------------------ZBA_RTYPEUW------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x3B) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x4) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x10)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_ZBA_RTYPEUW; tree->ast_node.zba_rtypeuw.rs2 = rs2; tree->ast_node.zba_rtypeuw.rs1 = rs1; tree->ast_node.zba_rtypeuw.rd = rd; tree->ast_node.zba_rtypeuw.op = RISCV_SH2ADDUW; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x3B) && ((binary_stream & 0x0000000000007000)>>12 == 0x6) && ((binary_stream & 0x00000000FE000000)>>25 == 0x10)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_ZBA_RTYPEUW ; + //------------------------------------------------------------ + + // ---------------------------ZBA_RTYPEUW------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x3B) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x6) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x10)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_ZBA_RTYPEUW; tree->ast_node.zba_rtypeuw.rs2 = rs2; tree->ast_node.zba_rtypeuw.rs1 = rs1; tree->ast_node.zba_rtypeuw.rd = rd; tree->ast_node.zba_rtypeuw.op = RISCV_SH3ADDUW; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x2) && ((binary_stream & 0x00000000FE000000)>>25 == 0x10)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_ZBA_RTYPE ; + //------------------------------------------------------------ + + // ---------------------------ZBA_RTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x10)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_ZBA_RTYPE; tree->ast_node.zba_rtype.rs2 = rs2; tree->ast_node.zba_rtype.rs1 = rs1; tree->ast_node.zba_rtype.rd = rd; tree->ast_node.zba_rtype.op = RISCV_SH1ADD; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x4) && ((binary_stream & 0x00000000FE000000)>>25 == 0x10)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_ZBA_RTYPE ; + //------------------------------------------------------------ + + // ---------------------------ZBA_RTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x4) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x10)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_ZBA_RTYPE; tree->ast_node.zba_rtype.rs2 = rs2; tree->ast_node.zba_rtype.rs1 = rs1; tree->ast_node.zba_rtype.rd = rd; tree->ast_node.zba_rtype.op = RISCV_SH2ADD; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x6) && ((binary_stream & 0x00000000FE000000)>>25 == 0x10)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_ZBA_RTYPE ; + //------------------------------------------------------------ + + // ---------------------------ZBA_RTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x6) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x10)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_ZBA_RTYPE; tree->ast_node.zba_rtype.rs2 = rs2; tree->ast_node.zba_rtype.rs1 = rs1; tree->ast_node.zba_rtype.rd = rd; tree->ast_node.zba_rtype.op = RISCV_SH3ADD; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x1B) && ((binary_stream & 0x0000000000007000)>>12 == 0x5) && ((binary_stream & 0x00000000FE000000)>>25 == 0x30)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t shamt = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_RORIW ; + //------------------------------------------------------------ + + // ---------------------------RISCV_RORIW------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x1B) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x30)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t shamt = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_RORIW; tree->ast_node.riscv_roriw.shamt = shamt; tree->ast_node.riscv_roriw.rs1 = rs1; tree->ast_node.riscv_roriw.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x5) && ((binary_stream & 0x00000000FC000000)>>26 == 0x18)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t shamt = (binary_stream & 0x0000000003F00000)>>20 ; - tree->ast_node_type = RISCV_RORI ; + //------------------------------------------------------------ + + // ---------------------------RISCV_RORI------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x18)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t shamt = (binary_stream & 0x0000000003F00000) >> 20; + tree->ast_node_type = RISCV_RORI; tree->ast_node.riscv_rori.shamt = shamt; tree->ast_node.riscv_rori.rs1 = rs1; tree->ast_node.riscv_rori.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x3B) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FE000000)>>25 == 0x30)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_ZBB_RTYPEW ; + //------------------------------------------------------------ + + // ---------------------------ZBB_RTYPEW------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x3B) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x30)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_ZBB_RTYPEW; tree->ast_node.zbb_rtypew.rs2 = rs2; tree->ast_node.zbb_rtypew.rs1 = rs1; tree->ast_node.zbb_rtypew.rd = rd; tree->ast_node.zbb_rtypew.op = RISCV_ROLW; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x3B) && ((binary_stream & 0x0000000000007000)>>12 == 0x5) && ((binary_stream & 0x00000000FE000000)>>25 == 0x30)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_ZBB_RTYPEW ; + //------------------------------------------------------------ + + // ---------------------------ZBB_RTYPEW------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x3B) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x30)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_ZBB_RTYPEW; tree->ast_node.zbb_rtypew.rs2 = rs2; tree->ast_node.zbb_rtypew.rs1 = rs1; tree->ast_node.zbb_rtypew.rd = rd; tree->ast_node.zbb_rtypew.op = RISCV_RORW; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x7) && ((binary_stream & 0x00000000FE000000)>>25 == 0x20)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_ZBB_RTYPE ; + //------------------------------------------------------------ + + // ---------------------------ZBB_RTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x7) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x20)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_ZBB_RTYPE; tree->ast_node.zbb_rtype.rs2 = rs2; tree->ast_node.zbb_rtype.rs1 = rs1; tree->ast_node.zbb_rtype.rd = rd; tree->ast_node.zbb_rtype.op = RISCV_ANDN; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x6) && ((binary_stream & 0x00000000FE000000)>>25 == 0x20)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_ZBB_RTYPE ; + //------------------------------------------------------------ + + // ---------------------------ZBB_RTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x6) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x20)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_ZBB_RTYPE; tree->ast_node.zbb_rtype.rs2 = rs2; tree->ast_node.zbb_rtype.rs1 = rs1; tree->ast_node.zbb_rtype.rd = rd; tree->ast_node.zbb_rtype.op = RISCV_ORN; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x4) && ((binary_stream & 0x00000000FE000000)>>25 == 0x20)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_ZBB_RTYPE ; + //------------------------------------------------------------ + + // ---------------------------ZBB_RTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x4) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x20)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_ZBB_RTYPE; tree->ast_node.zbb_rtype.rs2 = rs2; tree->ast_node.zbb_rtype.rs1 = rs1; tree->ast_node.zbb_rtype.rd = rd; tree->ast_node.zbb_rtype.op = RISCV_XNOR; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x6) && ((binary_stream & 0x00000000FE000000)>>25 == 0x05)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_ZBB_RTYPE ; + //------------------------------------------------------------ + + // ---------------------------ZBB_RTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x6) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x05)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_ZBB_RTYPE; tree->ast_node.zbb_rtype.rs2 = rs2; tree->ast_node.zbb_rtype.rs1 = rs1; tree->ast_node.zbb_rtype.rd = rd; tree->ast_node.zbb_rtype.op = RISCV_MAX; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x7) && ((binary_stream & 0x00000000FE000000)>>25 == 0x05)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_ZBB_RTYPE ; + //------------------------------------------------------------ + + // ---------------------------ZBB_RTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x7) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x05)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_ZBB_RTYPE; tree->ast_node.zbb_rtype.rs2 = rs2; tree->ast_node.zbb_rtype.rs1 = rs1; tree->ast_node.zbb_rtype.rd = rd; tree->ast_node.zbb_rtype.op = RISCV_MAXU; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x4) && ((binary_stream & 0x00000000FE000000)>>25 == 0x05)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_ZBB_RTYPE ; + //------------------------------------------------------------ + + // ---------------------------ZBB_RTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x4) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x05)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_ZBB_RTYPE; tree->ast_node.zbb_rtype.rs2 = rs2; tree->ast_node.zbb_rtype.rs1 = rs1; tree->ast_node.zbb_rtype.rd = rd; tree->ast_node.zbb_rtype.op = RISCV_MIN; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x5) && ((binary_stream & 0x00000000FE000000)>>25 == 0x05)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_ZBB_RTYPE ; + //------------------------------------------------------------ + + // ---------------------------ZBB_RTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x05)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_ZBB_RTYPE; tree->ast_node.zbb_rtype.rs2 = rs2; tree->ast_node.zbb_rtype.rs1 = rs1; tree->ast_node.zbb_rtype.rd = rd; tree->ast_node.zbb_rtype.op = RISCV_MINU; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FE000000)>>25 == 0x30)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_ZBB_RTYPE ; + //------------------------------------------------------------ + + // ---------------------------ZBB_RTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x30)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_ZBB_RTYPE; tree->ast_node.zbb_rtype.rs2 = rs2; tree->ast_node.zbb_rtype.rs1 = rs1; tree->ast_node.zbb_rtype.rd = rd; tree->ast_node.zbb_rtype.op = RISCV_ROL; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x5) && ((binary_stream & 0x00000000FE000000)>>25 == 0x30)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_ZBB_RTYPE ; + //------------------------------------------------------------ + + // ---------------------------ZBB_RTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x30)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_ZBB_RTYPE; tree->ast_node.zbb_rtype.rs2 = rs2; tree->ast_node.zbb_rtype.rs1 = rs1; tree->ast_node.zbb_rtype.rd = rd; tree->ast_node.zbb_rtype.op = RISCV_ROR; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x0000000001F00000)>>20 == 0x04) && ((binary_stream & 0x00000000FE000000)>>25 == 0x30)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_ZBB_EXTOP ; + //------------------------------------------------------------ + + // ---------------------------ZBB_EXTOP------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x04) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x30)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_ZBB_EXTOP; tree->ast_node.zbb_extop.rs1 = rs1; tree->ast_node.zbb_extop.rd = rd; tree->ast_node.zbb_extop.op = RISCV_SEXTB; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x0000000001F00000)>>20 == 0x05) && ((binary_stream & 0x00000000FE000000)>>25 == 0x30)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_ZBB_EXTOP ; + //------------------------------------------------------------ + + // ---------------------------ZBB_EXTOP------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x05) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x30)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_ZBB_EXTOP; tree->ast_node.zbb_extop.rs1 = rs1; tree->ast_node.zbb_extop.rd = rd; tree->ast_node.zbb_extop.op = RISCV_SEXTH; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x4) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x00000000FE000000)>>25 == 0x04)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_ZBB_EXTOP ; + //------------------------------------------------------------ + + // ---------------------------ZBB_EXTOP------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x4) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x04)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_ZBB_EXTOP; tree->ast_node.zbb_extop.rs1 = rs1; tree->ast_node.zbb_extop.rd = rd; tree->ast_node.zbb_extop.op = RISCV_ZEXTH; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x3B) && ((binary_stream & 0x0000000000007000)>>12 == 0x4) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x00000000FE000000)>>25 == 0x04)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_ZBB_EXTOP ; + //------------------------------------------------------------ + + // ---------------------------ZBB_EXTOP------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x3B) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x4) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x04)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_ZBB_EXTOP; tree->ast_node.zbb_extop.rs1 = rs1; tree->ast_node.zbb_extop.rd = rd; tree->ast_node.zbb_extop.op = RISCV_ZEXTH; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x5) && ((binary_stream & 0x00000000FFF00000)>>20 == 0x698)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_REV8 ; + //------------------------------------------------------------ + + // ---------------------------RISCV_REV8------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5) && + (((binary_stream & 0x00000000FFF00000) >> 20) == 0x698)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_REV8; tree->ast_node.riscv_rev8.rs1 = rs1; tree->ast_node.riscv_rev8.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x5) && ((binary_stream & 0x00000000FFF00000)>>20 == 0x6B8)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_REV8 ; + //------------------------------------------------------------ + + // ---------------------------RISCV_REV8------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5) && + (((binary_stream & 0x00000000FFF00000) >> 20) == 0x6B8)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_REV8; tree->ast_node.riscv_rev8.rs1 = rs1; tree->ast_node.riscv_rev8.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x5) && ((binary_stream & 0x00000000FFF00000)>>20 == 0x287)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_ORCB ; + //------------------------------------------------------------ + + // ---------------------------RISCV_ORCB------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5) && + (((binary_stream & 0x00000000FFF00000) >> 20) == 0x287)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_ORCB; tree->ast_node.riscv_orcb.rs1 = rs1; tree->ast_node.riscv_orcb.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FFF00000)>>20 == 0x602)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_CPOP ; + //------------------------------------------------------------ + + // ---------------------------RISCV_CPOP------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FFF00000) >> 20) == 0x602)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_CPOP; tree->ast_node.riscv_cpop.rs1 = rs1; tree->ast_node.riscv_cpop.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x1B) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FFF00000)>>20 == 0x602)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_CPOPW ; + //------------------------------------------------------------ + + // ---------------------------RISCV_CPOPW------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x1B) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FFF00000) >> 20) == 0x602)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_CPOPW; tree->ast_node.riscv_cpopw.rs1 = rs1; tree->ast_node.riscv_cpopw.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FFF00000)>>20 == 0x600)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_CLZ ; + //------------------------------------------------------------ + + // ---------------------------RISCV_CLZ------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FFF00000) >> 20) == 0x600)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_CLZ; tree->ast_node.riscv_clz.rs1 = rs1; tree->ast_node.riscv_clz.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x1B) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FFF00000)>>20 == 0x600)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_CLZW ; + //------------------------------------------------------------ + + // ---------------------------RISCV_CLZW------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x1B) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FFF00000) >> 20) == 0x600)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_CLZW; tree->ast_node.riscv_clzw.rs1 = rs1; tree->ast_node.riscv_clzw.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FFF00000)>>20 == 0x601)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_CTZ ; + //------------------------------------------------------------ + + // ---------------------------RISCV_CTZ------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FFF00000) >> 20) == 0x601)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_CTZ; tree->ast_node.riscv_ctz.rs1 = rs1; tree->ast_node.riscv_ctz.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x1B) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FFF00000)>>20 == 0x601)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_CTZW ; + //------------------------------------------------------------ + + // ---------------------------RISCV_CTZW------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x1B) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FFF00000) >> 20) == 0x601)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_CTZW; tree->ast_node.riscv_ctzw.rs1 = rs1; tree->ast_node.riscv_ctzw.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FE000000)>>25 == 0x05)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_CLMUL ; + //------------------------------------------------------------ + + // ---------------------------RISCV_CLMUL------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x05)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_CLMUL; tree->ast_node.riscv_clmul.rs2 = rs2; tree->ast_node.riscv_clmul.rs1 = rs1; tree->ast_node.riscv_clmul.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x3) && ((binary_stream & 0x00000000FE000000)>>25 == 0x05)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_CLMULH ; + //------------------------------------------------------------ + + // ---------------------------RISCV_CLMULH------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x3) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x05)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_CLMULH; tree->ast_node.riscv_clmulh.rs2 = rs2; tree->ast_node.riscv_clmulh.rs1 = rs1; tree->ast_node.riscv_clmulh.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x2) && ((binary_stream & 0x00000000FE000000)>>25 == 0x05)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_CLMULR ; + //------------------------------------------------------------ + + // ---------------------------RISCV_CLMULR------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x05)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_CLMULR; tree->ast_node.riscv_clmulr.rs2 = rs2; tree->ast_node.riscv_clmulr.rs1 = rs1; tree->ast_node.riscv_clmulr.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FC000000)>>26 == 0x12)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t shamt = (binary_stream & 0x0000000003F00000)>>20 ; - tree->ast_node_type = RISCV_ZBS_IOP ; + //------------------------------------------------------------ + + // ---------------------------ZBS_IOP------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x12)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t shamt = (binary_stream & 0x0000000003F00000) >> 20; + tree->ast_node_type = RISCV_ZBS_IOP; tree->ast_node.zbs_iop.shamt = shamt; tree->ast_node.zbs_iop.rs1 = rs1; tree->ast_node.zbs_iop.rd = rd; tree->ast_node.zbs_iop.op = RISCV_BCLRI; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x5) && ((binary_stream & 0x00000000FC000000)>>26 == 0x12)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t shamt = (binary_stream & 0x0000000003F00000)>>20 ; - tree->ast_node_type = RISCV_ZBS_IOP ; + //------------------------------------------------------------ + + // ---------------------------ZBS_IOP------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x12)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t shamt = (binary_stream & 0x0000000003F00000) >> 20; + tree->ast_node_type = RISCV_ZBS_IOP; tree->ast_node.zbs_iop.shamt = shamt; tree->ast_node.zbs_iop.rs1 = rs1; tree->ast_node.zbs_iop.rd = rd; tree->ast_node.zbs_iop.op = RISCV_BEXTI; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FC000000)>>26 == 0x1A)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t shamt = (binary_stream & 0x0000000003F00000)>>20 ; - tree->ast_node_type = RISCV_ZBS_IOP ; + //------------------------------------------------------------ + + // ---------------------------ZBS_IOP------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x1A)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t shamt = (binary_stream & 0x0000000003F00000) >> 20; + tree->ast_node_type = RISCV_ZBS_IOP; tree->ast_node.zbs_iop.shamt = shamt; tree->ast_node.zbs_iop.rs1 = rs1; tree->ast_node.zbs_iop.rd = rd; tree->ast_node.zbs_iop.op = RISCV_BINVI; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FC000000)>>26 == 0x0A)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t shamt = (binary_stream & 0x0000000003F00000)>>20 ; - tree->ast_node_type = RISCV_ZBS_IOP ; + //------------------------------------------------------------ + + // ---------------------------ZBS_IOP------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x0A)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t shamt = (binary_stream & 0x0000000003F00000) >> 20; + tree->ast_node_type = RISCV_ZBS_IOP; tree->ast_node.zbs_iop.shamt = shamt; tree->ast_node.zbs_iop.rs1 = rs1; tree->ast_node.zbs_iop.rd = rd; tree->ast_node.zbs_iop.op = RISCV_BSETI; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FE000000)>>25 == 0x24)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_ZBS_RTYPE ; + //------------------------------------------------------------ + + // ---------------------------ZBS_RTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x24)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_ZBS_RTYPE; tree->ast_node.zbs_rtype.rs2 = rs2; tree->ast_node.zbs_rtype.rs1 = rs1; tree->ast_node.zbs_rtype.rd = rd; tree->ast_node.zbs_rtype.op = RISCV_BCLR; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x5) && ((binary_stream & 0x00000000FE000000)>>25 == 0x24)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_ZBS_RTYPE ; + //------------------------------------------------------------ + + // ---------------------------ZBS_RTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x24)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_ZBS_RTYPE; tree->ast_node.zbs_rtype.rs2 = rs2; tree->ast_node.zbs_rtype.rs1 = rs1; tree->ast_node.zbs_rtype.rd = rd; tree->ast_node.zbs_rtype.op = RISCV_BEXT; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FE000000)>>25 == 0x34)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_ZBS_RTYPE ; + //------------------------------------------------------------ + + // ---------------------------ZBS_RTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x34)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_ZBS_RTYPE; tree->ast_node.zbs_rtype.rs2 = rs2; tree->ast_node.zbs_rtype.rs1 = rs1; tree->ast_node.zbs_rtype.rd = rd; tree->ast_node.zbs_rtype.op = RISCV_BINV; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FE000000)>>25 == 0x14)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_ZBS_RTYPE ; + //------------------------------------------------------------ + + // ---------------------------ZBS_RTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x14)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_ZBS_RTYPE; tree->ast_node.zbs_rtype.rs2 = rs2; tree->ast_node.zbs_rtype.rs1 = rs1; tree->ast_node.zbs_rtype.rd = rd; tree->ast_node.zbs_rtype.op = RISCV_BSET; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x00000000FE000000)>>25 == 0x02)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_RM_TYPE_H ; - tree->ast_node.f_bin_rm_type_h.rs2 = rs2; - tree->ast_node.f_bin_rm_type_h.rs1 = rs1; - tree->ast_node.f_bin_rm_type_h.rm = rm; - tree->ast_node.f_bin_rm_type_h.rd = rd; - tree->ast_node.f_bin_rm_type_h.op = RISCV_FADD_H; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x00000000FE000000)>>25 == 0x06)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_RM_TYPE_H ; - tree->ast_node.f_bin_rm_type_h.rs2 = rs2; - tree->ast_node.f_bin_rm_type_h.rs1 = rs1; - tree->ast_node.f_bin_rm_type_h.rm = rm; - tree->ast_node.f_bin_rm_type_h.rd = rd; - tree->ast_node.f_bin_rm_type_h.op = RISCV_FSUB_H; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x00000000FE000000)>>25 == 0x0A)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_RM_TYPE_H ; - tree->ast_node.f_bin_rm_type_h.rs2 = rs2; - tree->ast_node.f_bin_rm_type_h.rs1 = rs1; - tree->ast_node.f_bin_rm_type_h.rm = rm; - tree->ast_node.f_bin_rm_type_h.rd = rd; - tree->ast_node.f_bin_rm_type_h.op = RISCV_FMUL_H; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x00000000FE000000)>>25 == 0x0E)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_RM_TYPE_H ; - tree->ast_node.f_bin_rm_type_h.rs2 = rs2; - tree->ast_node.f_bin_rm_type_h.rs1 = rs1; - tree->ast_node.f_bin_rm_type_h.rm = rm; - tree->ast_node.f_bin_rm_type_h.rd = rd; - tree->ast_node.f_bin_rm_type_h.op = RISCV_FDIV_H; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x43) && ((binary_stream & 0x0000000006000000)>>25 == 0x2)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t rs3 = (binary_stream & 0x00000000F8000000)>>27 ; - tree->ast_node_type = RISCV_F_MADD_TYPE_H ; - tree->ast_node.f_madd_type_h.rs3 = rs3; - tree->ast_node.f_madd_type_h.rs2 = rs2; - tree->ast_node.f_madd_type_h.rs1 = rs1; - tree->ast_node.f_madd_type_h.rm = rm; - tree->ast_node.f_madd_type_h.rd = rd; - tree->ast_node.f_madd_type_h.op = RISCV_FMADD_H; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x47) && ((binary_stream & 0x0000000006000000)>>25 == 0x2)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t rs3 = (binary_stream & 0x00000000F8000000)>>27 ; - tree->ast_node_type = RISCV_F_MADD_TYPE_H ; - tree->ast_node.f_madd_type_h.rs3 = rs3; - tree->ast_node.f_madd_type_h.rs2 = rs2; - tree->ast_node.f_madd_type_h.rs1 = rs1; - tree->ast_node.f_madd_type_h.rm = rm; - tree->ast_node.f_madd_type_h.rd = rd; - tree->ast_node.f_madd_type_h.op = RISCV_FMSUB_H; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x4B) && ((binary_stream & 0x0000000006000000)>>25 == 0x2)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t rs3 = (binary_stream & 0x00000000F8000000)>>27 ; - tree->ast_node_type = RISCV_F_MADD_TYPE_H ; - tree->ast_node.f_madd_type_h.rs3 = rs3; - tree->ast_node.f_madd_type_h.rs2 = rs2; - tree->ast_node.f_madd_type_h.rs1 = rs1; - tree->ast_node.f_madd_type_h.rm = rm; - tree->ast_node.f_madd_type_h.rd = rd; - tree->ast_node.f_madd_type_h.op = RISCV_FNMSUB_H; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x4F) && ((binary_stream & 0x0000000006000000)>>25 == 0x2)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t rs3 = (binary_stream & 0x00000000F8000000)>>27 ; - tree->ast_node_type = RISCV_F_MADD_TYPE_H ; - tree->ast_node.f_madd_type_h.rs3 = rs3; - tree->ast_node.f_madd_type_h.rs2 = rs2; - tree->ast_node.f_madd_type_h.rs1 = rs1; - tree->ast_node.f_madd_type_h.rm = rm; - tree->ast_node.f_madd_type_h.rd = rd; - tree->ast_node.f_madd_type_h.op = RISCV_FNMADD_H; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x00000000FE000000)>>25 == 0x12)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_TYPE_H ; + return; + } + } + //------------------------------------------------------------ + + // ---------------------------F_BIN_RM_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x02)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_RM_TYPE_H; + tree->ast_node.f_bin_rm_type_h.rs2 = rs2; + tree->ast_node.f_bin_rm_type_h.rs1 = rs1; + tree->ast_node.f_bin_rm_type_h.rm = rm; + tree->ast_node.f_bin_rm_type_h.rd = rd; + tree->ast_node.f_bin_rm_type_h.op = RISCV_FADD_H; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_BIN_RM_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x06)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_RM_TYPE_H; + tree->ast_node.f_bin_rm_type_h.rs2 = rs2; + tree->ast_node.f_bin_rm_type_h.rs1 = rs1; + tree->ast_node.f_bin_rm_type_h.rm = rm; + tree->ast_node.f_bin_rm_type_h.rd = rd; + tree->ast_node.f_bin_rm_type_h.op = RISCV_FSUB_H; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_BIN_RM_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x0A)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_RM_TYPE_H; + tree->ast_node.f_bin_rm_type_h.rs2 = rs2; + tree->ast_node.f_bin_rm_type_h.rs1 = rs1; + tree->ast_node.f_bin_rm_type_h.rm = rm; + tree->ast_node.f_bin_rm_type_h.rd = rd; + tree->ast_node.f_bin_rm_type_h.op = RISCV_FMUL_H; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_BIN_RM_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x0E)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_RM_TYPE_H; + tree->ast_node.f_bin_rm_type_h.rs2 = rs2; + tree->ast_node.f_bin_rm_type_h.rs1 = rs1; + tree->ast_node.f_bin_rm_type_h.rm = rm; + tree->ast_node.f_bin_rm_type_h.rd = rd; + tree->ast_node.f_bin_rm_type_h.op = RISCV_FDIV_H; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_MADD_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x43) && + (((binary_stream & 0x0000000006000000) >> 25) == 0x2)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t rs3 = (binary_stream & 0x00000000F8000000) >> 27; + tree->ast_node_type = RISCV_F_MADD_TYPE_H; + tree->ast_node.f_madd_type_h.rs3 = rs3; + tree->ast_node.f_madd_type_h.rs2 = rs2; + tree->ast_node.f_madd_type_h.rs1 = rs1; + tree->ast_node.f_madd_type_h.rm = rm; + tree->ast_node.f_madd_type_h.rd = rd; + tree->ast_node.f_madd_type_h.op = RISCV_FMADD_H; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_MADD_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x47) && + (((binary_stream & 0x0000000006000000) >> 25) == 0x2)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t rs3 = (binary_stream & 0x00000000F8000000) >> 27; + tree->ast_node_type = RISCV_F_MADD_TYPE_H; + tree->ast_node.f_madd_type_h.rs3 = rs3; + tree->ast_node.f_madd_type_h.rs2 = rs2; + tree->ast_node.f_madd_type_h.rs1 = rs1; + tree->ast_node.f_madd_type_h.rm = rm; + tree->ast_node.f_madd_type_h.rd = rd; + tree->ast_node.f_madd_type_h.op = RISCV_FMSUB_H; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_MADD_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x4B) && + (((binary_stream & 0x0000000006000000) >> 25) == 0x2)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t rs3 = (binary_stream & 0x00000000F8000000) >> 27; + tree->ast_node_type = RISCV_F_MADD_TYPE_H; + tree->ast_node.f_madd_type_h.rs3 = rs3; + tree->ast_node.f_madd_type_h.rs2 = rs2; + tree->ast_node.f_madd_type_h.rs1 = rs1; + tree->ast_node.f_madd_type_h.rm = rm; + tree->ast_node.f_madd_type_h.rd = rd; + tree->ast_node.f_madd_type_h.op = RISCV_FNMSUB_H; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_MADD_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x4F) && + (((binary_stream & 0x0000000006000000) >> 25) == 0x2)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t rs3 = (binary_stream & 0x00000000F8000000) >> 27; + tree->ast_node_type = RISCV_F_MADD_TYPE_H; + tree->ast_node.f_madd_type_h.rs3 = rs3; + tree->ast_node.f_madd_type_h.rs2 = rs2; + tree->ast_node.f_madd_type_h.rs1 = rs1; + tree->ast_node.f_madd_type_h.rm = rm; + tree->ast_node.f_madd_type_h.rd = rd; + tree->ast_node.f_madd_type_h.op = RISCV_FNMADD_H; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_BIN_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x12)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_TYPE_H; tree->ast_node.f_bin_type_h.rs2 = rs2; tree->ast_node.f_bin_type_h.rs1 = rs1; tree->ast_node.f_bin_type_h.rd = rd; tree->ast_node.f_bin_type_h.fle_h = RISCV_FSGNJ_H; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FE000000)>>25 == 0x12)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_TYPE_H ; + //------------------------------------------------------------ + + // ---------------------------F_BIN_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x12)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_TYPE_H; tree->ast_node.f_bin_type_h.rs2 = rs2; tree->ast_node.f_bin_type_h.rs1 = rs1; tree->ast_node.f_bin_type_h.rd = rd; tree->ast_node.f_bin_type_h.fle_h = RISCV_FSGNJN_H; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x2) && ((binary_stream & 0x00000000FE000000)>>25 == 0x12)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_TYPE_H ; + //------------------------------------------------------------ + + // ---------------------------F_BIN_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x12)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_TYPE_H; tree->ast_node.f_bin_type_h.rs2 = rs2; tree->ast_node.f_bin_type_h.rs1 = rs1; tree->ast_node.f_bin_type_h.rd = rd; tree->ast_node.f_bin_type_h.fle_h = RISCV_FSGNJX_H; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x00000000FE000000)>>25 == 0x16)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_TYPE_H ; + //------------------------------------------------------------ + + // ---------------------------F_BIN_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x16)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_TYPE_H; tree->ast_node.f_bin_type_h.rs2 = rs2; tree->ast_node.f_bin_type_h.rs1 = rs1; tree->ast_node.f_bin_type_h.rd = rd; tree->ast_node.f_bin_type_h.fle_h = RISCV_FMIN_H; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FE000000)>>25 == 0x16)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_TYPE_H ; + //------------------------------------------------------------ + + // ---------------------------F_BIN_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x16)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_TYPE_H; tree->ast_node.f_bin_type_h.rs2 = rs2; tree->ast_node.f_bin_type_h.rs1 = rs1; tree->ast_node.f_bin_type_h.rd = rd; tree->ast_node.f_bin_type_h.fle_h = RISCV_FMAX_H; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x2) && ((binary_stream & 0x00000000FE000000)>>25 == 0x52)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_TYPE_H ; + //------------------------------------------------------------ + + // ---------------------------F_BIN_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x52)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_TYPE_H; tree->ast_node.f_bin_type_h.rs2 = rs2; tree->ast_node.f_bin_type_h.rs1 = rs1; tree->ast_node.f_bin_type_h.rd = rd; tree->ast_node.f_bin_type_h.fle_h = RISCV_FEQ_H; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FE000000)>>25 == 0x52)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_TYPE_H ; + //------------------------------------------------------------ + + // ---------------------------F_BIN_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x52)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_TYPE_H; tree->ast_node.f_bin_type_h.rs2 = rs2; tree->ast_node.f_bin_type_h.rs1 = rs1; tree->ast_node.f_bin_type_h.rd = rd; tree->ast_node.f_bin_type_h.fle_h = RISCV_FLT_H; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x00000000FE000000)>>25 == 0x52)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_F_BIN_TYPE_H ; + //------------------------------------------------------------ + + // ---------------------------F_BIN_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x52)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_F_BIN_TYPE_H; tree->ast_node.f_bin_type_h.rs2 = rs2; tree->ast_node.f_bin_type_h.rs1 = rs1; tree->ast_node.f_bin_type_h.rd = rd; tree->ast_node.f_bin_type_h.fle_h = RISCV_FLE_H; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x00000000FE000000)>>25 == 0x2E)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_H ; - tree->ast_node.f_un_rm_type_h.rs1 = rs1; - tree->ast_node.f_un_rm_type_h.rm = rm; - tree->ast_node.f_un_rm_type_h.rd = rd; - tree->ast_node.f_un_rm_type_h.fcvt_h_lu = RISCV_FSQRT_H; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x00000000FE000000)>>25 == 0x62)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_H ; - tree->ast_node.f_un_rm_type_h.rs1 = rs1; - tree->ast_node.f_un_rm_type_h.rm = rm; - tree->ast_node.f_un_rm_type_h.rd = rd; - tree->ast_node.f_un_rm_type_h.fcvt_h_lu = RISCV_FCVT_W_H; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x01) && ((binary_stream & 0x00000000FE000000)>>25 == 0x62)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_H ; - tree->ast_node.f_un_rm_type_h.rs1 = rs1; - tree->ast_node.f_un_rm_type_h.rm = rm; - tree->ast_node.f_un_rm_type_h.rd = rd; - tree->ast_node.f_un_rm_type_h.fcvt_h_lu = RISCV_FCVT_WU_H; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x00000000FE000000)>>25 == 0x6A)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_H ; - tree->ast_node.f_un_rm_type_h.rs1 = rs1; - tree->ast_node.f_un_rm_type_h.rm = rm; - tree->ast_node.f_un_rm_type_h.rd = rd; - tree->ast_node.f_un_rm_type_h.fcvt_h_lu = RISCV_FCVT_H_W; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x01) && ((binary_stream & 0x00000000FE000000)>>25 == 0x6A)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_H ; - tree->ast_node.f_un_rm_type_h.rs1 = rs1; - tree->ast_node.f_un_rm_type_h.rm = rm; - tree->ast_node.f_un_rm_type_h.rd = rd; - tree->ast_node.f_un_rm_type_h.fcvt_h_lu = RISCV_FCVT_H_WU; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x00000000FE000000)>>25 == 0x22)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_H ; - tree->ast_node.f_un_rm_type_h.rs1 = rs1; - tree->ast_node.f_un_rm_type_h.rm = rm; - tree->ast_node.f_un_rm_type_h.rd = rd; - tree->ast_node.f_un_rm_type_h.fcvt_h_lu = RISCV_FCVT_H_S; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x01) && ((binary_stream & 0x00000000FE000000)>>25 == 0x22)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_H ; - tree->ast_node.f_un_rm_type_h.rs1 = rs1; - tree->ast_node.f_un_rm_type_h.rm = rm; - tree->ast_node.f_un_rm_type_h.rd = rd; - tree->ast_node.f_un_rm_type_h.fcvt_h_lu = RISCV_FCVT_H_D; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x02) && ((binary_stream & 0x00000000FE000000)>>25 == 0x20)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_H ; - tree->ast_node.f_un_rm_type_h.rs1 = rs1; - tree->ast_node.f_un_rm_type_h.rm = rm; - tree->ast_node.f_un_rm_type_h.rd = rd; - tree->ast_node.f_un_rm_type_h.fcvt_h_lu = RISCV_FCVT_S_H; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x02) && ((binary_stream & 0x00000000FE000000)>>25 == 0x21)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_H ; - tree->ast_node.f_un_rm_type_h.rs1 = rs1; - tree->ast_node.f_un_rm_type_h.rm = rm; - tree->ast_node.f_un_rm_type_h.rd = rd; - tree->ast_node.f_un_rm_type_h.fcvt_h_lu = RISCV_FCVT_D_H; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x02) && ((binary_stream & 0x00000000FE000000)>>25 == 0x62)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_H ; - tree->ast_node.f_un_rm_type_h.rs1 = rs1; - tree->ast_node.f_un_rm_type_h.rm = rm; - tree->ast_node.f_un_rm_type_h.rd = rd; - tree->ast_node.f_un_rm_type_h.fcvt_h_lu = RISCV_FCVT_L_H; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x03) && ((binary_stream & 0x00000000FE000000)>>25 == 0x62)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_H ; - tree->ast_node.f_un_rm_type_h.rs1 = rs1; - tree->ast_node.f_un_rm_type_h.rm = rm; - tree->ast_node.f_un_rm_type_h.rd = rd; - tree->ast_node.f_un_rm_type_h.fcvt_h_lu = RISCV_FCVT_LU_H; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x02) && ((binary_stream & 0x00000000FE000000)>>25 == 0x6A)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_H ; - tree->ast_node.f_un_rm_type_h.rs1 = rs1; - tree->ast_node.f_un_rm_type_h.rm = rm; - tree->ast_node.f_un_rm_type_h.rd = rd; - tree->ast_node.f_un_rm_type_h.fcvt_h_lu = RISCV_FCVT_H_L; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x03) && ((binary_stream & 0x00000000FE000000)>>25 == 0x6A)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_RM_TYPE_H ; - tree->ast_node.f_un_rm_type_h.rs1 = rs1; - tree->ast_node.f_un_rm_type_h.rm = rm; - tree->ast_node.f_un_rm_type_h.rd = rd; - tree->ast_node.f_un_rm_type_h.fcvt_h_lu = RISCV_FCVT_H_LU; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x00000000FE000000)>>25 == 0x72)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_TYPE_H ; - tree->ast_node.f_un_type_h.rs1 = rs1; - tree->ast_node.f_un_type_h.rd = rd; - tree->ast_node.f_un_type_h.fmv_h_x = RISCV_FCLASS_H; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x00000000FE000000)>>25 == 0x72)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_TYPE_H ; - tree->ast_node.f_un_type_h.rs1 = rs1; - tree->ast_node.f_un_type_h.rd = rd; - tree->ast_node.f_un_type_h.fmv_h_x = RISCV_FMV_X_H; - return ; + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x2E)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_H; + tree->ast_node.f_un_rm_type_h.rs1 = rs1; + tree->ast_node.f_un_rm_type_h.rm = rm; + tree->ast_node.f_un_rm_type_h.rd = rd; + tree->ast_node.f_un_rm_type_h.fcvt_h_lu = RISCV_FSQRT_H; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x62)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_H; + tree->ast_node.f_un_rm_type_h.rs1 = rs1; + tree->ast_node.f_un_rm_type_h.rm = rm; + tree->ast_node.f_un_rm_type_h.rd = rd; + tree->ast_node.f_un_rm_type_h.fcvt_h_lu = RISCV_FCVT_W_H; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x01) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x62)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_H; + tree->ast_node.f_un_rm_type_h.rs1 = rs1; + tree->ast_node.f_un_rm_type_h.rm = rm; + tree->ast_node.f_un_rm_type_h.rd = rd; + tree->ast_node.f_un_rm_type_h.fcvt_h_lu = RISCV_FCVT_WU_H; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x6A)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_H; + tree->ast_node.f_un_rm_type_h.rs1 = rs1; + tree->ast_node.f_un_rm_type_h.rm = rm; + tree->ast_node.f_un_rm_type_h.rd = rd; + tree->ast_node.f_un_rm_type_h.fcvt_h_lu = RISCV_FCVT_H_W; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x01) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x6A)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_H; + tree->ast_node.f_un_rm_type_h.rs1 = rs1; + tree->ast_node.f_un_rm_type_h.rm = rm; + tree->ast_node.f_un_rm_type_h.rd = rd; + tree->ast_node.f_un_rm_type_h.fcvt_h_lu = RISCV_FCVT_H_WU; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x22)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_H; + tree->ast_node.f_un_rm_type_h.rs1 = rs1; + tree->ast_node.f_un_rm_type_h.rm = rm; + tree->ast_node.f_un_rm_type_h.rd = rd; + tree->ast_node.f_un_rm_type_h.fcvt_h_lu = RISCV_FCVT_H_S; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x01) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x22)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_H; + tree->ast_node.f_un_rm_type_h.rs1 = rs1; + tree->ast_node.f_un_rm_type_h.rm = rm; + tree->ast_node.f_un_rm_type_h.rd = rd; + tree->ast_node.f_un_rm_type_h.fcvt_h_lu = RISCV_FCVT_H_D; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x02) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x20)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_H; + tree->ast_node.f_un_rm_type_h.rs1 = rs1; + tree->ast_node.f_un_rm_type_h.rm = rm; + tree->ast_node.f_un_rm_type_h.rd = rd; + tree->ast_node.f_un_rm_type_h.fcvt_h_lu = RISCV_FCVT_S_H; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x02) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x21)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_H; + tree->ast_node.f_un_rm_type_h.rs1 = rs1; + tree->ast_node.f_un_rm_type_h.rm = rm; + tree->ast_node.f_un_rm_type_h.rd = rd; + tree->ast_node.f_un_rm_type_h.fcvt_h_lu = RISCV_FCVT_D_H; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x02) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x62)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_H; + tree->ast_node.f_un_rm_type_h.rs1 = rs1; + tree->ast_node.f_un_rm_type_h.rm = rm; + tree->ast_node.f_un_rm_type_h.rd = rd; + tree->ast_node.f_un_rm_type_h.fcvt_h_lu = RISCV_FCVT_L_H; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x03) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x62)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_H; + tree->ast_node.f_un_rm_type_h.rs1 = rs1; + tree->ast_node.f_un_rm_type_h.rm = rm; + tree->ast_node.f_un_rm_type_h.rd = rd; + tree->ast_node.f_un_rm_type_h.fcvt_h_lu = RISCV_FCVT_LU_H; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x02) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x6A)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_H; + tree->ast_node.f_un_rm_type_h.rs1 = rs1; + tree->ast_node.f_un_rm_type_h.rm = rm; + tree->ast_node.f_un_rm_type_h.rd = rd; + tree->ast_node.f_un_rm_type_h.fcvt_h_lu = RISCV_FCVT_H_L; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_RM_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x03) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x6A)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_RM_TYPE_H; + tree->ast_node.f_un_rm_type_h.rs1 = rs1; + tree->ast_node.f_un_rm_type_h.rm = rm; + tree->ast_node.f_un_rm_type_h.rd = rd; + tree->ast_node.f_un_rm_type_h.fcvt_h_lu = RISCV_FCVT_H_LU; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x72)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_TYPE_H; + tree->ast_node.f_un_type_h.rs1 = rs1; + tree->ast_node.f_un_type_h.rd = rd; + tree->ast_node.f_un_type_h.fmv_h_x = RISCV_FCLASS_H; + return; + } + } + //------------------------------------------------------------ + + // ---------------------------F_UN_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x72)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_TYPE_H; + tree->ast_node.f_un_type_h.rs1 = rs1; + tree->ast_node.f_un_type_h.rd = rd; + tree->ast_node.f_un_type_h.fmv_h_x = RISCV_FMV_X_H; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x00000000FE000000)>>25 == 0x7A)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_F_UN_TYPE_H ; + //------------------------------------------------------------ + + // ---------------------------F_UN_TYPE_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x7A)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_F_UN_TYPE_H; tree->ast_node.f_un_type_h.rs1 = rs1; tree->ast_node.f_un_type_h.rd = rd; tree->ast_node.f_un_type_h.fmv_h_x = RISCV_FMV_H_X; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x0000000001F00000)>>20 == 0x01) && ((binary_stream & 0x00000000FE000000)>>25 == 0x7A)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_FLI_H ; + //------------------------------------------------------------ + + // ---------------------------RISCV_FLI_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x01) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x7A)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_FLI_H; tree->ast_node.riscv_fli_h.constantidx = rs1; tree->ast_node.riscv_fli_h.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x0000000001F00000)>>20 == 0x01) && ((binary_stream & 0x00000000FE000000)>>25 == 0x78)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_FLI_S ; + //------------------------------------------------------------ + + // ---------------------------RISCV_FLI_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x01) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x78)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_FLI_S; tree->ast_node.riscv_fli_s.constantidx = rs1; tree->ast_node.riscv_fli_s.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x0000000001F00000)>>20 == 0x01) && ((binary_stream & 0x00000000FE000000)>>25 == 0x79)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_FLI_D ; + //------------------------------------------------------------ + + // ---------------------------RISCV_FLI_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x01) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x79)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_FLI_D; tree->ast_node.riscv_fli_d.constantidx = rs1; tree->ast_node.riscv_fli_d.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x2) && ((binary_stream & 0x00000000FE000000)>>25 == 0x16)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_FMINM_H ; + //------------------------------------------------------------ + + // ---------------------------RISCV_FMINM_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x16)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_FMINM_H; tree->ast_node.riscv_fminm_h.rs2 = rs2; tree->ast_node.riscv_fminm_h.rs1 = rs1; tree->ast_node.riscv_fminm_h.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x3) && ((binary_stream & 0x00000000FE000000)>>25 == 0x16)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_FMAXM_H ; + //------------------------------------------------------------ + + // ---------------------------RISCV_FMAXM_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x3) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x16)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_FMAXM_H; tree->ast_node.riscv_fmaxm_h.rs2 = rs2; tree->ast_node.riscv_fmaxm_h.rs1 = rs1; tree->ast_node.riscv_fmaxm_h.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x2) && ((binary_stream & 0x00000000FE000000)>>25 == 0x14)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_FMINM_S ; + //------------------------------------------------------------ + + // ---------------------------RISCV_FMINM_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x14)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_FMINM_S; tree->ast_node.riscv_fminm_s.rs2 = rs2; tree->ast_node.riscv_fminm_s.rs1 = rs1; tree->ast_node.riscv_fminm_s.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x3) && ((binary_stream & 0x00000000FE000000)>>25 == 0x14)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_FMAXM_S ; + //------------------------------------------------------------ + + // ---------------------------RISCV_FMAXM_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x3) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x14)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_FMAXM_S; tree->ast_node.riscv_fmaxm_s.rs2 = rs2; tree->ast_node.riscv_fmaxm_s.rs1 = rs1; tree->ast_node.riscv_fmaxm_s.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x2) && ((binary_stream & 0x00000000FE000000)>>25 == 0x15)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_FMINM_D ; + //------------------------------------------------------------ + + // ---------------------------RISCV_FMINM_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x15)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_FMINM_D; tree->ast_node.riscv_fminm_d.rs2 = rs2; tree->ast_node.riscv_fminm_d.rs1 = rs1; tree->ast_node.riscv_fminm_d.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x3) && ((binary_stream & 0x00000000FE000000)>>25 == 0x15)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_FMAXM_D ; + //------------------------------------------------------------ + + // ---------------------------RISCV_FMAXM_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x3) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x15)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_FMAXM_D; tree->ast_node.riscv_fmaxm_d.rs2 = rs2; tree->ast_node.riscv_fmaxm_d.rs1 = rs1; tree->ast_node.riscv_fmaxm_d.rd = rd; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x04) && ((binary_stream & 0x00000000FE000000)>>25 == 0x22)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_FROUND_H ; - tree->ast_node.riscv_fround_h.rs1 = rs1; - tree->ast_node.riscv_fround_h.rm = rm; - tree->ast_node.riscv_fround_h.rd = rd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x05) && ((binary_stream & 0x00000000FE000000)>>25 == 0x22)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_FROUNDNX_H ; - tree->ast_node.riscv_froundnx_h.rs1 = rs1; - tree->ast_node.riscv_froundnx_h.rm = rm; - tree->ast_node.riscv_froundnx_h.rd = rd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x04) && ((binary_stream & 0x00000000FE000000)>>25 == 0x20)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_FROUND_S ; - tree->ast_node.riscv_fround_s.rs1 = rs1; - tree->ast_node.riscv_fround_s.rm = rm; - tree->ast_node.riscv_fround_s.rd = rd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x05) && ((binary_stream & 0x00000000FE000000)>>25 == 0x20)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_FROUNDNX_S ; - tree->ast_node.riscv_froundnx_s.rs1 = rs1; - tree->ast_node.riscv_froundnx_s.rm = rm; - tree->ast_node.riscv_froundnx_s.rd = rd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x04) && ((binary_stream & 0x00000000FE000000)>>25 == 0x21)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_FROUND_D ; - tree->ast_node.riscv_fround_d.rs1 = rs1; - tree->ast_node.riscv_fround_d.rm = rm; - tree->ast_node.riscv_fround_d.rd = rd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000001F00000)>>20 == 0x05) && ((binary_stream & 0x00000000FE000000)>>25 == 0x21)) { - uint64_t rm = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - rm = RISCV_RM_DYN ; - break; - case 0x1: - rm = RISCV_RM_RTZ ; - break; - case 0x3: - rm = RISCV_RM_RUP ; - break; - case 0x2: - rm = RISCV_RM_RDN ; - break; - case 0x4: - rm = RISCV_RM_RMM ; - break; - case 0x0: - rm = RISCV_RM_RNE ; - break; - - } - if (rm != 0xFFFFFFFFFFFFFFFF) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_FROUNDNX_D ; - tree->ast_node.riscv_froundnx_d.rs1 = rs1; - tree->ast_node.riscv_froundnx_d.rm = rm; - tree->ast_node.riscv_froundnx_d.rd = rd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x0000000001F00000)>>20 == 0x01) && ((binary_stream & 0x00000000FE000000)>>25 == 0x71)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_FMVH_X_D ; + return; + } + } + //------------------------------------------------------------ + + // ---------------------------RISCV_FROUND_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x04) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x22)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_FROUND_H; + tree->ast_node.riscv_fround_h.rs1 = rs1; + tree->ast_node.riscv_fround_h.rm = rm; + tree->ast_node.riscv_fround_h.rd = rd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------RISCV_FROUNDNX_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x05) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x22)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_FROUNDNX_H; + tree->ast_node.riscv_froundnx_h.rs1 = rs1; + tree->ast_node.riscv_froundnx_h.rm = rm; + tree->ast_node.riscv_froundnx_h.rd = rd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------RISCV_FROUND_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x04) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x20)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_FROUND_S; + tree->ast_node.riscv_fround_s.rs1 = rs1; + tree->ast_node.riscv_fround_s.rm = rm; + tree->ast_node.riscv_fround_s.rd = rd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------RISCV_FROUNDNX_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x05) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x20)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_FROUNDNX_S; + tree->ast_node.riscv_froundnx_s.rs1 = rs1; + tree->ast_node.riscv_froundnx_s.rm = rm; + tree->ast_node.riscv_froundnx_s.rd = rd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------RISCV_FROUND_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x04) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x21)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_FROUND_D; + tree->ast_node.riscv_fround_d.rs1 = rs1; + tree->ast_node.riscv_fround_d.rm = rm; + tree->ast_node.riscv_fround_d.rd = rd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------RISCV_FROUNDNX_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x05) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x21)) { + uint64_t rm = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + rm = RISCV_RM_DYN; + break; + case 0x1: + rm = RISCV_RM_RTZ; + break; + case 0x3: + rm = RISCV_RM_RUP; + break; + case 0x2: + rm = RISCV_RM_RDN; + break; + case 0x4: + rm = RISCV_RM_RMM; + break; + case 0x0: + rm = RISCV_RM_RNE; + break; + } + if (rm != 0xFFFFFFFFFFFFFFFF) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_FROUNDNX_D; + tree->ast_node.riscv_froundnx_d.rs1 = rs1; + tree->ast_node.riscv_froundnx_d.rm = rm; + tree->ast_node.riscv_froundnx_d.rd = rd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------RISCV_FMVH_X_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x01) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x71)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_FMVH_X_D; tree->ast_node.riscv_fmvh_x_d.rs1 = rs1; tree->ast_node.riscv_fmvh_x_d.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x00000000FE000000)>>25 == 0x59)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_FMVP_D_X ; + //------------------------------------------------------------ + + // ---------------------------RISCV_FMVP_D_X------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x59)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_FMVP_D_X; tree->ast_node.riscv_fmvp_d_x.rs2 = rs2; tree->ast_node.riscv_fmvp_d_x.rs1 = rs1; tree->ast_node.riscv_fmvp_d_x.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x4) && ((binary_stream & 0x00000000FE000000)>>25 == 0x52)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_FLEQ_H ; + //------------------------------------------------------------ + + // ---------------------------RISCV_FLEQ_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x4) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x52)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_FLEQ_H; tree->ast_node.riscv_fleq_h.rs2 = rs2; tree->ast_node.riscv_fleq_h.rs1 = rs1; tree->ast_node.riscv_fleq_h.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x5) && ((binary_stream & 0x00000000FE000000)>>25 == 0x52)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_FLTQ_H ; + //------------------------------------------------------------ + + // ---------------------------RISCV_FLTQ_H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x52)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_FLTQ_H; tree->ast_node.riscv_fltq_h.rs2 = rs2; tree->ast_node.riscv_fltq_h.rs1 = rs1; tree->ast_node.riscv_fltq_h.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x4) && ((binary_stream & 0x00000000FE000000)>>25 == 0x50)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_FLEQ_S ; + //------------------------------------------------------------ + + // ---------------------------RISCV_FLEQ_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x4) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x50)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_FLEQ_S; tree->ast_node.riscv_fleq_s.rs2 = rs2; tree->ast_node.riscv_fleq_s.rs1 = rs1; tree->ast_node.riscv_fleq_s.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x5) && ((binary_stream & 0x00000000FE000000)>>25 == 0x50)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_FLTQ_S ; + //------------------------------------------------------------ + + // ---------------------------RISCV_FLTQ_S------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x50)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_FLTQ_S; tree->ast_node.riscv_fltq_s.rs2 = rs2; tree->ast_node.riscv_fltq_s.rs1 = rs1; tree->ast_node.riscv_fltq_s.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x4) && ((binary_stream & 0x00000000FE000000)>>25 == 0x51)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_FLEQ_D ; + //------------------------------------------------------------ + + // ---------------------------RISCV_FLEQ_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x4) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x51)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_FLEQ_D; tree->ast_node.riscv_fleq_d.rs2 = rs2; tree->ast_node.riscv_fleq_d.rs1 = rs1; tree->ast_node.riscv_fleq_d.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x5) && ((binary_stream & 0x00000000FE000000)>>25 == 0x51)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_FLTQ_D ; + //------------------------------------------------------------ + + // ---------------------------RISCV_FLTQ_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x51)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_FLTQ_D; tree->ast_node.riscv_fltq_d.rs2 = rs2; tree->ast_node.riscv_fltq_d.rs1 = rs1; tree->ast_node.riscv_fltq_d.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x53) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x0000000001F00000)>>20 == 0x08) && ((binary_stream & 0x00000000FE000000)>>25 == 0x61)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_FCVTMOD_W_D ; + //------------------------------------------------------------ + + // ---------------------------RISCV_FCVTMOD_W_D------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x53) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x08) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x61)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_FCVTMOD_W_D; tree->ast_node.riscv_fcvtmod_w_d.rs1 = rs1; tree->ast_node.riscv_fcvtmod_w_d.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x000000003E000000)>>25 == 0x08) && ((binary_stream & 0x00000000C0000000)>>30 == 0x0)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_SHA256SUM0 ; + //------------------------------------------------------------ + + // ---------------------------SHA256SUM0------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x000000003E000000) >> 25) == 0x08) && + (((binary_stream & 0x00000000C0000000) >> 30) == 0x0)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_SHA256SUM0; tree->ast_node.sha256sum0.rs1 = rs1; tree->ast_node.sha256sum0.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x0000000001F00000)>>20 == 0x01) && ((binary_stream & 0x000000003E000000)>>25 == 0x08) && ((binary_stream & 0x00000000C0000000)>>30 == 0x0)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_SHA256SUM1 ; + //------------------------------------------------------------ + + // ---------------------------SHA256SUM1------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x01) && + (((binary_stream & 0x000000003E000000) >> 25) == 0x08) && + (((binary_stream & 0x00000000C0000000) >> 30) == 0x0)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_SHA256SUM1; tree->ast_node.sha256sum1.rs1 = rs1; tree->ast_node.sha256sum1.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x0000000001F00000)>>20 == 0x02) && ((binary_stream & 0x000000003E000000)>>25 == 0x08) && ((binary_stream & 0x00000000C0000000)>>30 == 0x0)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_SHA256SIG0 ; + //------------------------------------------------------------ + + // ---------------------------SHA256SIG0------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x02) && + (((binary_stream & 0x000000003E000000) >> 25) == 0x08) && + (((binary_stream & 0x00000000C0000000) >> 30) == 0x0)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_SHA256SIG0; tree->ast_node.sha256sig0.rs1 = rs1; tree->ast_node.sha256sig0.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x0000000001F00000)>>20 == 0x03) && ((binary_stream & 0x000000003E000000)>>25 == 0x08) && ((binary_stream & 0x00000000C0000000)>>30 == 0x0)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_SHA256SIG1 ; + //------------------------------------------------------------ + + // ---------------------------SHA256SIG1------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x03) && + (((binary_stream & 0x000000003E000000) >> 25) == 0x08) && + (((binary_stream & 0x00000000C0000000) >> 30) == 0x0)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_SHA256SIG1; tree->ast_node.sha256sig1.rs1 = rs1; tree->ast_node.sha256sig1.rd = rd; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x000000003E000000)>>25 == 0x13)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t bs = (binary_stream & 0x00000000C0000000)>>30 ; - tree->ast_node_type = RISCV_AES32ESMI ; + return; + } + } + //------------------------------------------------------------ + + // ---------------------------AES32ESMI------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x000000003E000000) >> 25) == 0x13)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t bs = (binary_stream & 0x00000000C0000000) >> 30; + tree->ast_node_type = RISCV_AES32ESMI; tree->ast_node.aes32esmi.bs = bs; tree->ast_node.aes32esmi.rs2 = rs2; tree->ast_node.aes32esmi.rs1 = rs1; tree->ast_node.aes32esmi.rd = rd; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x000000003E000000)>>25 == 0x11)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t bs = (binary_stream & 0x00000000C0000000)>>30 ; - tree->ast_node_type = RISCV_AES32ESI ; + return; + } + } + //------------------------------------------------------------ + + // ---------------------------AES32ESI------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x000000003E000000) >> 25) == 0x11)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t bs = (binary_stream & 0x00000000C0000000) >> 30; + tree->ast_node_type = RISCV_AES32ESI; tree->ast_node.aes32esi.bs = bs; tree->ast_node.aes32esi.rs2 = rs2; tree->ast_node.aes32esi.rs1 = rs1; tree->ast_node.aes32esi.rd = rd; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x000000003E000000)>>25 == 0x17)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t bs = (binary_stream & 0x00000000C0000000)>>30 ; - tree->ast_node_type = RISCV_AES32DSMI ; + return; + } + } + //------------------------------------------------------------ + + // ---------------------------AES32DSMI------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x000000003E000000) >> 25) == 0x17)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t bs = (binary_stream & 0x00000000C0000000) >> 30; + tree->ast_node_type = RISCV_AES32DSMI; tree->ast_node.aes32dsmi.bs = bs; tree->ast_node.aes32dsmi.rs2 = rs2; tree->ast_node.aes32dsmi.rs1 = rs1; tree->ast_node.aes32dsmi.rd = rd; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x000000003E000000)>>25 == 0x15)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t bs = (binary_stream & 0x00000000C0000000)>>30 ; - tree->ast_node_type = RISCV_AES32DSI ; + return; + } + } + //------------------------------------------------------------ + + // ---------------------------AES32DSI------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x000000003E000000) >> 25) == 0x15)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t bs = (binary_stream & 0x00000000C0000000) >> 30; + tree->ast_node_type = RISCV_AES32DSI; tree->ast_node.aes32dsi.bs = bs; tree->ast_node.aes32dsi.rs2 = rs2; tree->ast_node.aes32dsi.rs1 = rs1; tree->ast_node.aes32dsi.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x000000003E000000)>>25 == 0x08) && ((binary_stream & 0x00000000C0000000)>>30 == 0x1)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_SHA512SUM0R ; + //------------------------------------------------------------ + + // ---------------------------SHA512SUM0R------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x000000003E000000) >> 25) == 0x08) && + (((binary_stream & 0x00000000C0000000) >> 30) == 0x1)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_SHA512SUM0R; tree->ast_node.sha512sum0r.rs2 = rs2; tree->ast_node.sha512sum0r.rs1 = rs1; tree->ast_node.sha512sum0r.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x000000003E000000)>>25 == 0x09) && ((binary_stream & 0x00000000C0000000)>>30 == 0x1)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_SHA512SUM1R ; + //------------------------------------------------------------ + + // ---------------------------SHA512SUM1R------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x000000003E000000) >> 25) == 0x09) && + (((binary_stream & 0x00000000C0000000) >> 30) == 0x1)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_SHA512SUM1R; tree->ast_node.sha512sum1r.rs2 = rs2; tree->ast_node.sha512sum1r.rs1 = rs1; tree->ast_node.sha512sum1r.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x000000003E000000)>>25 == 0x0A) && ((binary_stream & 0x00000000C0000000)>>30 == 0x1)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_SHA512SIG0L ; + //------------------------------------------------------------ + + // ---------------------------SHA512SIG0L------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x000000003E000000) >> 25) == 0x0A) && + (((binary_stream & 0x00000000C0000000) >> 30) == 0x1)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_SHA512SIG0L; tree->ast_node.sha512sig0l.rs2 = rs2; tree->ast_node.sha512sig0l.rs1 = rs1; tree->ast_node.sha512sig0l.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x000000003E000000)>>25 == 0x0E) && ((binary_stream & 0x00000000C0000000)>>30 == 0x1)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_SHA512SIG0H ; + //------------------------------------------------------------ + + // ---------------------------SHA512SIG0H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x000000003E000000) >> 25) == 0x0E) && + (((binary_stream & 0x00000000C0000000) >> 30) == 0x1)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_SHA512SIG0H; tree->ast_node.sha512sig0h.rs2 = rs2; tree->ast_node.sha512sig0h.rs1 = rs1; tree->ast_node.sha512sig0h.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x000000003E000000)>>25 == 0x0B) && ((binary_stream & 0x00000000C0000000)>>30 == 0x1)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_SHA512SIG1L ; + //------------------------------------------------------------ + + // ---------------------------SHA512SIG1L------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x000000003E000000) >> 25) == 0x0B) && + (((binary_stream & 0x00000000C0000000) >> 30) == 0x1)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_SHA512SIG1L; tree->ast_node.sha512sig1l.rs2 = rs2; tree->ast_node.sha512sig1l.rs1 = rs1; tree->ast_node.sha512sig1l.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x000000003E000000)>>25 == 0x0F) && ((binary_stream & 0x00000000C0000000)>>30 == 0x1)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_SHA512SIG1H ; + //------------------------------------------------------------ + + // ---------------------------SHA512SIG1H------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x000000003E000000) >> 25) == 0x0F) && + (((binary_stream & 0x00000000C0000000) >> 30) == 0x1)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_SHA512SIG1H; tree->ast_node.sha512sig1h.rs2 = rs2; tree->ast_node.sha512sig1h.rs1 = rs1; tree->ast_node.sha512sig1h.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x0000000001000000)>>24 == 0x1) && ((binary_stream & 0x000000003E000000)>>25 == 0x18) && ((binary_stream & 0x00000000C0000000)>>30 == 0x0)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rnum = (binary_stream & 0x0000000000F00000)>>20 ; - tree->ast_node_type = RISCV_AES64KS1I ; + //------------------------------------------------------------ + + // ---------------------------AES64KS1I------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x0000000001000000) >> 24) == 0x1) && + (((binary_stream & 0x000000003E000000) >> 25) == 0x18) && + (((binary_stream & 0x00000000C0000000) >> 30) == 0x0)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rnum = (binary_stream & 0x0000000000F00000) >> 20; + tree->ast_node_type = RISCV_AES64KS1I; tree->ast_node.aes64ks1i.rnum = rnum; tree->ast_node.aes64ks1i.rs1 = rs1; tree->ast_node.aes64ks1i.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x000000003E000000)>>25 == 0x18) && ((binary_stream & 0x00000000C0000000)>>30 == 0x0)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_AES64IM ; + //------------------------------------------------------------ + + // ---------------------------AES64IM------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x000000003E000000) >> 25) == 0x18) && + (((binary_stream & 0x00000000C0000000) >> 30) == 0x0)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_AES64IM; tree->ast_node.aes64im.rs1 = rs1; tree->ast_node.aes64im.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x000000003E000000)>>25 == 0x1F) && ((binary_stream & 0x00000000C0000000)>>30 == 0x1)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_AES64KS2 ; + //------------------------------------------------------------ + + // ---------------------------AES64KS2------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x000000003E000000) >> 25) == 0x1F) && + (((binary_stream & 0x00000000C0000000) >> 30) == 0x1)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_AES64KS2; tree->ast_node.aes64ks2.rs2 = rs2; tree->ast_node.aes64ks2.rs1 = rs1; tree->ast_node.aes64ks2.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x000000003E000000)>>25 == 0x1B) && ((binary_stream & 0x00000000C0000000)>>30 == 0x0)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_AES64ESM ; + //------------------------------------------------------------ + + // ---------------------------AES64ESM------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x000000003E000000) >> 25) == 0x1B) && + (((binary_stream & 0x00000000C0000000) >> 30) == 0x0)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_AES64ESM; tree->ast_node.aes64esm.rs2 = rs2; tree->ast_node.aes64esm.rs1 = rs1; tree->ast_node.aes64esm.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x000000003E000000)>>25 == 0x19) && ((binary_stream & 0x00000000C0000000)>>30 == 0x0)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_AES64ES ; + //------------------------------------------------------------ + + // ---------------------------AES64ES------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x000000003E000000) >> 25) == 0x19) && + (((binary_stream & 0x00000000C0000000) >> 30) == 0x0)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_AES64ES; tree->ast_node.aes64es.rs2 = rs2; tree->ast_node.aes64es.rs1 = rs1; tree->ast_node.aes64es.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x000000003E000000)>>25 == 0x1F) && ((binary_stream & 0x00000000C0000000)>>30 == 0x0)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_AES64DSM ; + //------------------------------------------------------------ + + // ---------------------------AES64DSM------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x000000003E000000) >> 25) == 0x1F) && + (((binary_stream & 0x00000000C0000000) >> 30) == 0x0)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_AES64DSM; tree->ast_node.aes64dsm.rs2 = rs2; tree->ast_node.aes64dsm.rs1 = rs1; tree->ast_node.aes64dsm.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x000000003E000000)>>25 == 0x1D) && ((binary_stream & 0x00000000C0000000)>>30 == 0x0)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_AES64DS ; + //------------------------------------------------------------ + + // ---------------------------AES64DS------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x000000003E000000) >> 25) == 0x1D) && + (((binary_stream & 0x00000000C0000000) >> 30) == 0x0)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_AES64DS; tree->ast_node.aes64ds.rs2 = rs2; tree->ast_node.aes64ds.rs1 = rs1; tree->ast_node.aes64ds.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x0000000001F00000)>>20 == 0x04) && ((binary_stream & 0x000000003E000000)>>25 == 0x08) && ((binary_stream & 0x00000000C0000000)>>30 == 0x0)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_SHA512SUM0 ; + //------------------------------------------------------------ + + // ---------------------------SHA512SUM0------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x04) && + (((binary_stream & 0x000000003E000000) >> 25) == 0x08) && + (((binary_stream & 0x00000000C0000000) >> 30) == 0x0)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_SHA512SUM0; tree->ast_node.sha512sum0.rs1 = rs1; tree->ast_node.sha512sum0.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x0000000001F00000)>>20 == 0x05) && ((binary_stream & 0x000000003E000000)>>25 == 0x08) && ((binary_stream & 0x00000000C0000000)>>30 == 0x0)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_SHA512SUM1 ; + //------------------------------------------------------------ + + // ---------------------------SHA512SUM1------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x05) && + (((binary_stream & 0x000000003E000000) >> 25) == 0x08) && + (((binary_stream & 0x00000000C0000000) >> 30) == 0x0)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_SHA512SUM1; tree->ast_node.sha512sum1.rs1 = rs1; tree->ast_node.sha512sum1.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x0000000001F00000)>>20 == 0x06) && ((binary_stream & 0x000000003E000000)>>25 == 0x08) && ((binary_stream & 0x00000000C0000000)>>30 == 0x0)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_SHA512SIG0 ; + //------------------------------------------------------------ + + // ---------------------------SHA512SIG0------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x06) && + (((binary_stream & 0x000000003E000000) >> 25) == 0x08) && + (((binary_stream & 0x00000000C0000000) >> 30) == 0x0)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_SHA512SIG0; tree->ast_node.sha512sig0.rs1 = rs1; tree->ast_node.sha512sig0.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x0000000001F00000)>>20 == 0x07) && ((binary_stream & 0x000000003E000000)>>25 == 0x08) && ((binary_stream & 0x00000000C0000000)>>30 == 0x0)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_SHA512SIG1 ; + //------------------------------------------------------------ + + // ---------------------------SHA512SIG1------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x07) && + (((binary_stream & 0x000000003E000000) >> 25) == 0x08) && + (((binary_stream & 0x00000000C0000000) >> 30) == 0x0)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_SHA512SIG1; tree->ast_node.sha512sig1.rs1 = rs1; tree->ast_node.sha512sig1.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x0000000001F00000)>>20 == 0x08) && ((binary_stream & 0x000000003E000000)>>25 == 0x08) && ((binary_stream & 0x00000000C0000000)>>30 == 0x0)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_SM3P0 ; + //------------------------------------------------------------ + + // ---------------------------SM3P0------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x08) && + (((binary_stream & 0x000000003E000000) >> 25) == 0x08) && + (((binary_stream & 0x00000000C0000000) >> 30) == 0x0)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_SM3P0; tree->ast_node.sm3p0.rs1 = rs1; tree->ast_node.sm3p0.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x0000000001F00000)>>20 == 0x09) && ((binary_stream & 0x000000003E000000)>>25 == 0x08) && ((binary_stream & 0x00000000C0000000)>>30 == 0x0)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_SM3P1 ; + //------------------------------------------------------------ + + // ---------------------------SM3P1------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x09) && + (((binary_stream & 0x000000003E000000) >> 25) == 0x08) && + (((binary_stream & 0x00000000C0000000) >> 30) == 0x0)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_SM3P1; tree->ast_node.sm3p1.rs1 = rs1; tree->ast_node.sm3p1.rd = rd; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x000000003E000000)>>25 == 0x18)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t bs = (binary_stream & 0x00000000C0000000)>>30 ; - tree->ast_node_type = RISCV_SM4ED ; + return; + } + } + //------------------------------------------------------------ + + // ---------------------------SM4ED------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x000000003E000000) >> 25) == 0x18)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t bs = (binary_stream & 0x00000000C0000000) >> 30; + tree->ast_node_type = RISCV_SM4ED; tree->ast_node.sm4ed.bs = bs; tree->ast_node.sm4ed.rs2 = rs2; tree->ast_node.sm4ed.rs1 = rs1; tree->ast_node.sm4ed.rd = rd; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x000000003E000000)>>25 == 0x1A)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t bs = (binary_stream & 0x00000000C0000000)>>30 ; - tree->ast_node_type = RISCV_SM4KS ; + return; + } + } + //------------------------------------------------------------ + + // ---------------------------SM4KS------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x000000003E000000) >> 25) == 0x1A)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t bs = (binary_stream & 0x00000000C0000000) >> 30; + tree->ast_node_type = RISCV_SM4KS; tree->ast_node.sm4ks.bs = bs; tree->ast_node.sm4ks.rs2 = rs2; tree->ast_node.sm4ks.rs1 = rs1; tree->ast_node.sm4ks.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x4) && ((binary_stream & 0x00000000FE000000)>>25 == 0x04)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_ZBKB_RTYPE ; + //------------------------------------------------------------ + + // ---------------------------ZBKB_RTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x4) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x04)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_ZBKB_RTYPE; tree->ast_node.zbkb_rtype.rs2 = rs2; tree->ast_node.zbkb_rtype.rs1 = rs1; tree->ast_node.zbkb_rtype.rd = rd; tree->ast_node.zbkb_rtype.op = RISCV_PACK; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x7) && ((binary_stream & 0x00000000FE000000)>>25 == 0x04)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_ZBKB_RTYPE ; + //------------------------------------------------------------ + + // ---------------------------ZBKB_RTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x7) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x04)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_ZBKB_RTYPE; tree->ast_node.zbkb_rtype.rs2 = rs2; tree->ast_node.zbkb_rtype.rs1 = rs1; tree->ast_node.zbkb_rtype.rd = rd; tree->ast_node.zbkb_rtype.op = RISCV_PACKH; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x3B) && ((binary_stream & 0x0000000000007000)>>12 == 0x4) && ((binary_stream & 0x00000000FE000000)>>25 == 0x04)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_ZBKB_PACKW ; + //------------------------------------------------------------ + + // ---------------------------ZBKB_PACKW------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x3B) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x4) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x04)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_ZBKB_PACKW; tree->ast_node.zbkb_packw.rs2 = rs2; tree->ast_node.zbkb_packw.rs1 = rs1; tree->ast_node.zbkb_packw.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FFF00000)>>20 == 0x08F)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_ZIP ; + //------------------------------------------------------------ + + // ---------------------------RISCV_ZIP------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FFF00000) >> 20) == 0x08F)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_ZIP; tree->ast_node.riscv_zip.rs1 = rs1; tree->ast_node.riscv_zip.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x5) && ((binary_stream & 0x00000000FFF00000)>>20 == 0x08F)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_UNZIP ; + //------------------------------------------------------------ + + // ---------------------------RISCV_UNZIP------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5) && + (((binary_stream & 0x00000000FFF00000) >> 20) == 0x08F)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_UNZIP; tree->ast_node.riscv_unzip.rs1 = rs1; tree->ast_node.riscv_unzip.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x13) && ((binary_stream & 0x0000000000007000)>>12 == 0x5) && ((binary_stream & 0x00000000FFF00000)>>20 == 0x687)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_BREV8 ; + //------------------------------------------------------------ + + // ---------------------------RISCV_BREV8------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x13) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5) && + (((binary_stream & 0x00000000FFF00000) >> 20) == 0x687)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_BREV8; tree->ast_node.riscv_brev8.rs1 = rs1; tree->ast_node.riscv_brev8.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x4) && ((binary_stream & 0x00000000FE000000)>>25 == 0x14)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_XPERM8 ; + //------------------------------------------------------------ + + // ---------------------------RISCV_XPERM8------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x4) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x14)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_XPERM8; tree->ast_node.riscv_xperm8.rs2 = rs2; tree->ast_node.riscv_xperm8.rs1 = rs1; tree->ast_node.riscv_xperm8.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x2) && ((binary_stream & 0x00000000FE000000)>>25 == 0x14)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_XPERM4 ; + //------------------------------------------------------------ + + // ---------------------------RISCV_XPERM4------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x14)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_XPERM4; tree->ast_node.riscv_xperm4.rs2 = rs2; tree->ast_node.riscv_xperm4.rs1 = rs1; tree->ast_node.riscv_xperm4.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x5) && ((binary_stream & 0x00000000FE000000)>>25 == 0x07)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_ZICOND_RTYPE ; + //------------------------------------------------------------ + + // ---------------------------ZICOND_RTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x07)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_ZICOND_RTYPE; tree->ast_node.zicond_rtype.rs2 = rs2; tree->ast_node.zicond_rtype.rs1 = rs1; tree->ast_node.zicond_rtype.rd = rd; tree->ast_node.zicond_rtype.riscv_czero_nez = RISCV_CZERO_EQZ; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x33) && ((binary_stream & 0x0000000000007000)>>12 == 0x7) && ((binary_stream & 0x00000000FE000000)>>25 == 0x07)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_ZICOND_RTYPE ; + //------------------------------------------------------------ + + // ---------------------------ZICOND_RTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x33) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x7) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x07)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_ZICOND_RTYPE; tree->ast_node.zicond_rtype.rs2 = rs2; tree->ast_node.zicond_rtype.rs1 = rs1; tree->ast_node.zicond_rtype.rd = rd; tree->ast_node.zicond_rtype.riscv_czero_nez = RISCV_CZERO_NEZ; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x7) && ((binary_stream & 0x00000000F0000000)>>28 == 0x0)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t lmul = (binary_stream & 0x0000000000700000)>>20 ; - uint64_t sew = (binary_stream & 0x0000000003800000)>>23 ; - uint64_t ta = (binary_stream & 0x0000000004000000)>>26 ; - uint64_t ma = (binary_stream & 0x0000000008000000)>>27 ; - tree->ast_node_type = RISCV_VSETVLI ; + return; + } + } + //------------------------------------------------------------ + + // ---------------------------VSETVLI------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x7) && + (((binary_stream & 0x00000000F0000000) >> 28) == 0x0)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t lmul = (binary_stream & 0x0000000000700000) >> 20; + uint64_t sew = (binary_stream & 0x0000000003800000) >> 23; + uint64_t ta = (binary_stream & 0x0000000004000000) >> 26; + uint64_t ma = (binary_stream & 0x0000000008000000) >> 27; + tree->ast_node_type = RISCV_VSETVLI; tree->ast_node.vsetvli.ma = ma; tree->ast_node.vsetvli.ta = ta; tree->ast_node.vsetvli.sew = sew; tree->ast_node.vsetvli.lmul = lmul; tree->ast_node.vsetvli.rs1 = rs1; tree->ast_node.vsetvli.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x7) && ((binary_stream & 0x00000000FE000000)>>25 == 0x40)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_VSETVL ; + //------------------------------------------------------------ + + // ---------------------------VSETVL------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x7) && + (((binary_stream & 0x00000000FE000000) >> 25) == 0x40)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_VSETVL; tree->ast_node.vsetvl.rs2 = rs2; tree->ast_node.vsetvl.rs1 = rs1; tree->ast_node.vsetvl.rd = rd; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x7) && ((binary_stream & 0x00000000F0000000)>>28 == 0xC)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t uimm = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t lmul = (binary_stream & 0x0000000000700000)>>20 ; - uint64_t sew = (binary_stream & 0x0000000003800000)>>23 ; - uint64_t ta = (binary_stream & 0x0000000004000000)>>26 ; - uint64_t ma = (binary_stream & 0x0000000008000000)>>27 ; - tree->ast_node_type = RISCV_VSETIVLI ; + return; + } + } + //------------------------------------------------------------ + + // ---------------------------VSETIVLI------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x7) && + (((binary_stream & 0x00000000F0000000) >> 28) == 0xC)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t uimm = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t lmul = (binary_stream & 0x0000000000700000) >> 20; + uint64_t sew = (binary_stream & 0x0000000003800000) >> 23; + uint64_t ta = (binary_stream & 0x0000000004000000) >> 26; + uint64_t ma = (binary_stream & 0x0000000008000000) >> 27; + tree->ast_node_type = RISCV_VSETIVLI; tree->ast_node.vsetivli.ma = ma; tree->ast_node.vsetivli.ta = ta; tree->ast_node.vsetivli.sew = sew; tree->ast_node.vsetivli.lmul = lmul; tree->ast_node.vsetivli.uimm = uimm; tree->ast_node.vsetivli.rd = rd; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x0)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x06: - funct6 = RISCV_VV_VMAXU ; - break; - case 0x25: - funct6 = RISCV_VV_VSLL ; - break; - case 0x23: - funct6 = RISCV_VV_VSSUB ; - break; - case 0x09: - funct6 = RISCV_VV_VAND ; - break; - case 0x00: - funct6 = RISCV_VV_VADD ; - break; - case 0x0A: - funct6 = RISCV_VV_VOR ; - break; - case 0x0C: - funct6 = RISCV_VV_VRGATHER ; - break; - case 0x2B: - funct6 = RISCV_VV_VSSRA ; - break; - case 0x02: - funct6 = RISCV_VV_VSUB ; - break; - case 0x20: - funct6 = RISCV_VV_VSADDU ; - break; - case 0x28: - funct6 = RISCV_VV_VSRL ; - break; - case 0x0B: - funct6 = RISCV_VV_VXOR ; - break; - case 0x07: - funct6 = RISCV_VV_VMAX ; - break; - case 0x04: - funct6 = RISCV_VV_VMINU ; - break; - case 0x22: - funct6 = RISCV_VV_VSSUBU ; - break; - case 0x27: - funct6 = RISCV_VV_VSMUL ; - break; - case 0x0E: - funct6 = RISCV_VV_VRGATHEREI16 ; - break; - case 0x2A: - funct6 = RISCV_VV_VSSRL ; - break; - case 0x05: - funct6 = RISCV_VV_VMIN ; - break; - case 0x21: - funct6 = RISCV_VV_VSADD ; - break; - case 0x29: - funct6 = RISCV_VV_VSRA ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_VVTYPE ; - tree->ast_node.vvtype.funct6 = funct6; - tree->ast_node.vvtype.vm = vm; - tree->ast_node.vvtype.vs2 = vs2; - tree->ast_node.vvtype.vs1 = vs1; - tree->ast_node.vvtype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x0)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x2C: - funct6 = RISCV_NVS_VNSRL ; - break; - case 0x2D: - funct6 = RISCV_NVS_VNSRA ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_NVSTYPE ; - tree->ast_node.nvstype.funct6 = funct6; - tree->ast_node.nvstype.vm = vm; - tree->ast_node.nvstype.vs2 = vs2; - tree->ast_node.nvstype.vs1 = vs1; - tree->ast_node.nvstype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x0)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x2E: - funct6 = RISCV_NV_VNCLIPU ; - break; - case 0x2F: - funct6 = RISCV_NV_VNCLIP ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_NVTYPE ; - tree->ast_node.nvtype.funct6 = funct6; - tree->ast_node.nvtype.vm = vm; - tree->ast_node.nvtype.vs2 = vs2; - tree->ast_node.nvtype.vs1 = vs1; - tree->ast_node.nvtype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x0000000002000000)>>25 == 0x0) && ((binary_stream & 0x00000000FC000000)>>26 == 0x17)) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_MASKTYPEV ; + return; + } + } + //------------------------------------------------------------ + + // ---------------------------VVTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x06: + funct6 = RISCV_VV_VMAXU; + break; + case 0x25: + funct6 = RISCV_VV_VSLL; + break; + case 0x23: + funct6 = RISCV_VV_VSSUB; + break; + case 0x09: + funct6 = RISCV_VV_VAND; + break; + case 0x00: + funct6 = RISCV_VV_VADD; + break; + case 0x0A: + funct6 = RISCV_VV_VOR; + break; + case 0x0C: + funct6 = RISCV_VV_VRGATHER; + break; + case 0x2B: + funct6 = RISCV_VV_VSSRA; + break; + case 0x02: + funct6 = RISCV_VV_VSUB; + break; + case 0x20: + funct6 = RISCV_VV_VSADDU; + break; + case 0x28: + funct6 = RISCV_VV_VSRL; + break; + case 0x0B: + funct6 = RISCV_VV_VXOR; + break; + case 0x07: + funct6 = RISCV_VV_VMAX; + break; + case 0x04: + funct6 = RISCV_VV_VMINU; + break; + case 0x22: + funct6 = RISCV_VV_VSSUBU; + break; + case 0x27: + funct6 = RISCV_VV_VSMUL; + break; + case 0x0E: + funct6 = RISCV_VV_VRGATHEREI16; + break; + case 0x2A: + funct6 = RISCV_VV_VSSRL; + break; + case 0x05: + funct6 = RISCV_VV_VMIN; + break; + case 0x21: + funct6 = RISCV_VV_VSADD; + break; + case 0x29: + funct6 = RISCV_VV_VSRA; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_VVTYPE; + tree->ast_node.vvtype.funct6 = funct6; + tree->ast_node.vvtype.vm = vm; + tree->ast_node.vvtype.vs2 = vs2; + tree->ast_node.vvtype.vs1 = vs1; + tree->ast_node.vvtype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------NVSTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x2C: + funct6 = RISCV_NVS_VNSRL; + break; + case 0x2D: + funct6 = RISCV_NVS_VNSRA; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_NVSTYPE; + tree->ast_node.nvstype.funct6 = funct6; + tree->ast_node.nvstype.vm = vm; + tree->ast_node.nvstype.vs2 = vs2; + tree->ast_node.nvstype.vs1 = vs1; + tree->ast_node.nvstype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------NVTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x2E: + funct6 = RISCV_NV_VNCLIPU; + break; + case 0x2F: + funct6 = RISCV_NV_VNCLIP; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_NVTYPE; + tree->ast_node.nvtype.funct6 = funct6; + tree->ast_node.nvtype.vm = vm; + tree->ast_node.nvtype.vs2 = vs2; + tree->ast_node.nvtype.vs1 = vs1; + tree->ast_node.nvtype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------MASKTYPEV------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x0000000002000000) >> 25) == 0x0) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x17)) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_MASKTYPEV; tree->ast_node.masktypev.vs2 = vs2; tree->ast_node.masktypev.vs1 = vs1; tree->ast_node.masktypev.vd = vd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x0000000002000000)>>25 == 0x1) && ((binary_stream & 0x00000000FC000000)>>26 == 0x17)) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_MOVETYPEV ; + //------------------------------------------------------------ + + // ---------------------------MOVETYPEV------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x0000000002000000) >> 25) == 0x1) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x17)) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_MOVETYPEV; tree->ast_node.movetypev.vs1 = vs1; tree->ast_node.movetypev.vd = vd; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x4)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x06: - funct6 = RISCV_VX_VMAXU ; - break; - case 0x25: - funct6 = RISCV_VX_VSLL ; - break; - case 0x23: - funct6 = RISCV_VX_VSSUB ; - break; - case 0x09: - funct6 = RISCV_VX_VAND ; - break; - case 0x00: - funct6 = RISCV_VX_VADD ; - break; - case 0x0A: - funct6 = RISCV_VX_VOR ; - break; - case 0x2B: - funct6 = RISCV_VX_VSSRA ; - break; - case 0x02: - funct6 = RISCV_VX_VSUB ; - break; - case 0x20: - funct6 = RISCV_VX_VSADDU ; - break; - case 0x28: - funct6 = RISCV_VX_VSRL ; - break; - case 0x0B: - funct6 = RISCV_VX_VXOR ; - break; - case 0x07: - funct6 = RISCV_VX_VMAX ; - break; - case 0x04: - funct6 = RISCV_VX_VMINU ; - break; - case 0x22: - funct6 = RISCV_VX_VSSUBU ; - break; - case 0x27: - funct6 = RISCV_VX_VSMUL ; - break; - case 0x2A: - funct6 = RISCV_VX_VSSRL ; - break; - case 0x03: - funct6 = RISCV_VX_VRSUB ; - break; - case 0x05: - funct6 = RISCV_VX_VMIN ; - break; - case 0x21: - funct6 = RISCV_VX_VSADD ; - break; - case 0x29: - funct6 = RISCV_VX_VSRA ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_VXTYPE ; - tree->ast_node.vxtype.funct6 = funct6; - tree->ast_node.vxtype.vm = vm; - tree->ast_node.vxtype.vs2 = vs2; - tree->ast_node.vxtype.rs1 = rs1; - tree->ast_node.vxtype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x4)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x2C: - funct6 = RISCV_NXS_VNSRL ; - break; - case 0x2D: - funct6 = RISCV_NXS_VNSRA ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_NXSTYPE ; - tree->ast_node.nxstype.funct6 = funct6; - tree->ast_node.nxstype.vm = vm; - tree->ast_node.nxstype.vs2 = vs2; - tree->ast_node.nxstype.rs1 = rs1; - tree->ast_node.nxstype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x4)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x2E: - funct6 = RISCV_NX_VNCLIPU ; - break; - case 0x2F: - funct6 = RISCV_NX_VNCLIP ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_NXTYPE ; - tree->ast_node.nxtype.funct6 = funct6; - tree->ast_node.nxtype.vm = vm; - tree->ast_node.nxtype.vs2 = vs2; - tree->ast_node.nxtype.rs1 = rs1; - tree->ast_node.nxtype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x4)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x0E: - funct6 = RISCV_VX_VSLIDEUP ; - break; - case 0x0C: - funct6 = RISCV_VX_VRGATHER ; - break; - case 0x0F: - funct6 = RISCV_VX_VSLIDEDOWN ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_VXSG ; - tree->ast_node.vxsg.funct6 = funct6; - tree->ast_node.vxsg.vm = vm; - tree->ast_node.vxsg.vs2 = vs2; - tree->ast_node.vxsg.rs1 = rs1; - tree->ast_node.vxsg.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x4) && ((binary_stream & 0x0000000002000000)>>25 == 0x0) && ((binary_stream & 0x00000000FC000000)>>26 == 0x17)) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_MASKTYPEX ; + return; + } + } + //------------------------------------------------------------ + + // ---------------------------VXTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x4)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x06: + funct6 = RISCV_VX_VMAXU; + break; + case 0x25: + funct6 = RISCV_VX_VSLL; + break; + case 0x23: + funct6 = RISCV_VX_VSSUB; + break; + case 0x09: + funct6 = RISCV_VX_VAND; + break; + case 0x00: + funct6 = RISCV_VX_VADD; + break; + case 0x0A: + funct6 = RISCV_VX_VOR; + break; + case 0x2B: + funct6 = RISCV_VX_VSSRA; + break; + case 0x02: + funct6 = RISCV_VX_VSUB; + break; + case 0x20: + funct6 = RISCV_VX_VSADDU; + break; + case 0x28: + funct6 = RISCV_VX_VSRL; + break; + case 0x0B: + funct6 = RISCV_VX_VXOR; + break; + case 0x07: + funct6 = RISCV_VX_VMAX; + break; + case 0x04: + funct6 = RISCV_VX_VMINU; + break; + case 0x22: + funct6 = RISCV_VX_VSSUBU; + break; + case 0x27: + funct6 = RISCV_VX_VSMUL; + break; + case 0x2A: + funct6 = RISCV_VX_VSSRL; + break; + case 0x03: + funct6 = RISCV_VX_VRSUB; + break; + case 0x05: + funct6 = RISCV_VX_VMIN; + break; + case 0x21: + funct6 = RISCV_VX_VSADD; + break; + case 0x29: + funct6 = RISCV_VX_VSRA; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_VXTYPE; + tree->ast_node.vxtype.funct6 = funct6; + tree->ast_node.vxtype.vm = vm; + tree->ast_node.vxtype.vs2 = vs2; + tree->ast_node.vxtype.rs1 = rs1; + tree->ast_node.vxtype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------NXSTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x4)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x2C: + funct6 = RISCV_NXS_VNSRL; + break; + case 0x2D: + funct6 = RISCV_NXS_VNSRA; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_NXSTYPE; + tree->ast_node.nxstype.funct6 = funct6; + tree->ast_node.nxstype.vm = vm; + tree->ast_node.nxstype.vs2 = vs2; + tree->ast_node.nxstype.rs1 = rs1; + tree->ast_node.nxstype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------NXTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x4)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x2E: + funct6 = RISCV_NX_VNCLIPU; + break; + case 0x2F: + funct6 = RISCV_NX_VNCLIP; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_NXTYPE; + tree->ast_node.nxtype.funct6 = funct6; + tree->ast_node.nxtype.vm = vm; + tree->ast_node.nxtype.vs2 = vs2; + tree->ast_node.nxtype.rs1 = rs1; + tree->ast_node.nxtype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VXSG------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x4)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x0E: + funct6 = RISCV_VX_VSLIDEUP; + break; + case 0x0C: + funct6 = RISCV_VX_VRGATHER; + break; + case 0x0F: + funct6 = RISCV_VX_VSLIDEDOWN; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_VXSG; + tree->ast_node.vxsg.funct6 = funct6; + tree->ast_node.vxsg.vm = vm; + tree->ast_node.vxsg.vs2 = vs2; + tree->ast_node.vxsg.rs1 = rs1; + tree->ast_node.vxsg.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------MASKTYPEX------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x4) && + (((binary_stream & 0x0000000002000000) >> 25) == 0x0) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x17)) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_MASKTYPEX; tree->ast_node.masktypex.vs2 = vs2; tree->ast_node.masktypex.rs1 = rs1; tree->ast_node.masktypex.vd = vd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x4) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x0000000002000000)>>25 == 0x1) && ((binary_stream & 0x00000000FC000000)>>26 == 0x17)) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_MOVETYPEX ; + //------------------------------------------------------------ + + // ---------------------------MOVETYPEX------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x4) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x0000000002000000) >> 25) == 0x1) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x17)) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_MOVETYPEX; tree->ast_node.movetypex.rs1 = rs1; tree->ast_node.movetypex.vd = vd; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x3)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x28: - funct6 = RISCV_VI_VSRL ; - break; - case 0x0B: - funct6 = RISCV_VI_VXOR ; - break; - case 0x25: - funct6 = RISCV_VI_VSLL ; - break; - case 0x09: - funct6 = RISCV_VI_VAND ; - break; - case 0x00: - funct6 = RISCV_VI_VADD ; - break; - case 0x0A: - funct6 = RISCV_VI_VOR ; - break; - case 0x2A: - funct6 = RISCV_VI_VSSRL ; - break; - case 0x03: - funct6 = RISCV_VI_VRSUB ; - break; - case 0x21: - funct6 = RISCV_VI_VSADD ; - break; - case 0x2B: - funct6 = RISCV_VI_VSSRA ; - break; - case 0x29: - funct6 = RISCV_VI_VSRA ; - break; - case 0x20: - funct6 = RISCV_VI_VSADDU ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t simm = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_VITYPE ; - tree->ast_node.vitype.funct6 = funct6; - tree->ast_node.vitype.vm = vm; - tree->ast_node.vitype.vs2 = vs2; - tree->ast_node.vitype.simm = simm; - tree->ast_node.vitype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x3)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x2C: - funct6 = RISCV_NIS_VNSRL ; - break; - case 0x2D: - funct6 = RISCV_NIS_VNSRA ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t simm = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_NISTYPE ; - tree->ast_node.nistype.funct6 = funct6; - tree->ast_node.nistype.vm = vm; - tree->ast_node.nistype.vs2 = vs2; - tree->ast_node.nistype.simm = simm; - tree->ast_node.nistype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x3)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x2E: - funct6 = RISCV_NI_VNCLIPU ; - break; - case 0x2F: - funct6 = RISCV_NI_VNCLIP ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t simm = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_NITYPE ; - tree->ast_node.nitype.funct6 = funct6; - tree->ast_node.nitype.vm = vm; - tree->ast_node.nitype.vs2 = vs2; - tree->ast_node.nitype.simm = simm; - tree->ast_node.nitype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x3)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x0E: - funct6 = RISCV_VI_VSLIDEUP ; - break; - case 0x0C: - funct6 = RISCV_VI_VRGATHER ; - break; - case 0x0F: - funct6 = RISCV_VI_VSLIDEDOWN ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t simm = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_VISG ; - tree->ast_node.visg.funct6 = funct6; - tree->ast_node.visg.vm = vm; - tree->ast_node.visg.vs2 = vs2; - tree->ast_node.visg.simm = simm; - tree->ast_node.visg.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x3) && ((binary_stream & 0x0000000002000000)>>25 == 0x0) && ((binary_stream & 0x00000000FC000000)>>26 == 0x17)) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t simm = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_MASKTYPEI ; - tree->ast_node.masktypei.vs2 = vs2; + return; + } + } + //------------------------------------------------------------ + + // ---------------------------VITYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x3)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x28: + funct6 = RISCV_VI_VSRL; + break; + case 0x0B: + funct6 = RISCV_VI_VXOR; + break; + case 0x25: + funct6 = RISCV_VI_VSLL; + break; + case 0x09: + funct6 = RISCV_VI_VAND; + break; + case 0x00: + funct6 = RISCV_VI_VADD; + break; + case 0x0A: + funct6 = RISCV_VI_VOR; + break; + case 0x2A: + funct6 = RISCV_VI_VSSRL; + break; + case 0x03: + funct6 = RISCV_VI_VRSUB; + break; + case 0x21: + funct6 = RISCV_VI_VSADD; + break; + case 0x2B: + funct6 = RISCV_VI_VSSRA; + break; + case 0x29: + funct6 = RISCV_VI_VSRA; + break; + case 0x20: + funct6 = RISCV_VI_VSADDU; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t simm = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_VITYPE; + tree->ast_node.vitype.funct6 = funct6; + tree->ast_node.vitype.vm = vm; + tree->ast_node.vitype.vs2 = vs2; + tree->ast_node.vitype.simm = simm; + tree->ast_node.vitype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------NISTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x3)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x2C: + funct6 = RISCV_NIS_VNSRL; + break; + case 0x2D: + funct6 = RISCV_NIS_VNSRA; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t simm = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_NISTYPE; + tree->ast_node.nistype.funct6 = funct6; + tree->ast_node.nistype.vm = vm; + tree->ast_node.nistype.vs2 = vs2; + tree->ast_node.nistype.simm = simm; + tree->ast_node.nistype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------NITYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x3)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x2E: + funct6 = RISCV_NI_VNCLIPU; + break; + case 0x2F: + funct6 = RISCV_NI_VNCLIP; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t simm = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_NITYPE; + tree->ast_node.nitype.funct6 = funct6; + tree->ast_node.nitype.vm = vm; + tree->ast_node.nitype.vs2 = vs2; + tree->ast_node.nitype.simm = simm; + tree->ast_node.nitype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VISG------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x3)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x0E: + funct6 = RISCV_VI_VSLIDEUP; + break; + case 0x0C: + funct6 = RISCV_VI_VRGATHER; + break; + case 0x0F: + funct6 = RISCV_VI_VSLIDEDOWN; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t simm = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_VISG; + tree->ast_node.visg.funct6 = funct6; + tree->ast_node.visg.vm = vm; + tree->ast_node.visg.vs2 = vs2; + tree->ast_node.visg.simm = simm; + tree->ast_node.visg.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------MASKTYPEI------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x3) && + (((binary_stream & 0x0000000002000000) >> 25) == 0x0) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x17)) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t simm = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_MASKTYPEI; + tree->ast_node.masktypei.vs2 = vs2; tree->ast_node.masktypei.simm = simm; tree->ast_node.masktypei.vd = vd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x3) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x0000000002000000)>>25 == 0x1) && ((binary_stream & 0x00000000FC000000)>>26 == 0x17)) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t simm = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_MOVETYPEI ; + //------------------------------------------------------------ + + // ---------------------------MOVETYPEI------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x3) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x0000000002000000) >> 25) == 0x1) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x17)) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t simm = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_MOVETYPEI; tree->ast_node.movetypei.vd = vd; tree->ast_node.movetypei.simm = simm; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x3) && ((binary_stream & 0x0000000002000000)>>25 == 0x1) && ((binary_stream & 0x00000000FC000000)>>26 == 0x27)) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t simm = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_VMVRTYPE ; + //------------------------------------------------------------ + + // ---------------------------VMVRTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x3) && + (((binary_stream & 0x0000000002000000) >> 25) == 0x1) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x27)) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t simm = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_VMVRTYPE; tree->ast_node.vmvrtype.vs2 = vs2; tree->ast_node.vmvrtype.simm = simm; tree->ast_node.vmvrtype.vd = vd; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x2)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x08: - funct6 = RISCV_MVV_VAADDU ; - break; - case 0x0B: - funct6 = RISCV_MVV_VASUB ; - break; - case 0x25: - funct6 = RISCV_MVV_VMUL ; - break; - case 0x23: - funct6 = RISCV_MVV_VREM ; - break; - case 0x09: - funct6 = RISCV_MVV_VAADD ; - break; - case 0x27: - funct6 = RISCV_MVV_VMULH ; - break; - case 0x22: - funct6 = RISCV_MVV_VREMU ; - break; - case 0x0A: - funct6 = RISCV_MVV_VASUBU ; - break; - case 0x24: - funct6 = RISCV_MVV_VMULHU ; - break; - case 0x26: - funct6 = RISCV_MVV_VMULHSU ; - break; - case 0x21: - funct6 = RISCV_MVV_VDIV ; - break; - case 0x20: - funct6 = RISCV_MVV_VDIVU ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_MVVTYPE ; - tree->ast_node.mvvtype.funct6 = funct6; - tree->ast_node.mvvtype.vm = vm; - tree->ast_node.mvvtype.vs2 = vs2; - tree->ast_node.mvvtype.vs1 = vs1; - tree->ast_node.mvvtype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x2)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x2D: - funct6 = RISCV_MVV_VMACC ; - break; - case 0x2F: - funct6 = RISCV_MVV_VNMSAC ; - break; - case 0x2B: - funct6 = RISCV_MVV_VNMSUB ; - break; - case 0x29: - funct6 = RISCV_MVV_VMADD ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_MVVMATYPE ; - tree->ast_node.mvvmatype.funct6 = funct6; - tree->ast_node.mvvmatype.vm = vm; - tree->ast_node.mvvmatype.vs2 = vs2; - tree->ast_node.mvvmatype.vs1 = vs1; - tree->ast_node.mvvmatype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x2)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x3B: - funct6 = RISCV_WVV_VWMUL ; - break; - case 0x33: - funct6 = RISCV_WVV_VSUB ; - break; - case 0x3A: - funct6 = RISCV_WVV_VWMULSU ; - break; - case 0x31: - funct6 = RISCV_WVV_VADD ; - break; - case 0x30: - funct6 = RISCV_WVV_VADDU ; - break; - case 0x32: - funct6 = RISCV_WVV_VSUBU ; - break; - case 0x38: - funct6 = RISCV_WVV_VWMULU ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_WVVTYPE ; - tree->ast_node.wvvtype.funct6 = funct6; - tree->ast_node.wvvtype.vm = vm; - tree->ast_node.wvvtype.vs2 = vs2; - tree->ast_node.wvvtype.vs1 = vs1; - tree->ast_node.wvvtype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x2)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x36: - funct6 = RISCV_WV_VSUBU ; - break; - case 0x35: - funct6 = RISCV_WV_VADD ; - break; - case 0x37: - funct6 = RISCV_WV_VSUB ; - break; - case 0x34: - funct6 = RISCV_WV_VADDU ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_WVTYPE ; - tree->ast_node.wvtype.funct6 = funct6; - tree->ast_node.wvtype.vm = vm; - tree->ast_node.wvtype.vs2 = vs2; - tree->ast_node.wvtype.vs1 = vs1; - tree->ast_node.wvtype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x2)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x3D: - funct6 = RISCV_WMVV_VWMACC ; - break; - case 0x3C: - funct6 = RISCV_WMVV_VWMACCU ; - break; - case 0x3F: - funct6 = RISCV_WMVV_VWMACCSU ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_WMVVTYPE ; - tree->ast_node.wmvvtype.funct6 = funct6; - tree->ast_node.wmvvtype.vm = vm; - tree->ast_node.wmvvtype.vs2 = vs2; - tree->ast_node.wmvvtype.vs1 = vs1; - tree->ast_node.wmvvtype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x2) && ((binary_stream & 0x00000000FC000000)>>26 == 0x12)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000000F8000)>>15) { - case 0x06: - funct6 = RISCV_VEXT2_ZVF2 ; - break; - case 0x07: - funct6 = RISCV_VEXT2_SVF2 ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_VEXT2TYPE ; - tree->ast_node.vext2type.funct6 = funct6; - tree->ast_node.vext2type.vm = vm; - tree->ast_node.vext2type.vs2 = vs2; - tree->ast_node.vext2type.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x2) && ((binary_stream & 0x00000000FC000000)>>26 == 0x12)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000000F8000)>>15) { - case 0x04: - funct6 = RISCV_VEXT4_ZVF4 ; - break; - case 0x05: - funct6 = RISCV_VEXT4_SVF4 ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_VEXT4TYPE ; - tree->ast_node.vext4type.funct6 = funct6; - tree->ast_node.vext4type.vm = vm; - tree->ast_node.vext4type.vs2 = vs2; - tree->ast_node.vext4type.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x2) && ((binary_stream & 0x00000000FC000000)>>26 == 0x12)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000000F8000)>>15) { - case 0x03: - funct6 = RISCV_VEXT8_SVF8 ; - break; - case 0x02: - funct6 = RISCV_VEXT8_ZVF8 ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_VEXT8TYPE ; - tree->ast_node.vext8type.funct6 = funct6; - tree->ast_node.vext8type.vm = vm; - tree->ast_node.vext8type.vs2 = vs2; - tree->ast_node.vext8type.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x2) && ((binary_stream & 0x00000000000F8000)>>15 == 0x00) && ((binary_stream & 0x0000000002000000)>>25 == 0x1) && ((binary_stream & 0x00000000FC000000)>>26 == 0x10)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_VMVXS ; + return; + } + } + //------------------------------------------------------------ + + // ---------------------------MVVTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x08: + funct6 = RISCV_MVV_VAADDU; + break; + case 0x0B: + funct6 = RISCV_MVV_VASUB; + break; + case 0x25: + funct6 = RISCV_MVV_VMUL; + break; + case 0x23: + funct6 = RISCV_MVV_VREM; + break; + case 0x09: + funct6 = RISCV_MVV_VAADD; + break; + case 0x27: + funct6 = RISCV_MVV_VMULH; + break; + case 0x22: + funct6 = RISCV_MVV_VREMU; + break; + case 0x0A: + funct6 = RISCV_MVV_VASUBU; + break; + case 0x24: + funct6 = RISCV_MVV_VMULHU; + break; + case 0x26: + funct6 = RISCV_MVV_VMULHSU; + break; + case 0x21: + funct6 = RISCV_MVV_VDIV; + break; + case 0x20: + funct6 = RISCV_MVV_VDIVU; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_MVVTYPE; + tree->ast_node.mvvtype.funct6 = funct6; + tree->ast_node.mvvtype.vm = vm; + tree->ast_node.mvvtype.vs2 = vs2; + tree->ast_node.mvvtype.vs1 = vs1; + tree->ast_node.mvvtype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------MVVMATYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x2D: + funct6 = RISCV_MVV_VMACC; + break; + case 0x2F: + funct6 = RISCV_MVV_VNMSAC; + break; + case 0x2B: + funct6 = RISCV_MVV_VNMSUB; + break; + case 0x29: + funct6 = RISCV_MVV_VMADD; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_MVVMATYPE; + tree->ast_node.mvvmatype.funct6 = funct6; + tree->ast_node.mvvmatype.vm = vm; + tree->ast_node.mvvmatype.vs2 = vs2; + tree->ast_node.mvvmatype.vs1 = vs1; + tree->ast_node.mvvmatype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------WVVTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x3B: + funct6 = RISCV_WVV_VWMUL; + break; + case 0x33: + funct6 = RISCV_WVV_VSUB; + break; + case 0x3A: + funct6 = RISCV_WVV_VWMULSU; + break; + case 0x31: + funct6 = RISCV_WVV_VADD; + break; + case 0x30: + funct6 = RISCV_WVV_VADDU; + break; + case 0x32: + funct6 = RISCV_WVV_VSUBU; + break; + case 0x38: + funct6 = RISCV_WVV_VWMULU; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_WVVTYPE; + tree->ast_node.wvvtype.funct6 = funct6; + tree->ast_node.wvvtype.vm = vm; + tree->ast_node.wvvtype.vs2 = vs2; + tree->ast_node.wvvtype.vs1 = vs1; + tree->ast_node.wvvtype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------WVTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x36: + funct6 = RISCV_WV_VSUBU; + break; + case 0x35: + funct6 = RISCV_WV_VADD; + break; + case 0x37: + funct6 = RISCV_WV_VSUB; + break; + case 0x34: + funct6 = RISCV_WV_VADDU; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_WVTYPE; + tree->ast_node.wvtype.funct6 = funct6; + tree->ast_node.wvtype.vm = vm; + tree->ast_node.wvtype.vs2 = vs2; + tree->ast_node.wvtype.vs1 = vs1; + tree->ast_node.wvtype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------WMVVTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x3D: + funct6 = RISCV_WMVV_VWMACC; + break; + case 0x3C: + funct6 = RISCV_WMVV_VWMACCU; + break; + case 0x3F: + funct6 = RISCV_WMVV_VWMACCSU; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_WMVVTYPE; + tree->ast_node.wmvvtype.funct6 = funct6; + tree->ast_node.wmvvtype.vm = vm; + tree->ast_node.wmvvtype.vs2 = vs2; + tree->ast_node.wmvvtype.vs1 = vs1; + tree->ast_node.wmvvtype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VEXT2TYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x12)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000000F8000) >> 15) { + case 0x06: + funct6 = RISCV_VEXT2_ZVF2; + break; + case 0x07: + funct6 = RISCV_VEXT2_SVF2; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_VEXT2TYPE; + tree->ast_node.vext2type.funct6 = funct6; + tree->ast_node.vext2type.vm = vm; + tree->ast_node.vext2type.vs2 = vs2; + tree->ast_node.vext2type.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VEXT4TYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x12)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000000F8000) >> 15) { + case 0x04: + funct6 = RISCV_VEXT4_ZVF4; + break; + case 0x05: + funct6 = RISCV_VEXT4_SVF4; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_VEXT4TYPE; + tree->ast_node.vext4type.funct6 = funct6; + tree->ast_node.vext4type.vm = vm; + tree->ast_node.vext4type.vs2 = vs2; + tree->ast_node.vext4type.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VEXT8TYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x12)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000000F8000) >> 15) { + case 0x03: + funct6 = RISCV_VEXT8_SVF8; + break; + case 0x02: + funct6 = RISCV_VEXT8_ZVF8; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_VEXT8TYPE; + tree->ast_node.vext8type.funct6 = funct6; + tree->ast_node.vext8type.vm = vm; + tree->ast_node.vext8type.vs2 = vs2; + tree->ast_node.vext8type.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VMVXS------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2) && + (((binary_stream & 0x00000000000F8000) >> 15) == 0x00) && + (((binary_stream & 0x0000000002000000) >> 25) == 0x1) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x10)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_VMVXS; tree->ast_node.vmvxs.vs2 = vs2; tree->ast_node.vmvxs.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x2) && ((binary_stream & 0x0000000002000000)>>25 == 0x1) && ((binary_stream & 0x00000000FC000000)>>26 == 0x17)) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_MVVCOMPRESS ; + //------------------------------------------------------------ + + // ---------------------------MVVCOMPRESS------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2) && + (((binary_stream & 0x0000000002000000) >> 25) == 0x1) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x17)) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_MVVCOMPRESS; tree->ast_node.mvvcompress.vs2 = vs2; tree->ast_node.mvvcompress.vs1 = vs1; tree->ast_node.mvvcompress.vd = vd; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x6)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x08: - funct6 = RISCV_MVX_VAADDU ; - break; - case 0x0B: - funct6 = RISCV_MVX_VASUB ; - break; - case 0x25: - funct6 = RISCV_MVX_VMUL ; - break; - case 0x23: - funct6 = RISCV_MVX_VREM ; - break; - case 0x09: - funct6 = RISCV_MVX_VAADD ; - break; - case 0x27: - funct6 = RISCV_MVX_VMULH ; - break; - case 0x22: - funct6 = RISCV_MVX_VREMU ; - break; - case 0x0A: - funct6 = RISCV_MVX_VASUBU ; - break; - case 0x24: - funct6 = RISCV_MVX_VMULHU ; - break; - case 0x0E: - funct6 = RISCV_MVX_VSLIDE1UP ; - break; - case 0x26: - funct6 = RISCV_MVX_VMULHSU ; - break; - case 0x21: - funct6 = RISCV_MVX_VDIV ; - break; - case 0x0F: - funct6 = RISCV_MVX_VSLIDE1DOWN ; - break; - case 0x20: - funct6 = RISCV_MVX_VDIVU ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_MVXTYPE ; - tree->ast_node.mvxtype.funct6 = funct6; - tree->ast_node.mvxtype.vm = vm; - tree->ast_node.mvxtype.vs2 = vs2; - tree->ast_node.mvxtype.rs1 = rs1; - tree->ast_node.mvxtype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x6)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x2D: - funct6 = RISCV_MVX_VMACC ; - break; - case 0x2F: - funct6 = RISCV_MVX_VNMSAC ; - break; - case 0x2B: - funct6 = RISCV_MVX_VNMSUB ; - break; - case 0x29: - funct6 = RISCV_MVX_VMADD ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_MVXMATYPE ; - tree->ast_node.mvxmatype.funct6 = funct6; - tree->ast_node.mvxmatype.vm = vm; - tree->ast_node.mvxmatype.vs2 = vs2; - tree->ast_node.mvxmatype.rs1 = rs1; - tree->ast_node.mvxmatype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x6)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x3B: - funct6 = RISCV_WVX_VWMUL ; - break; - case 0x33: - funct6 = RISCV_WVX_VSUB ; - break; - case 0x3A: - funct6 = RISCV_WVX_VWMULSU ; - break; - case 0x31: - funct6 = RISCV_WVX_VADD ; - break; - case 0x30: - funct6 = RISCV_WVX_VADDU ; - break; - case 0x32: - funct6 = RISCV_WVX_VSUBU ; - break; - case 0x38: - funct6 = RISCV_WVX_VWMULU ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_WVXTYPE ; - tree->ast_node.wvxtype.funct6 = funct6; - tree->ast_node.wvxtype.vm = vm; - tree->ast_node.wvxtype.vs2 = vs2; - tree->ast_node.wvxtype.rs1 = rs1; - tree->ast_node.wvxtype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x6)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x36: - funct6 = RISCV_WX_VSUBU ; - break; - case 0x35: - funct6 = RISCV_WX_VADD ; - break; - case 0x37: - funct6 = RISCV_WX_VSUB ; - break; - case 0x34: - funct6 = RISCV_WX_VADDU ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_WXTYPE ; - tree->ast_node.wxtype.funct6 = funct6; - tree->ast_node.wxtype.vm = vm; - tree->ast_node.wxtype.vs2 = vs2; - tree->ast_node.wxtype.rs1 = rs1; - tree->ast_node.wxtype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x6)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x3E: - funct6 = RISCV_WMVX_VWMACCUS ; - break; - case 0x3D: - funct6 = RISCV_WMVX_VWMACC ; - break; - case 0x3C: - funct6 = RISCV_WMVX_VWMACCU ; - break; - case 0x3F: - funct6 = RISCV_WMVX_VWMACCSU ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_WMVXTYPE ; - tree->ast_node.wmvxtype.funct6 = funct6; - tree->ast_node.wmvxtype.vm = vm; - tree->ast_node.wmvxtype.vs2 = vs2; - tree->ast_node.wmvxtype.rs1 = rs1; - tree->ast_node.wmvxtype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x6) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x0000000002000000)>>25 == 0x1) && ((binary_stream & 0x00000000FC000000)>>26 == 0x10)) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_VMVSX ; + return; + } + } + //------------------------------------------------------------ + + // ---------------------------MVXTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x6)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x08: + funct6 = RISCV_MVX_VAADDU; + break; + case 0x0B: + funct6 = RISCV_MVX_VASUB; + break; + case 0x25: + funct6 = RISCV_MVX_VMUL; + break; + case 0x23: + funct6 = RISCV_MVX_VREM; + break; + case 0x09: + funct6 = RISCV_MVX_VAADD; + break; + case 0x27: + funct6 = RISCV_MVX_VMULH; + break; + case 0x22: + funct6 = RISCV_MVX_VREMU; + break; + case 0x0A: + funct6 = RISCV_MVX_VASUBU; + break; + case 0x24: + funct6 = RISCV_MVX_VMULHU; + break; + case 0x0E: + funct6 = RISCV_MVX_VSLIDE1UP; + break; + case 0x26: + funct6 = RISCV_MVX_VMULHSU; + break; + case 0x21: + funct6 = RISCV_MVX_VDIV; + break; + case 0x0F: + funct6 = RISCV_MVX_VSLIDE1DOWN; + break; + case 0x20: + funct6 = RISCV_MVX_VDIVU; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_MVXTYPE; + tree->ast_node.mvxtype.funct6 = funct6; + tree->ast_node.mvxtype.vm = vm; + tree->ast_node.mvxtype.vs2 = vs2; + tree->ast_node.mvxtype.rs1 = rs1; + tree->ast_node.mvxtype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------MVXMATYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x6)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x2D: + funct6 = RISCV_MVX_VMACC; + break; + case 0x2F: + funct6 = RISCV_MVX_VNMSAC; + break; + case 0x2B: + funct6 = RISCV_MVX_VNMSUB; + break; + case 0x29: + funct6 = RISCV_MVX_VMADD; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_MVXMATYPE; + tree->ast_node.mvxmatype.funct6 = funct6; + tree->ast_node.mvxmatype.vm = vm; + tree->ast_node.mvxmatype.vs2 = vs2; + tree->ast_node.mvxmatype.rs1 = rs1; + tree->ast_node.mvxmatype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------WVXTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x6)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x3B: + funct6 = RISCV_WVX_VWMUL; + break; + case 0x33: + funct6 = RISCV_WVX_VSUB; + break; + case 0x3A: + funct6 = RISCV_WVX_VWMULSU; + break; + case 0x31: + funct6 = RISCV_WVX_VADD; + break; + case 0x30: + funct6 = RISCV_WVX_VADDU; + break; + case 0x32: + funct6 = RISCV_WVX_VSUBU; + break; + case 0x38: + funct6 = RISCV_WVX_VWMULU; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_WVXTYPE; + tree->ast_node.wvxtype.funct6 = funct6; + tree->ast_node.wvxtype.vm = vm; + tree->ast_node.wvxtype.vs2 = vs2; + tree->ast_node.wvxtype.rs1 = rs1; + tree->ast_node.wvxtype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------WXTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x6)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x36: + funct6 = RISCV_WX_VSUBU; + break; + case 0x35: + funct6 = RISCV_WX_VADD; + break; + case 0x37: + funct6 = RISCV_WX_VSUB; + break; + case 0x34: + funct6 = RISCV_WX_VADDU; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_WXTYPE; + tree->ast_node.wxtype.funct6 = funct6; + tree->ast_node.wxtype.vm = vm; + tree->ast_node.wxtype.vs2 = vs2; + tree->ast_node.wxtype.rs1 = rs1; + tree->ast_node.wxtype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------WMVXTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x6)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x3E: + funct6 = RISCV_WMVX_VWMACCUS; + break; + case 0x3D: + funct6 = RISCV_WMVX_VWMACC; + break; + case 0x3C: + funct6 = RISCV_WMVX_VWMACCU; + break; + case 0x3F: + funct6 = RISCV_WMVX_VWMACCSU; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_WMVXTYPE; + tree->ast_node.wmvxtype.funct6 = funct6; + tree->ast_node.wmvxtype.vm = vm; + tree->ast_node.wmvxtype.vs2 = vs2; + tree->ast_node.wmvxtype.rs1 = rs1; + tree->ast_node.wmvxtype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VMVSX------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x6) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x0000000002000000) >> 25) == 0x1) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x10)) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_VMVSX; tree->ast_node.vmvsx.rs1 = rs1; tree->ast_node.vmvsx.vd = vd; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x1)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x08: - funct6 = RISCV_FVV_VSGNJ ; - break; - case 0x06: - funct6 = RISCV_FVV_VMAX ; - break; - case 0x04: - funct6 = RISCV_FVV_VMIN ; - break; - case 0x09: - funct6 = RISCV_FVV_VSGNJN ; - break; - case 0x00: - funct6 = RISCV_FVV_VADD ; - break; - case 0x0A: - funct6 = RISCV_FVV_VSGNJX ; - break; - case 0x24: - funct6 = RISCV_FVV_VMUL ; - break; - case 0x02: - funct6 = RISCV_FVV_VSUB ; - break; - case 0x20: - funct6 = RISCV_FVV_VDIV ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_FVVTYPE ; - tree->ast_node.fvvtype.funct6 = funct6; - tree->ast_node.fvvtype.vm = vm; - tree->ast_node.fvvtype.vs2 = vs2; - tree->ast_node.fvvtype.vs1 = vs1; - tree->ast_node.fvvtype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x1)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x28: - funct6 = RISCV_FVV_VMADD ; - break; - case 0x2C: - funct6 = RISCV_FVV_VMACC ; - break; - case 0x2D: - funct6 = RISCV_FVV_VNMACC ; - break; - case 0x2E: - funct6 = RISCV_FVV_VMSAC ; - break; - case 0x2F: - funct6 = RISCV_FVV_VNMSAC ; - break; - case 0x2A: - funct6 = RISCV_FVV_VMSUB ; - break; - case 0x2B: - funct6 = RISCV_FVV_VNMSUB ; - break; - case 0x29: - funct6 = RISCV_FVV_VNMADD ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_FVVMATYPE ; - tree->ast_node.fvvmatype.funct6 = funct6; - tree->ast_node.fvvmatype.vm = vm; - tree->ast_node.fvvmatype.vs2 = vs2; - tree->ast_node.fvvmatype.vs1 = vs1; - tree->ast_node.fvvmatype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x1)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x30: - funct6 = RISCV_FWVV_VADD ; - break; - case 0x32: - funct6 = RISCV_FWVV_VSUB ; - break; - case 0x38: - funct6 = RISCV_FWVV_VMUL ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_FWVVTYPE ; - tree->ast_node.fwvvtype.funct6 = funct6; - tree->ast_node.fwvvtype.vm = vm; - tree->ast_node.fwvvtype.vs2 = vs2; - tree->ast_node.fwvvtype.vs1 = vs1; - tree->ast_node.fwvvtype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x1)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x3E: - funct6 = RISCV_FWVV_VMSAC ; - break; - case 0x3D: - funct6 = RISCV_FWVV_VNMACC ; - break; - case 0x3C: - funct6 = RISCV_FWVV_VMACC ; - break; - case 0x3F: - funct6 = RISCV_FWVV_VNMSAC ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs2 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs1 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_FWVVMATYPE ; - tree->ast_node.fwvvmatype.funct6 = funct6; - tree->ast_node.fwvvmatype.vm = vm; - tree->ast_node.fwvvmatype.vs1 = vs1; - tree->ast_node.fwvvmatype.vs2 = vs2; - tree->ast_node.fwvvmatype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x1)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x36: - funct6 = RISCV_FWV_VSUB ; - break; - case 0x34: - funct6 = RISCV_FWV_VADD ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_FWVTYPE ; - tree->ast_node.fwvtype.funct6 = funct6; - tree->ast_node.fwvtype.vm = vm; - tree->ast_node.fwvtype.vs2 = vs2; - tree->ast_node.fwvtype.vs1 = vs1; - tree->ast_node.fwvtype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FC000000)>>26 == 0x12)) { - uint64_t vfunary0 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000000F8000)>>15) { - case 0x01: - vfunary0 = RISCV_FV_CVT_X_F ; - break; - case 0x06: - vfunary0 = RISCV_FV_CVT_RTZ_XU_F ; - break; - case 0x07: - vfunary0 = RISCV_FV_CVT_RTZ_X_F ; - break; - case 0x00: - vfunary0 = RISCV_FV_CVT_XU_F ; - break; - case 0x03: - vfunary0 = RISCV_FV_CVT_F_X ; - break; - case 0x02: - vfunary0 = RISCV_FV_CVT_F_XU ; - break; - - } - if (vfunary0 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_VFUNARY0 ; - tree->ast_node.vfunary0.vm = vm; - tree->ast_node.vfunary0.vs2 = vs2; - tree->ast_node.vfunary0.vfunary0 = vfunary0; - tree->ast_node.vfunary0.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FC000000)>>26 == 0x12)) { - uint64_t vfwunary0 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000000F8000)>>15) { - case 0x08: - vfwunary0 = RISCV_FWV_CVT_XU_F ; - break; - case 0x0B: - vfwunary0 = RISCV_FWV_CVT_F_X ; - break; - case 0x09: - vfwunary0 = RISCV_FWV_CVT_X_F ; - break; - case 0x0A: - vfwunary0 = RISCV_FWV_CVT_F_XU ; - break; - case 0x0E: - vfwunary0 = RISCV_FWV_CVT_RTZ_XU_F ; - break; - case 0x0C: - vfwunary0 = RISCV_FWV_CVT_F_F ; - break; - case 0x0F: - vfwunary0 = RISCV_FWV_CVT_RTZ_X_F ; - break; - - } - if (vfwunary0 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_VFWUNARY0 ; - tree->ast_node.vfwunary0.vm = vm; - tree->ast_node.vfwunary0.vs2 = vs2; - tree->ast_node.vfwunary0.vfwunary0 = vfwunary0; - tree->ast_node.vfwunary0.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FC000000)>>26 == 0x12)) { - uint64_t vfnunary0 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000000F8000)>>15) { - case 0x15: - vfnunary0 = RISCV_FNV_CVT_ROD_F_F ; - break; - case 0x13: - vfnunary0 = RISCV_FNV_CVT_F_X ; - break; - case 0x10: - vfnunary0 = RISCV_FNV_CVT_XU_F ; - break; - case 0x12: - vfnunary0 = RISCV_FNV_CVT_F_XU ; - break; - case 0x14: - vfnunary0 = RISCV_FNV_CVT_F_F ; - break; - case 0x16: - vfnunary0 = RISCV_FNV_CVT_RTZ_XU_F ; - break; - case 0x11: - vfnunary0 = RISCV_FNV_CVT_X_F ; - break; - case 0x17: - vfnunary0 = RISCV_FNV_CVT_RTZ_X_F ; - break; - - } - if (vfnunary0 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_VFNUNARY0 ; - tree->ast_node.vfnunary0.vm = vm; - tree->ast_node.vfnunary0.vs2 = vs2; - tree->ast_node.vfnunary0.vfnunary0 = vfnunary0; - tree->ast_node.vfnunary0.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000FC000000)>>26 == 0x13)) { - uint64_t vfunary1 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000000F8000)>>15) { - case 0x04: - vfunary1 = RISCV_FVV_VRSQRT7 ; - break; - case 0x10: - vfunary1 = RISCV_FVV_VCLASS ; - break; - case 0x00: - vfunary1 = RISCV_FVV_VSQRT ; - break; - case 0x05: - vfunary1 = RISCV_FVV_VREC7 ; - break; - - } - if (vfunary1 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_VFUNARY1 ; - tree->ast_node.vfunary1.vm = vm; - tree->ast_node.vfunary1.vs2 = vs2; - tree->ast_node.vfunary1.vfunary1 = vfunary1; - tree->ast_node.vfunary1.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x1) && ((binary_stream & 0x00000000000F8000)>>15 == 0x00) && ((binary_stream & 0x0000000002000000)>>25 == 0x1) && ((binary_stream & 0x00000000FC000000)>>26 == 0x10)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_VFMVFS ; + return; + } + } + //------------------------------------------------------------ + + // ---------------------------FVVTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x08: + funct6 = RISCV_FVV_VSGNJ; + break; + case 0x06: + funct6 = RISCV_FVV_VMAX; + break; + case 0x04: + funct6 = RISCV_FVV_VMIN; + break; + case 0x09: + funct6 = RISCV_FVV_VSGNJN; + break; + case 0x00: + funct6 = RISCV_FVV_VADD; + break; + case 0x0A: + funct6 = RISCV_FVV_VSGNJX; + break; + case 0x24: + funct6 = RISCV_FVV_VMUL; + break; + case 0x02: + funct6 = RISCV_FVV_VSUB; + break; + case 0x20: + funct6 = RISCV_FVV_VDIV; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_FVVTYPE; + tree->ast_node.fvvtype.funct6 = funct6; + tree->ast_node.fvvtype.vm = vm; + tree->ast_node.fvvtype.vs2 = vs2; + tree->ast_node.fvvtype.vs1 = vs1; + tree->ast_node.fvvtype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------FVVMATYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x28: + funct6 = RISCV_FVV_VMADD; + break; + case 0x2C: + funct6 = RISCV_FVV_VMACC; + break; + case 0x2D: + funct6 = RISCV_FVV_VNMACC; + break; + case 0x2E: + funct6 = RISCV_FVV_VMSAC; + break; + case 0x2F: + funct6 = RISCV_FVV_VNMSAC; + break; + case 0x2A: + funct6 = RISCV_FVV_VMSUB; + break; + case 0x2B: + funct6 = RISCV_FVV_VNMSUB; + break; + case 0x29: + funct6 = RISCV_FVV_VNMADD; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_FVVMATYPE; + tree->ast_node.fvvmatype.funct6 = funct6; + tree->ast_node.fvvmatype.vm = vm; + tree->ast_node.fvvmatype.vs2 = vs2; + tree->ast_node.fvvmatype.vs1 = vs1; + tree->ast_node.fvvmatype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------FWVVTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x30: + funct6 = RISCV_FWVV_VADD; + break; + case 0x32: + funct6 = RISCV_FWVV_VSUB; + break; + case 0x38: + funct6 = RISCV_FWVV_VMUL; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_FWVVTYPE; + tree->ast_node.fwvvtype.funct6 = funct6; + tree->ast_node.fwvvtype.vm = vm; + tree->ast_node.fwvvtype.vs2 = vs2; + tree->ast_node.fwvvtype.vs1 = vs1; + tree->ast_node.fwvvtype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------FWVVMATYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x3E: + funct6 = RISCV_FWVV_VMSAC; + break; + case 0x3D: + funct6 = RISCV_FWVV_VNMACC; + break; + case 0x3C: + funct6 = RISCV_FWVV_VMACC; + break; + case 0x3F: + funct6 = RISCV_FWVV_VNMSAC; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs2 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs1 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_FWVVMATYPE; + tree->ast_node.fwvvmatype.funct6 = funct6; + tree->ast_node.fwvvmatype.vm = vm; + tree->ast_node.fwvvmatype.vs1 = vs1; + tree->ast_node.fwvvmatype.vs2 = vs2; + tree->ast_node.fwvvmatype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------FWVTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x36: + funct6 = RISCV_FWV_VSUB; + break; + case 0x34: + funct6 = RISCV_FWV_VADD; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_FWVTYPE; + tree->ast_node.fwvtype.funct6 = funct6; + tree->ast_node.fwvtype.vm = vm; + tree->ast_node.fwvtype.vs2 = vs2; + tree->ast_node.fwvtype.vs1 = vs1; + tree->ast_node.fwvtype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VFUNARY0------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x12)) { + uint64_t vfunary0 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000000F8000) >> 15) { + case 0x01: + vfunary0 = RISCV_FV_CVT_X_F; + break; + case 0x06: + vfunary0 = RISCV_FV_CVT_RTZ_XU_F; + break; + case 0x07: + vfunary0 = RISCV_FV_CVT_RTZ_X_F; + break; + case 0x00: + vfunary0 = RISCV_FV_CVT_XU_F; + break; + case 0x03: + vfunary0 = RISCV_FV_CVT_F_X; + break; + case 0x02: + vfunary0 = RISCV_FV_CVT_F_XU; + break; + } + if (vfunary0 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_VFUNARY0; + tree->ast_node.vfunary0.vm = vm; + tree->ast_node.vfunary0.vs2 = vs2; + tree->ast_node.vfunary0.vfunary0 = vfunary0; + tree->ast_node.vfunary0.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VFWUNARY0------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x12)) { + uint64_t vfwunary0 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000000F8000) >> 15) { + case 0x08: + vfwunary0 = RISCV_FWV_CVT_XU_F; + break; + case 0x0B: + vfwunary0 = RISCV_FWV_CVT_F_X; + break; + case 0x09: + vfwunary0 = RISCV_FWV_CVT_X_F; + break; + case 0x0A: + vfwunary0 = RISCV_FWV_CVT_F_XU; + break; + case 0x0E: + vfwunary0 = RISCV_FWV_CVT_RTZ_XU_F; + break; + case 0x0C: + vfwunary0 = RISCV_FWV_CVT_F_F; + break; + case 0x0F: + vfwunary0 = RISCV_FWV_CVT_RTZ_X_F; + break; + } + if (vfwunary0 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_VFWUNARY0; + tree->ast_node.vfwunary0.vm = vm; + tree->ast_node.vfwunary0.vs2 = vs2; + tree->ast_node.vfwunary0.vfwunary0 = vfwunary0; + tree->ast_node.vfwunary0.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VFNUNARY0------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x12)) { + uint64_t vfnunary0 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000000F8000) >> 15) { + case 0x15: + vfnunary0 = RISCV_FNV_CVT_ROD_F_F; + break; + case 0x13: + vfnunary0 = RISCV_FNV_CVT_F_X; + break; + case 0x10: + vfnunary0 = RISCV_FNV_CVT_XU_F; + break; + case 0x12: + vfnunary0 = RISCV_FNV_CVT_F_XU; + break; + case 0x14: + vfnunary0 = RISCV_FNV_CVT_F_F; + break; + case 0x16: + vfnunary0 = RISCV_FNV_CVT_RTZ_XU_F; + break; + case 0x11: + vfnunary0 = RISCV_FNV_CVT_X_F; + break; + case 0x17: + vfnunary0 = RISCV_FNV_CVT_RTZ_X_F; + break; + } + if (vfnunary0 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_VFNUNARY0; + tree->ast_node.vfnunary0.vm = vm; + tree->ast_node.vfnunary0.vs2 = vs2; + tree->ast_node.vfnunary0.vfnunary0 = vfnunary0; + tree->ast_node.vfnunary0.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VFUNARY1------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x13)) { + uint64_t vfunary1 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000000F8000) >> 15) { + case 0x04: + vfunary1 = RISCV_FVV_VRSQRT7; + break; + case 0x10: + vfunary1 = RISCV_FVV_VCLASS; + break; + case 0x00: + vfunary1 = RISCV_FVV_VSQRT; + break; + case 0x05: + vfunary1 = RISCV_FVV_VREC7; + break; + } + if (vfunary1 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_VFUNARY1; + tree->ast_node.vfunary1.vm = vm; + tree->ast_node.vfunary1.vs2 = vs2; + tree->ast_node.vfunary1.vfunary1 = vfunary1; + tree->ast_node.vfunary1.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VFMVFS------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1) && + (((binary_stream & 0x00000000000F8000) >> 15) == 0x00) && + (((binary_stream & 0x0000000002000000) >> 25) == 0x1) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x10)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_VFMVFS; tree->ast_node.vfmvfs.vs2 = vs2; tree->ast_node.vfmvfs.rd = rd; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x5)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x08: - funct6 = RISCV_VF_VSGNJ ; - break; - case 0x06: - funct6 = RISCV_VF_VMAX ; - break; - case 0x04: - funct6 = RISCV_VF_VMIN ; - break; - case 0x09: - funct6 = RISCV_VF_VSGNJN ; - break; - case 0x27: - funct6 = RISCV_VF_VRSUB ; - break; - case 0x00: - funct6 = RISCV_VF_VADD ; - break; - case 0x0A: - funct6 = RISCV_VF_VSGNJX ; - break; - case 0x24: - funct6 = RISCV_VF_VMUL ; - break; - case 0x0E: - funct6 = RISCV_VF_VSLIDE1UP ; - break; - case 0x21: - funct6 = RISCV_VF_VRDIV ; - break; - case 0x02: - funct6 = RISCV_VF_VSUB ; - break; - case 0x0F: - funct6 = RISCV_VF_VSLIDE1DOWN ; - break; - case 0x20: - funct6 = RISCV_VF_VDIV ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_FVFTYPE ; - tree->ast_node.fvftype.funct6 = funct6; - tree->ast_node.fvftype.vm = vm; - tree->ast_node.fvftype.vs2 = vs2; - tree->ast_node.fvftype.rs1 = rs1; - tree->ast_node.fvftype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x5)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x28: - funct6 = RISCV_VF_VMADD ; - break; - case 0x2C: - funct6 = RISCV_VF_VMACC ; - break; - case 0x2D: - funct6 = RISCV_VF_VNMACC ; - break; - case 0x2E: - funct6 = RISCV_VF_VMSAC ; - break; - case 0x2F: - funct6 = RISCV_VF_VNMSAC ; - break; - case 0x2A: - funct6 = RISCV_VF_VMSUB ; - break; - case 0x2B: - funct6 = RISCV_VF_VNMSUB ; - break; - case 0x29: - funct6 = RISCV_VF_VNMADD ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_FVFMATYPE ; - tree->ast_node.fvfmatype.funct6 = funct6; - tree->ast_node.fvfmatype.vm = vm; - tree->ast_node.fvfmatype.vs2 = vs2; - tree->ast_node.fvfmatype.rs1 = rs1; - tree->ast_node.fvfmatype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x5)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x30: - funct6 = RISCV_FWVF_VADD ; - break; - case 0x32: - funct6 = RISCV_FWVF_VSUB ; - break; - case 0x38: - funct6 = RISCV_FWVF_VMUL ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_FWVFTYPE ; - tree->ast_node.fwvftype.funct6 = funct6; - tree->ast_node.fwvftype.vm = vm; - tree->ast_node.fwvftype.vs2 = vs2; - tree->ast_node.fwvftype.rs1 = rs1; - tree->ast_node.fwvftype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x5)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x3E: - funct6 = RISCV_FWVF_VMSAC ; - break; - case 0x3D: - funct6 = RISCV_FWVF_VNMACC ; - break; - case 0x3C: - funct6 = RISCV_FWVF_VMACC ; - break; - case 0x3F: - funct6 = RISCV_FWVF_VNMSAC ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_FWVFMATYPE ; - tree->ast_node.fwvfmatype.funct6 = funct6; - tree->ast_node.fwvfmatype.vm = vm; - tree->ast_node.fwvfmatype.rs1 = rs1; - tree->ast_node.fwvfmatype.vs2 = vs2; - tree->ast_node.fwvfmatype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x5)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x36: - funct6 = RISCV_FWF_VSUB ; - break; - case 0x34: - funct6 = RISCV_FWF_VADD ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_FWFTYPE ; - tree->ast_node.fwftype.funct6 = funct6; - tree->ast_node.fwftype.vm = vm; - tree->ast_node.fwftype.vs2 = vs2; - tree->ast_node.fwftype.rs1 = rs1; - tree->ast_node.fwftype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x5) && ((binary_stream & 0x0000000002000000)>>25 == 0x0) && ((binary_stream & 0x00000000FC000000)>>26 == 0x17)) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_VFMERGE ; + return; + } + } + //------------------------------------------------------------ + + // ---------------------------FVFTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x08: + funct6 = RISCV_VF_VSGNJ; + break; + case 0x06: + funct6 = RISCV_VF_VMAX; + break; + case 0x04: + funct6 = RISCV_VF_VMIN; + break; + case 0x09: + funct6 = RISCV_VF_VSGNJN; + break; + case 0x27: + funct6 = RISCV_VF_VRSUB; + break; + case 0x00: + funct6 = RISCV_VF_VADD; + break; + case 0x0A: + funct6 = RISCV_VF_VSGNJX; + break; + case 0x24: + funct6 = RISCV_VF_VMUL; + break; + case 0x0E: + funct6 = RISCV_VF_VSLIDE1UP; + break; + case 0x21: + funct6 = RISCV_VF_VRDIV; + break; + case 0x02: + funct6 = RISCV_VF_VSUB; + break; + case 0x0F: + funct6 = RISCV_VF_VSLIDE1DOWN; + break; + case 0x20: + funct6 = RISCV_VF_VDIV; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_FVFTYPE; + tree->ast_node.fvftype.funct6 = funct6; + tree->ast_node.fvftype.vm = vm; + tree->ast_node.fvftype.vs2 = vs2; + tree->ast_node.fvftype.rs1 = rs1; + tree->ast_node.fvftype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------FVFMATYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x28: + funct6 = RISCV_VF_VMADD; + break; + case 0x2C: + funct6 = RISCV_VF_VMACC; + break; + case 0x2D: + funct6 = RISCV_VF_VNMACC; + break; + case 0x2E: + funct6 = RISCV_VF_VMSAC; + break; + case 0x2F: + funct6 = RISCV_VF_VNMSAC; + break; + case 0x2A: + funct6 = RISCV_VF_VMSUB; + break; + case 0x2B: + funct6 = RISCV_VF_VNMSUB; + break; + case 0x29: + funct6 = RISCV_VF_VNMADD; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_FVFMATYPE; + tree->ast_node.fvfmatype.funct6 = funct6; + tree->ast_node.fvfmatype.vm = vm; + tree->ast_node.fvfmatype.vs2 = vs2; + tree->ast_node.fvfmatype.rs1 = rs1; + tree->ast_node.fvfmatype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------FWVFTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x30: + funct6 = RISCV_FWVF_VADD; + break; + case 0x32: + funct6 = RISCV_FWVF_VSUB; + break; + case 0x38: + funct6 = RISCV_FWVF_VMUL; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_FWVFTYPE; + tree->ast_node.fwvftype.funct6 = funct6; + tree->ast_node.fwvftype.vm = vm; + tree->ast_node.fwvftype.vs2 = vs2; + tree->ast_node.fwvftype.rs1 = rs1; + tree->ast_node.fwvftype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------FWVFMATYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x3E: + funct6 = RISCV_FWVF_VMSAC; + break; + case 0x3D: + funct6 = RISCV_FWVF_VNMACC; + break; + case 0x3C: + funct6 = RISCV_FWVF_VMACC; + break; + case 0x3F: + funct6 = RISCV_FWVF_VNMSAC; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_FWVFMATYPE; + tree->ast_node.fwvfmatype.funct6 = funct6; + tree->ast_node.fwvfmatype.vm = vm; + tree->ast_node.fwvfmatype.rs1 = rs1; + tree->ast_node.fwvfmatype.vs2 = vs2; + tree->ast_node.fwvfmatype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------FWFTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x36: + funct6 = RISCV_FWF_VSUB; + break; + case 0x34: + funct6 = RISCV_FWF_VADD; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_FWFTYPE; + tree->ast_node.fwftype.funct6 = funct6; + tree->ast_node.fwftype.vm = vm; + tree->ast_node.fwftype.vs2 = vs2; + tree->ast_node.fwftype.rs1 = rs1; + tree->ast_node.fwftype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VFMERGE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5) && + (((binary_stream & 0x0000000002000000) >> 25) == 0x0) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x17)) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_VFMERGE; tree->ast_node.vfmerge.vs2 = vs2; tree->ast_node.vfmerge.rs1 = rs1; tree->ast_node.vfmerge.vd = vd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x5) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x0000000002000000)>>25 == 0x1) && ((binary_stream & 0x00000000FC000000)>>26 == 0x17)) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_VFMV ; + //------------------------------------------------------------ + + // ---------------------------VFMV------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x0000000002000000) >> 25) == 0x1) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x17)) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_VFMV; tree->ast_node.vfmv.rs1 = rs1; tree->ast_node.vfmv.vd = vd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x5) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x0000000002000000)>>25 == 0x1) && ((binary_stream & 0x00000000FC000000)>>26 == 0x10)) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_VFMVSF ; + //------------------------------------------------------------ + + // ---------------------------VFMVSF------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x0000000002000000) >> 25) == 0x1) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x10)) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_VFMVSF; tree->ast_node.vfmvsf.rs1 = rs1; tree->ast_node.vfmvsf.vd = vd; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x07) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x000000000C000000)>>26 == 0x0) && ((binary_stream & 0x0000000010000000)>>28 == 0x0)) { - uint64_t width = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - width = RISCV_VLE64 ; - break; - case 0x5: - width = RISCV_VLE16 ; - break; - case 0x6: - width = RISCV_VLE32 ; - break; - case 0x0: - width = RISCV_VLE8 ; - break; - - } - if (width != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - uint64_t nf = (binary_stream & 0x00000000E0000000)>>29 ; - tree->ast_node_type = RISCV_VLSEGTYPE ; - tree->ast_node.vlsegtype.nf = nf; - tree->ast_node.vlsegtype.vm = vm; - tree->ast_node.vlsegtype.rs1 = rs1; - tree->ast_node.vlsegtype.width = width; - tree->ast_node.vlsegtype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x07) && ((binary_stream & 0x0000000001F00000)>>20 == 0x10) && ((binary_stream & 0x000000000C000000)>>26 == 0x0) && ((binary_stream & 0x0000000010000000)>>28 == 0x0)) { - uint64_t width = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - width = RISCV_VLE64 ; - break; - case 0x5: - width = RISCV_VLE16 ; - break; - case 0x6: - width = RISCV_VLE32 ; - break; - case 0x0: - width = RISCV_VLE8 ; - break; - - } - if (width != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - uint64_t nf = (binary_stream & 0x00000000E0000000)>>29 ; - tree->ast_node_type = RISCV_VLSEGFFTYPE ; - tree->ast_node.vlsegfftype.nf = nf; - tree->ast_node.vlsegfftype.vm = vm; - tree->ast_node.vlsegfftype.rs1 = rs1; - tree->ast_node.vlsegfftype.width = width; - tree->ast_node.vlsegfftype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x27) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x000000000C000000)>>26 == 0x0) && ((binary_stream & 0x0000000010000000)>>28 == 0x0)) { - uint64_t width = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - width = RISCV_VLE64 ; - break; - case 0x5: - width = RISCV_VLE16 ; - break; - case 0x6: - width = RISCV_VLE32 ; - break; - case 0x0: - width = RISCV_VLE8 ; - break; - - } - if (width != 0xFFFFFFFFFFFFFFFF) { - uint64_t vs3 = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - uint64_t nf = (binary_stream & 0x00000000E0000000)>>29 ; - tree->ast_node_type = RISCV_VSSEGTYPE ; - tree->ast_node.vssegtype.nf = nf; - tree->ast_node.vssegtype.vm = vm; - tree->ast_node.vssegtype.rs1 = rs1; - tree->ast_node.vssegtype.width = width; - tree->ast_node.vssegtype.vs3 = vs3; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x07) && ((binary_stream & 0x000000000C000000)>>26 == 0x2) && ((binary_stream & 0x0000000010000000)>>28 == 0x0)) { - uint64_t width = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - width = RISCV_VLE64 ; - break; - case 0x5: - width = RISCV_VLE16 ; - break; - case 0x6: - width = RISCV_VLE32 ; - break; - case 0x0: - width = RISCV_VLE8 ; - break; - - } - if (width != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - uint64_t nf = (binary_stream & 0x00000000E0000000)>>29 ; - tree->ast_node_type = RISCV_VLSSEGTYPE ; - tree->ast_node.vlssegtype.nf = nf; - tree->ast_node.vlssegtype.vm = vm; - tree->ast_node.vlssegtype.rs2 = rs2; - tree->ast_node.vlssegtype.rs1 = rs1; - tree->ast_node.vlssegtype.width = width; - tree->ast_node.vlssegtype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x27) && ((binary_stream & 0x000000000C000000)>>26 == 0x2) && ((binary_stream & 0x0000000010000000)>>28 == 0x0)) { - uint64_t width = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - width = RISCV_VLE64 ; - break; - case 0x5: - width = RISCV_VLE16 ; - break; - case 0x6: - width = RISCV_VLE32 ; - break; - case 0x0: - width = RISCV_VLE8 ; - break; - - } - if (width != 0xFFFFFFFFFFFFFFFF) { - uint64_t vs3 = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t rs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - uint64_t nf = (binary_stream & 0x00000000E0000000)>>29 ; - tree->ast_node_type = RISCV_VSSSEGTYPE ; - tree->ast_node.vsssegtype.nf = nf; - tree->ast_node.vsssegtype.vm = vm; - tree->ast_node.vsssegtype.rs2 = rs2; - tree->ast_node.vsssegtype.rs1 = rs1; - tree->ast_node.vsssegtype.width = width; - tree->ast_node.vsssegtype.vs3 = vs3; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x07) && ((binary_stream & 0x000000000C000000)>>26 == 0x1) && ((binary_stream & 0x0000000010000000)>>28 == 0x0)) { - uint64_t width = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - width = RISCV_VLE64 ; - break; - case 0x5: - width = RISCV_VLE16 ; - break; - case 0x6: - width = RISCV_VLE32 ; - break; - case 0x0: - width = RISCV_VLE8 ; - break; - - } - if (width != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - uint64_t nf = (binary_stream & 0x00000000E0000000)>>29 ; - tree->ast_node_type = RISCV_VLUXSEGTYPE ; - tree->ast_node.vluxsegtype.nf = nf; - tree->ast_node.vluxsegtype.vm = vm; - tree->ast_node.vluxsegtype.vs2 = vs2; - tree->ast_node.vluxsegtype.rs1 = rs1; - tree->ast_node.vluxsegtype.width = width; - tree->ast_node.vluxsegtype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x07) && ((binary_stream & 0x000000000C000000)>>26 == 0x3) && ((binary_stream & 0x0000000010000000)>>28 == 0x0)) { - uint64_t width = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - width = RISCV_VLE64 ; - break; - case 0x5: - width = RISCV_VLE16 ; - break; - case 0x6: - width = RISCV_VLE32 ; - break; - case 0x0: - width = RISCV_VLE8 ; - break; - - } - if (width != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - uint64_t nf = (binary_stream & 0x00000000E0000000)>>29 ; - tree->ast_node_type = RISCV_VLOXSEGTYPE ; - tree->ast_node.vloxsegtype.nf = nf; - tree->ast_node.vloxsegtype.vm = vm; - tree->ast_node.vloxsegtype.vs2 = vs2; - tree->ast_node.vloxsegtype.rs1 = rs1; - tree->ast_node.vloxsegtype.width = width; - tree->ast_node.vloxsegtype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x27) && ((binary_stream & 0x000000000C000000)>>26 == 0x1) && ((binary_stream & 0x0000000010000000)>>28 == 0x0)) { - uint64_t width = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - width = RISCV_VLE64 ; - break; - case 0x5: - width = RISCV_VLE16 ; - break; - case 0x6: - width = RISCV_VLE32 ; - break; - case 0x0: - width = RISCV_VLE8 ; - break; - - } - if (width != 0xFFFFFFFFFFFFFFFF) { - uint64_t vs3 = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - uint64_t nf = (binary_stream & 0x00000000E0000000)>>29 ; - tree->ast_node_type = RISCV_VSUXSEGTYPE ; - tree->ast_node.vsuxsegtype.nf = nf; - tree->ast_node.vsuxsegtype.vm = vm; - tree->ast_node.vsuxsegtype.vs2 = vs2; - tree->ast_node.vsuxsegtype.rs1 = rs1; - tree->ast_node.vsuxsegtype.width = width; - tree->ast_node.vsuxsegtype.vs3 = vs3; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x27) && ((binary_stream & 0x000000000C000000)>>26 == 0x3) && ((binary_stream & 0x0000000010000000)>>28 == 0x0)) { - uint64_t width = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - width = RISCV_VLE64 ; - break; - case 0x5: - width = RISCV_VLE16 ; - break; - case 0x6: - width = RISCV_VLE32 ; - break; - case 0x0: - width = RISCV_VLE8 ; - break; - - } - if (width != 0xFFFFFFFFFFFFFFFF) { - uint64_t vs3 = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - uint64_t nf = (binary_stream & 0x00000000E0000000)>>29 ; - tree->ast_node_type = RISCV_VSOXSEGTYPE ; - tree->ast_node.vsoxsegtype.nf = nf; - tree->ast_node.vsoxsegtype.vm = vm; - tree->ast_node.vsoxsegtype.vs2 = vs2; - tree->ast_node.vsoxsegtype.rs1 = rs1; - tree->ast_node.vsoxsegtype.width = width; - tree->ast_node.vsoxsegtype.vs3 = vs3; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x07) && ((binary_stream & 0x0000000001F00000)>>20 == 0x08) && ((binary_stream & 0x0000000002000000)>>25 == 0x1) && ((binary_stream & 0x000000000C000000)>>26 == 0x0) && ((binary_stream & 0x0000000010000000)>>28 == 0x0)) { - uint64_t width = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x0000000000007000)>>12) { - case 0x7: - width = RISCV_VLE64 ; - break; - case 0x5: - width = RISCV_VLE16 ; - break; - case 0x6: - width = RISCV_VLE32 ; - break; - case 0x0: - width = RISCV_VLE8 ; - break; - - } - if (width != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t nf = (binary_stream & 0x00000000E0000000)>>29 ; - tree->ast_node_type = RISCV_VLRETYPE ; - tree->ast_node.vlretype.nf = nf; - tree->ast_node.vlretype.rs1 = rs1; - tree->ast_node.vlretype.width = width; - tree->ast_node.vlretype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x27) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x0000000001F00000)>>20 == 0x08) && ((binary_stream & 0x0000000002000000)>>25 == 0x1) && ((binary_stream & 0x000000000C000000)>>26 == 0x0) && ((binary_stream & 0x0000000010000000)>>28 == 0x0)) { - uint64_t vs3 = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t nf = (binary_stream & 0x00000000E0000000)>>29 ; - tree->ast_node_type = RISCV_VSRETYPE ; + return; + } + } + //------------------------------------------------------------ + + // ---------------------------VLSEGTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x07) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x000000000C000000) >> 26) == 0x0) && + (((binary_stream & 0x0000000010000000) >> 28) == 0x0)) { + uint64_t width = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + width = RISCV_VLE64; + break; + case 0x5: + width = RISCV_VLE16; + break; + case 0x6: + width = RISCV_VLE32; + break; + case 0x0: + width = RISCV_VLE8; + break; + } + if (width != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + uint64_t nf = (binary_stream & 0x00000000E0000000) >> 29; + tree->ast_node_type = RISCV_VLSEGTYPE; + tree->ast_node.vlsegtype.nf = nf; + tree->ast_node.vlsegtype.vm = vm; + tree->ast_node.vlsegtype.rs1 = rs1; + tree->ast_node.vlsegtype.width = width; + tree->ast_node.vlsegtype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VLSEGFFTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x07) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x10) && + (((binary_stream & 0x000000000C000000) >> 26) == 0x0) && + (((binary_stream & 0x0000000010000000) >> 28) == 0x0)) { + uint64_t width = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + width = RISCV_VLE64; + break; + case 0x5: + width = RISCV_VLE16; + break; + case 0x6: + width = RISCV_VLE32; + break; + case 0x0: + width = RISCV_VLE8; + break; + } + if (width != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + uint64_t nf = (binary_stream & 0x00000000E0000000) >> 29; + tree->ast_node_type = RISCV_VLSEGFFTYPE; + tree->ast_node.vlsegfftype.nf = nf; + tree->ast_node.vlsegfftype.vm = vm; + tree->ast_node.vlsegfftype.rs1 = rs1; + tree->ast_node.vlsegfftype.width = width; + tree->ast_node.vlsegfftype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VSSEGTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x27) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x000000000C000000) >> 26) == 0x0) && + (((binary_stream & 0x0000000010000000) >> 28) == 0x0)) { + uint64_t width = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + width = RISCV_VLE64; + break; + case 0x5: + width = RISCV_VLE16; + break; + case 0x6: + width = RISCV_VLE32; + break; + case 0x0: + width = RISCV_VLE8; + break; + } + if (width != 0xFFFFFFFFFFFFFFFF) { + uint64_t vs3 = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + uint64_t nf = (binary_stream & 0x00000000E0000000) >> 29; + tree->ast_node_type = RISCV_VSSEGTYPE; + tree->ast_node.vssegtype.nf = nf; + tree->ast_node.vssegtype.vm = vm; + tree->ast_node.vssegtype.rs1 = rs1; + tree->ast_node.vssegtype.width = width; + tree->ast_node.vssegtype.vs3 = vs3; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VLSSEGTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x07) && + (((binary_stream & 0x000000000C000000) >> 26) == 0x2) && + (((binary_stream & 0x0000000010000000) >> 28) == 0x0)) { + uint64_t width = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + width = RISCV_VLE64; + break; + case 0x5: + width = RISCV_VLE16; + break; + case 0x6: + width = RISCV_VLE32; + break; + case 0x0: + width = RISCV_VLE8; + break; + } + if (width != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + uint64_t nf = (binary_stream & 0x00000000E0000000) >> 29; + tree->ast_node_type = RISCV_VLSSEGTYPE; + tree->ast_node.vlssegtype.nf = nf; + tree->ast_node.vlssegtype.vm = vm; + tree->ast_node.vlssegtype.rs2 = rs2; + tree->ast_node.vlssegtype.rs1 = rs1; + tree->ast_node.vlssegtype.width = width; + tree->ast_node.vlssegtype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VSSSEGTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x27) && + (((binary_stream & 0x000000000C000000) >> 26) == 0x2) && + (((binary_stream & 0x0000000010000000) >> 28) == 0x0)) { + uint64_t width = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + width = RISCV_VLE64; + break; + case 0x5: + width = RISCV_VLE16; + break; + case 0x6: + width = RISCV_VLE32; + break; + case 0x0: + width = RISCV_VLE8; + break; + } + if (width != 0xFFFFFFFFFFFFFFFF) { + uint64_t vs3 = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t rs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + uint64_t nf = (binary_stream & 0x00000000E0000000) >> 29; + tree->ast_node_type = RISCV_VSSSEGTYPE; + tree->ast_node.vsssegtype.nf = nf; + tree->ast_node.vsssegtype.vm = vm; + tree->ast_node.vsssegtype.rs2 = rs2; + tree->ast_node.vsssegtype.rs1 = rs1; + tree->ast_node.vsssegtype.width = width; + tree->ast_node.vsssegtype.vs3 = vs3; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VLUXSEGTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x07) && + (((binary_stream & 0x000000000C000000) >> 26) == 0x1) && + (((binary_stream & 0x0000000010000000) >> 28) == 0x0)) { + uint64_t width = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + width = RISCV_VLE64; + break; + case 0x5: + width = RISCV_VLE16; + break; + case 0x6: + width = RISCV_VLE32; + break; + case 0x0: + width = RISCV_VLE8; + break; + } + if (width != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + uint64_t nf = (binary_stream & 0x00000000E0000000) >> 29; + tree->ast_node_type = RISCV_VLUXSEGTYPE; + tree->ast_node.vluxsegtype.nf = nf; + tree->ast_node.vluxsegtype.vm = vm; + tree->ast_node.vluxsegtype.vs2 = vs2; + tree->ast_node.vluxsegtype.rs1 = rs1; + tree->ast_node.vluxsegtype.width = width; + tree->ast_node.vluxsegtype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VLOXSEGTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x07) && + (((binary_stream & 0x000000000C000000) >> 26) == 0x3) && + (((binary_stream & 0x0000000010000000) >> 28) == 0x0)) { + uint64_t width = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + width = RISCV_VLE64; + break; + case 0x5: + width = RISCV_VLE16; + break; + case 0x6: + width = RISCV_VLE32; + break; + case 0x0: + width = RISCV_VLE8; + break; + } + if (width != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + uint64_t nf = (binary_stream & 0x00000000E0000000) >> 29; + tree->ast_node_type = RISCV_VLOXSEGTYPE; + tree->ast_node.vloxsegtype.nf = nf; + tree->ast_node.vloxsegtype.vm = vm; + tree->ast_node.vloxsegtype.vs2 = vs2; + tree->ast_node.vloxsegtype.rs1 = rs1; + tree->ast_node.vloxsegtype.width = width; + tree->ast_node.vloxsegtype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VSUXSEGTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x27) && + (((binary_stream & 0x000000000C000000) >> 26) == 0x1) && + (((binary_stream & 0x0000000010000000) >> 28) == 0x0)) { + uint64_t width = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + width = RISCV_VLE64; + break; + case 0x5: + width = RISCV_VLE16; + break; + case 0x6: + width = RISCV_VLE32; + break; + case 0x0: + width = RISCV_VLE8; + break; + } + if (width != 0xFFFFFFFFFFFFFFFF) { + uint64_t vs3 = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + uint64_t nf = (binary_stream & 0x00000000E0000000) >> 29; + tree->ast_node_type = RISCV_VSUXSEGTYPE; + tree->ast_node.vsuxsegtype.nf = nf; + tree->ast_node.vsuxsegtype.vm = vm; + tree->ast_node.vsuxsegtype.vs2 = vs2; + tree->ast_node.vsuxsegtype.rs1 = rs1; + tree->ast_node.vsuxsegtype.width = width; + tree->ast_node.vsuxsegtype.vs3 = vs3; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VSOXSEGTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x27) && + (((binary_stream & 0x000000000C000000) >> 26) == 0x3) && + (((binary_stream & 0x0000000010000000) >> 28) == 0x0)) { + uint64_t width = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + width = RISCV_VLE64; + break; + case 0x5: + width = RISCV_VLE16; + break; + case 0x6: + width = RISCV_VLE32; + break; + case 0x0: + width = RISCV_VLE8; + break; + } + if (width != 0xFFFFFFFFFFFFFFFF) { + uint64_t vs3 = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + uint64_t nf = (binary_stream & 0x00000000E0000000) >> 29; + tree->ast_node_type = RISCV_VSOXSEGTYPE; + tree->ast_node.vsoxsegtype.nf = nf; + tree->ast_node.vsoxsegtype.vm = vm; + tree->ast_node.vsoxsegtype.vs2 = vs2; + tree->ast_node.vsoxsegtype.rs1 = rs1; + tree->ast_node.vsoxsegtype.width = width; + tree->ast_node.vsoxsegtype.vs3 = vs3; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VLRETYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x07) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x08) && + (((binary_stream & 0x0000000002000000) >> 25) == 0x1) && + (((binary_stream & 0x000000000C000000) >> 26) == 0x0) && + (((binary_stream & 0x0000000010000000) >> 28) == 0x0)) { + uint64_t width = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x0000000000007000) >> 12) { + case 0x7: + width = RISCV_VLE64; + break; + case 0x5: + width = RISCV_VLE16; + break; + case 0x6: + width = RISCV_VLE32; + break; + case 0x0: + width = RISCV_VLE8; + break; + } + if (width != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t nf = (binary_stream & 0x00000000E0000000) >> 29; + tree->ast_node_type = RISCV_VLRETYPE; + tree->ast_node.vlretype.nf = nf; + tree->ast_node.vlretype.rs1 = rs1; + tree->ast_node.vlretype.width = width; + tree->ast_node.vlretype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VSRETYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x27) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x08) && + (((binary_stream & 0x0000000002000000) >> 25) == 0x1) && + (((binary_stream & 0x000000000C000000) >> 26) == 0x0) && + (((binary_stream & 0x0000000010000000) >> 28) == 0x0)) { + uint64_t vs3 = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t nf = (binary_stream & 0x00000000E0000000) >> 29; + tree->ast_node_type = RISCV_VSRETYPE; tree->ast_node.vsretype.nf = nf; tree->ast_node.vsretype.rs1 = rs1; tree->ast_node.vsretype.vs3 = vs3; - return ; + return; + } } - if (((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x0000000001F00000)>>20 == 0x0B) && ((binary_stream & 0x0000000002000000)>>25 == 0x1) && ((binary_stream & 0x000000000C000000)>>26 == 0x0) && ((binary_stream & 0x0000000010000000)>>28 == 0x0) && ((binary_stream & 0x00000000E0000000)>>29 == 0x0)) { - uint64_t op = 0xFFFFFFFFFFFFFFFF ; + //------------------------------------------------------------ + + // ---------------------------VMTYPE------------------------------- + { + if ((((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x0B) && + (((binary_stream & 0x0000000002000000) >> 25) == 0x1) && + (((binary_stream & 0x000000000C000000) >> 26) == 0x0) && + (((binary_stream & 0x0000000010000000) >> 28) == 0x0) && + (((binary_stream & 0x00000000E0000000) >> 29) == 0x0)) { + uint64_t op = 0xFFFFFFFFFFFFFFFF; switch (binary_stream & 0x000000000000007F) { - case 0x07: - op = RISCV_VLM ; - break; - case 0x27: - op = RISCV_VSM ; - break; - - } - if (op != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd_or_vs3 = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_VMTYPE ; - tree->ast_node.vmtype.rs1 = rs1; - tree->ast_node.vmtype.vd_or_vs3 = vd_or_vs3; - tree->ast_node.vmtype.op = op; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x2) && ((binary_stream & 0x0000000002000000)>>25 == 0x1)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x19: - funct6 = RISCV_MM_VMAND ; - break; - case 0x1B: - funct6 = RISCV_MM_VMXOR ; - break; - case 0x1C: - funct6 = RISCV_MM_VMORN ; - break; - case 0x1A: - funct6 = RISCV_MM_VMOR ; - break; - case 0x1E: - funct6 = RISCV_MM_VMNOR ; - break; - case 0x1D: - funct6 = RISCV_MM_VMNAND ; - break; - case 0x18: - funct6 = RISCV_MM_VMANDN ; - break; - case 0x1F: - funct6 = RISCV_MM_VMXNOR ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_MMTYPE ; - tree->ast_node.mmtype.funct6 = funct6; - tree->ast_node.mmtype.vs2 = vs2; - tree->ast_node.mmtype.vs1 = vs1; - tree->ast_node.mmtype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x2) && ((binary_stream & 0x00000000000F8000)>>15 == 0x10) && ((binary_stream & 0x00000000FC000000)>>26 == 0x10)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_VCPOP_M ; + case 0x07: + op = RISCV_VLM; + break; + case 0x27: + op = RISCV_VSM; + break; + } + if (op != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd_or_vs3 = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_VMTYPE; + tree->ast_node.vmtype.rs1 = rs1; + tree->ast_node.vmtype.vd_or_vs3 = vd_or_vs3; + tree->ast_node.vmtype.op = op; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------MMTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2) && + (((binary_stream & 0x0000000002000000) >> 25) == 0x1)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x19: + funct6 = RISCV_MM_VMAND; + break; + case 0x1B: + funct6 = RISCV_MM_VMXOR; + break; + case 0x1C: + funct6 = RISCV_MM_VMORN; + break; + case 0x1A: + funct6 = RISCV_MM_VMOR; + break; + case 0x1E: + funct6 = RISCV_MM_VMNOR; + break; + case 0x1D: + funct6 = RISCV_MM_VMNAND; + break; + case 0x18: + funct6 = RISCV_MM_VMANDN; + break; + case 0x1F: + funct6 = RISCV_MM_VMXNOR; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_MMTYPE; + tree->ast_node.mmtype.funct6 = funct6; + tree->ast_node.mmtype.vs2 = vs2; + tree->ast_node.mmtype.vs1 = vs1; + tree->ast_node.mmtype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VCPOP_M------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2) && + (((binary_stream & 0x00000000000F8000) >> 15) == 0x10) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x10)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_VCPOP_M; tree->ast_node.vcpop_m.vm = vm; tree->ast_node.vcpop_m.vs2 = vs2; tree->ast_node.vcpop_m.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x2) && ((binary_stream & 0x00000000000F8000)>>15 == 0x11) && ((binary_stream & 0x00000000FC000000)>>26 == 0x10)) { - uint64_t rd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_VFIRST_M ; + //------------------------------------------------------------ + + // ---------------------------VFIRST_M------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2) && + (((binary_stream & 0x00000000000F8000) >> 15) == 0x11) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x10)) { + uint64_t rd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_VFIRST_M; tree->ast_node.vfirst_m.vm = vm; tree->ast_node.vfirst_m.vs2 = vs2; tree->ast_node.vfirst_m.rd = rd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x2) && ((binary_stream & 0x00000000000F8000)>>15 == 0x01) && ((binary_stream & 0x00000000FC000000)>>26 == 0x14)) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_VMSBF_M ; + //------------------------------------------------------------ + + // ---------------------------VMSBF_M------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2) && + (((binary_stream & 0x00000000000F8000) >> 15) == 0x01) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x14)) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_VMSBF_M; tree->ast_node.vmsbf_m.vm = vm; tree->ast_node.vmsbf_m.vs2 = vs2; tree->ast_node.vmsbf_m.vd = vd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x2) && ((binary_stream & 0x00000000000F8000)>>15 == 0x03) && ((binary_stream & 0x00000000FC000000)>>26 == 0x14)) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_VMSIF_M ; + //------------------------------------------------------------ + + // ---------------------------VMSIF_M------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2) && + (((binary_stream & 0x00000000000F8000) >> 15) == 0x03) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x14)) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_VMSIF_M; tree->ast_node.vmsif_m.vm = vm; tree->ast_node.vmsif_m.vs2 = vs2; tree->ast_node.vmsif_m.vd = vd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x2) && ((binary_stream & 0x00000000000F8000)>>15 == 0x02) && ((binary_stream & 0x00000000FC000000)>>26 == 0x14)) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_VMSOF_M ; + //------------------------------------------------------------ + + // ---------------------------VMSOF_M------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2) && + (((binary_stream & 0x00000000000F8000) >> 15) == 0x02) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x14)) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_VMSOF_M; tree->ast_node.vmsof_m.vm = vm; tree->ast_node.vmsof_m.vs2 = vs2; tree->ast_node.vmsof_m.vd = vd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x2) && ((binary_stream & 0x00000000000F8000)>>15 == 0x10) && ((binary_stream & 0x00000000FC000000)>>26 == 0x14)) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_VIOTA_M ; + //------------------------------------------------------------ + + // ---------------------------VIOTA_M------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2) && + (((binary_stream & 0x00000000000F8000) >> 15) == 0x10) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x14)) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_VIOTA_M; tree->ast_node.viota_m.vm = vm; tree->ast_node.viota_m.vs2 = vs2; tree->ast_node.viota_m.vd = vd; - return ; + return; + } } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x2) && ((binary_stream & 0x00000000000F8000)>>15 == 0x11) && ((binary_stream & 0x0000000001F00000)>>20 == 0x00) && ((binary_stream & 0x00000000FC000000)>>26 == 0x14)) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_VID_V ; + //------------------------------------------------------------ + + // ---------------------------VID_V------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2) && + (((binary_stream & 0x00000000000F8000) >> 15) == 0x11) && + (((binary_stream & 0x0000000001F00000) >> 20) == 0x00) && + (((binary_stream & 0x00000000FC000000) >> 26) == 0x14)) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_VID_V; tree->ast_node.vid_v.vm = vm; tree->ast_node.vid_v.vd = vd; - return ; - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x0000000002000000)>>25 == 0x0)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x13: - funct6 = RISCV_VVM_VMSBC ; - break; - case 0x11: - funct6 = RISCV_VVM_VMADC ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_VVMTYPE ; - tree->ast_node.vvmtype.funct6 = funct6; - tree->ast_node.vvmtype.vs2 = vs2; - tree->ast_node.vvmtype.vs1 = vs1; - tree->ast_node.vvmtype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x0000000002000000)>>25 == 0x1)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x13: - funct6 = RISCV_VVMC_VMSBC ; - break; - case 0x11: - funct6 = RISCV_VVMC_VMADC ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_VVMCTYPE ; - tree->ast_node.vvmctype.funct6 = funct6; - tree->ast_node.vvmctype.vs2 = vs2; - tree->ast_node.vvmctype.vs1 = vs1; - tree->ast_node.vvmctype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x0) && ((binary_stream & 0x0000000002000000)>>25 == 0x0)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x10: - funct6 = RISCV_VVMS_VADC ; - break; - case 0x12: - funct6 = RISCV_VVMS_VSBC ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_VVMSTYPE ; - tree->ast_node.vvmstype.funct6 = funct6; - tree->ast_node.vvmstype.vs2 = vs2; - tree->ast_node.vvmstype.vs1 = vs1; - tree->ast_node.vvmstype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x0)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x19: - funct6 = RISCV_VVCMP_VMSNE ; - break; - case 0x1B: - funct6 = RISCV_VVCMP_VMSLT ; - break; - case 0x1C: - funct6 = RISCV_VVCMP_VMSLEU ; - break; - case 0x1A: - funct6 = RISCV_VVCMP_VMSLTU ; - break; - case 0x18: - funct6 = RISCV_VVCMP_VMSEQ ; - break; - case 0x1D: - funct6 = RISCV_VVCMP_VMSLE ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_VVCMPTYPE ; - tree->ast_node.vvcmptype.funct6 = funct6; - tree->ast_node.vvcmptype.vm = vm; - tree->ast_node.vvcmptype.vs2 = vs2; - tree->ast_node.vvcmptype.vs1 = vs1; - tree->ast_node.vvcmptype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x4) && ((binary_stream & 0x0000000002000000)>>25 == 0x0)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x13: - funct6 = RISCV_VXM_VMSBC ; - break; - case 0x11: - funct6 = RISCV_VXM_VMADC ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_VXMTYPE ; - tree->ast_node.vxmtype.funct6 = funct6; - tree->ast_node.vxmtype.vs2 = vs2; - tree->ast_node.vxmtype.rs1 = rs1; - tree->ast_node.vxmtype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x4) && ((binary_stream & 0x0000000002000000)>>25 == 0x1)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x13: - funct6 = RISCV_VXMC_VMSBC ; - break; - case 0x11: - funct6 = RISCV_VXMC_VMADC ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_VXMCTYPE ; - tree->ast_node.vxmctype.funct6 = funct6; - tree->ast_node.vxmctype.vs2 = vs2; - tree->ast_node.vxmctype.rs1 = rs1; - tree->ast_node.vxmctype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x4) && ((binary_stream & 0x0000000002000000)>>25 == 0x0)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x10: - funct6 = RISCV_VXMS_VADC ; - break; - case 0x12: - funct6 = RISCV_VXMS_VSBC ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_VXMSTYPE ; - tree->ast_node.vxmstype.funct6 = funct6; - tree->ast_node.vxmstype.vs2 = vs2; - tree->ast_node.vxmstype.rs1 = rs1; - tree->ast_node.vxmstype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x4)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x19: - funct6 = RISCV_VXCMP_VMSNE ; - break; - case 0x1B: - funct6 = RISCV_VXCMP_VMSLT ; - break; - case 0x1C: - funct6 = RISCV_VXCMP_VMSLEU ; - break; - case 0x1A: - funct6 = RISCV_VXCMP_VMSLTU ; - break; - case 0x1E: - funct6 = RISCV_VXCMP_VMSGTU ; - break; - case 0x18: - funct6 = RISCV_VXCMP_VMSEQ ; - break; - case 0x1D: - funct6 = RISCV_VXCMP_VMSLE ; - break; - case 0x1F: - funct6 = RISCV_VXCMP_VMSGT ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_VXCMPTYPE ; - tree->ast_node.vxcmptype.funct6 = funct6; - tree->ast_node.vxcmptype.vm = vm; - tree->ast_node.vxcmptype.vs2 = vs2; - tree->ast_node.vxcmptype.rs1 = rs1; - tree->ast_node.vxcmptype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x3) && ((binary_stream & 0x0000000002000000)>>25 == 0x0)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x11: - funct6 = RISCV_VIM_VMADC ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t simm = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_VIMTYPE ; - tree->ast_node.vimtype.funct6 = funct6; - tree->ast_node.vimtype.vs2 = vs2; - tree->ast_node.vimtype.simm = simm; - tree->ast_node.vimtype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x3) && ((binary_stream & 0x0000000002000000)>>25 == 0x1)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x11: - funct6 = RISCV_VIMC_VMADC ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t simm = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_VIMCTYPE ; - tree->ast_node.vimctype.funct6 = funct6; - tree->ast_node.vimctype.vs2 = vs2; - tree->ast_node.vimctype.simm = simm; - tree->ast_node.vimctype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x3) && ((binary_stream & 0x0000000002000000)>>25 == 0x0)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x10: - funct6 = RISCV_VIMS_VADC ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t simm = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - tree->ast_node_type = RISCV_VIMSTYPE ; - tree->ast_node.vimstype.funct6 = funct6; - tree->ast_node.vimstype.vs2 = vs2; - tree->ast_node.vimstype.simm = simm; - tree->ast_node.vimstype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x3)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x19: - funct6 = RISCV_VICMP_VMSNE ; - break; - case 0x1C: - funct6 = RISCV_VICMP_VMSLEU ; - break; - case 0x1E: - funct6 = RISCV_VICMP_VMSGTU ; - break; - case 0x18: - funct6 = RISCV_VICMP_VMSEQ ; - break; - case 0x1D: - funct6 = RISCV_VICMP_VMSLE ; - break; - case 0x1F: - funct6 = RISCV_VICMP_VMSGT ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t simm = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_VICMPTYPE ; - tree->ast_node.vicmptype.funct6 = funct6; - tree->ast_node.vicmptype.vm = vm; - tree->ast_node.vicmptype.vs2 = vs2; - tree->ast_node.vicmptype.simm = simm; - tree->ast_node.vicmptype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x1)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x19: - funct6 = RISCV_FVVM_VMFLE ; - break; - case 0x1B: - funct6 = RISCV_FVVM_VMFLT ; - break; - case 0x1C: - funct6 = RISCV_FVVM_VMFNE ; - break; - case 0x18: - funct6 = RISCV_FVVM_VMFEQ ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_FVVMTYPE ; - tree->ast_node.fvvmtype.funct6 = funct6; - tree->ast_node.fvvmtype.vm = vm; - tree->ast_node.fvvmtype.vs2 = vs2; - tree->ast_node.fvvmtype.vs1 = vs1; - tree->ast_node.fvvmtype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x5)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x19: - funct6 = RISCV_VFM_VMFLE ; - break; - case 0x1B: - funct6 = RISCV_VFM_VMFLT ; - break; - case 0x1C: - funct6 = RISCV_VFM_VMFNE ; - break; - case 0x18: - funct6 = RISCV_VFM_VMFEQ ; - break; - case 0x1D: - funct6 = RISCV_VFM_VMFGT ; - break; - case 0x1F: - funct6 = RISCV_VFM_VMFGE ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_FVFMTYPE ; - tree->ast_node.fvfmtype.funct6 = funct6; - tree->ast_node.fvfmtype.vm = vm; - tree->ast_node.fvfmtype.vs2 = vs2; - tree->ast_node.fvfmtype.rs1 = rs1; - tree->ast_node.fvfmtype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x0)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x31: - funct6 = RISCV_IVV_VWREDSUM ; - break; - case 0x30: - funct6 = RISCV_IVV_VWREDSUMU ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_RIVVTYPE ; - tree->ast_node.rivvtype.funct6 = funct6; - tree->ast_node.rivvtype.vm = vm; - tree->ast_node.rivvtype.vs2 = vs2; - tree->ast_node.rivvtype.vs1 = vs1; - tree->ast_node.rivvtype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x2)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x01: - funct6 = RISCV_MVV_VREDAND ; - break; - case 0x06: - funct6 = RISCV_MVV_VREDMAXU ; - break; - case 0x07: - funct6 = RISCV_MVV_VREDMAX ; - break; - case 0x04: - funct6 = RISCV_MVV_VREDMINU ; - break; - case 0x00: - funct6 = RISCV_MVV_VREDSUM ; - break; - case 0x03: - funct6 = RISCV_MVV_VREDXOR ; - break; - case 0x05: - funct6 = RISCV_MVV_VREDMIN ; - break; - case 0x02: - funct6 = RISCV_MVV_VREDOR ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_RMVVTYPE ; - tree->ast_node.rmvvtype.funct6 = funct6; - tree->ast_node.rmvvtype.vm = vm; - tree->ast_node.rmvvtype.vs2 = vs2; - tree->ast_node.rmvvtype.vs1 = vs1; - tree->ast_node.rmvvtype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x57) && ((binary_stream & 0x0000000000007000)>>12 == 0x1)) { - uint64_t funct6 = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FC000000)>>26) { - case 0x33: - funct6 = RISCV_FVV_VFWREDOSUM ; - break; - case 0x01: - funct6 = RISCV_FVV_VFREDUSUM ; - break; - case 0x31: - funct6 = RISCV_FVV_VFWREDUSUM ; - break; - case 0x07: - funct6 = RISCV_FVV_VFREDMAX ; - break; - case 0x03: - funct6 = RISCV_FVV_VFREDOSUM ; - break; - case 0x05: - funct6 = RISCV_FVV_VFREDMIN ; - break; - - } - if (funct6 != 0xFFFFFFFFFFFFFFFF) { - uint64_t vd = (binary_stream & 0x0000000000000F80)>>7 ; - uint64_t vs1 = (binary_stream & 0x00000000000F8000)>>15 ; - uint64_t vs2 = (binary_stream & 0x0000000001F00000)>>20 ; - uint64_t vm = (binary_stream & 0x0000000002000000)>>25 ; - tree->ast_node_type = RISCV_RFVVTYPE ; - tree->ast_node.rfvvtype.funct6 = funct6; - tree->ast_node.rfvvtype.vm = vm; - tree->ast_node.rfvvtype.vs2 = vs2; - tree->ast_node.rfvvtype.vs1 = vs1; - tree->ast_node.rfvvtype.vd = vd; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x0F) && ((binary_stream & 0x0000000000000F80)>>7 == 0x00) && ((binary_stream & 0x0000000000007000)>>12 == 0x2)) { - uint64_t cbop = 0xFFFFFFFFFFFFFFFF ; - switch ((binary_stream & 0x00000000FFF00000)>>20) { - case 0x000: - cbop = RISCV_CBO_INVAL ; - break; - case 0x002: - cbop = RISCV_CBO_FLUSH ; - break; - case 0x001: - cbop = RISCV_CBO_CLEAN ; - break; - - } - if (cbop != 0xFFFFFFFFFFFFFFFF) { - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_ZICBOM ; - tree->ast_node.riscv_zicbom.cbop = cbop; - tree->ast_node.riscv_zicbom.rs1 = rs1; - return ; - } - } - if ((binary_stream & 0x000000000000007F == 0x0F) && ((binary_stream & 0x0000000000000F80)>>7 == 0x00) && ((binary_stream & 0x0000000000007000)>>12 == 0x2) && ((binary_stream & 0x00000000FFF00000)>>20 == 0x004)) { - uint64_t rs1 = (binary_stream & 0x00000000000F8000)>>15 ; - tree->ast_node_type = RISCV_ZICBOZ ; + return; + } + } + //------------------------------------------------------------ + + // ---------------------------VVMTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x0000000002000000) >> 25) == 0x0)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x13: + funct6 = RISCV_VVM_VMSBC; + break; + case 0x11: + funct6 = RISCV_VVM_VMADC; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_VVMTYPE; + tree->ast_node.vvmtype.funct6 = funct6; + tree->ast_node.vvmtype.vs2 = vs2; + tree->ast_node.vvmtype.vs1 = vs1; + tree->ast_node.vvmtype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VVMCTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x0000000002000000) >> 25) == 0x1)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x13: + funct6 = RISCV_VVMC_VMSBC; + break; + case 0x11: + funct6 = RISCV_VVMC_VMADC; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_VVMCTYPE; + tree->ast_node.vvmctype.funct6 = funct6; + tree->ast_node.vvmctype.vs2 = vs2; + tree->ast_node.vvmctype.vs1 = vs1; + tree->ast_node.vvmctype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VVMSTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0) && + (((binary_stream & 0x0000000002000000) >> 25) == 0x0)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x10: + funct6 = RISCV_VVMS_VADC; + break; + case 0x12: + funct6 = RISCV_VVMS_VSBC; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_VVMSTYPE; + tree->ast_node.vvmstype.funct6 = funct6; + tree->ast_node.vvmstype.vs2 = vs2; + tree->ast_node.vvmstype.vs1 = vs1; + tree->ast_node.vvmstype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VVCMPTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x19: + funct6 = RISCV_VVCMP_VMSNE; + break; + case 0x1B: + funct6 = RISCV_VVCMP_VMSLT; + break; + case 0x1C: + funct6 = RISCV_VVCMP_VMSLEU; + break; + case 0x1A: + funct6 = RISCV_VVCMP_VMSLTU; + break; + case 0x18: + funct6 = RISCV_VVCMP_VMSEQ; + break; + case 0x1D: + funct6 = RISCV_VVCMP_VMSLE; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_VVCMPTYPE; + tree->ast_node.vvcmptype.funct6 = funct6; + tree->ast_node.vvcmptype.vm = vm; + tree->ast_node.vvcmptype.vs2 = vs2; + tree->ast_node.vvcmptype.vs1 = vs1; + tree->ast_node.vvcmptype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VXMTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x4) && + (((binary_stream & 0x0000000002000000) >> 25) == 0x0)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x13: + funct6 = RISCV_VXM_VMSBC; + break; + case 0x11: + funct6 = RISCV_VXM_VMADC; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_VXMTYPE; + tree->ast_node.vxmtype.funct6 = funct6; + tree->ast_node.vxmtype.vs2 = vs2; + tree->ast_node.vxmtype.rs1 = rs1; + tree->ast_node.vxmtype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VXMCTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x4) && + (((binary_stream & 0x0000000002000000) >> 25) == 0x1)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x13: + funct6 = RISCV_VXMC_VMSBC; + break; + case 0x11: + funct6 = RISCV_VXMC_VMADC; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_VXMCTYPE; + tree->ast_node.vxmctype.funct6 = funct6; + tree->ast_node.vxmctype.vs2 = vs2; + tree->ast_node.vxmctype.rs1 = rs1; + tree->ast_node.vxmctype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VXMSTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x4) && + (((binary_stream & 0x0000000002000000) >> 25) == 0x0)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x10: + funct6 = RISCV_VXMS_VADC; + break; + case 0x12: + funct6 = RISCV_VXMS_VSBC; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_VXMSTYPE; + tree->ast_node.vxmstype.funct6 = funct6; + tree->ast_node.vxmstype.vs2 = vs2; + tree->ast_node.vxmstype.rs1 = rs1; + tree->ast_node.vxmstype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VXCMPTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x4)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x19: + funct6 = RISCV_VXCMP_VMSNE; + break; + case 0x1B: + funct6 = RISCV_VXCMP_VMSLT; + break; + case 0x1C: + funct6 = RISCV_VXCMP_VMSLEU; + break; + case 0x1A: + funct6 = RISCV_VXCMP_VMSLTU; + break; + case 0x1E: + funct6 = RISCV_VXCMP_VMSGTU; + break; + case 0x18: + funct6 = RISCV_VXCMP_VMSEQ; + break; + case 0x1D: + funct6 = RISCV_VXCMP_VMSLE; + break; + case 0x1F: + funct6 = RISCV_VXCMP_VMSGT; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_VXCMPTYPE; + tree->ast_node.vxcmptype.funct6 = funct6; + tree->ast_node.vxcmptype.vm = vm; + tree->ast_node.vxcmptype.vs2 = vs2; + tree->ast_node.vxcmptype.rs1 = rs1; + tree->ast_node.vxcmptype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VIMTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x3) && + (((binary_stream & 0x0000000002000000) >> 25) == 0x0)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x11: + funct6 = RISCV_VIM_VMADC; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t simm = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_VIMTYPE; + tree->ast_node.vimtype.funct6 = funct6; + tree->ast_node.vimtype.vs2 = vs2; + tree->ast_node.vimtype.simm = simm; + tree->ast_node.vimtype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VIMCTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x3) && + (((binary_stream & 0x0000000002000000) >> 25) == 0x1)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x11: + funct6 = RISCV_VIMC_VMADC; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t simm = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_VIMCTYPE; + tree->ast_node.vimctype.funct6 = funct6; + tree->ast_node.vimctype.vs2 = vs2; + tree->ast_node.vimctype.simm = simm; + tree->ast_node.vimctype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VIMSTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x3) && + (((binary_stream & 0x0000000002000000) >> 25) == 0x0)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x10: + funct6 = RISCV_VIMS_VADC; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t simm = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + tree->ast_node_type = RISCV_VIMSTYPE; + tree->ast_node.vimstype.funct6 = funct6; + tree->ast_node.vimstype.vs2 = vs2; + tree->ast_node.vimstype.simm = simm; + tree->ast_node.vimstype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------VICMPTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x3)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x19: + funct6 = RISCV_VICMP_VMSNE; + break; + case 0x1C: + funct6 = RISCV_VICMP_VMSLEU; + break; + case 0x1E: + funct6 = RISCV_VICMP_VMSGTU; + break; + case 0x18: + funct6 = RISCV_VICMP_VMSEQ; + break; + case 0x1D: + funct6 = RISCV_VICMP_VMSLE; + break; + case 0x1F: + funct6 = RISCV_VICMP_VMSGT; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t simm = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_VICMPTYPE; + tree->ast_node.vicmptype.funct6 = funct6; + tree->ast_node.vicmptype.vm = vm; + tree->ast_node.vicmptype.vs2 = vs2; + tree->ast_node.vicmptype.simm = simm; + tree->ast_node.vicmptype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------FVVMTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x19: + funct6 = RISCV_FVVM_VMFLE; + break; + case 0x1B: + funct6 = RISCV_FVVM_VMFLT; + break; + case 0x1C: + funct6 = RISCV_FVVM_VMFNE; + break; + case 0x18: + funct6 = RISCV_FVVM_VMFEQ; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_FVVMTYPE; + tree->ast_node.fvvmtype.funct6 = funct6; + tree->ast_node.fvvmtype.vm = vm; + tree->ast_node.fvvmtype.vs2 = vs2; + tree->ast_node.fvvmtype.vs1 = vs1; + tree->ast_node.fvvmtype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------FVFMTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x5)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x19: + funct6 = RISCV_VFM_VMFLE; + break; + case 0x1B: + funct6 = RISCV_VFM_VMFLT; + break; + case 0x1C: + funct6 = RISCV_VFM_VMFNE; + break; + case 0x18: + funct6 = RISCV_VFM_VMFEQ; + break; + case 0x1D: + funct6 = RISCV_VFM_VMFGT; + break; + case 0x1F: + funct6 = RISCV_VFM_VMFGE; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_FVFMTYPE; + tree->ast_node.fvfmtype.funct6 = funct6; + tree->ast_node.fvfmtype.vm = vm; + tree->ast_node.fvfmtype.vs2 = vs2; + tree->ast_node.fvfmtype.rs1 = rs1; + tree->ast_node.fvfmtype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------RIVVTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x0)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x31: + funct6 = RISCV_IVV_VWREDSUM; + break; + case 0x30: + funct6 = RISCV_IVV_VWREDSUMU; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_RIVVTYPE; + tree->ast_node.rivvtype.funct6 = funct6; + tree->ast_node.rivvtype.vm = vm; + tree->ast_node.rivvtype.vs2 = vs2; + tree->ast_node.rivvtype.vs1 = vs1; + tree->ast_node.rivvtype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------RMVVTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x01: + funct6 = RISCV_MVV_VREDAND; + break; + case 0x06: + funct6 = RISCV_MVV_VREDMAXU; + break; + case 0x07: + funct6 = RISCV_MVV_VREDMAX; + break; + case 0x04: + funct6 = RISCV_MVV_VREDMINU; + break; + case 0x00: + funct6 = RISCV_MVV_VREDSUM; + break; + case 0x03: + funct6 = RISCV_MVV_VREDXOR; + break; + case 0x05: + funct6 = RISCV_MVV_VREDMIN; + break; + case 0x02: + funct6 = RISCV_MVV_VREDOR; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_RMVVTYPE; + tree->ast_node.rmvvtype.funct6 = funct6; + tree->ast_node.rmvvtype.vm = vm; + tree->ast_node.rmvvtype.vs2 = vs2; + tree->ast_node.rmvvtype.vs1 = vs1; + tree->ast_node.rmvvtype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------RFVVTYPE------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x57) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x1)) { + uint64_t funct6 = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FC000000) >> 26) { + case 0x33: + funct6 = RISCV_FVV_VFWREDOSUM; + break; + case 0x01: + funct6 = RISCV_FVV_VFREDUSUM; + break; + case 0x31: + funct6 = RISCV_FVV_VFWREDUSUM; + break; + case 0x07: + funct6 = RISCV_FVV_VFREDMAX; + break; + case 0x03: + funct6 = RISCV_FVV_VFREDOSUM; + break; + case 0x05: + funct6 = RISCV_FVV_VFREDMIN; + break; + } + if (funct6 != 0xFFFFFFFFFFFFFFFF) { + uint64_t vd = (binary_stream & 0x0000000000000F80) >> 7; + uint64_t vs1 = (binary_stream & 0x00000000000F8000) >> 15; + uint64_t vs2 = (binary_stream & 0x0000000001F00000) >> 20; + uint64_t vm = (binary_stream & 0x0000000002000000) >> 25; + tree->ast_node_type = RISCV_RFVVTYPE; + tree->ast_node.rfvvtype.funct6 = funct6; + tree->ast_node.rfvvtype.vm = vm; + tree->ast_node.rfvvtype.vs2 = vs2; + tree->ast_node.rfvvtype.vs1 = vs1; + tree->ast_node.rfvvtype.vd = vd; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------RISCV_ZICBOM------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x0F) && + (((binary_stream & 0x0000000000000F80) >> 7) == 0x00) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2)) { + uint64_t cbop = 0xFFFFFFFFFFFFFFFF; + switch ((binary_stream & 0x00000000FFF00000) >> 20) { + case 0x000: + cbop = RISCV_CBO_INVAL; + break; + case 0x002: + cbop = RISCV_CBO_FLUSH; + break; + case 0x001: + cbop = RISCV_CBO_CLEAN; + break; + } + if (cbop != 0xFFFFFFFFFFFFFFFF) { + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_ZICBOM; + tree->ast_node.riscv_zicbom.cbop = cbop; + tree->ast_node.riscv_zicbom.rs1 = rs1; + return; + } + } + } + //------------------------------------------------------------ + + // ---------------------------RISCV_ZICBOZ------------------------------- + { + if (((binary_stream & 0x000000000000007F) == 0x0F) && + (((binary_stream & 0x0000000000000F80) >> 7) == 0x00) && + (((binary_stream & 0x0000000000007000) >> 12) == 0x2) && + (((binary_stream & 0x00000000FFF00000) >> 20) == 0x004)) { + uint64_t rs1 = (binary_stream & 0x00000000000F8000) >> 15; + tree->ast_node_type = RISCV_ZICBOZ; tree->ast_node.riscv_zicboz = rs1; - return ; + return; + } } - uint64_t s = binary_stream & 0x00000000FFFFFFFF ; - tree->ast_node_type = RISCV_ILLEGAL ; + //------------------------------------------------------------ + + // ---------------------------ILLEGAL------------------------------- + { + uint64_t s = binary_stream & 0x00000000FFFFFFFF; + tree->ast_node_type = RISCV_ILLEGAL; tree->ast_node.illegal = s; - return ; -} \ No newline at end of file + return; + } + //------------------------------------------------------------ +} + +#endif diff --git a/arch/RISCV/riscv_helpers_ast2str.h b/arch/RISCV/riscv_helpers_ast2str.h new file mode 100644 index 00000000000..12bed0470f0 --- /dev/null +++ b/arch/RISCV/riscv_helpers_ast2str.h @@ -0,0 +1,235 @@ +#ifndef __AST2STR_HELPERS_H__ +#define __AST2STR_HELPERS_H__ + +#include +#include + +#include "riscv_helpers_rvconf.h" + +#define RISCV_TEMP_BUFFER_MAX_LEN 32 + +#define spc(ps, plen, c) \ + *ps = " "; \ + *plen = 1 + +#define opt_spc spc + +#define sep(ps, plen, c) \ + *ps = " , "; \ + *plen = 3 + +static inline void hex_bits(uint64_t bitvec, char **s, size_t *len, + uint8_t bvlen_bits, riscv_conf *conf) { + char *str = *s; + 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; + + for (uint8_t i = 0; i < bvlen_bits; i += 4) { + char digit = (bitvec & 0xF) + 48; + if (digit > '9') { + digit += ('a' - ':'); + } + + str[--str_len] = digit; + bitvec = bitvec >> 4; + } + str[0] = '0'; + str[1] = 'x'; +} + +#define DEF_HEX_BITS(n) \ + static inline void hex_bits_##n(uint64_t bitvec, char **s, size_t *len, \ + riscv_conf *conf) { \ + hex_bits(bitvec, s, len, n, conf); \ + } + +DEF_HEX_BITS(1) +DEF_HEX_BITS(2) +DEF_HEX_BITS(3) +DEF_HEX_BITS(4) +DEF_HEX_BITS(5) +DEF_HEX_BITS(6) +DEF_HEX_BITS(7) +DEF_HEX_BITS(8) +DEF_HEX_BITS(9) +DEF_HEX_BITS(10) +DEF_HEX_BITS(11) +DEF_HEX_BITS(12) +DEF_HEX_BITS(13) +DEF_HEX_BITS(14) +DEF_HEX_BITS(15) +DEF_HEX_BITS(16) +DEF_HEX_BITS(17) +DEF_HEX_BITS(18) +DEF_HEX_BITS(19) +DEF_HEX_BITS(20) +DEF_HEX_BITS(21) +DEF_HEX_BITS(22) +DEF_HEX_BITS(23) +DEF_HEX_BITS(24) +DEF_HEX_BITS(25) +DEF_HEX_BITS(26) +DEF_HEX_BITS(27) +DEF_HEX_BITS(28) +DEF_HEX_BITS(29) +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, + riscv_conf *conf) { + // is not negative ? + if ((bitvec & (1 << (bvlen_bits - 1))) == 0) { + hex_bits(bitvec, s, len, bvlen_bits, conf); + } else { + char *buff = *s; + buff[0] = '-'; + buff++; + hex_bits(~bitvec + 1ULL, &buff, len, bvlen_bits, 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); \ + } + +DEF_HEX_BITS_SIGNED(1); +DEF_HEX_BITS_SIGNED(2); +DEF_HEX_BITS_SIGNED(3); +DEF_HEX_BITS_SIGNED(4); +DEF_HEX_BITS_SIGNED(5); +DEF_HEX_BITS_SIGNED(6); +DEF_HEX_BITS_SIGNED(7); +DEF_HEX_BITS_SIGNED(8); +DEF_HEX_BITS_SIGNED(9); +DEF_HEX_BITS_SIGNED(10); +DEF_HEX_BITS_SIGNED(11); +DEF_HEX_BITS_SIGNED(12); +DEF_HEX_BITS_SIGNED(13); +DEF_HEX_BITS_SIGNED(14); +DEF_HEX_BITS_SIGNED(15); +DEF_HEX_BITS_SIGNED(16); +DEF_HEX_BITS_SIGNED(17); +DEF_HEX_BITS_SIGNED(18); +DEF_HEX_BITS_SIGNED(19); +DEF_HEX_BITS_SIGNED(20); +DEF_HEX_BITS_SIGNED(21); +DEF_HEX_BITS_SIGNED(22); +DEF_HEX_BITS_SIGNED(23); +DEF_HEX_BITS_SIGNED(24); +DEF_HEX_BITS_SIGNED(25); +DEF_HEX_BITS_SIGNED(26); +DEF_HEX_BITS_SIGNED(27); +DEF_HEX_BITS_SIGNED(28); +DEF_HEX_BITS_SIGNED(29); +DEF_HEX_BITS_SIGNED(30); +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 maybe_vmask(uint8_t vm, char **s, size_t *len, riscv_conf *conf) { + if (vm) { + *s = ""; + *len = 0; + return; + } + *s = " , v0.t"; + *len = 7; +} + +void maybe_ta_flag(uint8_t ta, char **s, size_t *len, riscv_conf *conf) { + if (ta) { + *s = "ta"; + *len = 2; + return; + } + *s = ""; + *len = 0; +} + +void maybe_ma_flag(uint8_t ma, char **s, size_t *len, riscv_conf *conf) { + if (ma) { + *s = "ma"; + *len = 2; + return; + } + *s = ""; + *len = 0; +} + +void maybe_lmul_flag(uint8_t lmul, char **s, size_t *len, riscv_conf *conf) { + switch (lmul) { + case 0x0: + *s = ""; + *len = 0; + return; + + case 0x5: + *s = " , mf8"; + *len = 6; + return; + + case 0x6: + *s = " , mf4"; + *len = 6; + return; + + case 0x7: + *s = " , mf2"; + *len = 6; + return; + + case 0x1: + *s = " , m2"; + *len = 5; + return; + + case 0x2: + *s = " , m4"; + *len = 5; + return; + + case 0x3: + *s = " , m8"; + *len = 5; + return; + } +} + +// TODO +void csr_name_map(uint32_t csr, char **s, size_t *len, riscv_conf *conf) { + *s = ""; + *len = 0; +} + +void fence_bits(uint8_t bits, char **s, size_t *len, riscv_conf *conf) { + char *buff = *s; + int length = 0; + if (bits & 0x8) { + buff[length++] = 'i'; + } + if (bits & 0x4) { + buff[length++] = 'o'; + } + if (bits & 0x2) { + buff[length++] = 'r'; + } + if (bits & 0x1) { + buff[length++] = 'w'; + } + *len = length; +} +#endif \ No newline at end of file diff --git a/arch/RISCV/riscv_helpers_rvconf.h b/arch/RISCV/riscv_helpers_rvconf.h new file mode 100644 index 00000000000..2f84c542e15 --- /dev/null +++ b/arch/RISCV/riscv_helpers_rvconf.h @@ -0,0 +1,13 @@ +#ifndef __RISCV_CONFIG_H__ +#define __RISCV_CONFIG_H__ + +#include + +typedef uint8_t (*Void2Bool)(void); + +typedef struct riscv_conf { + Void2Bool sys_enable_fdext; + Void2Bool sys_enable_zfinx; +} riscv_conf; + +#endif \ No newline at end of file diff --git a/arch/RISCV/riscv_insn_mapping.gen.inc b/arch/RISCV/riscv_insn_mapping.gen.inc new file mode 100644 index 00000000000..ce7abda2909 --- /dev/null +++ b/arch/RISCV/riscv_insn_mapping.gen.inc @@ -0,0 +1,598 @@ +#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}, +}; +static 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 09b8fedd3b3..fae66cef8f8 100644 --- a/include/capstone/riscv.h +++ b/include/capstone/riscv.h @@ -201,284 +201,7 @@ typedef enum riscv_reg { } riscv_reg; //> RISCV instruction -typedef enum riscv_insn { - RISCV_INS_INVALID = 0, - - RISCV_INS_ADD, - RISCV_INS_ADDI, - RISCV_INS_ADDIW, - RISCV_INS_ADDW, - RISCV_INS_AMOADD_D, - RISCV_INS_AMOADD_D_AQ, - RISCV_INS_AMOADD_D_AQ_RL, - RISCV_INS_AMOADD_D_RL, - RISCV_INS_AMOADD_W, - RISCV_INS_AMOADD_W_AQ, - RISCV_INS_AMOADD_W_AQ_RL, - RISCV_INS_AMOADD_W_RL, - RISCV_INS_AMOAND_D, - RISCV_INS_AMOAND_D_AQ, - RISCV_INS_AMOAND_D_AQ_RL, - RISCV_INS_AMOAND_D_RL, - RISCV_INS_AMOAND_W, - RISCV_INS_AMOAND_W_AQ, - RISCV_INS_AMOAND_W_AQ_RL, - RISCV_INS_AMOAND_W_RL, - RISCV_INS_AMOMAXU_D, - RISCV_INS_AMOMAXU_D_AQ, - RISCV_INS_AMOMAXU_D_AQ_RL, - RISCV_INS_AMOMAXU_D_RL, - RISCV_INS_AMOMAXU_W, - RISCV_INS_AMOMAXU_W_AQ, - RISCV_INS_AMOMAXU_W_AQ_RL, - RISCV_INS_AMOMAXU_W_RL, - RISCV_INS_AMOMAX_D, - RISCV_INS_AMOMAX_D_AQ, - RISCV_INS_AMOMAX_D_AQ_RL, - RISCV_INS_AMOMAX_D_RL, - RISCV_INS_AMOMAX_W, - RISCV_INS_AMOMAX_W_AQ, - RISCV_INS_AMOMAX_W_AQ_RL, - RISCV_INS_AMOMAX_W_RL, - RISCV_INS_AMOMINU_D, - RISCV_INS_AMOMINU_D_AQ, - RISCV_INS_AMOMINU_D_AQ_RL, - RISCV_INS_AMOMINU_D_RL, - RISCV_INS_AMOMINU_W, - RISCV_INS_AMOMINU_W_AQ, - RISCV_INS_AMOMINU_W_AQ_RL, - RISCV_INS_AMOMINU_W_RL, - RISCV_INS_AMOMIN_D, - RISCV_INS_AMOMIN_D_AQ, - RISCV_INS_AMOMIN_D_AQ_RL, - RISCV_INS_AMOMIN_D_RL, - RISCV_INS_AMOMIN_W, - RISCV_INS_AMOMIN_W_AQ, - RISCV_INS_AMOMIN_W_AQ_RL, - RISCV_INS_AMOMIN_W_RL, - RISCV_INS_AMOOR_D, - RISCV_INS_AMOOR_D_AQ, - RISCV_INS_AMOOR_D_AQ_RL, - RISCV_INS_AMOOR_D_RL, - RISCV_INS_AMOOR_W, - RISCV_INS_AMOOR_W_AQ, - RISCV_INS_AMOOR_W_AQ_RL, - RISCV_INS_AMOOR_W_RL, - RISCV_INS_AMOSWAP_D, - RISCV_INS_AMOSWAP_D_AQ, - RISCV_INS_AMOSWAP_D_AQ_RL, - RISCV_INS_AMOSWAP_D_RL, - RISCV_INS_AMOSWAP_W, - RISCV_INS_AMOSWAP_W_AQ, - RISCV_INS_AMOSWAP_W_AQ_RL, - RISCV_INS_AMOSWAP_W_RL, - RISCV_INS_AMOXOR_D, - RISCV_INS_AMOXOR_D_AQ, - RISCV_INS_AMOXOR_D_AQ_RL, - RISCV_INS_AMOXOR_D_RL, - RISCV_INS_AMOXOR_W, - RISCV_INS_AMOXOR_W_AQ, - RISCV_INS_AMOXOR_W_AQ_RL, - RISCV_INS_AMOXOR_W_RL, - RISCV_INS_AND, - RISCV_INS_ANDI, - RISCV_INS_AUIPC, - RISCV_INS_BEQ, - RISCV_INS_BGE, - RISCV_INS_BGEU, - RISCV_INS_BLT, - RISCV_INS_BLTU, - RISCV_INS_BNE, - RISCV_INS_CSRRC, - RISCV_INS_CSRRCI, - RISCV_INS_CSRRS, - RISCV_INS_CSRRSI, - RISCV_INS_CSRRW, - RISCV_INS_CSRRWI, - RISCV_INS_C_ADD, - RISCV_INS_C_ADDI, - RISCV_INS_C_ADDI16SP, - RISCV_INS_C_ADDI4SPN, - RISCV_INS_C_ADDIW, - RISCV_INS_C_ADDW, - RISCV_INS_C_AND, - RISCV_INS_C_ANDI, - RISCV_INS_C_BEQZ, - RISCV_INS_C_BNEZ, - RISCV_INS_C_EBREAK, - RISCV_INS_C_FLD, - RISCV_INS_C_FLDSP, - RISCV_INS_C_FLW, - RISCV_INS_C_FLWSP, - RISCV_INS_C_FSD, - RISCV_INS_C_FSDSP, - RISCV_INS_C_FSW, - RISCV_INS_C_FSWSP, - RISCV_INS_C_J, - RISCV_INS_C_JAL, - RISCV_INS_C_JALR, - RISCV_INS_C_JR, - RISCV_INS_C_LD, - RISCV_INS_C_LDSP, - RISCV_INS_C_LI, - RISCV_INS_C_LUI, - RISCV_INS_C_LW, - RISCV_INS_C_LWSP, - RISCV_INS_C_MV, - RISCV_INS_C_NOP, - RISCV_INS_C_OR, - RISCV_INS_C_SD, - RISCV_INS_C_SDSP, - RISCV_INS_C_SLLI, - RISCV_INS_C_SRAI, - RISCV_INS_C_SRLI, - RISCV_INS_C_SUB, - RISCV_INS_C_SUBW, - RISCV_INS_C_SW, - RISCV_INS_C_SWSP, - RISCV_INS_C_UNIMP, - RISCV_INS_C_XOR, - RISCV_INS_DIV, - RISCV_INS_DIVU, - RISCV_INS_DIVUW, - RISCV_INS_DIVW, - RISCV_INS_EBREAK, - RISCV_INS_ECALL, - RISCV_INS_FADD_D, - RISCV_INS_FADD_S, - RISCV_INS_FCLASS_D, - RISCV_INS_FCLASS_S, - RISCV_INS_FCVT_D_L, - RISCV_INS_FCVT_D_LU, - RISCV_INS_FCVT_D_S, - RISCV_INS_FCVT_D_W, - RISCV_INS_FCVT_D_WU, - RISCV_INS_FCVT_LU_D, - RISCV_INS_FCVT_LU_S, - RISCV_INS_FCVT_L_D, - RISCV_INS_FCVT_L_S, - RISCV_INS_FCVT_S_D, - RISCV_INS_FCVT_S_L, - RISCV_INS_FCVT_S_LU, - RISCV_INS_FCVT_S_W, - RISCV_INS_FCVT_S_WU, - RISCV_INS_FCVT_WU_D, - RISCV_INS_FCVT_WU_S, - RISCV_INS_FCVT_W_D, - RISCV_INS_FCVT_W_S, - RISCV_INS_FDIV_D, - RISCV_INS_FDIV_S, - RISCV_INS_FENCE, - RISCV_INS_FENCE_I, - RISCV_INS_FENCE_TSO, - RISCV_INS_FEQ_D, - RISCV_INS_FEQ_S, - RISCV_INS_FLD, - RISCV_INS_FLE_D, - RISCV_INS_FLE_S, - RISCV_INS_FLT_D, - RISCV_INS_FLT_S, - RISCV_INS_FLW, - RISCV_INS_FMADD_D, - RISCV_INS_FMADD_S, - RISCV_INS_FMAX_D, - RISCV_INS_FMAX_S, - RISCV_INS_FMIN_D, - RISCV_INS_FMIN_S, - RISCV_INS_FMSUB_D, - RISCV_INS_FMSUB_S, - RISCV_INS_FMUL_D, - RISCV_INS_FMUL_S, - RISCV_INS_FMV_D_X, - RISCV_INS_FMV_W_X, - RISCV_INS_FMV_X_D, - RISCV_INS_FMV_X_W, - RISCV_INS_FNMADD_D, - RISCV_INS_FNMADD_S, - RISCV_INS_FNMSUB_D, - RISCV_INS_FNMSUB_S, - RISCV_INS_FSD, - RISCV_INS_FSGNJN_D, - RISCV_INS_FSGNJN_S, - RISCV_INS_FSGNJX_D, - RISCV_INS_FSGNJX_S, - RISCV_INS_FSGNJ_D, - RISCV_INS_FSGNJ_S, - RISCV_INS_FSQRT_D, - RISCV_INS_FSQRT_S, - RISCV_INS_FSUB_D, - RISCV_INS_FSUB_S, - RISCV_INS_FSW, - RISCV_INS_JAL, - RISCV_INS_JALR, - RISCV_INS_LB, - RISCV_INS_LBU, - RISCV_INS_LD, - RISCV_INS_LH, - RISCV_INS_LHU, - RISCV_INS_LR_D, - RISCV_INS_LR_D_AQ, - RISCV_INS_LR_D_AQ_RL, - RISCV_INS_LR_D_RL, - RISCV_INS_LR_W, - RISCV_INS_LR_W_AQ, - RISCV_INS_LR_W_AQ_RL, - RISCV_INS_LR_W_RL, - RISCV_INS_LUI, - RISCV_INS_LW, - RISCV_INS_LWU, - RISCV_INS_MRET, - RISCV_INS_MUL, - RISCV_INS_MULH, - RISCV_INS_MULHSU, - RISCV_INS_MULHU, - RISCV_INS_MULW, - RISCV_INS_OR, - RISCV_INS_ORI, - RISCV_INS_REM, - RISCV_INS_REMU, - RISCV_INS_REMUW, - RISCV_INS_REMW, - RISCV_INS_SB, - RISCV_INS_SC_D, - RISCV_INS_SC_D_AQ, - RISCV_INS_SC_D_AQ_RL, - RISCV_INS_SC_D_RL, - RISCV_INS_SC_W, - RISCV_INS_SC_W_AQ, - RISCV_INS_SC_W_AQ_RL, - RISCV_INS_SC_W_RL, - RISCV_INS_SD, - RISCV_INS_SFENCE_VMA, - RISCV_INS_SH, - RISCV_INS_SLL, - RISCV_INS_SLLI, - RISCV_INS_SLLIW, - RISCV_INS_SLLW, - RISCV_INS_SLT, - RISCV_INS_SLTI, - RISCV_INS_SLTIU, - RISCV_INS_SLTU, - RISCV_INS_SRA, - RISCV_INS_SRAI, - RISCV_INS_SRAIW, - RISCV_INS_SRAW, - RISCV_INS_SRET, - RISCV_INS_SRL, - RISCV_INS_SRLI, - RISCV_INS_SRLIW, - RISCV_INS_SRLW, - RISCV_INS_SUB, - RISCV_INS_SUBW, - RISCV_INS_SW, - RISCV_INS_UNIMP, - RISCV_INS_URET, - RISCV_INS_WFI, - RISCV_INS_XOR, - RISCV_INS_XORI, - - RISCV_INS_ENDING, -} riscv_insn; +#include "riscv_insn.gen.inc" //> Group of RISCV instructions typedef enum riscv_insn_group { diff --git a/include/capstone/riscv_insn.gen.inc b/include/capstone/riscv_insn.gen.inc new file mode 100644 index 00000000000..9adbb221827 --- /dev/null +++ b/include/capstone/riscv_insn.gen.inc @@ -0,0 +1,974 @@ +#ifndef __Riscv_insn_gen_inc__ +#define __Riscv_insn_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