> Right away, you can see that the way test5() loads the value is
> lui v0,0x801c
> daddiu v0,v0,-19064
> lw a1,0(v0)
> whereas test4() loads it using
> lui a1,0x801c
> ld a1,-19064(a1)
It looks good except that you're using lw in the first case and ld in the
second case. That has been a common problem in the mips64 port.
> Now, I don't see any problems with the test4() code, but I would like
> to change the code to something like
> lui X,0x801c
> ld a1,-19064(X)
This is ok, you can use the same register as base and target.