I don't know if anyone has looked into this yet, but since Chp's vfpu gum doesn't make use of this stuff, I assume it isn't common knowledge.
Prefixes
Each VPU instruction can have up to 3 prefixes which specify transformations which are performed on the two inputs and the output. These are:
Swizzling, which allows you to select which parts of an input vector you want to operate on. For example:
Code: Select all
vmax.q c000, c000, c010[X,X,X,X] # only select X from the vector
vmax.q c000, c000, c010[X,Y,Z,W] # no-op swizzle
vmax.q c000, c000, c010[W,Z,Y,X] # reverse vector
Code: Select all
vmax.q c000, c000, c010[X,0,0,0] # only X and zero out the rest
vmax.q c000, c000, c010[X,1/2,0,1] # some other constants
You can also clamp the outputs to the range 0:1 or -1:1:
Code: Select all
vmax.q c000[0:1, -1:1, 0:1, 0:1], c010, c000
Code: Select all
vmax.q c000[0:1, m, 0:1, 0:1], c010, c000
Code: Select all
vmax.q c000[0:1, 0:1, -1:1, m], c010[X,Y,1/2,1], c020[W,X,Y,Z]
Code: Select all
vmax.t c000, c010[X,X,X], c000
vmax.p c000, c010[X,X], c000
Rotation
The vrot instruction seems special. It looks like it will compute cos and sin (optionally negative) and load up a vector with the results. This makes it easy to generate a rotation matrix. The syntax is:
Code: Select all
vrot.q c000,s100,[c,-s,0,0]
vrot.q c010,s100,[s,c,0,0]
I haven't tested this with running code yet. This is all from assembling+disassembling things with psp-as and psp-objdump.