dot_blank

Joined: 28 Sep 2005 Posts: 498 Location: Brasil
|
Posted: Mon Aug 20, 2007 4:07 am Post subject: |
|
|
Example using VFPU ASM
| Code: |
/** Point is to use gcc specific __asm__(//operations);
/* NOTE: volatile is optional when you know when you need it
*/
int someFunc(int arg1, int arg2) {
...
__asm__ volatile (
"lv.q C000, %0\n" // 16 byte aligned assumed.
"vdot.t S010, C000, C000\n" // squared magnitude of x,y,z
"vrsq.s S010, S010\n" // 1.0f/sqrtf(x*x+y*y+z*z)
"vscl.q C000, C000, S010\n" // vector/=mag
"sv.q C000, %0\n" // save it again
: "+m" (*plane)
);
...
} |
_________________ 10011011 00101010 11010111 10001001 10111010 |
|