In x86 Linux, how can I implement sin(x)
in assembly code using Taylor Expansion?
long double LD_COS(long double __X)
{
register long double __VALUE;
__asm__ __volatile__(
"fcos \n\t"
: "=t" (__VALUE)
: "0" (__X)
);
return __VALUE;
}
long double LD_SIN(long double __X)
{
register long double __VALUE;
__asm__ __volatile__(
"fsin \n\t"
: "=t" (__VALUE)
: "0" (__X)
);
return __VALUE;
}