mirror of git://git.musl-libc.org/musl
fix x86_64 fe[gs]etround, analogous to nsz's x86 changes
This commit is contained in:
parent
d5e576c752
commit
9cb6878e74
|
@ -32,18 +32,19 @@ feraiseexcept:
|
||||||
.global fesetround
|
.global fesetround
|
||||||
.type fesetround,@function
|
.type fesetround,@function
|
||||||
fesetround:
|
fesetround:
|
||||||
|
push %rax
|
||||||
xor %eax,%eax
|
xor %eax,%eax
|
||||||
sub $32,%rsp
|
mov %edi,%ecx
|
||||||
fnstenv (%rsp)
|
fnstcw (%rsp)
|
||||||
andb $0xf3,1(%rsp)
|
andb $0xf3,1(%rsp)
|
||||||
or %edi,(%rsp)
|
or %ch,1(%rsp)
|
||||||
fldenv (%rsp)
|
fldcw (%rsp)
|
||||||
stmxcsr (%rsp)
|
stmxcsr (%rsp)
|
||||||
shl $3,%edi
|
shl $3,%ch
|
||||||
andb $0x9f,1(%rsp)
|
andb $0x9f,1(%rsp)
|
||||||
or %edi,(%rsp)
|
or %ch,1(%rsp)
|
||||||
ldmxcsr (%rsp)
|
ldmxcsr (%rsp)
|
||||||
add $32,%rsp
|
pop %rcx
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.global fegetround
|
.global fegetround
|
||||||
|
@ -53,7 +54,7 @@ fegetround:
|
||||||
stmxcsr (%rsp)
|
stmxcsr (%rsp)
|
||||||
pop %rax
|
pop %rax
|
||||||
shr $3,%eax
|
shr $3,%eax
|
||||||
and $0xc,%ah
|
and $0xc00,%eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.global fegetenv
|
.global fegetenv
|
||||||
|
|
Loading…
Reference in New Issue