Page 1 of 1

vcallms

Posted: Wed Nov 24, 2004 1:23 am
by Saotome
i was using the vu0 in macromode only so far and would like to use vcallms for some algorithms where i just move some values directly into vu0-registers (using the lqc2 instruction) and then start a subroutine from vu0-micromem. after the subroutine is finished i would store the value with sqc2 in main memory.

i saw an example that looked like this:

lqc2 vf4,0x0(%0)
lqc2 vf5,0x0(%1)
vcallms %2
sqc2 vf4, 0x0(%0)

since there is no code that waits for the end of the subroutine,
does that mean the vcallms-instruction is waiting until the subroutine is finished or does the following sqc2-instruction stall until its finished?

2nd would be better since i could do something else in the meantime.


thanks for any help

Posted: Wed Nov 24, 2004 7:04 pm
by blackdroid
The only opcodes that does any interlocking with vu0 is qmfc2 and qmtc2, so they are the only ones actually waiting for a microprogram to finish after vcallms/vcallmsr,
lqc2 and sqc2 doesnt do any interlocking so they will just load/store the values at the time of execution. if you want to do stuff in the meantime of a mpg check the status register for vu0 when you want to fetch the result.

Posted: Thu Nov 25, 2004 4:40 am
by Saotome
thanks blackdroid

so if qmfc2 interlocks with vu0 then i dont need a loop where i read the status register and check if vu0 is still running, one qmfc2 instruction would suffice before writing the rest to memory?

for example:

Code: Select all

...
vcallms %0
/* ...doing something else... */
qmfc2 $1,vf01  /* wait / interlock(?) */
sqc2 vf01,0x0(%1)
sqc2 vf02,0x10(%1)
sqc2 vf03,0x20(%1)

Posted: Thu Nov 25, 2004 4:51 am
by blackdroid
i should have said qmtc2.i/qmfc2.i, the normal operation is without interlock.
but yes your way of thinking is correct, just change qmfc2 to qmfc2.i

Posted: Thu Nov 25, 2004 5:45 am
by Saotome
ok, thanks a lot.

Posted: Fri Dec 09, 2005 12:39 am
by Saotome
Is this some kind of a bot? Can someone ban him and delete his nonsense posts?

Posted: Sun Dec 11, 2005 5:03 pm
by gorim
You may want to see this earlier VU topic thread which discusses the issue of interlock:

http://forums.ps2dev.org/viewtopic.php?t=494