summaryrefslogtreecommitdiff
path: root/emulators/qemu/files/patch-fpu-softfloat-native.c
blob: 7e2662eb7457b29f303d04efc1470f19ba55e5ed (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Index: qemu/fpu/softfloat-native.c
@@ -228,7 +228,15 @@
 *----------------------------------------------------------------------------*/
 float64 float64_trunc_to_int( float64 a STATUS_PARAM )
 {
+#if defined(__FreeBSD__) && __FreeBSD__ <= 4
+    float64 ret;
+    fpsetround(FP_RZ);
+    ret = rint(a);
+    fpsetround(STATUS(float_rounding_mode));
+    return ret;
+#else
     return trunc(a);
+#endif
 }
 
 float64 float64_round_to_int( float64 a STATUS_PARAM )