qemu: fix build for soft float targets

Soft float targets do no define the FE_... rounding constants
thus do not try to fesetround() in case the constants are not defined.
This commit is contained in:
Jürgen Buchmüller 2020-12-12 21:16:42 +01:00
parent 76ca926dd6
commit 0be92167d7
1 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,39 @@
Source: @pullmoll
Upstream: no
Reason: Target architectures with soft float do not define these constants.
--- tests/fp/fp-bench.c 2020-12-08 17:59:44.000000000 +0100
+++ tests/fp/fp-bench.c 2020-12-12 20:38:40.702235420 +0100
@@ -485,16 +485,32 @@
switch (rounding) {
case ROUND_EVEN:
+#if defined(FE_TONEAREST)
rhost = FE_TONEAREST;
+#else
+ return;
+#endif
break;
case ROUND_ZERO:
+#if defined(FE_TOWARDZERO)
rhost = FE_TOWARDZERO;
+#else
+ return;
+#endif
break;
case ROUND_DOWN:
+#if defined(FE_DOWNWARD)
rhost = FE_DOWNWARD;
+#else
+ return;
+#endif
break;
case ROUND_UP:
+#if defined(FE_UPWARD)
rhost = FE_UPWARD;
+#else
+ return;
+#endif
break;
case ROUND_TIEAWAY:
die_host_rounding(rounding);