qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Fix: fp-test uninitialized member floatX::exp


From: Andrey Shinkevich
Subject: Re: [Qemu-devel] [PATCH] Fix: fp-test uninitialized member floatX::exp
Date: Tue, 20 Aug 2019 15:16:20 +0000

PINGING...

On 30/07/2019 13:13, Andrey Shinkevich wrote:
> Not all the paths in the functions, such as f16ToFloatX(), initialize
> the member 'exp' of the structure floatX.
> 
> Signed-off-by: Andrey Shinkevich <address@hidden>
> ---
>   source/slowfloat.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/tests/fp/berkeley-testfloat-3/source/slowfloat.c 
> b/tests/fp/berkeley-testfloat-3/source/slowfloat.c
> index 4e84656..6e0f0a6 100644
> --- a/tests/fp/berkeley-testfloat-3/source/slowfloat.c
> +++ b/tests/fp/berkeley-testfloat-3/source/slowfloat.c
> @@ -623,6 +623,7 @@ static void f16ToFloatX( float16_t a, struct floatX *xPtr 
> )
>       xPtr->isInf = false;
>       xPtr->isZero = false;
>       xPtr->sign = ((uiA & 0x8000) != 0);
> +    xPtr->exp = 0;
>       exp = uiA>>10 & 0x1F;
>       sig64 = uiA & 0x03FF;
>       sig64 <<= 45;
> @@ -759,6 +760,7 @@ static void f32ToFloatX( float32_t a, struct floatX *xPtr 
> )
>       xPtr->isInf = false;
>       xPtr->isZero = false;
>       xPtr->sign = ((uiA & 0x80000000) != 0);
> +    xPtr->exp = 0;
>       exp = uiA>>23 & 0xFF;
>       sig64 = uiA & 0x007FFFFF;
>       sig64 <<= 32;
> @@ -895,6 +897,7 @@ static void f64ToFloatX( float64_t a, struct floatX *xPtr 
> )
>       xPtr->isInf = false;
>       xPtr->isZero = false;
>       xPtr->sign = ((uiA & UINT64_C( 0x8000000000000000 )) != 0);
> +    xPtr->exp = 0;
>       exp = uiA>>52 & 0x7FF;
>       sig64 = uiA & UINT64_C( 0x000FFFFFFFFFFFFF );
>       if ( exp == 0x7FF ) {
> @@ -1220,6 +1223,7 @@ static void f128MToFloatX( const float128_t *aPtr, 
> struct floatX *xPtr )
>       xPtr->isZero = false;
>       uiA64 = uiAPtr->v64;
>       xPtr->sign = ((uiA64 & UINT64_C( 0x8000000000000000 )) != 0);
> +    xPtr->exp = 0;
>       exp = uiA64>>48 & 0x7FFF;
>       sig.v64 = uiA64 & UINT64_C( 0x0000FFFFFFFFFFFF );
>       sig.v0  = uiAPtr->v0;
> 

-- 
With the best regards,
Andrey Shinkevich

reply via email to

[Prev in Thread] Current Thread [Next in Thread]