 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
davidgf
Joined: 31 Aug 2009 Posts: 22
|
Posted: Sun Sep 27, 2009 4:25 am Post subject: VFPU: problem with vtfm3.t |
|
|
Hello I have a problem. I'm implementing some functions in VFPU hardware but this function:
| Code: |
PURE_INLINE void dMULTIPLY0_331_ (dReal* vout, const dReal* mat, const dReal* v) {
__asm__ volatile (
"ulv.q R000, 0+ %1\n"
"ulv.q R001, 16+ %1\n"
"ulv.q R002, 32+ %1\n"
"ulv.q R100, %2\n"
"vtfm3.t R003, M000, R100\n"
"usv.q R003, %0\n"
: "+m"(vout[0]): "m"(mat[0]), "m"(v[0]));
}
|
does not work, but this one (which doesn't use vtfm3.t) works like a charm:
| Code: |
PURE_INLINE void dMULTIPLY0_331_ (dReal* vout, const dReal* mat, const dReal* v) {
__asm__ volatile (
"ulv.q R000, 0+ %1\n"
"ulv.q R001, 16+ %1\n"
"ulv.q R002, 32+ %1\n"
"ulv.q R100, %2\n"
"vdot.t S003, R000, R100\n"
"vdot.t S013, R001, R100\n"
"vdot.t S023, R002, R100\n"
"usv.q R003, %0\n"
: "+m"(vout[0]): "m"(mat[0]), "m"(v[0]));
}
|
|
|
| Back to top |
|
 |
jsharrad
Joined: 20 Oct 2005 Posts: 102
|
Posted: Mon Sep 28, 2009 12:52 am Post subject: |
|
|
I read this a while back...
PLEASE READ THIS: There are 2 instructions, ulv.q and usv.q, that perform unaligned ran transfers to/from the vfpu. These have been found to be faulty so it is not recommended to use them. You have been warned. |
|
| Back to top |
|
 |
davidgf
Joined: 31 Aug 2009 Posts: 22
|
Posted: Mon Sep 28, 2009 7:33 am Post subject: |
|
|
I think this has nothing to do with the error.
The error is within the tfm and dot functions. And it's almost impossible to avoid using ulv.q function, because aligning data in the stack is quite complicated! |
|
| Back to top |
|
 |
hlide
Joined: 10 Sep 2006 Posts: 750
|
Posted: Thu Oct 15, 2009 6:06 am Post subject: |
|
|
| on PSP1000, using ULV wiill scratch FPU register with the same index so if you are using VFPU register $C000 to load it from memory, you're modifying $fpr0 with the same value as $S000 as well. That's why you MUST never use ULV if you plan to keep compatibily with psp1000. The reason is ULV is mapped to MIPS64 LDC1 (FPU double load) and sony engineers probably forgot to cut off the output link to FPU registers. |
|
| Back to top |
|
 |
hlide
Joined: 10 Sep 2006 Posts: 750
|
Posted: Thu Oct 15, 2009 6:24 am Post subject: |
|
|
| can you be more precise about what you get with vtfm3.t ? |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|