Cross, Dot GUm functions

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
User avatar
skistovel
Posts: 14
Joined: Mon Jul 17, 2006 11:46 pm

Cross, Dot GUm functions

Post by skistovel »

A quick question, are the gumCrossProduct & gumDotProduct functions from the pspgum library, hardware accelerated?
User avatar
ReKleSS
Posts: 73
Joined: Sat Jun 18, 2005 12:57 pm
Location: Melbourne, Australia

Post by ReKleSS »

There's no definition of gumCrossProduct in pspgum_vfpu.c, so no, it's not accelerated. The time to load your figures onto the VFPU would probably negate any speed advantage, anyway.
User avatar
Raphael
Posts: 646
Joined: Tue Jan 17, 2006 4:54 pm
Location: Germany
Contact:

Post by Raphael »

If you need the speed, write your own batch-processor in vfpu. I could speed up the audio analysis filter of my demo by a factor of 7-8.
Avoid using single function-calls for single operations though, the function calling and parameter loading/storing overhead kills the performance gain.
<Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki

Alexander Berl
chp
Posts: 313
Joined: Wed Jun 23, 2004 7:16 am

Post by chp »

gumCrossProduct() and gumDotProduct() are there for convenience, if you intend to use them in a larger set of data I recommend that you use vdot.p/t/q or vcrs.t directly. If all you're looking for is a way of rotating a point, vtfm2/3/4.p/t/q is also in the vfpu instruction set.
GE Dominator
User avatar
skistovel
Posts: 14
Joined: Mon Jul 17, 2006 11:46 pm

Post by skistovel »

Actually, I was just looking at my vec3 class and was thinking if those functions were hardware accelarated, switch my own with them.
gumCrossProduct() and gumDotProduct() are there for convenience, if you intend to use them in a larger set of data I recommend that you use vdot.p/t/q or vcrs.t directly. If all you're looking for is a way of rotating a point, vtfm2/3/4.p/t/q is also in the vfpu instruction set.
If you need the speed, write your own batch-processor in vfpu. I could speed up the audio analysis filter of my demo by a factor of 7-8.
Avoid using single function-calls for single operations though, the function calling and parameter loading/storing overhead kills the performance gain.
I seriously suck at assembly.. really bad! :-(
User avatar
Raphael
Posts: 646
Joined: Tue Jan 17, 2006 4:54 pm
Location: Germany
Contact:

Post by Raphael »

skistovel wrote:Actually, I was just looking at my vec3 class and was thinking if those functions were hardware accelarated, switch my own with them.
Even if they were, as said using function calls for every operation (dot,cross,etc) will kill the performance gain and will keep you far behind the real potential of the vfpu. vfpu isn't meant for a vector class, but rather for large data processing (you could write your vector class so it can handle operations on batches of data though).
I seriously suck at assembly.. really bad! :-(
just some vfpu assembly is really easier than you might think. I learned it in 2-3 days (though I still have big problems with general MIPS asm). Taking a look at gum will already give you a good overview of how it works in general, and a list of the most important vfpu ops is found here: http://hitmen.c02.at/files/yapspd/psp_doc/chap4.html
<Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki

Alexander Berl
User avatar
skistovel
Posts: 14
Joined: Mon Jul 17, 2006 11:46 pm

Post by skistovel »

you could write your vector class so it can handle operations on batches of data though
I don't know about the vector class, but will be useful for the matrix class, but on the other hand doesn't the gum library has that already (multiplication of matrices, etc)?

Anyway. thanks for the quick replys guys, much appreciated!
Post Reply