Skip to content

Commit

Permalink
fix vsync2
Browse files Browse the repository at this point in the history
  • Loading branch information
AngheloAlf committed Apr 19, 2024
1 parent 1932266 commit 7ca641f
Show file tree
Hide file tree
Showing 16 changed files with 40 additions and 6 deletions.
7 changes: 1 addition & 6 deletions asdf.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ tests/c/instruction_checks/r3000gte_disasm.c: 0 errors out of 65 entries. 100.00

tests/c/instruction_checks/r4000allegrex_disasm.c: 0 errors out of 73 entries. 100.00% correct.

Error on word '0x486000FF'. Expected 'vsync2', got '.word 0x486000FF # INVALID $v1, $zero, 0xFF # 00000000 <InstrIdType: R4000ALLEGREX_COP2_MFHC2_P>'
File: tests/c/instruction_checks/r4000allegrex_vfpu_disasm.c
InstrIdType: 'R4000ALLEGREX_COP2_MFHC2_P'
gnuMode 'true'

Error on word '0xD0161001'. Expected 'vsqrt.s S010, S400', got '.word 0xD0161001 # vsqrt.s S010 # 00001000 <InstrIdType: R4000ALLEGREX_VFPU4_FMT0_FMT0_FMT2>'
File: tests/c/instruction_checks/r4000allegrex_vfpu_disasm.c
InstrIdType: 'R4000ALLEGREX_VFPU4_FMT0_FMT0_FMT2'
Expand Down Expand Up @@ -6004,5 +5999,5 @@ Error on word '0xF3A090C0'. Expected 'vrot.q C002, S400, [C,S,S,S]', got 'v
InstrIdType: 'R4000ALLEGREX_VFPU6_FMT7'
gnuMode 'true'

tests/c/instruction_checks/r4000allegrex_vfpu_disasm.c: 1200 errors out of 4798 entries. 74.99% correct.
tests/c/instruction_checks/r4000allegrex_vfpu_disasm.c: 1199 errors out of 4798 entries. 75.01% correct.

