| View previous topic :: View next topic |
| Author |
Message |
siberianstar
Joined: 22 Jun 2006 Posts: 70
|
Posted: Wed Jul 19, 2006 8:07 am Post subject: Fast sqrt |
|
|
Hello,
for the float type i've made
inline float fastsqrt(float c)
{
float output;
asm("sqrt.s %0,%1" : "=f" (output) : "f" (c));
return output;
}
but this does not work for double type. There is an asm instruction that is "sqrt.d" that is for double type, but if i try to compile:
inline double fastsqrt(double c)
{
double output;
asm("sqrt.d %0,%1" : "=f" (output) : "f" (c));
return output;
}
it gives operand error. Why ? |
|
| Back to top |
|
 |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Wed Jul 19, 2006 10:53 am Post subject: |
|
|
| The allegrex FPU doesn't do doubles |
|
| Back to top |
|
 |
ector
Joined: 12 May 2005 Posts: 195
|
Posted: Wed Jul 19, 2006 6:28 pm Post subject: |
|
|
If you're writing games, you don't need doubles. If you think you do, you're wrong :) That's why there is no hardware support. _________________ http://www.dtek.chalmers.se/~tronic/PSPTexTool.zip Free texture converter for PSP with source. More to come. |
|
| Back to top |
|
 |
siberianstar
Joined: 22 Jun 2006 Posts: 70
|
Posted: Thu Jul 20, 2006 2:35 am Post subject: |
|
|
sure.
I found in the MIPS R4000 manual that double were supported. After i read that psp has a custom cpu and there is no support for double. |
|
| Back to top |
|
 |
RATiX
Joined: 30 Apr 2005 Posts: 48
|
Posted: Thu Jul 20, 2006 5:49 am Post subject: |
|
|
| comparing squares is much more efficient than comparing roots. |
|
| Back to top |
|
 |
siberianstar
Joined: 22 Jun 2006 Posts: 70
|
Posted: Thu Jul 20, 2006 9:45 am Post subject: |
|
|
| i know =) don't take me like a stupid |
|
| Back to top |
|
 |
|