vcallms

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
User avatar
Saotome
Posts: 182
Joined: Sat Apr 03, 2004 3:45 am

vcallms

Post 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
blackdroid
Posts: 564
Joined: Sat Jan 17, 2004 10:22 am
Location: Sweden
Contact:

Post 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.
Kung VU
User avatar
Saotome
Posts: 182
Joined: Sat Apr 03, 2004 3:45 am

Post 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)
infj
blackdroid
Posts: 564
Joined: Sat Jan 17, 2004 10:22 am
Location: Sweden
Contact:

Post 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
Kung VU
User avatar
Saotome
Posts: 182
Joined: Sat Apr 03, 2004 3:45 am

Post by Saotome »

ok, thanks a lot.
infj
User avatar
Saotome
Posts: 182
Joined: Sat Apr 03, 2004 3:45 am

Post by Saotome »

Is this some kind of a bot? Can someone ban him and delete his nonsense posts?
infj
gorim
Posts: 18
Joined: Wed Sep 21, 2005 1:47 pm

Post 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
Post Reply