diff mbox

[RESEND] softfloat: fix return type of roundAndPackFloat16

Message ID 1452700993-6570-1-git-send-email-aurelien@aurel32.net
State New
Headers show

Commit Message

Aurelien Jarno Jan. 13, 2016, 4:03 p.m. UTC
The roundAndPackFloat16 function should return a float16 value, not a
float32 one. Fix that.

Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 fpu/softfloat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Peter, given you are working on softfloat patches, you might want to get
this one merged at the same time.

Comments

Peter Maydell Jan. 15, 2016, 2:21 p.m. UTC | #1
On 13 January 2016 at 16:03, Aurelien Jarno <aurelien@aurel32.net> wrote:
> The roundAndPackFloat16 function should return a float16 value, not a
> float32 one. Fix that.
>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> ---
>  fpu/softfloat.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Peter, given you are working on softfloat patches, you might want to get
> this one merged at the same time.
>
> diff --git a/fpu/softfloat.c b/fpu/softfloat.c
> index f1170fe..acc9099 100644
> --- a/fpu/softfloat.c
> +++ b/fpu/softfloat.c
> @@ -3368,7 +3368,7 @@ static float16 packFloat16(flag zSign, int_fast16_t zExp, uint16_t zSig)
>  | Binary Floating-Point Arithmetic.
>  *----------------------------------------------------------------------------*/
>
> -static float32 roundAndPackFloat16(flag zSign, int_fast16_t zExp,
> +static float16 roundAndPackFloat16(flag zSign, int_fast16_t zExp,
>                                     uint32_t zSig, flag ieee,
>                                     float_status *status)
>  {

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

(a harmless error in the current code but we might as well get it right).

thanks
-- PMM
Aurelien Jarno Jan. 17, 2016, 5:40 p.m. UTC | #2
On 2016-01-15 14:21, Peter Maydell wrote:
> On 13 January 2016 at 16:03, Aurelien Jarno <aurelien@aurel32.net> wrote:
> > The roundAndPackFloat16 function should return a float16 value, not a
> > float32 one. Fix that.
> >
> > Cc: Peter Maydell <peter.maydell@linaro.org>
> > Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> > ---
> >  fpu/softfloat.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > Peter, given you are working on softfloat patches, you might want to get
> > this one merged at the same time.
> >
> > diff --git a/fpu/softfloat.c b/fpu/softfloat.c
> > index f1170fe..acc9099 100644
> > --- a/fpu/softfloat.c
> > +++ b/fpu/softfloat.c
> > @@ -3368,7 +3368,7 @@ static float16 packFloat16(flag zSign, int_fast16_t zExp, uint16_t zSig)
> >  | Binary Floating-Point Arithmetic.
> >  *----------------------------------------------------------------------------*/
> >
> > -static float32 roundAndPackFloat16(flag zSign, int_fast16_t zExp,
> > +static float16 roundAndPackFloat16(flag zSign, int_fast16_t zExp,
> >                                     uint32_t zSig, flag ieee,
> >                                     float_status *status)
> >  {
> 
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
> 
> (a harmless error in the current code but we might as well get it right).

It's harmless in the default build, but it fails to build when softfloat
type checking is activated. Unfortunately more code with the wrong type
has been added recently.
diff mbox

Patch

diff --git a/fpu/softfloat.c b/fpu/softfloat.c
index f1170fe..acc9099 100644
--- a/fpu/softfloat.c
+++ b/fpu/softfloat.c
@@ -3368,7 +3368,7 @@  static float16 packFloat16(flag zSign, int_fast16_t zExp, uint16_t zSig)
 | Binary Floating-Point Arithmetic.
 *----------------------------------------------------------------------------*/
 
-static float32 roundAndPackFloat16(flag zSign, int_fast16_t zExp,
+static float16 roundAndPackFloat16(flag zSign, int_fast16_t zExp,
                                    uint32_t zSig, flag ieee,
                                    float_status *status)
 {