I was looking at different methods to compute the square root, and one in particular (sqrt14 from here) caught my attention, unfortunately it was written in C++ (it only uses assembly), it's difficult for me to translate it back to C - if that's possible.
double inline __declspec (naked) __fastcall sqrt14(double n)
{
_asm fld qword ptr [esp+4]
_asm fsqrt
_asm ret 8
}
As can be seen here, inserting assembly in C++ is different from C.
I wanted to ask you if it was possible to have a C equivalent, and if so, can I ask you to write it? If it's useful, my architecture is 64bits.
I suspect that the function declaration will be like this one:
double inline __attribute__((fastcall, naked)) sqrt14(double n);
... but I don't know enough about assembly to do the rest...