[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 15:56:54 +0100 |
On 22 May 2018 at 15:55, Richard Henderson <address@hidden> wrote:
> On 05/22/2018 07:50 AM, Peter Maydell wrote:
>> Hi; I was reading about the x86-64 calling convention and I found
>> out that apparently for returns of smaller-than-register types the
>> high parts may contain garbage:
>> https://stackoverflow.com/questions/36706721/is-a-sign-or-zero-extension-required-when-adding-a-32bit-offset-to-a-pointer-for/36760539#36760539
>
> Yes, that's one reason I didn't want to get involved in returning a "real"
> 16-bit quantity.
>
>> However, for TCG helper functions, although we allow the helper
>> macro to say that the return type is 'f16', in helper-head.h we
>> seem to just alias f16 as i32, and in dh_sizemask() we only record
>> "is this 64 bits" and "is this signed". Am I missing the place
>> where we zero-extend the value we get back from the helper so
>> that it's the right thing in TCG's i32 ?
>
> It happens in C, implicit in "typedef uint16_t float16".
...but uint16_t is only 16 bits, so we are returning
a "real" 16 bit quantity?
thanks
-- PMM
- [Qemu-devel] TCG helpers that return f16, Peter Maydell, 2018/05/22
- Re: [Qemu-devel] TCG helpers that return f16, Richard Henderson, 2018/05/22
- Re: [Qemu-devel] TCG helpers that return f16,
Peter Maydell <=
- Re: [Qemu-devel] TCG helpers that return f16, Richard Henderson, 2018/05/22
- Re: [Qemu-devel] TCG helpers that return f16, Peter Maydell, 2018/05/22
- Re: [Qemu-devel] TCG helpers that return f16, Richard Henderson, 2018/05/22
- Re: [Qemu-devel] TCG helpers that return f16, Peter Maydell, 2018/05/22
- Re: [Qemu-devel] TCG helpers that return f16, Richard Henderson, 2018/05/22