notaz
Certified Guru
About $ra access in JAL delay slot..
I don't have much luck with this. Well it mostly works but the register allocator occasionally allocates the same ARM register for r31 and whatever the delay slot uses. And I have hard time understanding how you did delay slot allocation (pre-alloc and post-alloc?). Maybe it decides r31 is unneeded or something.
Some advice would be helpful.
Ari64 said:It is doable. Move the stuff that sets the return address above the call to ds_assemble, but after the REG_PREFETCH bit. Then make sure it doesn't load the old value of r31. Under "// Load the delay slot registers if necessary" add
if(rt1==0||rs1[i+1]!=rt1) for the first case, and
if(rt1==0||rs2[i+1]!=rt1) for the second.
Then test it to make sure everything works correctly
You can do the constant propagation thing too if you want, but make sure you don't overwrite r31 with the original value if it's already been set with the result of the add instruction, which will happen in load_consts().
I don't have much luck with this. Well it mostly works but the register allocator occasionally allocates the same ARM register for r31 and whatever the delay slot uses. And I have hard time understanding how you did delay slot allocation (pre-alloc and post-alloc?). Maybe it decides r31 is unneeded or something.
Some advice would be helpful.
Last edited by a moderator: