Lines Matching full:dec

2539 static void decode_inst_opcode(rv_decode *dec, rv_isa isa)  in decode_inst_opcode()  argument
2541 rv_inst inst = dec->inst; in decode_inst_opcode()
2614 if (dec->cfg->ext_zcmop) { in decode_inst_opcode()
2620 if (dec->cfg->ext_zicfiss) { in decode_inst_opcode()
2715 if (dec->cfg->ext_zcmp && ((inst >> 12) & 0b01)) { in decode_inst_opcode()
2741 if (!dec->cfg->ext_zcmt) { in decode_inst_opcode()
2751 if (!dec->cfg->ext_zcmp) { in decode_inst_opcode()
2959 if (dec->cfg->ext_zicfilp && in decode_inst_opcode()
4061 if (dec->cfg->ext_zimop) { in decode_inst_opcode()
4071 if (dec->cfg->ext_zicfiss && in decode_inst_opcode()
4090 if (dec->cfg->ext_zicfiss && in decode_inst_opcode()
4161 dec->op = op; in decode_inst_opcode()
4556 static void decode_inst_operands(rv_decode *dec, rv_isa isa) in decode_inst_operands() argument
4558 const rv_opcode_data *opcode_data = dec->opcode_data; in decode_inst_operands()
4559 rv_inst inst = dec->inst; in decode_inst_operands()
4560 dec->codec = opcode_data[dec->op].codec; in decode_inst_operands()
4561 switch (dec->codec) { in decode_inst_operands()
4563 dec->rd = dec->rs1 = dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4564 dec->imm = 0; in decode_inst_operands()
4567 dec->rd = operand_rd(inst); in decode_inst_operands()
4568 dec->rs1 = dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4569 dec->imm = operand_imm20(inst); in decode_inst_operands()
4572 dec->rd = operand_rd(inst); in decode_inst_operands()
4573 dec->rs1 = dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4574 dec->imm = operand_jimm20(inst); in decode_inst_operands()
4577 dec->rd = operand_rd(inst); in decode_inst_operands()
4578 dec->rs1 = operand_rs1(inst); in decode_inst_operands()
4579 dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4580 dec->imm = operand_imm12(inst); in decode_inst_operands()
4583 dec->rd = operand_rd(inst); in decode_inst_operands()
4584 dec->rs1 = operand_rs1(inst); in decode_inst_operands()
4585 dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4586 dec->imm = operand_shamt5(inst); in decode_inst_operands()
4589 dec->rd = operand_rd(inst); in decode_inst_operands()
4590 dec->rs1 = operand_rs1(inst); in decode_inst_operands()
4591 dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4592 dec->imm = operand_shamt6(inst); in decode_inst_operands()
4595 dec->rd = operand_rd(inst); in decode_inst_operands()
4596 dec->rs1 = operand_rs1(inst); in decode_inst_operands()
4597 dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4598 dec->imm = operand_shamt7(inst); in decode_inst_operands()
4601 dec->rd = operand_rd(inst); in decode_inst_operands()
4602 dec->rs1 = operand_rs1(inst); in decode_inst_operands()
4603 dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4604 dec->imm = operand_csr12(inst); in decode_inst_operands()
4607 dec->rd = rv_ireg_zero; in decode_inst_operands()
4608 dec->rs1 = operand_rs1(inst); in decode_inst_operands()
4609 dec->rs2 = operand_rs2(inst); in decode_inst_operands()
4610 dec->imm = operand_simm12(inst); in decode_inst_operands()
4613 dec->rd = rv_ireg_zero; in decode_inst_operands()
4614 dec->rs1 = operand_rs1(inst); in decode_inst_operands()
4615 dec->rs2 = operand_rs2(inst); in decode_inst_operands()
4616 dec->imm = operand_sbimm12(inst); in decode_inst_operands()
4619 dec->rd = operand_rd(inst); in decode_inst_operands()
4620 dec->rs1 = operand_rs1(inst); in decode_inst_operands()
4621 dec->rs2 = operand_rs2(inst); in decode_inst_operands()
4622 dec->imm = 0; in decode_inst_operands()
4625 dec->rd = operand_rd(inst); in decode_inst_operands()
4626 dec->rs1 = operand_rs1(inst); in decode_inst_operands()
4627 dec->rs2 = operand_rs2(inst); in decode_inst_operands()
4628 dec->imm = 0; in decode_inst_operands()
4629 dec->rm = operand_rm(inst); in decode_inst_operands()
4632 dec->rd = operand_rd(inst); in decode_inst_operands()
4633 dec->rs1 = operand_rs1(inst); in decode_inst_operands()
4634 dec->rs2 = operand_rs2(inst); in decode_inst_operands()
4635 dec->rs3 = operand_rs3(inst); in decode_inst_operands()
4636 dec->imm = 0; in decode_inst_operands()
4637 dec->rm = operand_rm(inst); in decode_inst_operands()
4640 dec->rd = operand_rd(inst); in decode_inst_operands()
4641 dec->rs1 = operand_rs1(inst); in decode_inst_operands()
4642 dec->rs2 = operand_rs2(inst); in decode_inst_operands()
4643 dec->imm = 0; in decode_inst_operands()
4644 dec->aq = operand_aq(inst); in decode_inst_operands()
4645 dec->rl = operand_rl(inst); in decode_inst_operands()
4648 dec->rd = operand_rd(inst); in decode_inst_operands()
4649 dec->rs1 = operand_rs1(inst); in decode_inst_operands()
4650 dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4651 dec->imm = 0; in decode_inst_operands()
4652 dec->aq = operand_aq(inst); in decode_inst_operands()
4653 dec->rl = operand_rl(inst); in decode_inst_operands()
4656 dec->rd = dec->rs1 = dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4657 dec->pred = operand_pred(inst); in decode_inst_operands()
4658 dec->succ = operand_succ(inst); in decode_inst_operands()
4659 dec->imm = 0; in decode_inst_operands()
4662 dec->rd = rv_ireg_zero; in decode_inst_operands()
4663 dec->rs1 = operand_crs1q(inst) + 8; in decode_inst_operands()
4664 dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4665 dec->imm = operand_cimmb(inst); in decode_inst_operands()
4668 dec->rd = dec->rs1 = operand_crs1rdq(inst) + 8; in decode_inst_operands()
4669 dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4670 dec->imm = operand_cimmi(inst); in decode_inst_operands()
4673 dec->rd = dec->rs1 = operand_crs1rdq(inst) + 8; in decode_inst_operands()
4674 dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4675 dec->imm = operand_cimmsh5(inst); in decode_inst_operands()
4678 dec->rd = dec->rs1 = operand_crs1rdq(inst) + 8; in decode_inst_operands()
4679 dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4680 dec->imm = operand_cimmshr6(inst, isa); in decode_inst_operands()
4683 dec->rd = dec->rs1 = operand_crs1rd(inst); in decode_inst_operands()
4684 dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4685 dec->imm = operand_cimmi(inst); in decode_inst_operands()
4688 dec->rd = dec->rs1 = operand_crs1rd(inst); in decode_inst_operands()
4689 dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4690 dec->imm = operand_cimmsh5(inst); in decode_inst_operands()
4693 dec->rd = dec->rs1 = operand_crs1rd(inst); in decode_inst_operands()
4694 dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4695 dec->imm = operand_cimmshl6(inst, isa); in decode_inst_operands()
4698 dec->rd = rv_ireg_sp; in decode_inst_operands()
4699 dec->rs1 = rv_ireg_sp; in decode_inst_operands()
4700 dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4701 dec->imm = operand_cimm16sp(inst); in decode_inst_operands()
4704 dec->rd = operand_crd(inst); in decode_inst_operands()
4705 dec->rs1 = rv_ireg_sp; in decode_inst_operands()
4706 dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4707 dec->imm = operand_cimmlwsp(inst); in decode_inst_operands()
4710 dec->rd = operand_crd(inst); in decode_inst_operands()
4711 dec->rs1 = rv_ireg_sp; in decode_inst_operands()
4712 dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4713 dec->imm = operand_cimmldsp(inst); in decode_inst_operands()
4716 dec->rd = operand_crd(inst); in decode_inst_operands()
4717 dec->rs1 = rv_ireg_sp; in decode_inst_operands()
4718 dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4719 dec->imm = operand_cimmlqsp(inst); in decode_inst_operands()
4722 dec->rd = operand_crd(inst); in decode_inst_operands()
4723 dec->rs1 = rv_ireg_zero; in decode_inst_operands()
4724 dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4725 dec->imm = operand_cimmi(inst); in decode_inst_operands()
4728 dec->rd = operand_crd(inst); in decode_inst_operands()
4729 dec->rs1 = rv_ireg_zero; in decode_inst_operands()
4730 dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4731 dec->imm = operand_cimmui(inst); in decode_inst_operands()
4734 dec->rd = dec->rs1 = dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4735 dec->imm = 0; in decode_inst_operands()
4738 dec->rd = operand_crdq(inst) + 8; in decode_inst_operands()
4739 dec->rs1 = rv_ireg_sp; in decode_inst_operands()
4740 dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4741 dec->imm = operand_cimm4spn(inst); in decode_inst_operands()
4744 dec->rd = dec->rs1 = dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4745 dec->imm = operand_cimmj(inst); in decode_inst_operands()
4748 dec->rd = rv_ireg_ra; in decode_inst_operands()
4749 dec->rs1 = dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4750 dec->imm = operand_cimmj(inst); in decode_inst_operands()
4753 dec->rd = operand_crdq(inst) + 8; in decode_inst_operands()
4754 dec->rs1 = operand_crs1q(inst) + 8; in decode_inst_operands()
4755 dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4756 dec->imm = operand_cimmw(inst); in decode_inst_operands()
4759 dec->rd = operand_crdq(inst) + 8; in decode_inst_operands()
4760 dec->rs1 = operand_crs1q(inst) + 8; in decode_inst_operands()
4761 dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4762 dec->imm = operand_cimmd(inst); in decode_inst_operands()
4765 dec->rd = operand_crdq(inst) + 8; in decode_inst_operands()
4766 dec->rs1 = operand_crs1q(inst) + 8; in decode_inst_operands()
4767 dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4768 dec->imm = operand_cimmq(inst); in decode_inst_operands()
4771 dec->rd = dec->rs1 = operand_crs1rd(inst); in decode_inst_operands()
4772 dec->rs2 = operand_crs2(inst); in decode_inst_operands()
4773 dec->imm = 0; in decode_inst_operands()
4776 dec->rd = operand_crd(inst); in decode_inst_operands()
4777 dec->rs1 = operand_crs2(inst); in decode_inst_operands()
4778 dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4779 dec->imm = 0; in decode_inst_operands()
4782 dec->rd = rv_ireg_ra; in decode_inst_operands()
4783 dec->rs1 = operand_crs1(inst); in decode_inst_operands()
4784 dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4785 dec->imm = 0; in decode_inst_operands()
4788 dec->rd = rv_ireg_zero; in decode_inst_operands()
4789 dec->rs1 = operand_crs1(inst); in decode_inst_operands()
4790 dec->rs2 = rv_ireg_zero; in decode_inst_operands()
4791 dec->imm = 0; in decode_inst_operands()
4794 dec->rd = dec->rs1 = operand_crs1rdq(inst) + 8; in decode_inst_operands()
4795 dec->rs2 = operand_crs2q(inst) + 8; in decode_inst_operands()
4796 dec->imm = 0; in decode_inst_operands()
4799 dec->rd = rv_ireg_zero; in decode_inst_operands()
4800 dec->rs1 = operand_crs1q(inst) + 8; in decode_inst_operands()
4801 dec->rs2 = operand_crs2q(inst) + 8; in decode_inst_operands()
4802 dec->imm = operand_cimmw(inst); in decode_inst_operands()
4805 dec->rd = rv_ireg_zero; in decode_inst_operands()
4806 dec->rs1 = operand_crs1q(inst) + 8; in decode_inst_operands()
4807 dec->rs2 = operand_crs2q(inst) + 8; in decode_inst_operands()
4808 dec->imm = operand_cimmd(inst); in decode_inst_operands()
4811 dec->rd = rv_ireg_zero; in decode_inst_operands()
4812 dec->rs1 = operand_crs1q(inst) + 8; in decode_inst_operands()
4813 dec->rs2 = operand_crs2q(inst) + 8; in decode_inst_operands()
4814 dec->imm = operand_cimmq(inst); in decode_inst_operands()
4817 dec->rd = rv_ireg_zero; in decode_inst_operands()
4818 dec->rs1 = rv_ireg_sp; in decode_inst_operands()
4819 dec->rs2 = operand_crs2(inst); in decode_inst_operands()
4820 dec->imm = operand_cimmswsp(inst); in decode_inst_operands()
4823 dec->rd = rv_ireg_zero; in decode_inst_operands()
4824 dec->rs1 = rv_ireg_sp; in decode_inst_operands()
4825 dec->rs2 = operand_crs2(inst); in decode_inst_operands()
4826 dec->imm = operand_cimmsdsp(inst); in decode_inst_operands()
4829 dec->rd = rv_ireg_zero; in decode_inst_operands()
4830 dec->rs1 = rv_ireg_sp; in decode_inst_operands()
4831 dec->rs2 = operand_crs2(inst); in decode_inst_operands()
4832 dec->imm = operand_cimmsqsp(inst); in decode_inst_operands()
4835 dec->rs1 = operand_rs1(inst); in decode_inst_operands()
4836 dec->rs2 = operand_rs2(inst); in decode_inst_operands()
4837 dec->bs = operand_bs(inst); in decode_inst_operands()
4840 dec->rd = operand_rd(inst); in decode_inst_operands()
4841 dec->rs1 = operand_rs1(inst); in decode_inst_operands()
4842 dec->rnum = operand_rnum(inst); in decode_inst_operands()
4845 dec->rd = operand_rd(inst); in decode_inst_operands()
4846 dec->rs1 = operand_rs1(inst); in decode_inst_operands()
4847 dec->rs2 = operand_rs2(inst); in decode_inst_operands()
4848 dec->vm = operand_vm(inst); in decode_inst_operands()
4851 dec->rd = operand_rd(inst); in decode_inst_operands()
4852 dec->rs1 = operand_rs1(inst); in decode_inst_operands()
4853 dec->vm = operand_vm(inst); in decode_inst_operands()
4856 dec->rd = operand_rd(inst); in decode_inst_operands()
4857 dec->rs2 = operand_rs2(inst); in decode_inst_operands()
4858 dec->imm = operand_vimm(inst); in decode_inst_operands()
4859 dec->vm = operand_vm(inst); in decode_inst_operands()
4862 dec->rd = operand_rd(inst); in decode_inst_operands()
4863 dec->rs2 = operand_rs2(inst); in decode_inst_operands()
4864 dec->imm = operand_vzimm6(inst); in decode_inst_operands()
4865 dec->vm = operand_vm(inst); in decode_inst_operands()
4868 dec->rd = operand_rd(inst); in decode_inst_operands()
4869 dec->rs1 = operand_rs1(inst); in decode_inst_operands()
4870 dec->vzimm = operand_vzimm11(inst); in decode_inst_operands()
4873 dec->rd = operand_rd(inst); in decode_inst_operands()
4874 dec->imm = extract32(inst, 15, 5); in decode_inst_operands()
4875 dec->vzimm = operand_vzimm10(inst); in decode_inst_operands()
4878 dec->rs1 = operand_crs1q(inst) + 8; in decode_inst_operands()
4879 dec->rs2 = operand_crs2q(inst) + 8; in decode_inst_operands()
4880 dec->imm = operand_uimm_c_lb(inst); in decode_inst_operands()
4883 dec->rs1 = operand_crs1q(inst) + 8; in decode_inst_operands()
4884 dec->rs2 = operand_crs2q(inst) + 8; in decode_inst_operands()
4885 dec->imm = operand_uimm_c_lh(inst); in decode_inst_operands()
4888 dec->rd = operand_crs1q(inst) + 8; in decode_inst_operands()
4891 dec->rd = operand_crs1rdq(inst) + 8; in decode_inst_operands()
4892 dec->rs2 = operand_crs2q(inst) + 8; in decode_inst_operands()
4895 dec->imm = operand_zcmp_stack_adj(inst, isa); in decode_inst_operands()
4896 dec->rlist = operand_zcmp_rlist(inst); in decode_inst_operands()
4899 dec->rd = operand_sreg1(inst); in decode_inst_operands()
4900 dec->rs2 = operand_sreg2(inst); in decode_inst_operands()
4903 dec->imm = operand_tbl_index(inst); in decode_inst_operands()
4906 dec->rd = operand_rd(inst); in decode_inst_operands()
4907 dec->imm = operand_rs1(inst); in decode_inst_operands()
4910 dec->rd = operand_rd(inst); in decode_inst_operands()
4911 dec->rs1 = operand_rs1(inst); in decode_inst_operands()
4912 dec->imm = operand_rs2(inst); in decode_inst_operands()
4915 dec->rd = operand_rd(inst); in decode_inst_operands()
4916 dec->rs1 = operand_rs1(inst); in decode_inst_operands()
4919 dec->rd = operand_rd(inst); in decode_inst_operands()
4920 dec->rs1 = operand_rs1(inst); in decode_inst_operands()
4921 dec->imm = operand_imm6(inst); in decode_inst_operands()
4924 dec->rd = operand_rd(inst); in decode_inst_operands()
4925 dec->rs1 = operand_rs1(inst); in decode_inst_operands()
4926 dec->rs2 = operand_rs2(inst); in decode_inst_operands()
4927 dec->imm = operand_imm2(inst); in decode_inst_operands()
4930 dec->rd = operand_rd(inst); in decode_inst_operands()
4931 dec->rs1 = operand_rs1(inst); in decode_inst_operands()
4932 dec->imm = operand_immh(inst); in decode_inst_operands()
4933 dec->imm1 = operand_imml(inst); in decode_inst_operands()
4936 dec->rd = operand_rd(inst); in decode_inst_operands()
4937 dec->rs1 = operand_rs1(inst); in decode_inst_operands()
4938 dec->imm = sextract32(operand_rs2(inst), 0, 5); in decode_inst_operands()
4939 dec->imm1 = operand_imm2(inst); in decode_inst_operands()
4942 dec->imm = operand_lpl(inst); in decode_inst_operands()
4945 dec->rd = rv_ireg_zero; in decode_inst_operands()
4946 dec->rs1 = dec->rs2 = operand_crs1(inst); in decode_inst_operands()
4947 dec->imm = 0; in decode_inst_operands()
4954 static bool check_constraints(rv_decode *dec, const rvc_constraint *c) in check_constraints() argument
4956 int32_t imm = dec->imm; in check_constraints()
4957 uint8_t rd = dec->rd, rs1 = dec->rs1, rs2 = dec->rs2; in check_constraints()
5081 static GString *format_inst(size_t tab, rv_decode *dec) in format_inst() argument
5083 const rv_opcode_data *opcode_data = dec->opcode_data; in format_inst()
5087 fmt = opcode_data[dec->op].format; in format_inst()
5091 g_string_append(buf, opcode_data[dec->op].name); in format_inst()
5100 g_string_append_printf(buf, "%d", dec->bs); in format_inst()
5103 g_string_append_printf(buf, "%d", dec->rnum); in format_inst()
5106 g_string_append(buf, rv_ireg_name_sym[dec->rd]); in format_inst()
5109 g_string_append(buf, rv_ireg_name_sym[dec->rs1]); in format_inst()
5112 g_string_append(buf, rv_ireg_name_sym[dec->rs2]); in format_inst()
5115 if (dec->cfg->ext_zfinx) { in format_inst()
5116 g_string_append(buf, rv_ireg_name_sym[dec->rd]); in format_inst()
5118 g_string_append(buf, rv_freg_name_sym[dec->rd]); in format_inst()
5122 if (dec->cfg->ext_zfinx) { in format_inst()
5123 g_string_append(buf, rv_ireg_name_sym[dec->rs1]); in format_inst()
5125 g_string_append(buf, rv_freg_name_sym[dec->rs1]); in format_inst()
5129 if (dec->cfg->ext_zfinx) { in format_inst()
5130 g_string_append(buf, rv_ireg_name_sym[dec->rs2]); in format_inst()
5132 g_string_append(buf, rv_freg_name_sym[dec->rs2]); in format_inst()
5136 if (dec->cfg->ext_zfinx) { in format_inst()
5137 g_string_append(buf, rv_ireg_name_sym[dec->rs3]); in format_inst()
5139 g_string_append(buf, rv_freg_name_sym[dec->rs3]); in format_inst()
5143 g_string_append_printf(buf, "%d", dec->rs1); in format_inst()
5146 g_string_append_printf(buf, "%d", dec->imm); in format_inst()
5149 g_string_append_printf(buf, "%u", ((uint32_t)dec->imm & 0b111111)); in format_inst()
5152 g_string_append_printf(buf, "%d", dec->imm1); in format_inst()
5155 g_string_append_printf(buf, "%d", dec->imm); in format_inst()
5159 g_string_append_printf(buf, "# 0x%" PRIx64, dec->pc + dec->imm); in format_inst()
5163 g_string_append_printf(buf, "%d", dec->imm >> 12); in format_inst()
5168 g_string_append_printf(buf, "# 0x%" PRIx64, dec->pc + dec->imm); in format_inst()
5172 const char *name = csr_name(dec->imm & 0xfff); in format_inst()
5176 g_string_append_printf(buf, "0x%03x", dec->imm & 0xfff); in format_inst()
5181 switch (dec->rm) { in format_inst()
5206 if (dec->pred & rv_fence_i) { in format_inst()
5209 if (dec->pred & rv_fence_o) { in format_inst()
5212 if (dec->pred & rv_fence_r) { in format_inst()
5215 if (dec->pred & rv_fence_w) { in format_inst()
5220 if (dec->succ & rv_fence_i) { in format_inst()
5223 if (dec->succ & rv_fence_o) { in format_inst()
5226 if (dec->succ & rv_fence_r) { in format_inst()
5229 if (dec->succ & rv_fence_w) { in format_inst()
5239 if (dec->aq) { in format_inst()
5244 if (dec->rl) { in format_inst()
5252 if (dec->vm == 0) { in format_inst()
5257 g_string_append(buf, rv_vreg_name_sym[dec->rd]); in format_inst()
5260 g_string_append(buf, rv_vreg_name_sym[dec->rs1]); in format_inst()
5263 g_string_append(buf, rv_vreg_name_sym[dec->rs2]); in format_inst()
5266 g_string_append(buf, rv_vreg_name_sym[dec->rs3]); in format_inst()
5269 const int sew = 1 << (((dec->vzimm >> 3) & 0b111) + 3); in format_inst()
5270 const int lmul = dec->vzimm & 0b11; in format_inst()
5271 const int flmul = (dec->vzimm >> 2) & 1; in format_inst()
5272 const char *vta = (dec->vzimm >> 6) & 1 ? "ta" : "tu"; in format_inst()
5273 const char *vma = (dec->vzimm >> 7) & 1 ? "ma" : "mu"; in format_inst()
5298 switch (dec->rlist) { in format_inst()
5309 g_string_append_printf(buf, "{ra, s0-s%d}", dec->rlist - 5); in format_inst()
5315 g_string_append(buf, rv_fli_name_const[dec->imm]); in format_inst()
5328 static void decode_inst_lift_pseudo(rv_decode *dec) in decode_inst_lift_pseudo() argument
5330 const rv_opcode_data *opcode_data = dec->opcode_data; in decode_inst_lift_pseudo()
5331 const rv_comp_data *comp_data = opcode_data[dec->op].pseudo; in decode_inst_lift_pseudo()
5336 if (check_constraints(dec, comp_data->constraints)) { in decode_inst_lift_pseudo()
5337 dec->op = comp_data->op; in decode_inst_lift_pseudo()
5338 dec->codec = opcode_data[dec->op].codec; in decode_inst_lift_pseudo()
5347 static void decode_inst_decompress_rv32(rv_decode *dec) in decode_inst_decompress_rv32() argument
5349 const rv_opcode_data *opcode_data = dec->opcode_data; in decode_inst_decompress_rv32()
5350 int decomp_op = opcode_data[dec->op].decomp_rv32; in decode_inst_decompress_rv32()
5352 if ((opcode_data[dec->op].decomp_data & rvcd_imm_nz) in decode_inst_decompress_rv32()
5353 && dec->imm == 0) { in decode_inst_decompress_rv32()
5354 dec->op = rv_op_illegal; in decode_inst_decompress_rv32()
5356 dec->op = decomp_op; in decode_inst_decompress_rv32()
5357 dec->codec = opcode_data[decomp_op].codec; in decode_inst_decompress_rv32()
5362 static void decode_inst_decompress_rv64(rv_decode *dec) in decode_inst_decompress_rv64() argument
5364 const rv_opcode_data *opcode_data = dec->opcode_data; in decode_inst_decompress_rv64()
5365 int decomp_op = opcode_data[dec->op].decomp_rv64; in decode_inst_decompress_rv64()
5367 if ((opcode_data[dec->op].decomp_data & rvcd_imm_nz) in decode_inst_decompress_rv64()
5368 && dec->imm == 0) { in decode_inst_decompress_rv64()
5369 dec->op = rv_op_illegal; in decode_inst_decompress_rv64()
5371 dec->op = decomp_op; in decode_inst_decompress_rv64()
5372 dec->codec = opcode_data[decomp_op].codec; in decode_inst_decompress_rv64()
5377 static void decode_inst_decompress_rv128(rv_decode *dec) in decode_inst_decompress_rv128() argument
5379 const rv_opcode_data *opcode_data = dec->opcode_data; in decode_inst_decompress_rv128()
5380 int decomp_op = opcode_data[dec->op].decomp_rv128; in decode_inst_decompress_rv128()
5382 if ((opcode_data[dec->op].decomp_data & rvcd_imm_nz) in decode_inst_decompress_rv128()
5383 && dec->imm == 0) { in decode_inst_decompress_rv128()
5384 dec->op = rv_op_illegal; in decode_inst_decompress_rv128()
5386 dec->op = decomp_op; in decode_inst_decompress_rv128()
5387 dec->codec = opcode_data[decomp_op].codec; in decode_inst_decompress_rv128()
5392 static void decode_inst_decompress(rv_decode *dec, rv_isa isa) in decode_inst_decompress() argument
5396 decode_inst_decompress_rv32(dec); in decode_inst_decompress()
5399 decode_inst_decompress_rv64(dec); in decode_inst_decompress()
5402 decode_inst_decompress_rv128(dec); in decode_inst_decompress()
5412 rv_decode dec = { 0 }; in disasm_inst() local
5413 dec.pc = pc; in disasm_inst()
5414 dec.inst = inst; in disasm_inst()
5415 dec.cfg = cfg; in disasm_inst()
5443 dec.opcode_data = opcode_data; in disasm_inst()
5444 decode_func(&dec, isa); in disasm_inst()
5445 if (dec.op != rv_op_illegal) in disasm_inst()
5450 if (dec.op == rv_op_illegal) { in disasm_inst()
5451 dec.opcode_data = rvi_opcode_data; in disasm_inst()
5454 decode_inst_operands(&dec, isa); in disasm_inst()
5455 decode_inst_decompress(&dec, isa); in disasm_inst()
5456 decode_inst_lift_pseudo(&dec); in disasm_inst()
5457 return format_inst(24, &dec); in disasm_inst()