mirror of
https://github.com/ran-j/PS2Recomp.git
synced 2026-09-30 10:14:24 -04:00
Feature/runtime review codegen fixes (#87)
* feat: small fixes on code gen * feat: added code gen test * feat: rename IOP * fix: fix special case on JR feat: added code generator test * feat: ps2 logs now need special macros * feat: a lot of regressions test feat: use test to fix bugs on runtime fix: fix incorrect instructions on code generator feat: added missing decode on r5900 decoder feat: added scissor on rasterizer * feat: better ghidra plugin analyzer fix: fix real bug on function finding on elf analyzer * feat: some logs on GS feat: added more syscalls stubs feat: added more ps2 stubs * feat: added missing stub
This commit is contained in:
@@ -117,6 +117,31 @@ void register_r5900_decoder_tests()
|
||||
t.IsTrue(inst.modificationInfo.modifiesGPR, "jalr with rd!=0 should mark GPR modification");
|
||||
});
|
||||
|
||||
tc.Run("R5900 MULT marks rd modification when rd is non-zero", [](TestCase &t) {
|
||||
uint32_t address = 0x5800;
|
||||
uint32_t rawWithRd = (OPCODE_SPECIAL << 26) | (4 << 21) | (5 << 16) | (3 << 11) | SPECIAL_MULT;
|
||||
uint32_t rawRdZero = (OPCODE_SPECIAL << 26) | (4 << 21) | (5 << 16) | (0 << 11) | SPECIAL_MULT;
|
||||
|
||||
R5900Decoder decoder;
|
||||
Instruction withRd = decoder.decodeInstruction(address, rawWithRd);
|
||||
Instruction rdZero = decoder.decodeInstruction(address + 4, rawRdZero);
|
||||
|
||||
t.IsTrue(withRd.modificationInfo.modifiesControl, "MULT should modify HI/LO");
|
||||
t.IsTrue(withRd.modificationInfo.modifiesGPR, "MULT should mark rd modification when rd!=0");
|
||||
t.IsFalse(rdZero.modificationInfo.modifiesGPR, "MULT should not mark rd modification when rd==0");
|
||||
});
|
||||
|
||||
tc.Run("R5900 MMI MULT1 marks rd modification when rd is non-zero", [](TestCase &t) {
|
||||
uint32_t address = 0x5900;
|
||||
uint32_t raw = (OPCODE_MMI << 26) | (6 << 21) | (7 << 16) | (8 << 11) | MMI_MULT1;
|
||||
|
||||
R5900Decoder decoder;
|
||||
Instruction inst = decoder.decodeInstruction(address, raw);
|
||||
|
||||
t.IsTrue(inst.modificationInfo.modifiesControl, "MULT1 should modify HI1/LO1");
|
||||
t.IsTrue(inst.modificationInfo.modifiesGPR, "MULT1 should mark rd modification when rd!=0");
|
||||
});
|
||||
|
||||
tc.Run("MMI instruction sets MMI flags", [](TestCase &t) {
|
||||
uint32_t address = 0x6000;
|
||||
// Use opcode 0x1C (MMI), rs=1, rt=2, rd=3, sa=MMI0_PADDW (0)
|
||||
|
||||
Reference in New Issue
Block a user