diff --git a/bochs/cpu/fpu/softfloat.cc b/bochs/cpu/fpu/softfloat.cc index 633d5d959..9490cda84 100644 --- a/bochs/cpu/fpu/softfloat.cc +++ b/bochs/cpu/fpu/softfloat.cc @@ -137,7 +137,8 @@ float64 int64_to_float64(Bit64s a, float_status_t &status) float32 uint32_to_float32(Bit32u a, float_status_t &status) { - if (a == 0) return 0; + if (a == 0) return 0; + if (a & 0x80000000) return normalizeRoundAndPackFloat32(0, 0x9D, a >> 1, status); return normalizeRoundAndPackFloat32(0, 0x9C, a, status); } @@ -1373,7 +1374,7 @@ Bit32u float64_to_uint32_round_to_zero(float64 a, float_status_t &status) if ((aSig<