[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-stable] [PATCH 1/1] Fix conversion from uint64 to float128
From: |
Peter Maydell |
Subject: |
Re: [Qemu-stable] [PATCH 1/1] Fix conversion from uint64 to float128 |
Date: |
Fri, 11 May 2018 13:37:18 +0100 |
On 11 May 2018 at 08:10, Petr Tesarik <address@hidden> wrote:
> The significand is passed to normalizeRoundAndPackFloat128() as high
> first, low second. The current code passes the integer first, so the
> result is incorrectly shifted left by 64 bits.
>
> This bug affects the emulation of s390x instruction CXLGBR (convert
> from logical 64-bit binary-integer operand to extended BFP result).
>
> Cc: address@hidden
> Signed-off-by: Petr Tesarik <address@hidden>
> ---
> fpu/softfloat.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fpu/softfloat.c b/fpu/softfloat.c
> index 70e0c40a1c..386805475b 100644
> --- a/fpu/softfloat.c
> +++ b/fpu/softfloat.c
> @@ -3139,7 +3139,7 @@ float128 uint64_to_float128(uint64_t a, float_status
> *status)
> if (a == 0) {
> return float128_zero;
> }
> - return normalizeRoundAndPackFloat128(0, 0x406E, a, 0, status);
> + return normalizeRoundAndPackFloat128(0, 0x406E, 0, a, status);
> }
Reviewed-by: Peter Maydell <address@hidden>
thanks
-- PMM