[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/5] softfloat: Fix warn about implicit conversi
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 2/5] softfloat: Fix warn about implicit conversion from int to int8_t |
Date: |
Tue, 9 Aug 2016 22:12:20 +0100 |
On 9 August 2016 at 20:16, Aurelien Jarno <address@hidden> wrote:
> On 2016-08-09 15:02, Pranith Kumar wrote:
>> Change the flag type to 'int' to fix the implicit conversion error.
>>
>> Suggested-by: Peter Maydell <address@hidden>
>> Signed-off-by: Pranith Kumar <address@hidden>
>> ---
>> fpu/softfloat-specialize.h | 2 +-
>> include/fpu/softfloat.h | 4 ++--
>> 2 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/fpu/softfloat-specialize.h b/fpu/softfloat-specialize.h
>> index 43d0890..46b4091 100644
>> --- a/fpu/softfloat-specialize.h
>> +++ b/fpu/softfloat-specialize.h
>> @@ -197,7 +197,7 @@ float128 float128_default_nan(float_status *status)
>> | should be simply `float_exception_flags |= flags;'.
>>
>> *----------------------------------------------------------------------------*/
>>
>> -void float_raise(int8_t flags, float_status *status)
>> +void float_raise(int flags, float_status *status)
>> {
>> status->float_exception_flags |= flags;
>> }
>> diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h
>> index 0e57ee5..416cf7a 100644
>> --- a/include/fpu/softfloat.h
>> +++ b/include/fpu/softfloat.h
>> @@ -196,9 +196,9 @@ enum {
>> };
>>
>> typedef struct float_status {
>> + int float_exception_flags;
>> signed char float_detect_tininess;
>> signed char float_rounding_mode;
>> - signed char float_exception_flags;
>> signed char floatx80_rounding_precision;
>> /* should denormalised results go to zero and set the inexact flag? */
>> flag flush_to_zero;
>
> This changes the size of the structure, and thus of the CPU*State
> structures. I don't think it's something we want to do, especially given
> we currently only use 7 flags, so 7 bits and that fits in a char.
It does, but only by four bytes, which I didn't think was that
big a deal. If we want to keep it to one byte then I think
making it a uint8_t is probably better than leaving it as
signed char, given we're definitely not treating it as a
signed value.
thanks
-- PMM
- [Qemu-devel] [PATCH 1/5] atomic: strip "const" from variables declared with typeof, Pranith Kumar, 2016/08/09
- [Qemu-devel] [PATCH 2/5] softfloat: Fix warn about implicit conversion from int to int8_t, Pranith Kumar, 2016/08/09
- [Qemu-devel] [PATCH 3/5] Disable warn about left shifts of negative values, Pranith Kumar, 2016/08/09
- [Qemu-devel] [PATCH 4/5] clang: Fix warning reg. expansion to 'defined', Pranith Kumar, 2016/08/09
- [Qemu-devel] [PATCH 5/5] target-arm: Fix warn about implicit conversion, Pranith Kumar, 2016/08/09
- Re: [Qemu-devel] [PATCH 1/5] atomic: strip "const" from variables declared with typeof, Paolo Bonzini, 2016/08/09