On 20 April 2011 11:11, Aurelien Jarno <aurel...@aurel32.net> wrote: > float*_scalnb() were not taking into account all cases. This patch fixes > some corner cases: > - NaN values in input were not properly propagated and the invalid flag > not correctly raised. Use propagateFloat*NaN() for that. > - NaN or infinite values in input of floatx80_scalnb() were not correctly > detected due to a typo. > - The sum of exponent and n could overflow, leading to strange results. > Additionally having int16 defined to int make that happening for a very > small range of values. Fix that by saturating n to the maximum exponent > range, and using an explicit wider type if needed. > > Signed-off-by: Aurelien Jarno <aurel...@aurel32.net> > --- > fpu/softfloat.c | 47 ++++++++++++++++++++++++++++++++++++++++++----- > 1 files changed, 42 insertions(+), 5 deletions(-) > > v1 -> v2: fix condition for float32
Reviewed-by: Peter Maydell <peter.mayd...@linaro.org> -- PMM