Browse Source

fix fesetround - it was writing to status word instead of control word

Rich Felker 13 years ago
parent
commit
52cf24a0f4
1 changed files with 8 additions and 3 deletions
  1. 8 3
      src/fenv/i386/fenv.s

+ 8 - 3
src/fenv/i386/fenv.s

@@ -27,10 +27,15 @@ feraiseexcept:
 
 
 .global fesetround
 .global fesetround
 fesetround:
 fesetround:
+	mov 4(%esp),%ecx
 	xor %eax,%eax
 	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
 .global fegetround
 fegetround:
 fegetround: