- Jan 26, 2013
-
-
Richard Sandiford authored
Honour float_muladd_negate_c in the case where the product is zero and c is nonzero. Previously we would fail to negate c. Seen in (and tested against) the gfortran testsuite on MIPS. Signed-off-by:
Richard Sandiford <rdsandiford@googlemail.com> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
- Jan 05, 2013
-
-
Richard Henderson authored
Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Richard Henderson <rth@twiddle.net> Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
Richard Henderson authored
The interface to normalizeRoundAndPackFloat64 requires that the high bit be clear. Perform one shift-right-and-jam if needed. Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Richard Henderson <rth@twiddle.net> Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
- Dec 19, 2012
-
-
Paolo Bonzini authored
Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Oct 31, 2012
-
-
Aurelien Jarno authored
Add a pickNaNMulAdd function for MIPS, implementing NaN propagation rules for MIPS fused multiply-add instructions. Cc: Peter Maydell <peter.maydell@linaro.org> Reviewed-by:
Richard Henderson <rth@twiddle.net> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
- Oct 01, 2012
-
-
Peter Maydell authored
The uint64_to_float32() conversion function was incorrectly always returning numbers with the sign bit set (ie negative numbers). Correct this so we return positive numbers instead. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
Peter Maydell authored
In float16_to_float32, when returning an infinity, just pass zero as the mantissa argument to packFloat32(), rather than shifting a value which we know must be zero. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Reviewed-by:
Richard Henderson <rth@twiddle.net> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
- Sep 22, 2012
-
-
Max Filippov authored
NaN propagation rule: leftmost NaN in the expression gets propagated to the result. Signed-off-by:
Max Filippov <jcmvbkbc@gmail.com> Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
Max Filippov authored
Architectures that don't have signaling NaNs can define NO_SIGNALING_NANS, it will make float*_is_quiet_nan return 1 for any NaN and float*_is_signaling_nan always return 0. Signed-off-by:
Max Filippov <jcmvbkbc@gmail.com> Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
Max Filippov authored
Flags passed into float{32,64}_muladd are treated as bits; assign independent bits to float_muladd_negate_* to allow precise control over what gets negated in float{32,64}_muladd. Signed-off-by:
Max Filippov <jcmvbkbc@gmail.com> Reviewed-by:
Aurelien Jarno <aurelien@aurel32.net> Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
- Apr 28, 2012
-
-
Andreas Färber authored
Based on the following Coccinelle patch: @@ typedef int16, int_fast16_t; @@ -int16 +int_fast16_t Avoids a workaround for AIX. Add typedef for pre-10 Solaris. Signed-off-by:
Andreas Färber <afaerber@suse.de> Cc: malc <av1474@comtv.ru> Cc: Ben Taylor <bentaylor.solx86@gmail.com> Tested-by:
Bernhard Walle <bernhard@bwalle.de> Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
Andreas Färber authored
Based on the following Coccinelle patch: @@ typedef uint16, uint_fast16_t; @@ -uint16 +uint_fast16_t Fixes the build of the Cocoa frontend on Mac OS X and avoids a workaround for AIX. For pre-10 Solaris include osdep.h. Reported-by:
Pavel Borzenkov <pavel.borzenkov@gmail.com> Reported-by:
Rui Carmo <rui.carmo@gmail.com> Signed-off-by:
Andreas Färber <afaerber@suse.de> Cc: Juan Pineda <juan@logician.com> Cc: malc <av1474@comtv.ru> Cc: Ben Taylor <bentaylor.solx86@gmail.com> Tested-by:
Bernhard Walle <bernhard@bwalle.de> Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
Andreas Färber authored
normalizeFloat{32,64}Subnormal() expect the exponent as int16, not int. This went unnoticed since int16 and uint16 were both typedef'ed to int. Signed-off-by:
Andreas Färber <afaerber@suse.de> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Tested-by:
Bernhard Walle <bernhard@bwalle.de> Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
- Apr 21, 2012
-
-
Juan Quintela authored
This change makes it compile and return the same value than the #undef one. Signed-off-by:
Juan Quintela <quintela@redhat.com> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Acked-by:
Andreas Färber <afaerber@suse.de> Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
- Apr 07, 2012
-
-
Peter Maydell authored
Fix code in roundAndPackInt32 that assumed that int32 was only 32 bits, by simply using int32_t instead. Fix the parallel bug in roundAndPackInt64 as well, although that one is only theoretical since it's unlikely that int64 will ever be more than 64 bits. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
Peter Maydell authored
Code in the float64_to_int32_round_to_zero() function was assuming that int32 would not be wider than 32 bits; this meant it might not correctly detect the overflow case. We take the simple approach of using int32_t. Also fix equivalent issues in the functions for other float sizes. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
- Mar 17, 2012
-
-
Avi Kivity authored
C99 appears to consider compound literals as non-constants, and complains when they are used in static initializers. Switch to ordinary initializer syntax. Signed-off-by:
Avi Kivity <avi@redhat.com> Acked-by:
Andreas Färber <afaerber@suse.de> Reported-by:
Andreas Färber <andreas.faerber@web.de> Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
- Oct 19, 2011
-
-
Peter Maydell authored
Implement fused multiply-add as a softfloat primitive. This implements "a+b*c" as a single step without any intermediate rounding; it is specified in IEEE 754-2008 and implemented in a number of CPUs. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
- Oct 01, 2011
-
-
Peter Maydell authored
Include config.h in softfloat.c, so that the target specific ifdefs in softfloat-specialize.h are evaluated correctly. This was accidentally broken in commit 789ec7ce when config-target.h was removed from softfloat.h, and means that most targets will have been returning the wrong results for calculations involving NaNs. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
- Sep 03, 2011
-
-
Andreas Färber authored
Prepares for uint32 replacement. Signed-off-by:
Andreas Färber <andreas.faerber@web.de> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
Andreas Färber authored
Prepares for uint16 replacement. Signed-off-by:
Andreas Färber <andreas.faerber@web.de> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
- Jul 29, 2011
-
-
Paolo Bonzini authored
Most definitions in softfloat.h are really target-independent, but the file is not because it includes definitions of the default NaN values. Change those to variables to allow including softfloat.h from files that are not compiled per-target. By making them const, the compiler is allowed to optimize them into softfloat functions that use them. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
- Jun 03, 2011
-
-
Aurelien Jarno authored
float*_is_zero_or_denormal() is available for float32, but not for float64, floatx80 and float128. Fix that. Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
Aurelien Jarno authored
Now that softfloat-native is gone, there is no real point on not always enabling floatx80 and float128 support. Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
Aurelien Jarno authored
Remove softfloat-native support, all targets are now using softfloat instead. Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
- May 23, 2011
-
-
Peter Maydell authored
Add a new float_flag_output_denormal which is set when the result of a floating point operation would be denormal but is flushed to zero because we are in flush_to_zero mode. This is necessary because some architectures signal this condition as an underflow and others signal it as an inexact result. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
- Apr 25, 2011
-
-
Aurelien Jarno authored
Add float*_is_any_nan() functions to match the softfloat API. Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
Aurelien Jarno authored
float*_scalbn() should be able to take a status parameter. Fix that. Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
Aurelien Jarno authored
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. Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
Aurelien Jarno authored
Add floatx80_compare() and floatx80_compare_quiet() functions to match the softfloat-native ones. Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
Aurelien Jarno authored
Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
Aurelien Jarno authored
Add a pi constant for float32, float64, floatx80. It will be used by target-i386 and later by the trigonometric functions. Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
Aurelien Jarno authored
Add floatx80 constants similarly to float32 or float64. Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
Aurelien Jarno authored
With floatx80, the explicit bit is set for infinity. Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
Aurelien Jarno authored
The floatx80 format uses an explicit bit that should be taken into account when converting to and from commonNaN format. When converting to commonNaN, the explicit bit should be removed if it is a 1, and a default NaN should be used if it is 0. When converting from commonNan, the explicit bit should be added. Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
- Apr 17, 2011
-
-
Aurelien Jarno authored
Make clear for all comparison functions which ones trigger an exception for all NaNs, and which one only for sNaNs. Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
Aurelien Jarno authored
I am not a big fan of code moving, but having the signaling version in the middle of quiet versions and vice versa doesn't make the code easy to read. This patch is a simple code move, basically swapping locations of float*_eq and float*_eq_quiet. Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
Aurelien Jarno authored
float*_eq_signaling functions have a different semantics than other comparison functions. Fix that by renaming float*_quiet_signaling() into float*_eq(). Note that it is purely mechanical, and the behaviour should be unchanged. Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
Aurelien Jarno authored
float*_eq functions have a different semantics than other comparison functions. Fix that by first renaming float*_quiet() into float*_eq_quiet(). Note that it is purely mechanical, and the behaviour should be unchanged. That said it clearly highlight problems due to this different semantics, they are fixed later in this patch series. Cc: Alexander Graf <agraf@suse.de> Acked-by:
Edgar E. Iglesias <edgar.iglesias@gmail.com> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-