softfloat: fix return type of roundAndPackFloat16
PATCH 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(-)
fpu/softfloat.c +1 -1
@@ -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 ;
Signature · 1 line
1.7.10.4
Quoted 5 lines · Aurelien Jarno
The roundAndPackFloat16 function should return a float16 value, not a float32 one. Fix that.
Cc Peter Maydell <[email protected]>Signed-off-by Aurelien Jarno <[email protected]>
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
Quoted 8 lines · Peter Maydell
Quoted 5 lines · Aurelien Jarno
The roundAndPackFloat16 function should return a float16 value, not a float32 one. Fix that.
Cc Peter Maydell <[email protected]>Signed-off-by Aurelien Jarno <[email protected]>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.
Quoted 2 lines
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
Signature · 2 lines
Aurelien Jarno GPG: 4096R/1DDD8C9B [email protected] http://www.aurel32.net