Add incomplet long double math support to libmingwex.a
This commit is contained in:
22
winsup/mingw/mingwex/math/fmodl.c
Normal file
22
winsup/mingw/mingwex/math/fmodl.c
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Written by J.T. Conklin <jtc@netbsd.org>.
|
||||
* Public domain.
|
||||
*
|
||||
* Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>.
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
|
||||
long double
|
||||
fmodl (long double x, long double y)
|
||||
{
|
||||
long double res;
|
||||
|
||||
asm ("1:\tfprem\n\t"
|
||||
"fstsw %%ax\n\t"
|
||||
"sahf\n\t"
|
||||
"jp 1b\n\t"
|
||||
"fstp %%st(1)"
|
||||
: "=t" (res) : "0" (x), "u" (y) : "ax", "st(1)");
|
||||
return res;
|
||||
}
|
Reference in New Issue
Block a user