Fix ARM7 recompiler crashing when using SUB R*,PC,* opcodes - #2441
Conversation
Generalized handling of operands in the emitDataProcOp function, which had inconsistent handling of operands, leading to some instructions working with this operand set, and others not, as any use of PC as Rn is generally converted to an immediate operand instead. A better solution is to generalize the emitter and operand handling to transparently handle immediates vs. register operands, but that is a much more intrusive change that I'm not confident to make in an unfamiliar codebase.
|
What game can reproduce this crash? |
|
I found this issue while writing my own code for a personal project, I can create a minimized test case with KallistiOS if needed. The easiest way to run into this issue is with the |
|
After more development on my own project, I've found issues with the carry-out handling for shift-by-register operands as well. I think there are probably even more bugs here if things like this don't get caught by any existing programs, so it might be good to find an ARM test suite (if one exists...) and port it to DC for this and fully flush it out. |
|
this is the only ARM test suite for this cpu I know of: |
|
Ah, that's at the least a great starting point, thank you very much. I'll take a look at enhancing it to cover the cases I fixed here, and any other cases I can find or think of. |
|
Could you target the |
Generalized handling of operands in the emitDataProcOp function, which had inconsistent handling of operands, leading to some instructions working with this operand set, and others not, as any use of PC as Rn is generally converted to an immediate operand instead.
A better solution is to generalize the emitter and operand handling to transparently handle immediates vs. register operands, but that is a much more intrusive change that I'm not confident to make in an unfamiliar codebase.
I was a little surprised to find such a low-hanging error here, I guess the ARM7 core doesn't get much workout from the existing library?