OSDN Git Service

6405d725fbda2ef766605e42a4795f82068625ab
[pf3gnuchains/pf3gnuchains3x.git] / winsup / mingw / mingwex / math / fmodf.c
1 /*
2  * Written by J.T. Conklin <jtc@netbsd.org>.
3  * Public domain.
4  *
5  * Adapted for float type by Danny Smith
6  *  <dannysmith@users.sourceforge.net>.
7  */
8
9 #include <math.h>
10
11 float
12 fmodf (float x, float y)
13 {
14   float res;
15
16   asm ("1:\tfprem\n\t"
17        "fstsw   %%ax\n\t"
18        "sahf\n\t"
19        "jp      1b\n\t"
20        "fstp    %%st(1)"
21        : "=t" (res) : "0" (x), "u" (y) : "ax", "st(1)");
22   return res;
23 }