Could someone tell me how to execute mips code within c++ applications?????
Thanks.
Mips & C++
Example using VFPU ASM
Code: Select all
/** 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