projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix multiple bugs in syslog interfaces
[musl]
/
src
/
fenv
/
i386
/
fenv.s
diff --git
a/src/fenv/i386/fenv.s
b/src/fenv/i386/fenv.s
index
ee2eae6
..
e365b8f
100644
(file)
--- a/
src/fenv/i386/fenv.s
+++ b/
src/fenv/i386/fenv.s
@@
-1,52
+1,55
@@
-2: not %ecx
+.global feclearexcept
+.type feclearexcept,@function
+feclearexcept:
+ mov 4(%esp),%ecx
+ not %ecx
+ test $0x3f,%ecx
+ jnz 2f
+1: fnclex
+ xor %eax,%eax
+ ret
+2: fnstsw %ax
+ and %ecx,%eax
+ jz 1b
sub $32,%esp
fnstenv (%esp)
sub $32,%esp
fnstenv (%esp)
- and %ecx,4(%esp)
- or %edx,4(%esp)
+ mov %al,4(%esp)
fldenv (%esp)
add $32,%esp
fldenv (%esp)
add $32,%esp
- ret
-
-.global feclearexcept
-.type feclearexcept,@function
-feclearexcept:
xor %eax,%eax
xor %eax,%eax
- mov 4(%esp),%ecx
- xor %edx,%edx
- test %ecx,%ecx
- jnz 2b
ret
.global feraiseexcept
.type feraiseexcept,@function
feraiseexcept:
ret
.global feraiseexcept
.type feraiseexcept,@function
feraiseexcept:
+ mov 4(%esp),%eax
+ sub $32,%esp
+ fnstenv (%esp)
+ or %al,4(%esp)
+ fldenv (%esp)
+ add $32,%esp
xor %eax,%eax
xor %eax,%eax
- mov 4(%esp),%edx
- xor %ecx,%ecx
- test %edx,%edx
- jnz 2b
ret
.global fesetround
.type fesetround,@function
fesetround:
mov 4(%esp),%ecx
ret
.global fesetround
.type fesetround,@function
fesetround:
mov 4(%esp),%ecx
+ push %eax
xor %eax,%eax
xor %eax,%eax
- sub $4,%esp
fnstcw (%esp)
andb $0xf3,1(%esp)
fnstcw (%esp)
andb $0xf3,1(%esp)
- or %c
x,
(%esp)
+ or %c
h,1
(%esp)
fldcw (%esp)
fldcw (%esp)
- add $4,%esp
+ pop %ecx
ret
.global fegetround
.type fegetround,@function
fegetround:
ret
.global fegetround
.type fegetround,@function
fegetround:
- sub $4,%esp
+ push %eax
fnstcw (%esp)
fnstcw (%esp)
- mov (%esp),%ax
- add $4,%esp
+ pop %eax
and $0xc00,%eax
ret
and $0xc00,%eax
ret