diff --git a/cplusplus/include/generated/InstrIdType_enum_class.hpp b/cplusplus/include/generated/InstrIdType_enum_class.hpp index 9d069323..eb50de3c 100644 --- a/cplusplus/include/generated/InstrIdType_enum_class.hpp +++ b/cplusplus/include/generated/InstrIdType_enum_class.hpp @@ -50,9 +50,14 @@ enum class IdType { R4000ALLEGREX_SPECIAL3, R4000ALLEGREX_SPECIAL3_BSHFL, R4000ALLEGREX_COP0, + R4000ALLEGREX_COP0_BC0, + R4000ALLEGREX_COP0_TLB, R4000ALLEGREX_COP1, + R4000ALLEGREX_COP1_BC1, R4000ALLEGREX_COP2, + R4000ALLEGREX_COP2_BC2, R4000ALLEGREX_COP3, + R4000ALLEGREX_COP3_BC3, R4000ALLEGREX_VFPU0, R4000ALLEGREX_VFPU1, R4000ALLEGREX_VFPU3, diff --git a/cplusplus/include/generated/OperandType_enum_class.hpp b/cplusplus/include/generated/OperandType_enum_class.hpp index 9aa18352..1452936b 100644 --- a/cplusplus/include/generated/OperandType_enum_class.hpp +++ b/cplusplus/include/generated/OperandType_enum_class.hpp @@ -55,6 +55,7 @@ enum class OperandType { r4000allegrex_pos, r4000allegrex_size, r4000allegrex_size_plus_pos, + r4000allegrex_cop3cd, r5900_I, r5900_Q, r5900_R, diff --git a/cplusplus/include/generated/Registers_enum_classes.hpp b/cplusplus/include/generated/Registers_enum_classes.hpp index d0c8e46b..3de659d3 100644 --- a/cplusplus/include/generated/Registers_enum_classes.hpp +++ b/cplusplus/include/generated/Registers_enum_classes.hpp @@ -436,6 +436,42 @@ RSP_VECTOR_v31, }; }; + namespace R4000Allegrex { + enum class Cop3 { + R4000ALLEGREX_COP3_0, + R4000ALLEGREX_COP3_1, + R4000ALLEGREX_COP3_2, + R4000ALLEGREX_COP3_3, + R4000ALLEGREX_COP3_4, + R4000ALLEGREX_COP3_5, + R4000ALLEGREX_COP3_6, + R4000ALLEGREX_COP3_7, + R4000ALLEGREX_COP3_8, + R4000ALLEGREX_COP3_9, + R4000ALLEGREX_COP3_10, + R4000ALLEGREX_COP3_11, + R4000ALLEGREX_COP3_12, + R4000ALLEGREX_COP3_13, + R4000ALLEGREX_COP3_14, + R4000ALLEGREX_COP3_15, + R4000ALLEGREX_COP3_16, + R4000ALLEGREX_COP3_17, + R4000ALLEGREX_COP3_18, + R4000ALLEGREX_COP3_19, + R4000ALLEGREX_COP3_20, + R4000ALLEGREX_COP3_21, + R4000ALLEGREX_COP3_22, + R4000ALLEGREX_COP3_23, + R4000ALLEGREX_COP3_24, + R4000ALLEGREX_COP3_25, + R4000ALLEGREX_COP3_26, + R4000ALLEGREX_COP3_27, + R4000ALLEGREX_COP3_28, + R4000ALLEGREX_COP3_29, + R4000ALLEGREX_COP3_30, + R4000ALLEGREX_COP3_31, + }; + }; namespace R5900 { enum class VF { R5900_VF_vf0, diff --git a/cplusplus/include/generated/UniqueId_enum_class.hpp b/cplusplus/include/generated/UniqueId_enum_class.hpp index f3c23cec..9e2a05b3 100644 --- a/cplusplus/include/generated/UniqueId_enum_class.hpp +++ b/cplusplus/include/generated/UniqueId_enum_class.hpp @@ -480,6 +480,18 @@ enum class UniqueId { cpu_seb, cpu_seh, cpu_bitrev, + r4000allegrex_bc2f, + r4000allegrex_bc2t, + r4000allegrex_bc2fl, + r4000allegrex_bc2tl, + r4000allegrex_mfc3, + r4000allegrex_mtc3, + r4000allegrex_cfc3, + r4000allegrex_ctc3, + r4000allegrex_bc3f, + r4000allegrex_bc3t, + r4000allegrex_bc3fl, + r4000allegrex_bc3tl, r4000allegrex_USERDEF_00, r4000allegrex_USERDEF_01, r4000allegrex_USERDEF_02, diff --git a/include/generated/InstrDescriptor_Descriptors_array.h b/include/generated/InstrDescriptor_Descriptors_array.h index 48144628..ae4676da 100644 --- a/include/generated/InstrDescriptor_Descriptors_array.h +++ b/include/generated/InstrDescriptor_Descriptors_array.h @@ -480,6 +480,18 @@ const RabbitizerInstrDescriptor RabbitizerInstrDescriptor_Descriptors[] = { [RABBITIZER_INSTR_ID_cpu_seb] = { .operands={RAB_OPERAND_cpu_rd, RAB_OPERAND_cpu_rt}, .instrType=RABBITIZER_INSTR_TYPE_R, .modifiesRd=true, .readsRt=true }, [RABBITIZER_INSTR_ID_cpu_seh] = { .operands={RAB_OPERAND_cpu_rd, RAB_OPERAND_cpu_rt}, .instrType=RABBITIZER_INSTR_TYPE_R, .modifiesRd=true, .readsRt=true }, [RABBITIZER_INSTR_ID_cpu_bitrev] = { .operands={RAB_OPERAND_cpu_rd, RAB_OPERAND_cpu_rt}, .instrType=RABBITIZER_INSTR_TYPE_R, .modifiesRd=true, .readsRt=true }, + [RABBITIZER_INSTR_ID_r4000allegrex_bc2f] = { .operands={RAB_OPERAND_cpu_branch_target_label}, .instrType=RABBITIZER_INSTR_TYPE_UNKNOWN, .isBranch=true }, + [RABBITIZER_INSTR_ID_r4000allegrex_bc2t] = { .operands={RAB_OPERAND_cpu_branch_target_label}, .instrType=RABBITIZER_INSTR_TYPE_UNKNOWN, .isBranch=true }, + [RABBITIZER_INSTR_ID_r4000allegrex_bc2fl] = { .operands={RAB_OPERAND_cpu_branch_target_label}, .instrType=RABBITIZER_INSTR_TYPE_UNKNOWN, .isBranch=true, .isBranchLikely=true }, + [RABBITIZER_INSTR_ID_r4000allegrex_bc2tl] = { .operands={RAB_OPERAND_cpu_branch_target_label}, .instrType=RABBITIZER_INSTR_TYPE_UNKNOWN, .isBranch=true, .isBranchLikely=true }, + [RABBITIZER_INSTR_ID_r4000allegrex_mfc3] = { .operands={RAB_OPERAND_cpu_rt, RAB_OPERAND_r4000allegrex_cop3cd}, .modifiesRt=true }, + [RABBITIZER_INSTR_ID_r4000allegrex_mtc3] = { .operands={RAB_OPERAND_cpu_rt, RAB_OPERAND_r4000allegrex_cop3cd}, .readsRt=true }, + [RABBITIZER_INSTR_ID_r4000allegrex_cfc3] = { .operands={RAB_OPERAND_cpu_rt, RAB_OPERAND_r4000allegrex_cop3cd}, .modifiesRt=true }, + [RABBITIZER_INSTR_ID_r4000allegrex_ctc3] = { .operands={RAB_OPERAND_cpu_rt, RAB_OPERAND_r4000allegrex_cop3cd}, .readsRt=true }, + [RABBITIZER_INSTR_ID_r4000allegrex_bc3f] = { .operands={RAB_OPERAND_cpu_branch_target_label}, .instrType=RABBITIZER_INSTR_TYPE_UNKNOWN, .isBranch=true }, + [RABBITIZER_INSTR_ID_r4000allegrex_bc3t] = { .operands={RAB_OPERAND_cpu_branch_target_label}, .instrType=RABBITIZER_INSTR_TYPE_UNKNOWN, .isBranch=true }, + [RABBITIZER_INSTR_ID_r4000allegrex_bc3fl] = { .operands={RAB_OPERAND_cpu_branch_target_label}, .instrType=RABBITIZER_INSTR_TYPE_UNKNOWN, .isBranch=true, .isBranchLikely=true }, + [RABBITIZER_INSTR_ID_r4000allegrex_bc3tl] = { .operands={RAB_OPERAND_cpu_branch_target_label}, .instrType=RABBITIZER_INSTR_TYPE_UNKNOWN, .isBranch=true, .isBranchLikely=true }, [RABBITIZER_INSTR_ID_r4000allegrex_USERDEF_00] = { .operands={0} }, [RABBITIZER_INSTR_ID_r4000allegrex_USERDEF_01] = { .operands={0} }, [RABBITIZER_INSTR_ID_r4000allegrex_USERDEF_02] = { .operands={0} }, diff --git a/include/generated/InstrIdType_Names_array.h b/include/generated/InstrIdType_Names_array.h index 547af8c5..2f0e4697 100644 --- a/include/generated/InstrIdType_Names_array.h +++ b/include/generated/InstrIdType_Names_array.h @@ -50,9 +50,14 @@ const char *RabInstrIdType_Names[] = { [RAB_INSTR_ID_TYPE_R4000ALLEGREX_SPECIAL3] = "R4000ALLEGREX" "_" "SPECIAL3", [RAB_INSTR_ID_TYPE_R4000ALLEGREX_SPECIAL3_BSHFL] = "R4000ALLEGREX" "_" "SPECIAL3_BSHFL", [RAB_INSTR_ID_TYPE_R4000ALLEGREX_COP0] = "R4000ALLEGREX" "_" "COP0", + [RAB_INSTR_ID_TYPE_R4000ALLEGREX_COP0_BC0] = "R4000ALLEGREX" "_" "COP0_BC0", + [RAB_INSTR_ID_TYPE_R4000ALLEGREX_COP0_TLB] = "R4000ALLEGREX" "_" "COP0_TLB", [RAB_INSTR_ID_TYPE_R4000ALLEGREX_COP1] = "R4000ALLEGREX" "_" "COP1", + [RAB_INSTR_ID_TYPE_R4000ALLEGREX_COP1_BC1] = "R4000ALLEGREX" "_" "COP1_BC1", [RAB_INSTR_ID_TYPE_R4000ALLEGREX_COP2] = "R4000ALLEGREX" "_" "COP2", + [RAB_INSTR_ID_TYPE_R4000ALLEGREX_COP2_BC2] = "R4000ALLEGREX" "_" "COP2_BC2", [RAB_INSTR_ID_TYPE_R4000ALLEGREX_COP3] = "R4000ALLEGREX" "_" "COP3", + [RAB_INSTR_ID_TYPE_R4000ALLEGREX_COP3_BC3] = "R4000ALLEGREX" "_" "COP3_BC3", [RAB_INSTR_ID_TYPE_R4000ALLEGREX_VFPU0] = "R4000ALLEGREX" "_" "VFPU0", [RAB_INSTR_ID_TYPE_R4000ALLEGREX_VFPU1] = "R4000ALLEGREX" "_" "VFPU1", [RAB_INSTR_ID_TYPE_R4000ALLEGREX_VFPU3] = "R4000ALLEGREX" "_" "VFPU3", diff --git a/include/generated/InstrIdType_enum.h b/include/generated/InstrIdType_enum.h index bf06761d..541316b6 100644 --- a/include/generated/InstrIdType_enum.h +++ b/include/generated/InstrIdType_enum.h @@ -50,9 +50,14 @@ typedef enum RabInstrIdType { RAB_INSTR_ID_TYPE_R4000ALLEGREX_SPECIAL3, RAB_INSTR_ID_TYPE_R4000ALLEGREX_SPECIAL3_BSHFL, RAB_INSTR_ID_TYPE_R4000ALLEGREX_COP0, + RAB_INSTR_ID_TYPE_R4000ALLEGREX_COP0_BC0, + RAB_INSTR_ID_TYPE_R4000ALLEGREX_COP0_TLB, RAB_INSTR_ID_TYPE_R4000ALLEGREX_COP1, + RAB_INSTR_ID_TYPE_R4000ALLEGREX_COP1_BC1, RAB_INSTR_ID_TYPE_R4000ALLEGREX_COP2, + RAB_INSTR_ID_TYPE_R4000ALLEGREX_COP2_BC2, RAB_INSTR_ID_TYPE_R4000ALLEGREX_COP3, + RAB_INSTR_ID_TYPE_R4000ALLEGREX_COP3_BC3, RAB_INSTR_ID_TYPE_R4000ALLEGREX_VFPU0, RAB_INSTR_ID_TYPE_R4000ALLEGREX_VFPU1, RAB_INSTR_ID_TYPE_R4000ALLEGREX_VFPU3, diff --git a/include/generated/InstrId_Names_array.h b/include/generated/InstrId_Names_array.h index 8ebfa618..1d751c92 100644 --- a/include/generated/InstrId_Names_array.h +++ b/include/generated/InstrId_Names_array.h @@ -480,6 +480,18 @@ const char *RabbitizerInstrId_Names[] = { [RABBITIZER_INSTR_ID_cpu_seb] = "seb", [RABBITIZER_INSTR_ID_cpu_seh] = "seh", [RABBITIZER_INSTR_ID_cpu_bitrev] = "bitrev", + [RABBITIZER_INSTR_ID_r4000allegrex_bc2f] = "bc2f", + [RABBITIZER_INSTR_ID_r4000allegrex_bc2t] = "bc2t", + [RABBITIZER_INSTR_ID_r4000allegrex_bc2fl] = "bc2fl", + [RABBITIZER_INSTR_ID_r4000allegrex_bc2tl] = "bc2tl", + [RABBITIZER_INSTR_ID_r4000allegrex_mfc3] = "mfc3", + [RABBITIZER_INSTR_ID_r4000allegrex_mtc3] = "mtc3", + [RABBITIZER_INSTR_ID_r4000allegrex_cfc3] = "cfc3", + [RABBITIZER_INSTR_ID_r4000allegrex_ctc3] = "ctc3", + [RABBITIZER_INSTR_ID_r4000allegrex_bc3f] = "bc3f", + [RABBITIZER_INSTR_ID_r4000allegrex_bc3t] = "bc3t", + [RABBITIZER_INSTR_ID_r4000allegrex_bc3fl] = "bc3fl", + [RABBITIZER_INSTR_ID_r4000allegrex_bc3tl] = "bc3tl", [RABBITIZER_INSTR_ID_r4000allegrex_USERDEF_00] = "USERDEF_00", [RABBITIZER_INSTR_ID_r4000allegrex_USERDEF_01] = "USERDEF_01", [RABBITIZER_INSTR_ID_r4000allegrex_USERDEF_02] = "USERDEF_02", diff --git a/include/generated/InstrId_enum.h b/include/generated/InstrId_enum.h index 226315e4..58c625a4 100644 --- a/include/generated/InstrId_enum.h +++ b/include/generated/InstrId_enum.h @@ -480,6 +480,18 @@ typedef enum RabbitizerInstrId { RABBITIZER_INSTR_ID_cpu_seb, RABBITIZER_INSTR_ID_cpu_seh, RABBITIZER_INSTR_ID_cpu_bitrev, + RABBITIZER_INSTR_ID_r4000allegrex_bc2f, + RABBITIZER_INSTR_ID_r4000allegrex_bc2t, + RABBITIZER_INSTR_ID_r4000allegrex_bc2fl, + RABBITIZER_INSTR_ID_r4000allegrex_bc2tl, + RABBITIZER_INSTR_ID_r4000allegrex_mfc3, + RABBITIZER_INSTR_ID_r4000allegrex_mtc3, + RABBITIZER_INSTR_ID_r4000allegrex_cfc3, + RABBITIZER_INSTR_ID_r4000allegrex_ctc3, + RABBITIZER_INSTR_ID_r4000allegrex_bc3f, + RABBITIZER_INSTR_ID_r4000allegrex_bc3t, + RABBITIZER_INSTR_ID_r4000allegrex_bc3fl, + RABBITIZER_INSTR_ID_r4000allegrex_bc3tl, RABBITIZER_INSTR_ID_r4000allegrex_USERDEF_00, RABBITIZER_INSTR_ID_r4000allegrex_USERDEF_01, RABBITIZER_INSTR_ID_r4000allegrex_USERDEF_02, diff --git a/include/generated/OperandType_enum.h b/include/generated/OperandType_enum.h index 468eebf5..3e26fc70 100644 --- a/include/generated/OperandType_enum.h +++ b/include/generated/OperandType_enum.h @@ -55,6 +55,7 @@ typedef enum RabbitizerOperandType { RAB_OPERAND_r4000allegrex_pos, RAB_OPERAND_r4000allegrex_size, RAB_OPERAND_r4000allegrex_size_plus_pos, + RAB_OPERAND_r4000allegrex_cop3cd, RAB_OPERAND_r5900_I, RAB_OPERAND_r5900_Q, RAB_OPERAND_r5900_R, diff --git a/include/generated/OperandType_function_declarations.h b/include/generated/OperandType_function_declarations.h index a4661cb2..71d76f4c 100644 --- a/include/generated/OperandType_function_declarations.h +++ b/include/generated/OperandType_function_declarations.h @@ -53,6 +53,7 @@ size_t RabbitizerOperandType_process_r4000allegrex_pos (const struct RabbitizerInstruction *self, char *dst, const char *immOverride, size_t immOverrideLength); size_t RabbitizerOperandType_process_r4000allegrex_size (const struct RabbitizerInstruction *self, char *dst, const char *immOverride, size_t immOverrideLength); size_t RabbitizerOperandType_process_r4000allegrex_size_plus_pos (const struct RabbitizerInstruction *self, char *dst, const char *immOverride, size_t immOverrideLength); + size_t RabbitizerOperandType_process_r4000allegrex_cop3cd (const struct RabbitizerInstruction *self, char *dst, const char *immOverride, size_t immOverrideLength); size_t RabbitizerOperandType_process_r5900_I (const struct RabbitizerInstruction *self, char *dst, const char *immOverride, size_t immOverrideLength); size_t RabbitizerOperandType_process_r5900_Q (const struct RabbitizerInstruction *self, char *dst, const char *immOverride, size_t immOverrideLength); size_t RabbitizerOperandType_process_r5900_R (const struct RabbitizerInstruction *self, char *dst, const char *immOverride, size_t immOverrideLength); diff --git a/include/generated/RegisterDescriptor_Descriptors_arrays.h b/include/generated/RegisterDescriptor_Descriptors_arrays.h index 428158d4..5f25cabf 100644 --- a/include/generated/RegisterDescriptor_Descriptors_arrays.h +++ b/include/generated/RegisterDescriptor_Descriptors_arrays.h @@ -432,6 +432,40 @@ const RabbitizerRegisterDescriptor RabbitizerRegister_RspVector_Descriptors[] = [RABBITIZER_REG_RSP_VECTOR_v30] = { 0 }, [RABBITIZER_REG_RSP_VECTOR_v31] = { 0 }, }; +const RabbitizerRegisterDescriptor RabbitizerRegister_R4000AllegrexCop3_Descriptors[] = { + [RABBITIZER_REG_R4000ALLEGREX_COP3_0] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_1] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_2] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_3] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_4] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_5] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_6] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_7] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_8] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_9] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_10] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_11] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_12] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_13] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_14] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_15] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_16] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_17] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_18] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_19] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_20] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_21] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_22] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_23] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_24] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_25] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_26] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_27] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_28] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_29] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_30] = { 0 }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_31] = { 0 }, +}; const RabbitizerRegisterDescriptor RabbitizerRegister_R5900VF_Descriptors[] = { [RABBITIZER_REG_R5900_VF_vf0] = { 0 }, [RABBITIZER_REG_R5900_VF_vf1] = { 0 }, diff --git a/include/generated/Registers_Names_arrays.h b/include/generated/Registers_Names_arrays.h index 5eba8f1f..f119f113 100644 --- a/include/generated/Registers_Names_arrays.h +++ b/include/generated/Registers_Names_arrays.h @@ -432,6 +432,40 @@ const char *RabbitizerRegister_RspVector_Names[][2] = { [RABBITIZER_REG_RSP_VECTOR_v30] = { "$" "30", "$" "v30" }, [RABBITIZER_REG_RSP_VECTOR_v31] = { "$" "31", "$" "v31" }, }; +const char *RabbitizerRegister_R4000AllegrexCop3_Names[][2] = { + [RABBITIZER_REG_R4000ALLEGREX_COP3_0] = { "$" "0", "$" "0" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_1] = { "$" "1", "$" "1" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_2] = { "$" "2", "$" "2" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_3] = { "$" "3", "$" "3" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_4] = { "$" "4", "$" "4" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_5] = { "$" "5", "$" "5" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_6] = { "$" "6", "$" "6" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_7] = { "$" "7", "$" "7" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_8] = { "$" "8", "$" "8" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_9] = { "$" "9", "$" "9" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_10] = { "$" "10", "$" "10" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_11] = { "$" "11", "$" "11" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_12] = { "$" "12", "$" "12" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_13] = { "$" "13", "$" "13" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_14] = { "$" "14", "$" "14" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_15] = { "$" "15", "$" "15" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_16] = { "$" "16", "$" "16" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_17] = { "$" "17", "$" "17" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_18] = { "$" "18", "$" "18" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_19] = { "$" "19", "$" "19" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_20] = { "$" "20", "$" "20" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_21] = { "$" "21", "$" "21" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_22] = { "$" "22", "$" "22" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_23] = { "$" "23", "$" "23" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_24] = { "$" "24", "$" "24" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_25] = { "$" "25", "$" "25" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_26] = { "$" "26", "$" "26" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_27] = { "$" "27", "$" "27" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_28] = { "$" "28", "$" "28" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_29] = { "$" "29", "$" "29" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_30] = { "$" "30", "$" "30" }, + [RABBITIZER_REG_R4000ALLEGREX_COP3_31] = { "$" "31", "$" "31" }, +}; const char *RabbitizerRegister_R5900VF_Names[][2] = { [RABBITIZER_REG_R5900_VF_vf0] = { "$" "vf0", "$" "vf0" }, [RABBITIZER_REG_R5900_VF_vf1] = { "$" "vf1", "$" "vf1" }, diff --git a/include/generated/Registers_enums.h b/include/generated/Registers_enums.h index 8052c690..a5052116 100644 --- a/include/generated/Registers_enums.h +++ b/include/generated/Registers_enums.h @@ -432,6 +432,40 @@ typedef enum RabbitizerRegister_RspVector { RABBITIZER_REG_RSP_VECTOR_v30, RABBITIZER_REG_RSP_VECTOR_v31, } RabbitizerRegister_RspVector; +typedef enum RabbitizerRegister_R4000AllegrexCop3 { + RABBITIZER_REG_R4000ALLEGREX_COP3_0, + RABBITIZER_REG_R4000ALLEGREX_COP3_1, + RABBITIZER_REG_R4000ALLEGREX_COP3_2, + RABBITIZER_REG_R4000ALLEGREX_COP3_3, + RABBITIZER_REG_R4000ALLEGREX_COP3_4, + RABBITIZER_REG_R4000ALLEGREX_COP3_5, + RABBITIZER_REG_R4000ALLEGREX_COP3_6, + RABBITIZER_REG_R4000ALLEGREX_COP3_7, + RABBITIZER_REG_R4000ALLEGREX_COP3_8, + RABBITIZER_REG_R4000ALLEGREX_COP3_9, + RABBITIZER_REG_R4000ALLEGREX_COP3_10, + RABBITIZER_REG_R4000ALLEGREX_COP3_11, + RABBITIZER_REG_R4000ALLEGREX_COP3_12, + RABBITIZER_REG_R4000ALLEGREX_COP3_13, + RABBITIZER_REG_R4000ALLEGREX_COP3_14, + RABBITIZER_REG_R4000ALLEGREX_COP3_15, + RABBITIZER_REG_R4000ALLEGREX_COP3_16, + RABBITIZER_REG_R4000ALLEGREX_COP3_17, + RABBITIZER_REG_R4000ALLEGREX_COP3_18, + RABBITIZER_REG_R4000ALLEGREX_COP3_19, + RABBITIZER_REG_R4000ALLEGREX_COP3_20, + RABBITIZER_REG_R4000ALLEGREX_COP3_21, + RABBITIZER_REG_R4000ALLEGREX_COP3_22, + RABBITIZER_REG_R4000ALLEGREX_COP3_23, + RABBITIZER_REG_R4000ALLEGREX_COP3_24, + RABBITIZER_REG_R4000ALLEGREX_COP3_25, + RABBITIZER_REG_R4000ALLEGREX_COP3_26, + RABBITIZER_REG_R4000ALLEGREX_COP3_27, + RABBITIZER_REG_R4000ALLEGREX_COP3_28, + RABBITIZER_REG_R4000ALLEGREX_COP3_29, + RABBITIZER_REG_R4000ALLEGREX_COP3_30, + RABBITIZER_REG_R4000ALLEGREX_COP3_31, +} RabbitizerRegister_R4000AllegrexCop3; typedef enum RabbitizerRegister_R5900VF { RABBITIZER_REG_R5900_VF_vf0, RABBITIZER_REG_R5900_VF_vf1, diff --git a/include/generated/instrOpercandCallbacks_array.h b/include/generated/instrOpercandCallbacks_array.h index 1819faf8..e8917e02 100644 --- a/include/generated/instrOpercandCallbacks_array.h +++ b/include/generated/instrOpercandCallbacks_array.h @@ -54,6 +54,7 @@ const OperandCallback instrOpercandCallbacks[] = { [RAB_OPERAND_r4000allegrex_pos] = RabbitizerOperandType_process_r4000allegrex_pos, [RAB_OPERAND_r4000allegrex_size] = RabbitizerOperandType_process_r4000allegrex_size, [RAB_OPERAND_r4000allegrex_size_plus_pos] = RabbitizerOperandType_process_r4000allegrex_size_plus_pos, + [RAB_OPERAND_r4000allegrex_cop3cd] = RabbitizerOperandType_process_r4000allegrex_cop3cd, [RAB_OPERAND_r5900_I] = RabbitizerOperandType_process_r5900_I, [RAB_OPERAND_r5900_Q] = RabbitizerOperandType_process_r5900_Q, [RAB_OPERAND_r5900_R] = RabbitizerOperandType_process_r5900_R, diff --git a/include/instructions/RabbitizerInstructionR4000Allegrex.h b/include/instructions/RabbitizerInstructionR4000Allegrex.h index a9e66978..77dc749b 100644 --- a/include/instructions/RabbitizerInstructionR4000Allegrex.h +++ b/include/instructions/RabbitizerInstructionR4000Allegrex.h @@ -16,11 +16,15 @@ extern "C" { #define RAB_INSTR_R4000ALLEGREX_GET_size(self) (SHIFTR((self)->word, 11, 5)) #define RAB_INSTR_R4000ALLEGREX_GET_size_plus_pos(self) (SHIFTR((self)->word, 11, 5)) +#define RAB_INSTR_R4000ALLEGREX_GET_cop3cd(self) (SHIFTR((self)->word, 11, 5)) + #define RAB_INSTR_R4000ALLEGREX_PACK_pos(word, value) (BITREPACK((word), (value), 6, 5)) #define RAB_INSTR_R4000ALLEGREX_PACK_size(word, value) (BITREPACK((word), (value), 11, 5)) #define RAB_INSTR_R4000ALLEGREX_PACK_size_plus_pos(word, value) (BITREPACK((word), (value), 11, 5)) +#define RAB_INSTR_R4000ALLEGREX_PACK_cop3cd(word, value) (BITREPACK((word), value, 11, 5)) + NON_NULL(1) void RabbitizerInstructionR4000Allegrex_init(RabbitizerInstruction *self, uint32_t word, uint32_t vram); @@ -51,12 +55,25 @@ void RabbitizerInstructionR4000Allegrex_processUniqueId_Special3_Bshfl(Rabbitize NON_NULL(1) void RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor0(RabbitizerInstruction *self); +NON_NULL(1) +void RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor0_BC0(RabbitizerInstruction *self); +NON_NULL(1) +void RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor0_Tlb(RabbitizerInstruction *self); + NON_NULL(1) void RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor1(RabbitizerInstruction *self); +NON_NULL(1) +void RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor1_BC1(RabbitizerInstruction *self); + NON_NULL(1) void RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor2(RabbitizerInstruction *self); +NON_NULL(1) +void RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor2_BC2(RabbitizerInstruction *self); + NON_NULL(1) void RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor3(RabbitizerInstruction *self); +NON_NULL(1) +void RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor3_BC3(RabbitizerInstruction *self); NON_NULL(1) void RabbitizerInstructionR4000Allegrex_processUniqueId_Vfpu0(RabbitizerInstruction *self); diff --git a/include/instructions/RabbitizerRegister.h b/include/instructions/RabbitizerRegister.h index 2387d19e..916a37f0 100644 --- a/include/instructions/RabbitizerRegister.h +++ b/include/instructions/RabbitizerRegister.h @@ -57,6 +57,9 @@ const char *RabbitizerRegister_getNameRspCop2Control(uint8_t regValue); NODISCARD PURE RETURNS_NON_NULL const char *RabbitizerRegister_getNameRspVector(uint8_t regValue); +NODISCARD PURE RETURNS_NON_NULL +const char *RabbitizerRegister_getNameR4000AllegrexCop3(uint8_t regValue); + NODISCARD PURE RETURNS_NON_NULL const char *RabbitizerRegister_getNameR5900VF(uint8_t regValue); NODISCARD PURE RETURNS_NON_NULL @@ -86,6 +89,9 @@ const RabbitizerRegisterDescriptor *RabbitizerRegister_getDescriptor_RspCop2Cont NODISCARD PURE RETURNS_NON_NULL const RabbitizerRegisterDescriptor *RabbitizerRegister_getDescriptor_RspVector(uint8_t regValue); +NODISCARD PURE RETURNS_NON_NULL +const RabbitizerRegisterDescriptor *RabbitizerRegister_getDescriptor_R4000AllegrexCop3(uint8_t regValue); + NODISCARD PURE RETURNS_NON_NULL const RabbitizerRegisterDescriptor *RabbitizerRegister_getDescriptor_R5900VF(uint8_t regValue); NODISCARD PURE RETURNS_NON_NULL diff --git a/include/instructions/RabbitizerRegisterDescriptor.h b/include/instructions/RabbitizerRegisterDescriptor.h index e5740c61..10082f54 100644 --- a/include/instructions/RabbitizerRegisterDescriptor.h +++ b/include/instructions/RabbitizerRegisterDescriptor.h @@ -51,6 +51,12 @@ extern const RabbitizerRegisterDescriptor RabbitizerRegister_RspVector_Descripto /* RSP */ +/* R4000ALLEGREX */ + +extern const RabbitizerRegisterDescriptor RabbitizerRegister_R4000AllegrexCop3_Descriptors[]; + +/* R4000ALLEGREX */ + /* R5900 */ extern const RabbitizerRegisterDescriptor RabbitizerRegister_R5900VF_Descriptors[]; diff --git a/rabbitizer/InstrId.pyi b/rabbitizer/InstrId.pyi index 70480d61..62d0224b 100644 --- a/rabbitizer/InstrId.pyi +++ b/rabbitizer/InstrId.pyi @@ -421,6 +421,18 @@ class InstrId: cpu_seb: Enum cpu_seh: Enum cpu_bitrev: Enum + r4000allegrex_bc2f: Enum + r4000allegrex_bc2t: Enum + r4000allegrex_bc2fl: Enum + r4000allegrex_bc2tl: Enum + r4000allegrex_mfc3: Enum + r4000allegrex_mtc3: Enum + r4000allegrex_cfc3: Enum + r4000allegrex_ctc3: Enum + r4000allegrex_bc3f: Enum + r4000allegrex_bc3t: Enum + r4000allegrex_bc3fl: Enum + r4000allegrex_bc3tl: Enum r4000allegrex_MAX: Enum r5900_INVALID: Enum r5900_lq: Enum diff --git a/rabbitizer/InstrIdType.pyi b/rabbitizer/InstrIdType.pyi index ffb5432a..d659b83e 100644 --- a/rabbitizer/InstrIdType.pyi +++ b/rabbitizer/InstrIdType.pyi @@ -51,9 +51,14 @@ class InstrIdType: R4000ALLEGREX_SPECIAL3: Enum R4000ALLEGREX_SPECIAL3_BSHFL: Enum R4000ALLEGREX_COP0: Enum + R4000ALLEGREX_COP0_BC0: Enum + R4000ALLEGREX_COP0_TLB: Enum R4000ALLEGREX_COP1: Enum + R4000ALLEGREX_COP1_BC1: Enum R4000ALLEGREX_COP2: Enum + R4000ALLEGREX_COP2_BC2: Enum R4000ALLEGREX_COP3: Enum + R4000ALLEGREX_COP3_BC3: Enum R4000ALLEGREX_VFPU0: Enum R4000ALLEGREX_VFPU1: Enum R4000ALLEGREX_VFPU3: Enum diff --git a/rabbitizer/OperandType.pyi b/rabbitizer/OperandType.pyi index 1a1c2a1d..0a11d959 100644 --- a/rabbitizer/OperandType.pyi +++ b/rabbitizer/OperandType.pyi @@ -56,6 +56,7 @@ class OperandType: r4000allegrex_pos: Enum r4000allegrex_size: Enum r4000allegrex_size_plus_pos: Enum + r4000allegrex_cop3cd: Enum r5900_I: Enum r5900_Q: Enum r5900_R: Enum diff --git a/rust/src/instr_id_enum.rs b/rust/src/instr_id_enum.rs index 0056118f..2623ff33 100644 --- a/rust/src/instr_id_enum.rs +++ b/rust/src/instr_id_enum.rs @@ -480,6 +480,18 @@ pub enum InstrId { cpu_seb, cpu_seh, cpu_bitrev, + r4000allegrex_bc2f, + r4000allegrex_bc2t, + r4000allegrex_bc2fl, + r4000allegrex_bc2tl, + r4000allegrex_mfc3, + r4000allegrex_mtc3, + r4000allegrex_cfc3, + r4000allegrex_ctc3, + r4000allegrex_bc3f, + r4000allegrex_bc3t, + r4000allegrex_bc3fl, + r4000allegrex_bc3tl, r4000allegrex_USERDEF_00, r4000allegrex_USERDEF_01, r4000allegrex_USERDEF_02, diff --git a/rust/src/instr_id_type_enum.rs b/rust/src/instr_id_type_enum.rs index 91504795..8d14c0e2 100644 --- a/rust/src/instr_id_type_enum.rs +++ b/rust/src/instr_id_type_enum.rs @@ -50,9 +50,14 @@ pub enum InstrIdType { R4000ALLEGREX_SPECIAL3, R4000ALLEGREX_SPECIAL3_BSHFL, R4000ALLEGREX_COP0, + R4000ALLEGREX_COP0_BC0, + R4000ALLEGREX_COP0_TLB, R4000ALLEGREX_COP1, + R4000ALLEGREX_COP1_BC1, R4000ALLEGREX_COP2, + R4000ALLEGREX_COP2_BC2, R4000ALLEGREX_COP3, + R4000ALLEGREX_COP3_BC3, R4000ALLEGREX_VFPU0, R4000ALLEGREX_VFPU1, R4000ALLEGREX_VFPU3, diff --git a/rust/src/operand_type_enum.rs b/rust/src/operand_type_enum.rs index 57421143..e7a74665 100644 --- a/rust/src/operand_type_enum.rs +++ b/rust/src/operand_type_enum.rs @@ -55,6 +55,7 @@ pub enum OperandType { r4000allegrex_pos, r4000allegrex_size, r4000allegrex_size_plus_pos, + r4000allegrex_cop3cd, r5900_I, r5900_Q, r5900_R, diff --git a/rust/src/registers_enum.rs b/rust/src/registers_enum.rs index d01d3f8b..808eaf62 100644 --- a/rust/src/registers_enum.rs +++ b/rust/src/registers_enum.rs @@ -486,6 +486,44 @@ pub mod registers { #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] #[allow(non_camel_case_types)] #[derive(num_enum::TryFromPrimitive, num_enum::IntoPrimitive)] + pub enum R4000AllegrexCop3 { + R4000ALLEGREX_COP3_0, + R4000ALLEGREX_COP3_1, + R4000ALLEGREX_COP3_2, + R4000ALLEGREX_COP3_3, + R4000ALLEGREX_COP3_4, + R4000ALLEGREX_COP3_5, + R4000ALLEGREX_COP3_6, + R4000ALLEGREX_COP3_7, + R4000ALLEGREX_COP3_8, + R4000ALLEGREX_COP3_9, + R4000ALLEGREX_COP3_10, + R4000ALLEGREX_COP3_11, + R4000ALLEGREX_COP3_12, + R4000ALLEGREX_COP3_13, + R4000ALLEGREX_COP3_14, + R4000ALLEGREX_COP3_15, + R4000ALLEGREX_COP3_16, + R4000ALLEGREX_COP3_17, + R4000ALLEGREX_COP3_18, + R4000ALLEGREX_COP3_19, + R4000ALLEGREX_COP3_20, + R4000ALLEGREX_COP3_21, + R4000ALLEGREX_COP3_22, + R4000ALLEGREX_COP3_23, + R4000ALLEGREX_COP3_24, + R4000ALLEGREX_COP3_25, + R4000ALLEGREX_COP3_26, + R4000ALLEGREX_COP3_27, + R4000ALLEGREX_COP3_28, + R4000ALLEGREX_COP3_29, + R4000ALLEGREX_COP3_30, + R4000ALLEGREX_COP3_31, + } + #[repr(u32)] + #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] + #[allow(non_camel_case_types)] + #[derive(num_enum::TryFromPrimitive, num_enum::IntoPrimitive)] pub enum R5900VF { vf0, vf1, diff --git a/rust/src/registers_methods.rs b/rust/src/registers_methods.rs index e6664d9d..542438e2 100644 --- a/rust/src/registers_methods.rs +++ b/rust/src/registers_methods.rs @@ -35,6 +35,8 @@ extern "C" { pub fn RabbitizerRegister_getNameRspCop2Control(reg_value: u8) -> *const core::ffi::c_char; pub fn RabbitizerRegister_getNameRspVector(reg_value: u8) -> *const core::ffi::c_char; + pub fn RabbitizerRegister_getNameR4000AllegrexCop3(reg_value: u8) -> *const core::ffi::c_char; + pub fn RabbitizerRegister_getNameR5900VF(reg_value: u8) -> *const core::ffi::c_char; pub fn RabbitizerRegister_getNameR5900VI(reg_value: u8) -> *const core::ffi::c_char; */ @@ -58,6 +60,12 @@ extern "C" { /* RSP */ + /* R4000ALLEGREX */ + + pub static mut RabbitizerRegister_R4000AllegrexCop3_Names: [RegisterDescriptor; 0usize]; + + /* R4000ALLEGREX */ + /* R5900 */ pub static mut RabbitizerRegister_R5900VF_Descriptors: [RegisterDescriptor; 0usize]; @@ -300,6 +308,28 @@ impl registers_enum::registers::RspVector { } } +impl registers_enum::registers::R4000AllegrexCop3 { + pub fn name(self) -> &'static str { + let reg_value: u32 = self.into(); + + unsafe { + std::ffi::CStr::from_ptr( + RabbitizerRegister_R4000AllegrexCop3_Names[reg_value as usize][1], + ) + .to_str() + .unwrap() + } + } + + pub fn descriptor(&self) -> &RegisterDescriptor { + let reg_value: u32 = (*self).into(); + + unsafe { + RabbitizerRegister_R4000AllegrexCop3_Descriptors.get_unchecked(reg_value as usize) + } + } +} + impl registers_enum::registers::R5900VF { pub fn name(self) -> &'static str { let reg_value: u32 = self.into(); diff --git a/src/instructions/RabbitizerInstrDescriptor.c b/src/instructions/RabbitizerInstrDescriptor.c index 509c9733..fefd2265 100644 --- a/src/instructions/RabbitizerInstrDescriptor.c +++ b/src/instructions/RabbitizerInstrDescriptor.c @@ -268,6 +268,7 @@ bool RabbitizerInstrDescriptor_hasOperandAlias(const RabbitizerInstrDescriptor * case RAB_OPERAND_r4000allegrex_pos: case RAB_OPERAND_r4000allegrex_size: case RAB_OPERAND_r4000allegrex_size_plus_pos: + case RAB_OPERAND_r4000allegrex_cop3cd: break; /* r4000allegrex */ diff --git a/src/instructions/RabbitizerInstruction/RabbitizerInstruction.c b/src/instructions/RabbitizerInstruction/RabbitizerInstruction.c index af462821..5e229b58 100644 --- a/src/instructions/RabbitizerInstruction/RabbitizerInstruction.c +++ b/src/instructions/RabbitizerInstruction/RabbitizerInstruction.c @@ -368,6 +368,10 @@ void RabbitizerInstruction_blankOut(RabbitizerInstruction *self) { case RAB_OPERAND_r4000allegrex_size_plus_pos: self->word = RAB_INSTR_R4000ALLEGREX_PACK_size_plus_pos(self->word, 0); break; + + case RAB_OPERAND_r4000allegrex_cop3cd: + self->word = RAB_INSTR_R4000ALLEGREX_PACK_cop3cd(self->word, 0); + break; /* r4000allegrex */ /* r5900 */ diff --git a/src/instructions/RabbitizerInstruction/RabbitizerInstruction_Examination.c b/src/instructions/RabbitizerInstruction/RabbitizerInstruction_Examination.c index 276c1da8..5fc7271b 100644 --- a/src/instructions/RabbitizerInstruction/RabbitizerInstruction_Examination.c +++ b/src/instructions/RabbitizerInstruction/RabbitizerInstruction_Examination.c @@ -414,6 +414,10 @@ uint32_t RabbitizerInstruction_getValidBits(const RabbitizerInstruction *self) { case RAB_OPERAND_r4000allegrex_size_plus_pos: validbits = RAB_INSTR_R4000ALLEGREX_PACK_size_plus_pos(validbits, ~0); break; + + case RAB_OPERAND_r4000allegrex_cop3cd: + validbits = RAB_INSTR_R4000ALLEGREX_PACK_cop3cd(validbits, ~0); + break; /* r4000allegrex */ /* r5900 */ diff --git a/src/instructions/RabbitizerInstructionR4000Allegrex/RabbitizerInstructionR4000Allegrex_OperandType.c b/src/instructions/RabbitizerInstructionR4000Allegrex/RabbitizerInstructionR4000Allegrex_OperandType.c index 42c22102..7ca0be15 100644 --- a/src/instructions/RabbitizerInstructionR4000Allegrex/RabbitizerInstructionR4000Allegrex_OperandType.c +++ b/src/instructions/RabbitizerInstructionR4000Allegrex/RabbitizerInstructionR4000Allegrex_OperandType.c @@ -64,3 +64,13 @@ size_t RabbitizerOperandType_process_r4000allegrex_size_plus_pos(const Rabbitize RABUTILS_BUFFER_SPRINTF(dst, totalSize, "%i", temp); return totalSize; } + +size_t RabbitizerOperandType_process_r4000allegrex_cop3cd(const RabbitizerInstruction *self, char *dst, + UNUSED const char *immOverride, + UNUSED size_t immOverrideLength) { + size_t totalSize = 0; + const char *reg = RabbitizerRegister_getNameCop2(RAB_INSTR_R4000ALLEGREX_GET_cop3cd(self)); + + RABUTILS_BUFFER_CPY(dst, totalSize, reg); + return totalSize; +} diff --git a/src/instructions/RabbitizerInstructionR4000Allegrex/RabbitizerInstructionR4000Allegrex_ProcessUniqueId.c b/src/instructions/RabbitizerInstructionR4000Allegrex/RabbitizerInstructionR4000Allegrex_ProcessUniqueId.c index 0984fe76..0008ba01 100644 --- a/src/instructions/RabbitizerInstructionR4000Allegrex/RabbitizerInstructionR4000Allegrex_ProcessUniqueId.c +++ b/src/instructions/RabbitizerInstructionR4000Allegrex/RabbitizerInstructionR4000Allegrex_ProcessUniqueId.c @@ -171,6 +171,7 @@ void RabbitizerInstructionR4000Allegrex_processUniqueId_Special3_Bshfl(Rabbitize void RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor0(RabbitizerInstruction *self) { uint32_t fmt = RAB_INSTR_GET_fmt(self); + bool fetchDescriptor = true; self->_mandatorybits = RAB_INSTR_PACK_fmt(self->_mandatorybits, fmt); self->instrIdType = RAB_INSTR_ID_TYPE_R4000ALLEGREX_COP0; @@ -178,26 +179,130 @@ void RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor0(RabbitizerI switch (fmt) { #include "tables/instr_id/r4000allegrex/r4000allegrex_cop0.inc" + + case 0x08: + RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor0_BC0(self); + fetchDescriptor = false; + break; + + case 0x10: + RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor0_Tlb(self); + fetchDescriptor = false; + break; + + default: + RabbitizerInstruction_processUniqueId_Coprocessor0(self); + fetchDescriptor = false; + break; } - self->descriptor = &RabbitizerInstrDescriptor_Descriptors[self->uniqueId]; + if (fetchDescriptor) { + self->descriptor = &RabbitizerInstrDescriptor_Descriptors[self->uniqueId]; + } +} + +void RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor0_BC0(RabbitizerInstruction *self) { + uint32_t fmt = RAB_INSTR_GET_bc_fmt(self); + bool fetchDescriptor = true; + + self->_mandatorybits = RAB_INSTR_PACK_bc_fmt(self->_mandatorybits, fmt); + self->instrIdType = RAB_INSTR_ID_TYPE_R4000ALLEGREX_COP0_BC0; + self->_handwrittenCategory = true; + + switch (fmt) { +#include "tables/instr_id/r4000allegrex/r4000allegrex_cop0_bc0.inc" + + default: + RabbitizerInstruction_processUniqueId_Coprocessor0_BC0(self); + fetchDescriptor = false; + break; + } + + if (fetchDescriptor) { + self->descriptor = &RabbitizerInstrDescriptor_Descriptors[self->uniqueId]; + } +} + +void RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor0_Tlb(RabbitizerInstruction *self) { + uint32_t function = RAB_INSTR_GET_function(self); + bool fetchDescriptor = true; + + self->_mandatorybits = RAB_INSTR_PACK_function(self->_mandatorybits, function); + self->instrIdType = RAB_INSTR_ID_TYPE_R4000ALLEGREX_COP0_BC0; + self->_handwrittenCategory = true; + + switch (function) { +#include "tables/instr_id/r4000allegrex/r4000allegrex_cop0_tlb.inc" + + default: + RabbitizerInstruction_processUniqueId_Coprocessor0_Tlb(self); + fetchDescriptor = false; + break; + } + + if (fetchDescriptor) { + self->descriptor = &RabbitizerInstrDescriptor_Descriptors[self->uniqueId]; + } } void RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor1(RabbitizerInstruction *self) { uint32_t fmt = RAB_INSTR_GET_fmt(self); + bool fetchDescriptor = true; self->_mandatorybits = RAB_INSTR_PACK_fmt(self->_mandatorybits, fmt); self->instrIdType = RAB_INSTR_ID_TYPE_R4000ALLEGREX_COP1; switch (fmt) { -#include "tables/instr_id/r4000allegrex/r4000allegrex_cop0.inc" +#include "tables/instr_id/r4000allegrex/r4000allegrex_cop1.inc" + + case 0x08: + RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor1_BC1(self); + fetchDescriptor = false; + break; + + case 0x10: + case 0x11: + case 0x14: + case 0x15: + // ???? + break; + + default: + RabbitizerInstruction_processUniqueId_Coprocessor1(self); + fetchDescriptor = false; + break; } - self->descriptor = &RabbitizerInstrDescriptor_Descriptors[self->uniqueId]; + if (fetchDescriptor) { + self->descriptor = &RabbitizerInstrDescriptor_Descriptors[self->uniqueId]; + } +} + +void RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor1_BC1(RabbitizerInstruction *self) { + uint32_t fmt = RAB_INSTR_GET_bc_fmt(self); + bool fetchDescriptor = true; + + self->_mandatorybits = RAB_INSTR_PACK_bc_fmt(self->_mandatorybits, fmt); + self->instrIdType = RAB_INSTR_ID_TYPE_R4000ALLEGREX_COP1_BC1; + self->_handwrittenCategory = true; + + switch (fmt) { +#include "tables/instr_id/r4000allegrex/r4000allegrex_cop1_bc1.inc" + + default: + RabbitizerInstruction_processUniqueId_Coprocessor1_BC1(self); + fetchDescriptor = false; + break; + } + + if (fetchDescriptor) { + self->descriptor = &RabbitizerInstrDescriptor_Descriptors[self->uniqueId]; + } } void RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor2(RabbitizerInstruction *self) { uint32_t fmt = RAB_INSTR_GET_fmt(self); + bool fetchDescriptor = true; self->_mandatorybits = RAB_INSTR_PACK_fmt(self->_mandatorybits, fmt); self->instrIdType = RAB_INSTR_ID_TYPE_R4000ALLEGREX_COP2; @@ -205,13 +310,43 @@ void RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor2(RabbitizerI switch (fmt) { #include "tables/instr_id/r4000allegrex/r4000allegrex_cop2.inc" + + case 0x08: + RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor2_BC2(self); + fetchDescriptor = false; + break; + + default: + RabbitizerInstruction_processUniqueId_Coprocessor2(self); + fetchDescriptor = false; + break; } - self->descriptor = &RabbitizerInstrDescriptor_Descriptors[self->uniqueId]; + if (fetchDescriptor) { + self->descriptor = &RabbitizerInstrDescriptor_Descriptors[self->uniqueId]; + } +} + +void RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor2_BC2(RabbitizerInstruction *self) { + uint32_t fmt = RAB_INSTR_GET_bc_fmt(self); + bool fetchDescriptor = true; + + self->_mandatorybits = RAB_INSTR_PACK_bc_fmt(self->_mandatorybits, fmt); + self->instrIdType = RAB_INSTR_ID_TYPE_R4000ALLEGREX_COP2_BC2; + self->_handwrittenCategory = true; + + switch (fmt) { +#include "tables/instr_id/r4000allegrex/r4000allegrex_cop2_bc2.inc" + } + + if (fetchDescriptor) { + self->descriptor = &RabbitizerInstrDescriptor_Descriptors[self->uniqueId]; + } } void RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor3(RabbitizerInstruction *self) { uint32_t fmt = RAB_INSTR_GET_fmt(self); + bool fetchDescriptor = true; self->_mandatorybits = RAB_INSTR_PACK_fmt(self->_mandatorybits, fmt); self->instrIdType = RAB_INSTR_ID_TYPE_R4000ALLEGREX_COP3; @@ -219,9 +354,33 @@ void RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor3(RabbitizerI switch (fmt) { #include "tables/instr_id/r4000allegrex/r4000allegrex_cop3.inc" + + case 0x08: + RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor3_BC3(self); + fetchDescriptor = false; + break; } - self->descriptor = &RabbitizerInstrDescriptor_Descriptors[self->uniqueId]; + if (fetchDescriptor) { + self->descriptor = &RabbitizerInstrDescriptor_Descriptors[self->uniqueId]; + } +} + +void RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor3_BC3(RabbitizerInstruction *self) { + uint32_t fmt = RAB_INSTR_GET_bc_fmt(self); + bool fetchDescriptor = true; + + self->_mandatorybits = RAB_INSTR_PACK_bc_fmt(self->_mandatorybits, fmt); + self->instrIdType = RAB_INSTR_ID_TYPE_R4000ALLEGREX_COP3_BC3; + self->_handwrittenCategory = true; + + switch (fmt) { +#include "tables/instr_id/r4000allegrex/r4000allegrex_cop3_bc3.inc" + } + + if (fetchDescriptor) { + self->descriptor = &RabbitizerInstrDescriptor_Descriptors[self->uniqueId]; + } } void RabbitizerInstructionR4000Allegrex_processUniqueId_Vfpu0(RabbitizerInstruction *self) { diff --git a/src/instructions/RabbitizerRegister.c b/src/instructions/RabbitizerRegister.c index a2bdd3fe..4177ee5c 100644 --- a/src/instructions/RabbitizerRegister.c +++ b/src/instructions/RabbitizerRegister.c @@ -101,6 +101,12 @@ const char *RabbitizerRegister_getNameRspVector(uint8_t regValue) { return RabbitizerRegister_RspVector_Names[regValue][RabbitizerConfig_Cfg.regNames.namedRegisters ? 1 : 0]; } +const char *RabbitizerRegister_getNameR4000AllegrexCop3(uint8_t regValue) { + assert(regValue < ARRAY_COUNT(RabbitizerRegister_R4000AllegrexCop3_Names)); + + return RabbitizerRegister_R4000AllegrexCop3_Names[regValue][RabbitizerConfig_Cfg.regNames.namedRegisters ? 1 : 0]; +} + const char *RabbitizerRegister_getNameR5900VF(uint8_t regValue) { assert(regValue < ARRAY_COUNT(RabbitizerRegister_R5900VF_Names)); @@ -186,6 +192,12 @@ const RabbitizerRegisterDescriptor *RabbitizerRegister_getDescriptor_RspVector(u return &RabbitizerRegister_RspVector_Descriptors[regValue]; } +const RabbitizerRegisterDescriptor *RabbitizerRegister_getDescriptor_R4000AllegrexCop3(uint8_t regValue) { + assert(regValue < ARRAY_COUNT(RabbitizerRegister_R4000AllegrexCop3_Names)); + + return &RabbitizerRegister_R4000AllegrexCop3_Descriptors[regValue]; +} + const RabbitizerRegisterDescriptor *RabbitizerRegister_getDescriptor_R5900VF(uint8_t regValue) { assert(regValue < ARRAY_COUNT(RabbitizerRegister_R5900VF_Names)); diff --git a/tables/tables/instr_id/RabbitizerInstrId_cpu.inc b/tables/tables/instr_id/RabbitizerInstrId_cpu.inc index 617c696c..15d9ed6a 100644 --- a/tables/tables/instr_id/RabbitizerInstrId_cpu.inc +++ b/tables/tables/instr_id/RabbitizerInstrId_cpu.inc @@ -9,15 +9,18 @@ #include "cpu/cpu_normal.inc" #include "cpu/cpu_special.inc" #include "cpu/cpu_regimm.inc" + #include "cpu/cpu_cop0.inc" #include "cpu/cpu_cop0_bc0.inc" #include "cpu/cpu_cop0_tlb.inc" + #include "cpu/cpu_cop1.inc" #include "cpu/cpu_cop1_bc1.inc" #include "cpu/cpu_cop1_fpu_s.inc" #include "cpu/cpu_cop1_fpu_d.inc" #include "cpu/cpu_cop1_fpu_w.inc" #include "cpu/cpu_cop1_fpu_l.inc" + #include "cpu/cpu_cop2.inc" #ifndef INSTRID_AVOID_USERDEF diff --git a/tables/tables/instr_id/RabbitizerInstrId_r4000allegrex.inc b/tables/tables/instr_id/RabbitizerInstrId_r4000allegrex.inc index 5b7571cd..4723efb3 100644 --- a/tables/tables/instr_id/RabbitizerInstrId_r4000allegrex.inc +++ b/tables/tables/instr_id/RabbitizerInstrId_r4000allegrex.inc @@ -21,9 +21,17 @@ #include "r4000allegrex/r4000allegrex_special3_bshfl.inc" #include "r4000allegrex/r4000allegrex_cop0.inc" + #include "r4000allegrex/r4000allegrex_cop0_bc0.inc" + #include "r4000allegrex/r4000allegrex_cop0_tlb.inc" + #include "r4000allegrex/r4000allegrex_cop1.inc" + #include "r4000allegrex/r4000allegrex_cop1_bc1.inc" + #include "r4000allegrex/r4000allegrex_cop2.inc" + #include "r4000allegrex/r4000allegrex_cop2_bc2.inc" + #include "r4000allegrex/r4000allegrex_cop3.inc" + #include "r4000allegrex/r4000allegrex_cop3_bc3.inc" #include "r4000allegrex/r4000allegrex_vfpu0.inc" #include "r4000allegrex/r4000allegrex_vfpu1.inc" diff --git a/tables/tables/instr_id/cpu/cpu_cop0_tlb.inc b/tables/tables/instr_id/cpu/cpu_cop0_tlb.inc index 56726d40..a20818b0 100644 --- a/tables/tables/instr_id/cpu/cpu_cop0_tlb.inc +++ b/tables/tables/instr_id/cpu/cpu_cop0_tlb.inc @@ -16,6 +16,7 @@ 111 | --- | --- | --- | --- | --- | --- | --- | --- | hi |-------|-------|-------|-------|-------|-------|-------|-------| */ + // OP RABBITIZER_DEF_INSTR_ID( cpu, 0x01, tlbr, diff --git a/tables/tables/instr_id/cpu/cpu_cop2.inc b/tables/tables/instr_id/cpu/cpu_cop2.inc index 17d9461f..346483d2 100644 --- a/tables/tables/instr_id/cpu/cpu_cop2.inc +++ b/tables/tables/instr_id/cpu/cpu_cop2.inc @@ -6,7 +6,7 @@ | = COP0 | fmt | | ------6----------5----------------------------------------------- |--000--|--001--|--010--|--011--|--100--|--101--|--110--|--111--| lo - 00 | MFC2 | --- | CFC0 | --- | MTC2 | --- | CTC2 | --- | + 00 | MFC2 | --- | CFC2 | --- | MTC2 | --- | CTC2 | --- | 01 | --- | --- | --- | --- | --- | --- | --- | --- | 10 | --- | --- | --- | --- | --- | --- | --- | --- | 11 | --- | --- | --- | --- | --- | --- | --- | --- | diff --git a/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop0.inc b/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop0.inc index 4943a62b..5d0ad69e 100644 --- a/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop0.inc +++ b/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop0.inc @@ -6,9 +6,12 @@ | = COP0 | fmt | | ------6----------5----------------------------------------------- |--000--|--001--|--010--|--011--|--100--|--101--|--110--|--111--| lo - 00 | --- | --- | --- | --- | --- | --- | --- | --- | - 01 | --- | --- | --- | --- | --- | --- | --- | --- | + 00 | MFC0 | --- | --- | --- | MTC0 | --- | --- | --- | + 01 | *1 | --- | --- | --- | --- | --- | --- | --- | 10 | --- | --- | --- | --- | --- | --- | --- | --- | 11 | --- | --- | --- | --- | --- | --- | --- | --- | hi |-------|-------|-------|-------|-------|-------|-------|-------| + *1=BC See BC0 list */ + + // The other instructions are implemented using the main CPU table diff --git a/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop0_bc0.inc b/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop0_bc0.inc new file mode 100644 index 00000000..9a7fa401 --- /dev/null +++ b/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop0_bc0.inc @@ -0,0 +1,16 @@ +/* SPDX-FileCopyrightText: © 2024 Decompollaborate */ +/* SPDX-License-Identifier: MIT */ + +/* + 31--------26-25------21-20------16------------------------------0 + | = COP0 | BC0 | fmt | | + ------6----------5----------5------------------------------------ + |--000--|--001--|--010--|--011--|--100--|--101--|--110--|--111--| lo + 00 | BC0F | BC0T | BC0FL | BC0TL | --- | --- | --- | --- | + 01 | --- | --- | --- | --- | --- | --- | --- | --- | + 10 | --- | --- | --- | --- | --- | --- | --- | --- | + 11 | --- | --- | --- | --- | --- | --- | --- | --- | + hi |-------|-------|-------|-------|-------|-------|-------|-------| +*/ + + // The other instructions are implemented using the main CPU table diff --git a/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop0_tlb.inc b/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop0_tlb.inc new file mode 100644 index 00000000..5647ce7c --- /dev/null +++ b/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop0_tlb.inc @@ -0,0 +1,20 @@ +/* SPDX-FileCopyrightText: © 2024 Decompollaborate */ +/* SPDX-License-Identifier: MIT */ + +/* + 31--------26-25------21--------------------------------5--------0 + | = COP0 | TLB | | fmt | + ------6----------5----------------------------------------------- + |--000--|--001--|--010--|--011--|--100--|--101--|--110--|--111--| lo +000 | --- | --- | --- | --- | --- | --- | --- | --- | +001 | --- | --- | --- | --- | --- | --- | --- | --- | +010 | --- | --- | --- | --- | --- | --- | --- | --- | +011 | ERET | --- | --- | --- | --- | --- | --- | --- | +100 | --- | --- | --- | --- | --- | --- | --- | --- | +101 | --- | --- | --- | --- | --- | --- | --- | --- | +110 | --- | --- | --- | --- | --- | --- | --- | --- | +111 | --- | --- | --- | --- | --- | --- | --- | --- | + hi |-------|-------|-------|-------|-------|-------|-------|-------| +*/ + + // The other instructions are implemented using the main CPU table diff --git a/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop1.inc b/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop1.inc index 4943a62b..2c92937b 100644 --- a/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop1.inc +++ b/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop1.inc @@ -3,12 +3,21 @@ /* 31--------26-25------21 ----------------------------------------0 - | = COP0 | fmt | | + | = COP1 | fmt | | ------6----------5----------------------------------------------- |--000--|--001--|--010--|--011--|--100--|--101--|--110--|--111--| lo - 00 | --- | --- | --- | --- | --- | --- | --- | --- | - 01 | --- | --- | --- | --- | --- | --- | --- | --- | + 00 | MFC1 | --- | CFC1 | MFHC1 | MTC1 | --- | CTC1 | MTHC1 | + 01 | *1 | --- | --- | --- | --- | --- | --- | --- | 10 | --- | --- | --- | --- | --- | --- | --- | --- | 11 | --- | --- | --- | --- | --- | --- | --- | --- | hi |-------|-------|-------|-------|-------|-------|-------|-------| + *1=BC See BC1 list */ + +/* +TODO: +- MFHC1 +- MTHC1 +*/ + + // The other instructions are implemented using the main CPU table diff --git a/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop1_bc1.inc b/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop1_bc1.inc new file mode 100644 index 00000000..447982cb --- /dev/null +++ b/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop1_bc1.inc @@ -0,0 +1,16 @@ +/* SPDX-FileCopyrightText: © 2024 Decompollaborate */ +/* SPDX-License-Identifier: MIT */ + +/* + 31--------26-25------21-20------16------------------------------0 + | = COP1 | BC1 | fmt | | + ------6----------5----------5------------------------------------ + |--000--|--001--|--010--|--011--|--100--|--101--|--110--|--111--| lo + 00 | BC1F | BC1T | BC1FL | BC1TL | --- | --- | --- | --- | + 01 | --- | --- | --- | --- | --- | --- | --- | --- | + 10 | --- | --- | --- | --- | --- | --- | --- | --- | + 11 | --- | --- | --- | --- | --- | --- | --- | --- | + hi |-------|-------|-------|-------|-------|-------|-------|-------| +*/ + + // The other instructions are implemented using the main CPU table diff --git a/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop2.inc b/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop2.inc index 4943a62b..1b31dd06 100644 --- a/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop2.inc +++ b/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop2.inc @@ -3,12 +3,21 @@ /* 31--------26-25------21 ----------------------------------------0 - | = COP0 | fmt | | + | = COP2 | fmt | | ------6----------5----------------------------------------------- |--000--|--001--|--010--|--011--|--100--|--101--|--110--|--111--| lo - 00 | --- | --- | --- | --- | --- | --- | --- | --- | - 01 | --- | --- | --- | --- | --- | --- | --- | --- | + 00 | MFC2 | --- | CFC2 | MFHC2 | MTC2 | --- | CTC2 | MTHC2 | + 01 | *1 | --- | --- | --- | --- | --- | --- | --- | 10 | --- | --- | --- | --- | --- | --- | --- | --- | 11 | --- | --- | --- | --- | --- | --- | --- | --- | hi |-------|-------|-------|-------|-------|-------|-------|-------| + *1=BC See BC2 list */ + +/* +TODO: +- MFHC2 +- MTHC2 +*/ + + // The other instructions are implemented using the main CPU table diff --git a/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop2_bc2.inc b/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop2_bc2.inc new file mode 100644 index 00000000..5cf22556 --- /dev/null +++ b/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop2_bc2.inc @@ -0,0 +1,42 @@ +/* SPDX-FileCopyrightText: © 2024 Decompollaborate */ +/* SPDX-License-Identifier: MIT */ + +/* + 31--------26-25------21-20------16------------------------------0 + | = COP2 | BC2 | fmt | | + ------6----------5----------5------------------------------------ + |--000--|--001--|--010--|--011--|--100--|--101--|--110--|--111--| lo + 00 | BC2F | BC2T | BC2FL | BC2TL | --- | --- | --- | --- | + 01 | --- | --- | --- | --- | --- | --- | --- | --- | + 10 | --- | --- | --- | --- | --- | --- | --- | --- | + 11 | --- | --- | --- | --- | --- | --- | --- | --- | + hi |-------|-------|-------|-------|-------|-------|-------|-------| +*/ + + // OP IMM + RABBITIZER_DEF_INSTR_ID( + r4000allegrex, 0x00, bc2f, + .operands={RAB_OPERAND_cpu_branch_target_label}, + .instrType=RABBITIZER_INSTR_TYPE_UNKNOWN, + .isBranch=true + ) // Branch on FP False + RABBITIZER_DEF_INSTR_ID( + r4000allegrex, 0x01, bc2t, + .operands={RAB_OPERAND_cpu_branch_target_label}, + .instrType=RABBITIZER_INSTR_TYPE_UNKNOWN, + .isBranch=true + ) // Branch on FP True + RABBITIZER_DEF_INSTR_ID( + r4000allegrex, 0x02, bc2fl, + .operands={RAB_OPERAND_cpu_branch_target_label}, + .instrType=RABBITIZER_INSTR_TYPE_UNKNOWN, + .isBranch=true, + .isBranchLikely=true + ) // Branch on FP False Likely + RABBITIZER_DEF_INSTR_ID( + r4000allegrex, 0x03, bc2tl, + .operands={RAB_OPERAND_cpu_branch_target_label}, + .instrType=RABBITIZER_INSTR_TYPE_UNKNOWN, + .isBranch=true, + .isBranchLikely=true + ) // Branch on FP True Likely diff --git a/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop3.inc b/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop3.inc index 4943a62b..4e7d580b 100644 --- a/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop3.inc +++ b/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop3.inc @@ -3,12 +3,43 @@ /* 31--------26-25------21 ----------------------------------------0 - | = COP0 | fmt | | + | = COP3 | fmt | | ------6----------5----------------------------------------------- |--000--|--001--|--010--|--011--|--100--|--101--|--110--|--111--| lo - 00 | --- | --- | --- | --- | --- | --- | --- | --- | - 01 | --- | --- | --- | --- | --- | --- | --- | --- | + 00 | MFC3 | --- | CFC3 | MFHC3 | MTC3 | --- | CTC3 | MTHC3 | + 01 | *1 | --- | --- | --- | --- | --- | --- | --- | 10 | --- | --- | --- | --- | --- | --- | --- | --- | 11 | --- | --- | --- | --- | --- | --- | --- | --- | hi |-------|-------|-------|-------|-------|-------|-------|-------| + *1=BC See BC3 list +*/ + + // OP rt, cop3cd + RABBITIZER_DEF_INSTR_ID( + r4000allegrex, 0x00, mfc3, + .operands={RAB_OPERAND_cpu_rt, RAB_OPERAND_r4000allegrex_cop3cd}, + .modifiesRt=true + ) + RABBITIZER_DEF_INSTR_ID( + r4000allegrex, 0x04, mtc3, + .operands={RAB_OPERAND_cpu_rt, RAB_OPERAND_r4000allegrex_cop3cd}, + .readsRt=true + ) + + // OP rt, cop3cd + RABBITIZER_DEF_INSTR_ID( + r4000allegrex, 0x02, cfc3, + .operands={RAB_OPERAND_cpu_rt, RAB_OPERAND_r4000allegrex_cop3cd}, + .modifiesRt=true + ) + RABBITIZER_DEF_INSTR_ID( + r4000allegrex, 0x06, ctc3, + .operands={RAB_OPERAND_cpu_rt, RAB_OPERAND_r4000allegrex_cop3cd}, + .readsRt=true + ) + +/* +TODO: +- MFHC3 +- MTHC3 */ diff --git a/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop3_bc3.inc b/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop3_bc3.inc new file mode 100644 index 00000000..152a32a3 --- /dev/null +++ b/tables/tables/instr_id/r4000allegrex/r4000allegrex_cop3_bc3.inc @@ -0,0 +1,42 @@ +/* SPDX-FileCopyrightText: © 2024 Decompollaborate */ +/* SPDX-License-Identifier: MIT */ + +/* + 31--------26-25------21-20------16------------------------------0 + | = COP2 | BC3 | fmt | | + ------6----------5----------5------------------------------------ + |--000--|--001--|--010--|--011--|--100--|--101--|--110--|--111--| lo + 00 | BC3F | BC3T | BC3FL | BC3TL | --- | --- | --- | --- | + 01 | --- | --- | --- | --- | --- | --- | --- | --- | + 10 | --- | --- | --- | --- | --- | --- | --- | --- | + 11 | --- | --- | --- | --- | --- | --- | --- | --- | + hi |-------|-------|-------|-------|-------|-------|-------|-------| +*/ + + // OP IMM + RABBITIZER_DEF_INSTR_ID( + r4000allegrex, 0x00, bc3f, + .operands={RAB_OPERAND_cpu_branch_target_label}, + .instrType=RABBITIZER_INSTR_TYPE_UNKNOWN, + .isBranch=true + ) // Branch on FP False + RABBITIZER_DEF_INSTR_ID( + r4000allegrex, 0x01, bc3t, + .operands={RAB_OPERAND_cpu_branch_target_label}, + .instrType=RABBITIZER_INSTR_TYPE_UNKNOWN, + .isBranch=true + ) // Branch on FP True + RABBITIZER_DEF_INSTR_ID( + r4000allegrex, 0x02, bc3fl, + .operands={RAB_OPERAND_cpu_branch_target_label}, + .instrType=RABBITIZER_INSTR_TYPE_UNKNOWN, + .isBranch=true, + .isBranchLikely=true + ) // Branch on FP False Likely + RABBITIZER_DEF_INSTR_ID( + r4000allegrex, 0x03, bc3tl, + .operands={RAB_OPERAND_cpu_branch_target_label}, + .instrType=RABBITIZER_INSTR_TYPE_UNKNOWN, + .isBranch=true, + .isBranchLikely=true + ) // Branch on FP True Likely diff --git a/tables/tables/instr_id_types/InstrIdType_r4000allegrex.inc b/tables/tables/instr_id_types/InstrIdType_r4000allegrex.inc index d7a98503..753cea90 100644 --- a/tables/tables/instr_id_types/InstrIdType_r4000allegrex.inc +++ b/tables/tables/instr_id_types/InstrIdType_r4000allegrex.inc @@ -17,19 +17,21 @@ RABBITIZER_DEF_INSTR_ID_TYPE(R4000ALLEGREX, SPECIAL3_BSHFL) RABBITIZER_DEF_INSTR_ID_TYPE(R4000ALLEGREX, COP0) - //RABBITIZER_DEF_INSTR_ID_TYPE(R4000ALLEGREX, COP0_BC0) - //RABBITIZER_DEF_INSTR_ID_TYPE(R4000ALLEGREX, COP0_TLB) + RABBITIZER_DEF_INSTR_ID_TYPE(R4000ALLEGREX, COP0_BC0) + RABBITIZER_DEF_INSTR_ID_TYPE(R4000ALLEGREX, COP0_TLB) RABBITIZER_DEF_INSTR_ID_TYPE(R4000ALLEGREX, COP1) - //RABBITIZER_DEF_INSTR_ID_TYPE(R4000ALLEGREX, COP1_BC1) + RABBITIZER_DEF_INSTR_ID_TYPE(R4000ALLEGREX, COP1_BC1) //RABBITIZER_DEF_INSTR_ID_TYPE(R4000ALLEGREX, COP1_FPUS) //RABBITIZER_DEF_INSTR_ID_TYPE(R4000ALLEGREX, COP1_FPUD) //RABBITIZER_DEF_INSTR_ID_TYPE(R4000ALLEGREX, COP1_FPUW) //RABBITIZER_DEF_INSTR_ID_TYPE(R4000ALLEGREX, COP1_FPUL) RABBITIZER_DEF_INSTR_ID_TYPE(R4000ALLEGREX, COP2) + RABBITIZER_DEF_INSTR_ID_TYPE(R4000ALLEGREX, COP2_BC2) RABBITIZER_DEF_INSTR_ID_TYPE(R4000ALLEGREX, COP3) + RABBITIZER_DEF_INSTR_ID_TYPE(R4000ALLEGREX, COP3_BC3) RABBITIZER_DEF_INSTR_ID_TYPE(R4000ALLEGREX, VFPU0) diff --git a/tables/tables/operands/RabbitizerOperandType_r4000allegrex.inc b/tables/tables/operands/RabbitizerOperandType_r4000allegrex.inc index 969b8c40..bc3535a7 100644 --- a/tables/tables/operands/RabbitizerOperandType_r4000allegrex.inc +++ b/tables/tables/operands/RabbitizerOperandType_r4000allegrex.inc @@ -4,3 +4,5 @@ RAB_DEF_OPERAND(r4000allegrex, pos) RAB_DEF_OPERAND(r4000allegrex, size) RAB_DEF_OPERAND(r4000allegrex, size_plus_pos) + + RAB_DEF_OPERAND(r4000allegrex, cop3cd) diff --git a/tables/tables/registers/RabbitizerRegister_R4000AllegrexCop3.inc b/tables/tables/registers/RabbitizerRegister_R4000AllegrexCop3.inc new file mode 100644 index 00000000..060e6e83 --- /dev/null +++ b/tables/tables/registers/RabbitizerRegister_R4000AllegrexCop3.inc @@ -0,0 +1,131 @@ +/* SPDX-FileCopyrightText: © 2024 Decompollaborate */ +/* SPDX-License-Identifier: MIT */ + + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 0, 0, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 1, 1, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 2, 2, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 3, 3, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 4, 4, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 5, 5, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 6, 6, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 7, 7, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 8, 8, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 9, 9, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 10, 10, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 11, 11, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 12, 12, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 13, 13, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 14, 14, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 15, 15, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 16, 16, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 17, 17, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 18, 18, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 19, 19, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 20, 20, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 21, 21, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 22, 22, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 23, 23, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 24, 24, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 25, 25, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 26, 26, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 27, 27, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 28, 28, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 29, 29, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 30, 30, + 0 + ) + RABBITIZER_DEF_REG( + R4000ALLEGREX_COP3, 31, 31, + 0 + ) diff --git a/tables/templates/c/RegisterDescriptor_Descriptors_arrays.table.template b/tables/templates/c/RegisterDescriptor_Descriptors_arrays.table.template index 476c7da8..ec5c389a 100644 --- a/tables/templates/c/RegisterDescriptor_Descriptors_arrays.table.template +++ b/tables/templates/c/RegisterDescriptor_Descriptors_arrays.table.template @@ -63,6 +63,14 @@ const RabbitizerRegisterDescriptor RabbitizerRegister_RspVector_Descriptors[] = /* RSP */ +/* R4000ALLEGREX */ + +const RabbitizerRegisterDescriptor RabbitizerRegister_R4000AllegrexCop3_Descriptors[] = { +#include "registers/RabbitizerRegister_R4000AllegrexCop3.inc" +}; + +/* R4000ALLEGREX */ + /* R5900 */ const RabbitizerRegisterDescriptor RabbitizerRegister_R5900VF_Descriptors[] = { diff --git a/tables/templates/c/Registers_Names_arrays.table.template b/tables/templates/c/Registers_Names_arrays.table.template index bb26155b..de6a3836 100644 --- a/tables/templates/c/Registers_Names_arrays.table.template +++ b/tables/templates/c/Registers_Names_arrays.table.template @@ -65,6 +65,14 @@ const char *RabbitizerRegister_RspVector_Names[][2] = { /* RSP */ +/* R4000ALLEGREX */ + +const char *RabbitizerRegister_R4000AllegrexCop3_Names[][2] = { +#include "registers/RabbitizerRegister_R4000AllegrexCop3.inc" +}; + +/* R4000ALLEGREX */ + /* R5900 */ const char *RabbitizerRegister_R5900VF_Names[][2] = { diff --git a/tables/templates/c/Registers_enums.table.template b/tables/templates/c/Registers_enums.table.template index 077f8244..b9da34b8 100644 --- a/tables/templates/c/Registers_enums.table.template +++ b/tables/templates/c/Registers_enums.table.template @@ -66,6 +66,14 @@ typedef enum RabbitizerRegister_RspVector { /* RSP */ +/* R4000ALLEGREX */ + +typedef enum RabbitizerRegister_R4000AllegrexCop3 { + #include "registers/RabbitizerRegister_R4000AllegrexCop3.inc" +} RabbitizerRegister_R4000AllegrexCop3; + +/* R4000ALLEGREX */ + /* R5900 */ typedef enum RabbitizerRegister_R5900VF { diff --git a/tables/templates/cplusplus/Registers_enum_classes.table.template b/tables/templates/cplusplus/Registers_enum_classes.table.template index da1d400e..87ef5cc7 100644 --- a/tables/templates/cplusplus/Registers_enum_classes.table.template +++ b/tables/templates/cplusplus/Registers_enum_classes.table.template @@ -66,6 +66,11 @@ }; }; + namespace R4000Allegrex { + enum class Cop3 { + #include "registers/RabbitizerRegister_R4000AllegrexCop3.inc" + }; + }; namespace R5900 { enum class VF { diff --git a/tables/templates/rust/registers_enum.tablers.template b/tables/templates/rust/registers_enum.tablers.template index e289123a..c6f9465e 100644 --- a/tables/templates/rust/registers_enum.tablers.template +++ b/tables/templates/rust/registers_enum.tablers.template @@ -142,6 +142,28 @@ pub mod registers { /* RSP */ + /* R4000ALLEGREX */ + +#undef RABBITIZER_DEF_REG + +#define RABBITIZER_DEF_REG(prefix, name, numeric, ...) \ + prefix##_##name, + + SPECIAL_RS_TAG(repr(u32)) + SPECIAL_RS_TAG(derive(Debug, Copy, Clone, Hash, PartialEq, Eq)) + SPECIAL_RS_TAG(allow(non_camel_case_types)) + SPECIAL_RS_TAG(derive(num_enum::TryFromPrimitive, num_enum::IntoPrimitive)) + pub enum R4000AllegrexCop3 { + #include "registers/RabbitizerRegister_R4000AllegrexCop3.inc" + } + +#undef RABBITIZER_DEF_REG + +#define RABBITIZER_DEF_REG(prefix, name, numeric, ...) \ + name, + + /* R4000ALLEGREX */ + /* R5900 */ SPECIAL_RS_TAG(repr(u32))