Re: [Qemu-devel] TCG helpers that return f16

2018-05-22 Thread Richard Henderson
On 05/22/2018 09:31 AM, Peter Maydell wrote: > Do we also want f16 inputs to mean uint32_t arguments? Yes. We don't want the compiler assuming zeros (for non-x86 abis) when we aren't providing them. r~

Re: [Qemu-devel] TCG helpers that return f16

2018-05-22 Thread Peter Maydell
On 22 May 2018 at 17:27, Richard Henderson wrote: > On 05/22/2018 09:19 AM, Peter Maydell wrote: >> 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)

Re: [Qemu-devel] TCG helpers that return f16

2018-05-22 Thread Richard Henderson
On 05/22/2018 09:19 AM, Peter Maydell wrote: > 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 "float

Re: [Qemu-devel] TCG helpers that return f16

2018-05-22 Thread Peter Maydell
On 22 May 2018 at 17:11, Richard Henderson 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 f

Re: [Qemu-devel] TCG helpers that return f16

2018-05-22 Thread Richard Henderson
On 05/22/2018 07:56 AM, Peter Maydell wrote: >>> 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

Re: [Qemu-devel] TCG helpers that return f16

2018-05-22 Thread Peter Maydell
On 22 May 2018 at 15:55, Richard Henderson 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.co

Re: [Qemu-devel] TCG helpers that return f16

2018-05-22 Thread Richard Henderson
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

[Qemu-devel] TCG helpers that return f16

2018-05-22 Thread Peter Maydell
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