[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 11/20] target-i386: fix helper_flbd_ST0() wrt so
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 11/20] target-i386: fix helper_flbd_ST0() wrt softfloat |
Date: |
Tue, 19 Apr 2011 18:06:57 +0100 |
On 18 April 2011 22:00, Aurelien Jarno <address@hidden> wrote:
> Signed-off-by: Aurelien Jarno <address@hidden>
> ---
> target-i386/op_helper.c | 7 ++++---
> 1 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/target-i386/op_helper.c b/target-i386/op_helper.c
> index f614893..7dddd37 100644
> --- a/target-i386/op_helper.c
> +++ b/target-i386/op_helper.c
> @@ -3920,9 +3920,10 @@ void helper_fbld_ST0(target_ulong ptr)
> v = ldub(ptr + i);
> val = (val * 100) + ((v >> 4) * 10) + (v & 0xf);
> }
> - tmp = val;
> - if (ldub(ptr + 9) & 0x80)
> - tmp = -tmp;
> + if (ldub(ptr + 9) & 0x80) {
> + val = -val;
> + }
> + tmp = int64_to_floatx(val, &env->fp_status);
> fpush();
> ST0 = tmp;
> }
This doesn't do the right thing for -0 (should generate -0,
not +0). I think:
tmp = int64_to_floatx(val, &env->fp_status);
if (ldub(ptr + 9) & 0x80) {
floatx_chs(tmp);
}
ought to do the right thing and work for both softfloat and
sf-native, but I haven't tested it.
-- PMM
- [Qemu-devel] [PATCH 00/20] target-i386 conversion to softfloat, Aurelien Jarno, 2011/04/18
- [Qemu-devel] [PATCH 02/20] softfloat: fix floatx80_is_infinity(), Aurelien Jarno, 2011/04/18
- [Qemu-devel] [PATCH 03/20] softfloat: add floatx80 constants, Aurelien Jarno, 2011/04/18
- [Qemu-devel] [PATCH 11/20] target-i386: fix helper_flbd_ST0() wrt softfloat, Aurelien Jarno, 2011/04/18
- Re: [Qemu-devel] [PATCH 11/20] target-i386: fix helper_flbd_ST0() wrt softfloat,
Peter Maydell <=
- [Qemu-devel] [PATCH 05/20] softfloat-native: add a few constant values, Aurelien Jarno, 2011/04/18
- [Qemu-devel] [PATCH 01/20] softfloat: fix floatx80 handling of NaN, Aurelien Jarno, 2011/04/18
- [Qemu-devel] [PATCH 16/20] target-i386: add CPU86_LDouble <-> double conversion functions, Aurelien Jarno, 2011/04/18
- [Qemu-devel] [PATCH 04/20] softfloat: add pi constants, Aurelien Jarno, 2011/04/18