[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] softfloat: rename make_float[x80|128]_init to c
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH] softfloat: rename make_float[x80|128]_init to const_float[x80|128] |
Date: |
Tue, 19 Sep 2017 14:06:58 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 09/19/2017 12:39 PM, Eric Blake wrote:
> On 09/19/2017 11:30 AM, Richard Henderson wrote:
>> On 09/18/2017 05:46 AM, Laurent Vivier wrote:
>>> Redefine make_floatx80() and make_float128() as make_float16(),
>>> make_float32() and make_float64() using a variable and not only
>>> a cast.
>
>>> -#define make_floatx80(exp, mant) ((floatx80) { mant, exp })
>>> -#define make_floatx80_init(exp, mant) { .low = mant, .high = exp }
>>> +#define make_floatx80(exp, mant) __extension__ \
>>> + ({ floatx80 f80_val = { .low = mant, .high = exp }; f80_val; })
>>> +#define const_floatx80(exp, mant) { .low = mant, .high = exp }
>
>>
>> I don't like this part -- (type){ init } is a standard C99 compound literal.
>> There's no point using a gcc extension instead.
>
> The C99 compound literal is not a const initializer in all situations,
> though :(
A compound literal not officially a const initializer in any situation. That
it is accepted by gcc as a const initializer is an extension.
I don't dispute const_floatx80, but the change to make_floatx80.
r~