about summary refs log tree commit diff
path: root/src/fenv/i386
diff options
context:
space:
mode:
Diffstat (limited to 'src/fenv/i386')
-rw-r--r--src/fenv/i386/fenv.s11
1 files changed, 8 insertions, 3 deletions
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: