diff mbox

softfloat: fix return type of roundAndPackFloat16

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

Commit Message

Aurelien Jarno June 21, 2014, 7:35 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(-)

Comments

Peter Maydell June 21, 2014, 8:06 p.m. UTC | #1
On 21 June 2014 20:35, 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>

Agreed, though I don't think it has any effect on the results.
Can we have the usual "ok under softfloat 2a or 2b license"
confirmation, please?

thanks
-- PMM
Aurelien Jarno June 21, 2014, 8:29 p.m. UTC | #2
On Sat, Jun 21, 2014 at 09:06:21PM +0100, Peter Maydell wrote:
> On 21 June 2014 20:35, 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>
> 
> Agreed, though I don't think it has any effect on the results.

No, it doesn't have any effect on the results, but it produces slightly
less optimized code. The main problem there is that it fails to build
when enforcing type checking, though less and less targets are compiling
when it is enabled.

> Can we have the usual "ok under softfloat 2a or 2b license"
> confirmation, please?

Yes, I am fine to license this patch under softfloat 2a or 2b license.

Aurelien
diff mbox

Patch

diff --git a/fpu/softfloat.c b/fpu/softfloat.c
index e00a6fb..3b19736 100644
--- a/fpu/softfloat.c
+++ b/fpu/softfloat.c
@@ -3209,7 +3209,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 STATUS_PARAM)
 {
     int maxexp = ieee ? 29 : 30;