inline float sqrt2(float sqr)
{
float root = 0;
__asm
{
sqrtss xmm0, sqr
movss root, xmm0
}
return root;
}
here is MSVC compilator inline assembly which I want to compile with gcc x86, what I know that gcc inline assembly is getting called with asm("asm here"); but I completely don't know how to include parameter in that, the result is obtained by "=r" I know only.
Which should result in something like that:
asm("sqrtss xmm0, %1\n\t"
"movss %0, xmm0"
: "=r" (root)
: "r" (sqr));