Re: [Qemu-devel] [PATCH 6/6] softfloat: Fix missing inexact for floating-point add

2018-08-11 Thread Laurent Desnogues
On Fri, Aug 10, 2018 at 9:31 PM, Richard Henderson
 wrote:
> For 0x1.3p+0 + 0x1.ffep+14 = 0x1.0001fffp+15
> we dropped the sticky bit and so failed to raise inexact.
>
> Reported-by: Laurent Desnogues 
> Signed-off-by: Richard Henderson 

Tested-by: Laurent Desnogues 
Reviewed-by: Laurent Desnogues 

Laurent

> ---
>  fpu/softfloat.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fpu/softfloat.c b/fpu/softfloat.c
> index 8cd2400081..7d63cffdeb 100644
> --- a/fpu/softfloat.c
> +++ b/fpu/softfloat.c
> @@ -701,7 +701,7 @@ static FloatParts addsub_floats(FloatParts a, FloatParts 
> b, bool subtract,
>  }
>  a.frac += b.frac;
>  if (a.frac & DECOMPOSED_OVERFLOW_BIT) {
> -a.frac >>= 1;
> +shift64RightJamming(a.frac, 1, );
>  a.exp += 1;
>  }
>  return a;
> --
> 2.17.1
>



[Qemu-devel] [PATCH 6/6] softfloat: Fix missing inexact for floating-point add

2018-08-10 Thread Richard Henderson
For 0x1.3p+0 + 0x1.ffep+14 = 0x1.0001fffp+15
we dropped the sticky bit and so failed to raise inexact.

Reported-by: Laurent Desnogues 
Signed-off-by: Richard Henderson 
---
 fpu/softfloat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fpu/softfloat.c b/fpu/softfloat.c
index 8cd2400081..7d63cffdeb 100644
--- a/fpu/softfloat.c
+++ b/fpu/softfloat.c
@@ -701,7 +701,7 @@ static FloatParts addsub_floats(FloatParts a, FloatParts b, 
bool subtract,
 }
 a.frac += b.frac;
 if (a.frac & DECOMPOSED_OVERFLOW_BIT) {
-a.frac >>= 1;
+shift64RightJamming(a.frac, 1, );
 a.exp += 1;
 }
 return a;
-- 
2.17.1