repo.or.cz
/
musl.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
math: move x87-family fmod functions to C with inline asm
[musl.git]
/
src
/
math
/
i386
/
fmodf.c
blob
90b56ab0fa50f197b7d6f14747b9240b1143d561
1
#include <math.h>
2
3
float
fmodf
(
float
x
,
float
y
)
4
{
5
unsigned short
fpsr
;
6
// fprem does not introduce excess precision into x
7
do
__asm__
(
"fprem; fnstsw %%ax"
:
"+t"
(
x
),
"=a"
(
fpsr
) :
"u"
(
y
));
8
while
(
fpsr
&
0x400
);
9
return
x
;
10
}