X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=winsup%2Fmingw%2Fmingwex%2Fmath%2Ffmodf.c;fp=winsup%2Fmingw%2Fmingwex%2Fmath%2Ffmodf.c;h=6405d725fbda2ef766605e42a4795f82068625ab;hb=ae4bf010374a9320497af260fa90af3fe8e2c5a5;hp=0000000000000000000000000000000000000000;hpb=3cc729069938336ea54d399c4bbbe7d197295f9a;p=pf3gnuchains%2Fpf3gnuchains3x.git diff --git a/winsup/mingw/mingwex/math/fmodf.c b/winsup/mingw/mingwex/math/fmodf.c new file mode 100644 index 0000000000..6405d725fb --- /dev/null +++ b/winsup/mingw/mingwex/math/fmodf.c @@ -0,0 +1,23 @@ +/* + * Written by J.T. Conklin . + * Public domain. + * + * Adapted for float type by Danny Smith + * . + */ + +#include + +float +fmodf (float x, float y) +{ + float 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; +}