[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] TCG helpers that return f16
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] TCG helpers that return f16 |
Date: |
Tue, 22 May 2018 17:19:30 +0100 |
On 22 May 2018 at 17:11, Richard Henderson <address@hidden> wrote:
> On 05/22/2018 07:56 AM, Peter Maydell wrote:
> The *helpers* are supposed to be returning uint32_t. That should be enforced
> by the prototype generated from "f16" being aliased to "i32".
>
> The softfloat routines are supposed to be returning float16, aka uint16_t.
>
> So:
>
> float16 f();
> uint32_t h() { return f(); }
>
> will generate a zero-extend, in C, before returning to TCG generated code.
But what we actually have is
target/arm/helper.c:float16 HELPER(recpe_f16)(float16 input, void *fpstp)
target/arm/helper.c:float16 HELPER(vfp_sltoh)(uint32_t x, uint32_t
shift, void *fpst)
(and others that you can find by grepping for "float16 HELPER") --
the helpers don't return a uint32_t, they return float16.
In fact if you try to make them return uint32_t then you get
a compile error, because the DEF_HELPER_* macros prototype them
as returning float16 when you say the return type is 'f16'.
thanks
-- PMM