32 #if (!defined (CS_NO_QSQRT)) && defined (CS_PROCESSOR_X86) && defined (CS_COMPILER_GCC)
51 static inline float qsqrt (
float x)
66 "movl $0xbe6f0000,%%eax\n"
83 "fsubp %%st,%%st(2)\n"
86 :
"=&t" (ret),
"+m" (x) :
"m" (0.5F),
"m" (1.5F)
87 :
"eax",
"st",
"st(1)",
"st(2)",
"st(3)",
"st(4)",
"st(5)",
"st(6)",
"st(7)"
99 static inline float qisqrt (
float x)
104 "movl $0xbe6f0000,%%eax\n"
121 "fsubp %%st,%%st(2)\n"
123 :
"=t" (ret),
"+m" (x) :
"m" (0.5F),
"m" (1.5F)
124 :
"eax",
"st",
"st(1)",
"st(2)",
"st(3)",
"st(4)",
"st(5)",
"st(6)",
"st(7)"
129 #elif (!defined (CS_NO_QSQRT)) && defined (PROC_POWERPC) && defined (CS_COMPILER_GCC)
138 static inline float qsqrt(
float x)
146 asm (
"frsqrte %0,%1" :
"=f" (y0) :
"f" (x));
148 y0 = y0 * (1.5f - x0 * y0 * y0);
149 y0 = (y0 * (1.5f - x0 * y0 * y0)) *
x;
159 static inline float qisqrt(
float x)
163 asm (
"frsqrte %0,%1" :
"=f" (y0) :
"f" (x));
165 y0 = y0 * (1.5f - x0 * y0 * y0);
166 y0 = y0 * (1.5f - x0 * y0 * y0);
174 #define qsqrt(x) sqrt(x)
175 #define qisqrt(x) (1.0/sqrt(x))
179 #endif // __QSQRT_H__