This question specifically concerns the VR3000A and MIPS I instruction set, although it's more of a general MIPS question.
I recently found a set of PlayStation 1 hardware tests about the behavior of branches and jumps placed directly after each other without any extra instructions to separate them. This test shows that branches are relative to wherever the PC is currently which can cause behavior that isn't immediately obvious. Another test shows much more predictable behavior for the absolute jump instruction, which makes sense.
One thing this doesn't test (due to the limitations of the PlayStation's memory map) is what would happen when crossing a segment boundary. The bottom 28 bits of the jump address are specified by the instruction, but the top 4 bits are still derived from PC. Take this this example. The second j
is in segment 0x8xxx'xxxx
, but it gets executed while PC is in segment 0x7xxx'xxxx
. Would this end up jumping to 0x8000'1234
like expected or 0x7000'1234
instead?
7FFF'0000: addr1: nop
...
7FFF'7FFC: j addr1 ; Execution starts here
8000'0000: j addr2
8000'0004: nop
...
8000'1234: addr2: nop
...