@@ -0,0 +1,88 @@
+2: not %edi
+ sub $32,%rsp
+ fnstenv (%rsp)
+ and %edi,4(%rsp)
+ or %esi,4(%rsp)
+ fldenv (%rsp)
+ stmxcsr (%rsp)
+ and %edi,(%rsp)
+ ldmxcsr (%rsp)
+ add $32,%rsp
+ ret
+
+.global feclearexcept
+feclearexcept:
+ xor %eax,%eax
+ xor %esi,%esi
+ test %edi,%edi
+ jnz 2b
+.global feraiseexcept
+feraiseexcept:
+ mov %edi,%esi
+ xor %edi,%edi
+ test %esi,%esi
+.global fesetround
+fesetround:
+ andb $0xf3,1(%rsp)
+ or %edi,(%rsp)
+ shl $3,%edi
+ andb $0x9f,1(%rsp)
+.global fegetround
+fegetround:
+ push %rax
+ pop %rax
+ shr $3,%eax
+ and $0xc,%ah
+.global fegetenv
+fegetenv:
+ fnstenv (%rdi)
+ stmxcsr 28(%rdi)
+.global fesetenv
+fesetenv:
+ inc %rdi
+ jz 1f
+ fldenv -1(%rdi)
+ ldmxcsr 27(%rdi)
+1: push %rax
+ pushq $0x37f
+ pushq $0x1f80
+ add $40,%rsp
+.global fetestexcept
+fetestexcept:
+ pop %rsi
+ fnstsw %ax
+ or %esi,%eax
+ and %edi,%eax