[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] tcg: Fix helper function vs host abi for float1
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH] tcg: Fix helper function vs host abi for float16 |
Date: |
Thu, 24 May 2018 14:21:16 +0100 |
On 22 May 2018 at 18:56, Richard Henderson <address@hidden> wrote:
> Depending on the host abi, float16, aka uint16_t, values are
> passed and returned either zero-extended in the host register
> or with garbage at the top of the host register.
>
> The tcg code generator has so far been assuming garbage, as that
> matches the x86 abi, but this is incorrect for other host abis.
> Further, target/arm has so far been assuming zero-extended results,
> so that it may store the 16-bit value into a 32-bit slot with the
> high 16-bits already clear.
>
> Rectify both problems by mapping "f16" in the helper definition
> to uint32_t instead of (a typedef for) uint16_t. This forces
> the host compiler to assume garbage in the upper 16 bits on input
> and to zero-extend the result on output.
>
> Signed-off-by: Richard Henderson <address@hidden>
Applied to target-arm.next, thanks. Is it worth marking this as
cc:stable?
thanks
-- PMM