disas/nanomips: Remove helper methods from class

Helper methods from NMD class like NMD::renumber_registers,
NMD::decode_gpr_gpr4... etc. are removed from the class. They're now
declared global static functions.

Following helper methods have been deleted because they're not used by
the nanomips disassembler:
- NMD::encode_msbd_from_pos_and_size,
- NMD::encode_s_from_s_hi,
- NMD::neg_copy

Global functions used by those methods:
- nanomips_dis
- sign_extend
- extract_bits
have also been defined as static global functions.

Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220912122635.74032-6-milica.lazarevic@syrmia.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
Milica Lazarevic 2022-09-12 14:26:16 +02:00 committed by Philippe Mathieu-Daudé
parent 9972c8fa7c
commit 2dc0c175df
2 changed files with 154 additions and 318 deletions

File diff suppressed because it is too large Load Diff

View File

@ -94,150 +94,6 @@ private:
TABLE_ENTRY_TYPE & type, const Pool *table, int table_size, TABLE_ENTRY_TYPE & type, const Pool *table, int table_size,
Dis_info *info); Dis_info *info);
uint64 renumber_registers(uint64 index, uint64 *register_list,
size_t register_list_size);
uint64 decode_gpr_gpr4(uint64 d);
uint64 decode_gpr_gpr4_zero(uint64 d);
uint64 decode_gpr_gpr3(uint64 d);
uint64 decode_gpr_gpr3_src_store(uint64 d);
uint64 decode_gpr_gpr2_reg1(uint64 d);
uint64 decode_gpr_gpr2_reg2(uint64 d);
uint64 decode_gpr_gpr1(uint64 d);
uint64 copy(uint64 d);
int64 copy(int64 d);
int64 neg_copy(uint64 d);
int64 neg_copy(int64 d);
uint64 encode_rs3_and_check_rs3_ge_rt3(uint64 d);
uint64 encode_rs3_and_check_rs3_lt_rt3(uint64 d);
uint64 encode_s_from_address(uint64 d);
uint64 encode_u_from_address(uint64 d);
uint64 encode_s_from_s_hi(uint64 d);
uint64 encode_count3_from_count(uint64 d);
uint64 encode_shift3_from_shift(uint64 d);
int64 encode_eu_from_s_li16(uint64 d);
uint64 encode_msbd_from_size(uint64 d);
uint64 encode_eu_from_u_andi16(uint64 d);
uint64 encode_msbd_from_pos_and_size(uint64 d);
uint64 encode_rt1_from_rt(uint64 d);
uint64 encode_lsb_from_pos_and_size(uint64 d);
std::string save_restore_list(uint64 rt, uint64 count, uint64 gp);
std::string GPR(uint64 reg);
std::string FPR(uint64 reg);
std::string AC(uint64 reg);
std::string IMMEDIATE(uint64 value);
std::string IMMEDIATE(int64 value);
std::string CPR(uint64 reg);
std::string ADDRESS(uint64 value, int instruction_size, Dis_info *info);
int64 extract_s__se3_4_2_1_0(uint64 instruction);
int64 extract_s__se7_0_6_5_4_3_2_1_s1(uint64 instruction);
int64 extract_s__se8_15_7_6_5_4_3_s3(uint64 instruction);
int64 extract_s__se8_15_7_6_5_4_3_2_s2(uint64 instruction);
int64 extract_s__se8_15_7_6_5_4_3_2_1_0(uint64 instruction);
int64 extract_s__se9_20_19_18_17_16_15_14_13_12_11(uint64 instruction);
int64 extract_s__se10_0_9_8_7_6_5_4_3_2_1_s1(uint64 instruction);
int64 extract_s__se11_0_10_9_8_7_6_5_4_3_2_1_0_s1(uint64 instruction);
int64 extract_s__se14_0_13_to_1_s1(uint64 instruction);
int64 extract_s__se21_0_20_to_1_s1(uint64 instruction);
int64 extract_s__se25_0_24_to_1_s1(uint64 instruction);
int64 extract_s__se31_15_to_0_31_to_16(uint64 instruction);
int64 extract_s__se31_0_11_to_2_20_to_12_s12(uint64 instruction);
int64 extract_shift__se5_21_20_19_18_17_16(uint64 instruction);
uint64 extract_ac_15_14(uint64 instruction);
uint64 extract_bit_16_15_14_13_12_11(uint64 instruction);
uint64 extract_bit_23_22_21(uint64 instruction);
uint64 extract_c0s_20_19_18_17_16(uint64 instruction);
uint64 extract_code_17_to_0(uint64 instruction);
uint64 extract_code_18_to_0(uint64 instruction);
uint64 extract_code_1_0(uint64 instruction);
uint64 extract_code_2_1_0(uint64 instruction);
uint64 extract_code_25_24_23_22_21_20_19_18_17_16(uint64 instruction);
uint64 extract_cofun_25_24_23(uint64 instruction);
uint64 extract_count3_14_13_12(uint64 instruction);
uint64 extract_count_3_2_1_0(uint64 instruction);
uint64 extract_count_19_18_17_16(uint64 instruction);
uint64 extract_cs_20_19_18_17_16(uint64 instruction);
uint64 extract_cs_25_24_23_22_21(uint64 instruction);
uint64 extract_ct_25_24_23_22_21(uint64 instruction);
uint64 extract_eu_3_2_1_0(uint64 instruction);
uint64 extract_eu_6_5_4_3_2_1_0(uint64 instruction);
uint64 extract_fd_15_14_13_12_11(uint64 instruction);
uint64 extract_fs_20_19_18_17_16(uint64 instruction);
uint64 extract_ft_15_14_13_12_11(uint64 instruction);
uint64 extract_ft_25_24_23_22_21(uint64 instruction);
uint64 extract_gp_2(uint64 instruction);
uint64 extract_hint_25_24_23_22_21(uint64 instruction);
uint64 extract_hs_20_19_18_17_16(uint64 instruction);
uint64 extract_lsb_4_3_2_1_0(uint64 instruction);
uint64 extract_mask_20_19_18_17_16_15_14(uint64 instruction);
uint64 extract_msbt_10_9_8_7_6(uint64 instruction);
uint64 extract_op_25_24_23_22_21(uint64 instruction);
uint64 extract_op_25_to_3(uint64 instruction);
uint64 extract_rdl_25_24(uint64 instruction);
uint64 extract_rd2_3_8(uint64 instruction);
uint64 extract_rd3_3_2_1(uint64 instruction);
uint64 extract_rd_15_14_13_12_11(uint64 instruction);
uint64 extract_rs3_6_5_4(uint64 instruction);
uint64 extract_rs4_4_2_1_0(uint64 instruction);
uint64 extract_rs_4_3_2_1_0(uint64 instruction);
uint64 extract_rs_20_19_18_17_16(uint64 instruction);
uint64 extract_rsz4_4_2_1_0(uint64 instruction);
uint64 extract_rtl_11(uint64 instruction);
uint64 extract_rt3_9_8_7(uint64 instruction);
uint64 extract_rt4_9_7_6_5(uint64 instruction);
uint64 extract_rt_25_24_23_22_21(uint64 instruction);
uint64 extract_rt_41_40_39_38_37(uint64 instruction);
uint64 extract_rt_9_8_7_6_5(uint64 instruction);
uint64 extract_rtz3_9_8_7(uint64 instruction);
uint64 extract_rtz4_27_26_25_23_22_21(uint64 instruction);
uint64 extract_rtz4_9_7_6_5(uint64 instruction);
uint64 extract_ru_7_6_5_4_3(uint64 instruction);
uint64 extract_sa_15_14_13_12_11(uint64 instruction);
uint64 extract_sa_15_14_13_12(uint64 instruction);
uint64 extract_sa_15_14_13(uint64 instruction);
uint64 extract_sel_13_12_11(uint64 instruction);
uint64 extract_sel_15_14_13_12_11(uint64 instruction);
uint64 extract_shift3_2_1_0(uint64 instruction);
uint64 extract_shift_4_3_2_1_0(uint64 instruction);
uint64 extract_shift_5_4_3_2_1_0(uint64 instruction);
uint64 extract_shift_20_19_18_17_16(uint64 instruction);
uint64 extract_shift_10_9_8_7_6(uint64 instruction);
uint64 extract_shiftx_11_10_9_8_7_6(uint64 instruction);
uint64 extract_shiftx_10_9_8_7__s1(uint64 instruction);
uint64 extract_size_20_19_18_17_16(uint64 instruction);
uint64 extract_stripe_6(uint64 instruction);
uint64 extract_stype_20_19_18_17_16(uint64 instruction);
uint64 extract_u2_10_9(uint64 instruction);
uint64 extract_u_11_10_9_8_7_6_5_4_3_2_1_0(uint64 instruction);
uint64 extract_u_15_to_0(uint64 instruction);
uint64 extract_u_17_to_0(uint64 instruction);
uint64 extract_u_1_0(uint64 instruction);
uint64 extract_u_3_2_1_0__s1(uint64 instruction);
uint64 extract_u_2_1_0__s2(uint64 instruction);
uint64 extract_u_3_2_1_0__s2(uint64 instruction);
uint64 extract_u_4_3_2_1_0__s2(uint64 instruction);
uint64 extract_u_5_4_3_2_1_0__s2(uint64 instruction);
uint64 extract_u_6_5_4_3_2_1_0__s2(uint64 instruction);
uint64 extract_u_31_to_0__s32(uint64 instruction);
uint64 extract_u_10(uint64 instruction);
uint64 extract_u_17_16_15_14_13_12_11(uint64 instruction);
uint64 extract_u_20_19_18_17_16_15_14_13(uint64 instruction);
uint64 extract_u_17_to_1__s1(uint64 instruction);
uint64 extract_u_2_1__s1(uint64 instruction);
uint64 extract_u_17_to_2__s2(uint64 instruction);
uint64 extract_u_20_to_2__s2(uint64 instruction);
uint64 extract_u_20_to_3__s3(uint64 instruction);
uint64 extract_u_3_8__s2(uint64 instruction);
uint64 extract_u_11_10_9_8_7_6_5_4_3__s3(uint64 instruction);
uint64 extract_u_7_6_5_4__s4(uint64 instruction);
bool ADDIU_32__cond(uint64 instruction); bool ADDIU_32__cond(uint64 instruction);
bool ADDIU_RS5__cond(uint64 instruction); bool ADDIU_RS5__cond(uint64 instruction);
bool BALRSC_cond(uint64 instruction); bool BALRSC_cond(uint64 instruction);