Skip to contentSkip to conversation

softfloat: fix return type of roundAndPackFloat16

PATCH RESEND In review Aurelien Jarno 2 participants 3 messages Jan 13, 2016 – Jan 17, 2016

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 softfloat: fix return type of roundAndPackFloat16

The roundAndPackFloat16 function should return a float16 value, not a float32 one. Fix that.

---
 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.

fpu/softfloat.c +1 -1
index f1170fe..acc9099 100644
@@ -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)
 {
Signature · 1 line
2.1.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 17 lines · Aurelien Jarno

The roundAndPackFloat16 function should return a float16 value, not a float32 one. Fix that.

---
 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.

fpu/softfloat.c +0 -0
index f1170fe..acc9099 100644

fpu/softfloat.c static float16 packFloat16(flag zSign, int_fast16_t zExp, uint16_t zSig) · line 3374

Quoted 8 lines
fpu/softfloat.c +1 -1
@@ -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)
 {

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

thanks
-- PMM

#2 lore raw
Quoted 29 lines · Peter Maydell
Quoted 17 lines · Aurelien Jarno

The roundAndPackFloat16 function should return a float16 value, not a float32 one. Fix that.

---
 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.

fpu/softfloat.c +0 -0
index f1170fe..acc9099 100644

fpu/softfloat.c static float16 packFloat16(flag zSign, int_fast16_t zExp, uint16_t zSig) · line 3374

Quoted 8 lines
fpu/softfloat.c +1 -1
@@ -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)
 {
Quoted 1 line

(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.

Signature · 2 lines
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
[email protected]                 http://www.aurel32.net