1 change: 1 addition & 0 deletions cplusplus/include/generated/InstrIdType_enum_class.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions cplusplus/include/generated/UniqueId_enum_class.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions include/generated/InstrDescriptor_Descriptors_array.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions include/generated/InstrIdType_Names_array.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions include/generated/InstrIdType_enum.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions include/generated/InstrId_Names_array.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions include/generated/InstrId_enum.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions include/instructions/RabbitizerInstructionR4000Allegrex.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ extern "C" {
#define RAB_INSTR_R4000ALLEGREX_GET_bc2_fmt(self) (SHIFTR((self)->word, 16, 2))
#define RAB_INSTR_R4000ALLEGREX_GET_mxhc2(self) (SHIFTR((self)->word, 7, 1))
#define RAB_INSTR_R4000ALLEGREX_GET_mfhc2_p_fmt(self) (SHIFTR((self)->word, 4, 3))
#define RAB_INSTR_R4000ALLEGREX_GET_mfhc2_p_s_fmt(self) (SHIFTR((self)->word, 0, 4))

#define RAB_INSTR_R4000ALLEGREX_GET_imm3(self) (SHIFTR((self)->word, 18, 3))
#define RAB_INSTR_R4000ALLEGREX_GET_offset14(self) (SHIFTR((self)->word, 2, 14))
Expand Down Expand Up @@ -72,6 +73,7 @@ extern "C" {
#define RAB_INSTR_R4000ALLEGREX_PACK_bc2_fmt(word, value) (BITREPACK((word), (value), 16, 2))
#define RAB_INSTR_R4000ALLEGREX_PACK_mxhc2(word, value) (BITREPACK((word), (value), 7, 1))
#define RAB_INSTR_R4000ALLEGREX_PACK_mfhc2_p_fmt(word, value) (BITREPACK((word), (value), 4, 3))
#define RAB_INSTR_R4000ALLEGREX_PACK_mfhc2_p_s_fmt(word, value) (BITREPACK((word), (value), 0, 4))

#define RAB_INSTR_R4000ALLEGREX_PACK_imm3(word, value) (BITREPACK((word), (value), 18, 3))
#define RAB_INSTR_R4000ALLEGREX_PACK_offset14(word, value) (BITREPACK((word), (value), 2, 14))
Expand Down Expand Up @@ -146,6 +148,8 @@ void RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor2_MFHC2(Rabbi
NON_NULL(1)
void RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor2_MFHC2_p(RabbitizerInstruction *self);
NON_NULL(1)
void RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor2_MFHC2_p_s(RabbitizerInstruction *self);
NON_NULL(1)
void RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor2_MTHC2(RabbitizerInstruction *self);

NON_NULL(1)
Expand Down
1 change: 1 addition & 0 deletions rabbitizer/InstrId.pyi

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions rabbitizer/InstrIdType.pyi

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions rust/src/instr_id_enum.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions rust/src/instr_id_type_enum.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,11 @@ void RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor2_MFHC2_p(Rab
// self->_handwrittenCategory = true;

switch (fmt) {
case 0x7:
RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor2_MFHC2_p_s(self);
fetchDescriptor = false;
break;

#include "tables/instr_id/r4000allegrex/r4000allegrex_cop2_mfhc2_p.inc"
}

Expand All @@ -454,6 +459,23 @@ void RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor2_MFHC2_p(Rab
}
}

void RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor2_MFHC2_p_s(RabbitizerInstruction *self) {
uint32_t fmt = RAB_INSTR_R4000ALLEGREX_GET_mfhc2_p_s_fmt(self);
bool fetchDescriptor = true;

self->_mandatorybits = RAB_INSTR_R4000ALLEGREX_PACK_mfhc2_p_s_fmt(self->_mandatorybits, fmt);
self->instrIdType = RAB_INSTR_ID_TYPE_R4000ALLEGREX_COP2_MFHC2_P_S;
// self->_handwrittenCategory = true;

switch (fmt) {
#include "tables/instr_id/r4000allegrex/r4000allegrex_cop2_mfhc2_p_s.inc"
}

if (fetchDescriptor) {
self->descriptor = &RabbitizerInstrDescriptor_Descriptors[self->uniqueId];
}
}

void RabbitizerInstructionR4000Allegrex_processUniqueId_Coprocessor2_MTHC2(RabbitizerInstruction *self) {
uint32_t fmt = RAB_INSTR_R4000ALLEGREX_GET_mxhc2(self);
bool fetchDescriptor = true;
Expand Down
1 change: 1 addition & 0 deletions tables/tables/instr_id/RabbitizerInstrId_r4000allegrex.inc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "r4000allegrex/r4000allegrex_cop2_bc2.inc"
#include "r4000allegrex/r4000allegrex_cop2_mfhc2.inc"
#include "r4000allegrex/r4000allegrex_cop2_mfhc2_p.inc"
#include "r4000allegrex/r4000allegrex_cop2_mfhc2_p_s.inc"
#include "r4000allegrex/r4000allegrex_cop2_mthc2.inc"

#include "r4000allegrex/r4000allegrex_vfpu0.inc"
Expand Down
1 change: 1 addition & 0 deletions tables/tables/instr_id_types/InstrIdType_r4000allegrex.inc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
RABBITIZER_DEF_INSTR_ID_TYPE(R4000ALLEGREX, COP2_BC2)
RABBITIZER_DEF_INSTR_ID_TYPE(R4000ALLEGREX, COP2_MFHC2)
RABBITIZER_DEF_INSTR_ID_TYPE(R4000ALLEGREX, COP2_MFHC2_P)
RABBITIZER_DEF_INSTR_ID_TYPE(R4000ALLEGREX, COP2_MFHC2_P_S)
RABBITIZER_DEF_INSTR_ID_TYPE(R4000ALLEGREX, COP2_MTHC2)

RABBITIZER_DEF_INSTR_ID_TYPE(R4000ALLEGREX, VFPU0)
Expand Down

0 comments on commit 7ca641f

Please sign in to comment.