From: Rich Felker Date: Mon, 13 Jun 2011 17:37:16 +0000 (-0400) Subject: fix fesetround - it was writing to status word instead of control word X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=commitdiff_plain;h=52cf24a0f45f208b1627a64e4af9a5ed8cb28ae7 fix fesetround - it was writing to status word instead of control word --- diff --git a/src/fenv/i386/fenv.s b/src/fenv/i386/fenv.s index 72d2ed7d..34101d58 100644 --- a/src/fenv/i386/fenv.s +++ b/src/fenv/i386/fenv.s @@ -27,10 +27,15 @@ feraiseexcept: .global fesetround fesetround: + mov 4(%esp),%ecx xor %eax,%eax - mov $0xc00,%ecx - mov 4(%esp),%edx - jmp 2b + sub $32,%esp + fnstenv (%esp) + andb $0xf3,1(%esp) + or %ecx,(%esp) + fldenv (%esp) + add $32,%esp + ret .global fegetround fegetround: