summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/eglibc/eglibc-2.15/x86_fenv.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/eglibc/eglibc-2.15/x86_fenv.patch')
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.15/x86_fenv.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/meta/recipes-core/eglibc/eglibc-2.15/x86_fenv.patch b/meta/recipes-core/eglibc/eglibc-2.15/x86_fenv.patch
new file mode 100644
index 0000000000..40c1c4d67e
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.15/x86_fenv.patch
@@ -0,0 +1,29 @@
1--- a/sysdeps/x86_64/fpu/bits/fenv.h
2+++ b/sysdeps/x86_64/fpu/bits/fenv.h
3@@ -112,16 +112,24 @@ __NTH (feraiseexcept (int __excepts))
4 {
5 /* One example of a invalid operation is 0.0 / 0.0. */
6 float __f = 0.0;
7-
8+# if defined __SSE_MATH__ || __WORDSIZE == 64
9 __asm__ __volatile__ ("divss %0, %0 " : : "x" (__f));
10+# else
11+ __asm__ __volatile__ ("fdiv %%st, %%st(0); fwait"
12+ : "=t" (__f) : "0" (__f));
13+# endif
14 (void) &__f;
15 }
16 if ((FE_DIVBYZERO & __excepts) != 0)
17 {
18 float __f = 1.0;
19 float __g = 0.0;
20-
21+# if defined __SSE_MATH__ || __WORDSIZE == 64
22 __asm__ __volatile__ ("divss %1, %0" : : "x" (__f), "x" (__g));
23+# else
24+ __asm__ __volatile__ ("fdivp %%st(1), %%st; fwait"
25+ : "=t" (__f) : "0" (__f), "u" (__g) : "st(1)");
26+# endif
27 (void) &__f;
28 }
29