fpu atan2

This commit is contained in:
K. Lange 2018-09-18 16:20:19 +09:00
parent 6b75993263
commit 1d05b03808
2 changed files with 13 additions and 4 deletions

View File

@ -12,10 +12,6 @@ double atan(double x) {
return 0.0;
}
double atan2(double y, double x) {
return 0.0;
}
double ceil(double x) {
return 0.0; /* extract and convert? */
}

View File

@ -444,4 +444,17 @@ double cos(double x) {
return sin(x + 3.141592654 / 2.0);
}
double atan2(double y, double x) {
float out;
float _x = x;
float _y = y;
asm volatile (
"fld %1\n"
"fld %2\n"
"fpatan\n"
"fstp %0\n"
: "=m"(out) : "m"(_y), "m"(_x)
);
return out;
}