Statistics
| Branch: | Revision:

root / fpu @ feature-archipelago

# Date Author Comment
67d43538 02/20/2014 12:35 pm Peter Maydell

softfloat: Support halving the result of muladd operation

The ARMv8 instruction set includes a fused floating point
reciprocal square root step instruction which demands an
"(x * y + z) / 2" fused operation. Support this by adding
a flag to the softfloat muladd operations which requests...

38970efa 01/08/2014 09:07 pm Peter Maydell

softfloat: Fix exception flag handling for float32_to_float16()

Our float32 to float16 conversion routine was generating the correct
numerical answers, but not always setting the right set of exception
flags. Fix this, mostly by rearranging the code to more closely...

f581bf54 01/08/2014 09:07 pm Will Newton

softfloat: Add float to 16bit integer conversions.

ARMv8 requires support for converting 32 and 64bit floating point
values to signed and unsigned 16bit integers.

Signed-off-by: Will Newton <>
[PMM: updated not to incorrectly set Inexact for Invalid inputs]...

c4850f9e 01/08/2014 09:07 pm Peter Maydell

softfloat: Make the int-to-float functions take exact-width types

Currently the int-to-float functions take types which are specified
as "at least X bits wide", rather than "exactly X bits wide". This is
confusing and unhelpful since it means that the callers have to include...

fb3ea83a 01/08/2014 09:07 pm Tom Musta

softfloat: Fix float64_to_uint64

The comment preceding the float64_to_uint64 routine suggests that
the implementation is broken. And this is, indeed, the case.

This patch properly implements the conversion of a 64-bit floating
point number to an unsigned, 64 bit integer....

34e1c27b 01/08/2014 09:07 pm Peter Maydell

softfloat: Only raise Invalid when conversions to int are out of range

We implement a number of float-to-integer conversions using conversion
to an integer type with a wider range and then a check against the
narrower range we are actually converting to. If we find the result to...

3c85c37f 01/08/2014 09:07 pm Peter Maydell

softfloat: Fix factor 2 error for scalbn on denormal inputs

If the input to float*_scalbn() is denormal then it represents
a number 0.[mantissabits] * 2^(1-exponentbias) (and the actual
exponent field is all zeroes). This means that when we convert
it to our unpacked encoding the unpacked exponent must be one...

2f18bbf9 01/08/2014 09:07 pm Tom Musta

softfloat: Add float32_to_uint64()

This patch adds the float32_to_uint64() routine, which converts a
32-bit floating point number to an unsigned 64 bit number.

This contribution can be licensed under either the softfloat-2a or -2b
license.

Signed-off-by: Tom Musta <>...

0a87a310 01/08/2014 09:07 pm Tom Musta

softfloat: Fix float64_to_uint64_round_to_zero

The float64_to_uint64_round_to_zero routine is incorrect.

For example, the following test pattern:

46697351FF4AEC29 / 0x1.97351ff4aec29p+103

currently produces 8000000000000000 instead of FFFFFFFFFFFFFFFF....

5e7f654f 01/08/2014 09:07 pm Tom Musta

softfloat: Fix float64_to_uint32

The float64_to_uint32 has several flaws:

- for numbers between 2**32 and 2**64, the inexact exception flag
may get incorrectly set. In this case, only the invalid flag
should be set.
test pattern: 425F81378DC0CD1F / 0x1.f81378dc0cd1fp+38...
fd728f2f 01/08/2014 09:07 pm Tom Musta

softfloat: Fix float64_to_uint32_round_to_zero

The float64_to_uint32_round_to_zero routine is incorrect.

For example, the following test pattern:

425F81378DC0CD1F / 0x1.f81378dc0cd1fp+38

will erroneously set the inexact flag.

This patch re-implements the routine to use the float64_to_uint64_round_to_zero...

879d096b 01/08/2014 09:07 pm Peter Maydell

softfloat: Provide complete set of accessors for fp state

Tidy up the get/set accessors for the fp state to add missing ones
and make them all inline in softfloat.h rather than some inline and
some not.

Signed-off-by: Peter Maydell <>...

c4a1c5e7 01/08/2014 09:07 pm Peter Maydell

softfloat: Factor out RoundAndPackFloat16 and NormalizeFloat16Subnormal

In preparation for adding conversions between float16 and float64,
factor out code currently done inline in the float16<=>float32
conversion functions into functions RoundAndPackFloat16 and...

14c9a07e 01/08/2014 09:07 pm Peter Maydell

softfloat: Add float16 <=> float64 conversion functions

Add the conversion functions float16_to_float64() and
float64_to_float16(), which will be needed for the ARM
A64 instruction set.

Signed-off-by: Peter Maydell <>
Reviewed-by: Richard Henderson <>

dc355b76 01/08/2014 09:07 pm Peter Maydell

softfloat: Refactor code handling various rounding modes

Refactor the code in various functions which calculates rounding
increments given the current rounding mode, so that instead of a
set of nested if statements we have a simple switch statement.
This will give us a clean place to add the case for the new...

f9288a76 01/08/2014 09:07 pm Peter Maydell

softfloat: Add support for ties-away rounding

IEEE754-2008 specifies a new rounding mode:

"roundTiesToAway: the floating-point number nearest to the infinitely
precise result shall be delivered; if the two nearest floating-point
numbers bracketing an unrepresentable infinitely precise result are...

e70614ea 12/10/2013 03:28 pm Will Newton

softfloat: Remove unused argument from MINMAX macro.

The nan_exp argument is not used, so remove it.

Signed-off-by: Will Newton <>
Reviewed-by: Peter Maydell <>
Message-id: ...

e17ab310 12/10/2013 03:28 pm Will Newton

softfloat: Add minNum() and maxNum() functions to softfloat.

Add floatnn_minnum() and floatnn_maxnum() functions which are equivalent
to the minNum() and maxNum() functions from IEEE 754-2008. They are
similar to min() and max() but differ in the handling of QNaN arguments....

4039736e 06/10/2013 07:36 pm Peter Maydell

softfloat: Fix shift128Right for shift counts 64..127

shift128Right would give the wrong result for a shift count
between 64 and 127. This was never noticed because all of
our uses of this function are guaranteed not to use shift
counts in this range.

Signed-off-by: Peter Maydell <>...

e3d142d0 04/15/2013 05:06 pm Peter Maydell

fpu: Correct edgecase in float64_muladd

In handling float64_muladd, if we end up doing a subtraction of the
product and c, and the 128 bit result of this subtraction happens to
have its most significant bit in bit 63, we weren't handling this
correctly when attempting to normalize to put the most significant...

a6e7c184 01/26/2013 03:22 pm Richard Sandiford

softfloat: Handle float_muladd_negate_c when product is zero

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

1e397ead 01/05/2013 12:12 pm Richard Henderson

softfloat: Implement uint64_to_float128

Reviewed-by: Peter Maydell <>
Signed-off-by: Richard Henderson <>
Signed-off-by: Blue Swirl <>

17ed2293 01/05/2013 12:12 pm Richard Henderson

softfloat: Fix uint64_to_float64

The interface to normalizeRoundAndPackFloat64 requires that the
high bit be clear. Perform one shift-right-and-jam if needed.

Reviewed-by: Peter Maydell <>
Signed-off-by: Richard Henderson <>...

6b4c305c 12/19/2012 09:32 am Paolo Bonzini

fpu: move public header file to include/fpu

Signed-off-by: Paolo Bonzini <>

1de7afc9 12/19/2012 09:32 am Paolo Bonzini

misc: move include files to include/qemu/

Signed-off-by: Paolo Bonzini <>

bbc1dede 10/31/2012 11:20 pm Aurelien Jarno

softfloat: implement fused multiply-add NaN propagation for MIPS

Add a pickNaNMulAdd function for MIPS, implementing NaN propagation
rules for MIPS fused multiply-add instructions.

Cc: Peter Maydell <>
Reviewed-by: Richard Henderson <>...

4be8eeac 10/01/2012 11:06 pm Peter Maydell

fpu/softfloat.c: Remove pointless shift of always-zero value

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

e744c06f 10/01/2012 11:06 pm Peter Maydell

fpu/softfloat.c: Return correctly signed values from uint64_to_float32

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

66176802 09/22/2012 08:59 pm Max Filippov

softfloat: make float_muladd_negate_* flags independent

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

213ff4e6 09/22/2012 08:59 pm Max Filippov

softfloat: add NO_SIGNALING_NANS

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

b81fe822 09/22/2012 08:59 pm Max Filippov

target-xtensa: specialize softfloat NaN rules

NaN propagation rule: leftmost NaN in the expression gets propagated to
the result.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

94a49d86 04/28/2012 12:13 pm Andreas Färber

softfloat: Replace int16 type with int_fast16_t

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

5aea4c58 04/28/2012 12:13 pm Andreas Färber

softfloat: Replace uint16 type with uint_fast16_t

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

c9696547 04/28/2012 12:12 pm Andreas Färber

softfloat: Fix mixups of int and int16

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 <>
Reviewed-by: Peter Maydell <>...

0eb4fc81 04/21/2012 04:26 pm Juan Quintela

softfloat: make USE_SOFTFLOAT_STRUCT_TYPES compile

This change makes it compile and return the same value than the #undef one.

Signed-off-by: Juan Quintela <>
Reviewed-by: Peter Maydell <>
Acked-by: Andreas Färber <>...

760e1416 04/07/2012 02:15 pm Peter Maydell

softfloat: roundAndPackInt{32, 64}: Don't assume int32 is 32 bits

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

b3a6a2e0 04/07/2012 02:15 pm Peter Maydell

softfloat: float*_to_int32_round_to_zero: don't assume int32 is 32 bits

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

3bf7e40a 03/17/2012 03:01 pm Avi Kivity

softfloat: fix for C99

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 <>
Acked-by: Andreas Färber <>...

369be8f6 10/19/2011 07:14 pm Peter Maydell

softfloat: Implement fused multiply-add

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

2ac8bd03 10/01/2011 09:19 am Peter Maydell

softfloat: Reinstate accidentally disabled target-specific NaN handling

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 789ec7ce2 when config-target.h was removed from...

9f8d2a09 09/03/2011 08:47 pm Andreas Färber

softfloat: Use uint32 consistently

Prepares for uint32 replacement.

Signed-off-by: Andreas Färber <>
Reviewed-by: Peter Maydell <>
Signed-off-by: Blue Swirl <>

38641f8f 09/03/2011 08:46 pm Andreas Färber

softfloat: Use uint16 consistently

Prepares for uint16 replacement.

Signed-off-by: Andreas Färber <>
Reviewed-by: Peter Maydell <>
Signed-off-by: Blue Swirl <>

789ec7ce 07/29/2011 04:25 pm Paolo Bonzini

softfloat: change default nan definitions to variables

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

587eabfa 06/03/2011 05:07 pm Aurelien Jarno

softfloat: add float*_is_zero_or_denormal()

float*_is_zero_or_denormal() is available for float32, but not for
float64, floatx80 and float128. Fix that.

Reviewed-by: Peter Maydell <>
Signed-off-by: Aurelien Jarno <>

cf67c6ba 06/03/2011 05:07 pm Aurelien Jarno

softfloat-native: remove

Remove softfloat-native support, all targets are now using softfloat
instead.

Reviewed-by: Peter Maydell <>
Signed-off-by: Aurelien Jarno <>

be22a9ab 06/03/2011 05:07 pm Aurelien Jarno

softfloat: always enable floatx80 and float128 support

Now that softfloat-native is gone, there is no real point on not always
enabling floatx80 and float128 support.

Reviewed-by: Peter Maydell <>
Signed-off-by: Aurelien Jarno <>

e6afc87f 05/23/2011 11:39 pm Peter Maydell

softfloat: Add new flag for when denormal result is flushed to zero

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

326b9e98 04/25/2011 12:18 pm Aurelien Jarno

softfloat: fix float*_scalnb() corner cases

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

d6882cf0 04/25/2011 12:18 pm Aurelien Jarno

softfloat-native: fix float*_scalbn() functions

float*_scalbn() should be able to take a status parameter. Fix that.

Reviewed-by: Peter Maydell <>
Signed-off-by: Aurelien Jarno <>

4cc5383f 04/25/2011 12:18 pm Aurelien Jarno

softfloat-native: add float*_is_any_nan() functions

Add float*_is_any_nan() functions to match the softfloat API.

Reviewed-by: Peter Maydell <>
Signed-off-by: Aurelien Jarno <>

e2f42204 04/25/2011 12:18 pm Aurelien Jarno

softfloat: fix floatx80 handling of NaN

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

b76235e4 04/25/2011 12:18 pm Aurelien Jarno

softfloat: fix floatx80_is_infinity()

With floatx80, the explicit bit is set for infinity.

Reviewed-by: Peter Maydell <>
Signed-off-by: Aurelien Jarno <>

f3218a8d 04/25/2011 12:18 pm Aurelien Jarno

softfloat: add floatx80 constants

Add floatx80 constants similarly to float32 or float64.

Reviewed-by: Peter Maydell <>
Signed-off-by: Aurelien Jarno <>

c4b4c77a 04/25/2011 12:18 pm Aurelien Jarno

softfloat: add pi constants

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 <>
Signed-off-by: Aurelien Jarno <>

d2b1027d 04/25/2011 12:18 pm Aurelien Jarno

softfloat-native: add a few constant values

Reviewed-by: Peter Maydell <>
Signed-off-by: Aurelien Jarno <>

f6714d36 04/25/2011 12:18 pm Aurelien Jarno

softfloat: add floatx80_compare*() functions

Add floatx80_compare() and floatx80_compare_quiet() functions to match
the softfloat-native ones.

Reviewed-by: Peter Maydell <>
Signed-off-by: Aurelien Jarno <>

b689362d 04/17/2011 09:32 pm Aurelien Jarno

softfloat: move float*_eq and float*_eq_quiet

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

f5a64251 04/17/2011 09:32 pm Aurelien Jarno

softfloat: improve description of comparison functions

Make clear for all comparison functions which ones trigger an exception
for all NaNs, and which one only for sNaNs.

Reviewed-by: Peter Maydell <>
Signed-off-by: Aurelien Jarno <>

b3b4c7f3 04/17/2011 09:32 pm Aurelien Jarno

softfloat: use GCC builtins to count the leading zeros

Softfloat has its own implementation to count the leading zeros. However
a lot of architectures have either a dedicated instruction or an
optimized to do that. When using GCC >= 3.4, this patch uses GCC builtins...

67b7861d 04/17/2011 09:32 pm Aurelien Jarno

softfloat: add float*_unordered_{,quiet}() functions

Add float*_unordered() functions to softfloat, matching the softfloat-native
ones. Also add float*_unordered_quiet() functions to match the others
comparison functions.

This allow target-i386/ops_sse.h to be compiled with softfloat....

b4a0ef79 04/17/2011 09:32 pm Aurelien Jarno

softfloat-native: add float*_unordered_quiet() functions

Add float*_unordered_quiet() functions to march the softfloat versions.
As FPU status is not tracked with softfloat-native, they don't differ
from the signaling version.

Reviewed-by: Peter Maydell <>...

211315fb 04/17/2011 09:32 pm Aurelien Jarno

softfloat: rename float*_eq() into float*_eq_quiet()

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

2657d0ff 04/17/2011 09:32 pm Aurelien Jarno

softfloat: rename float*_eq_signaling() into float*_eq()

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

c29aca44 04/13/2011 12:33 am Peter Maydell

softfloat: Add setter function for tininess detection mode

Add a setter function for the underflow tininess detection mode,
in line with the similar functions for other parts of the float status
structure.

Signed-off-by: Peter Maydell <>...

d2fbca94 04/12/2011 09:49 pm Guan Xuetao

unicore32: necessary modifications for other files to support unicore32

Signed-off-by: Guan Xuetao <>
Signed-off-by: Blue Swirl <>

274f1b04 04/03/2011 06:19 pm Peter Maydell

softfloat: Add float*_min() and float*_max() functions

Add min and max operations to softfloat. This allows us to implement
propagation of NaNs and handling of negative zero correctly (unlike
the approach of having target helper routines return one of the operands...

bb98fe42 03/21/2011 10:46 pm Andreas Färber

softfloat: Drop [s]bits{8, 16, 32, 64} types in favor of [u]int{8, 16, 32, 64}_t

They are defined with the same semantics as the POSIX types,
so prefer those for consistency. Suggested by Peter Maydell.

Cc: Peter Maydell <>
Cc: Aurelien Jarno <>...

87b8cc3c 03/21/2011 10:46 pm Andreas Färber

softfloat: Resolve type mismatches between declaration and implementation

The original SoftFloat 2.0b library avoided the use of custom integer types
in its public headers. This requires the definitions of int{8,16,32,64} to
match the assumptions in the declarations. This breaks on BeOS R5 and Haiku/x86,...

8d725fac 03/21/2011 10:46 pm Andreas Färber

softfloat: Prepend QEMU-style header with derivation notice

The SoftFloat license requires "prominent notice that the work
is derivative". Having added features like improved 16-bit support
for arm already, add such a notice to the sources.

softfloat-native.[ch] are not under the SoftFloat license...

8559666d 02/24/2011 09:53 am Christophe Lyon

softfloat: move all default NaN definitions to softfloat.h.

These special values are needed to implement some helper functions,
which return/use these values in some cases.

Signed-off-by: Christophe Lyon <>
Reviewed-by: Peter Maydell <>...

c30fe7df 02/24/2011 09:53 am Christophe Lyon

softfloat: add _set_sign(), _infinity and _half for 32 and 64 bits floats.

These constants and utility function are needed to implement some
helpers. Defining constants avoids the need to re-compute them at
runtime.

Signed-off-by: Christophe Lyon <>...

d5138cf4 02/10/2011 09:16 pm Peter Maydell

softfloat: Fix compilation failures with USE_SOFTFLOAT_STRUCT_TYPES

Make softfloat compile with USE_SOFTFLOAT_STRUCT_TYPES defined, by
adding and using new macros const_float16(), const_float32() and
const_float64() so you can use array initializers in an array of...

f591e1be 02/10/2011 07:28 pm Peter Maydell

softfloat: Correctly handle NaNs in float16_to_float32()

Correctly handle NaNs in float16_to_float32(), by defining and
using a float16ToCommonNaN() function, as we do with the other formats.

Signed-off-by: Peter Maydell <>
Signed-off-by: Aurelien Jarno <>

600e30d2 02/10/2011 07:28 pm Peter Maydell

softfloat: Fix single-to-half precision float conversions

Fix various bugs in the single-to-half-precision conversion code: * input NaNs not correctly converted in IEEE mode
(fixed by defining and using a commonNaNToFloat16()) * wrong values returned when converting NaN/Inf into non-IEEE...

bcd4d9af 02/10/2011 07:28 pm Christophe Lyon

softfloat: Honour default_nan_mode for float-to-float conversions

Honour the default_nan_mode flag when doing conversions between
different floating point formats, as well as when returning a NaN from
a two-operand floating point function. This corrects the behaviour...

bb4d4bb3 02/10/2011 07:28 pm Peter Maydell

softfloat: Add float16 type and float16 NaN handling functions

Add a float16 type to softfloat, rather than using bits16 directly.
Also add the missing functions float16_is_quiet_nan(),
float16_is_signaling_nan() and float16_maybe_silence_nan(),
which are needed for the float16 conversion routines....

de4af5f7 01/20/2011 01:37 pm Aurelien Jarno

softfloat: fix floatx80_is_{quiet,signaling}_nan()

floatx80_is_{quiet,signaling}_nan() functions are incorrectly detecting
the type of NaN, depending on SNAN_BIT_IS_ONE, one of the two is
returning the correct value, and the other true for any kind of NaN....

6f3300ad 01/14/2011 09:39 pm Peter Maydell

softfloat: Add float32_is_zero_or_denormal() function

Add a utility function to softfloat to test whether a float32
is zero or denormal.

Signed-off-by: Peter Maydell <>
Reviewed-by: Aurelien Jarno <>
Signed-off-by: Aurelien Jarno <>

e9087750 01/14/2011 09:39 pm Aurelien Jarno

softfloat: SH4 has the sNaN bit set

Signed-off-by: Aurelien Jarno <>

10201602 01/14/2011 09:39 pm Aurelien Jarno

softfloat: fix default-NaN mode

When the default-NaN mode is enabled, it should return the default NaN
value, but it should anyway raise the invalid operation flag if one of
the operand is an sNaN.

I have checked that this behavior matches the ARM and SH4 manuals, as...

2bed652f 01/07/2011 05:35 pm Peter Maydell

softfloat: Implement floatx80_is_any_nan() and float128_is_any_nan()

Implement versions of float*_is_any_nan() for the floatx80 and
float128 types.

Acked-by: Aurelien Jarno <>
Signed-off-by: Peter Maydell <>
Signed-off-by: Riku Voipio <>

37d18660 01/06/2011 11:16 pm Peter Maydell

softfloat: Implement flushing input denormals to zero

Add support to softfloat for flushing input denormal float32 and float64
to zero. softfloat's existing 'flush_to_zero' flag only flushes denormals
to zero on output. Some CPUs need input denormals to be flushed before...

e024e881 01/06/2011 05:29 pm Aurelien Jarno

target-ppc: Implement correct NaN propagation rules

Implement the correct NaN propagation rules for PowerPC targets by
providing an appropriate pickNaN function.

Also fix the #ifdef tests for default NaN definition, the correct name
is TARGET_PPC instead of TARGET_POWERPC....

084d19ba 01/06/2011 05:29 pm Aurelien Jarno

target-mips: Implement correct NaN propagation rules

Implement the correct NaN propagation rules for MIPS targets by
providing an appropriate pickNaN function.

Signed-off-by: Aurelien Jarno <>

1f398e08 01/06/2011 05:29 pm Aurelien Jarno

softfloat: use float{32,64,x80,128}_maybe_silence_nan()

Use float{32,64,x80,128}_maybe_silence_nan() instead of toggling the
sNaN bit manually. This allow per target implementation of sNaN to qNaN
conversion.

Signed-off-by: Aurelien Jarno <>...

f6a7d92a 01/06/2011 05:29 pm Aurelien Jarno

softfloat: add float{x80,128}_maybe_silence_nan()

Add float{x80,128}_maybe_silence_nan() functions, they will be need by
propagateFloat{x80,128}NaN().

Reviewed-by: Peter Maydell <>
Signed-off-by: Aurelien Jarno <>

93ae1c6f 01/06/2011 05:29 pm Aurelien Jarno

softfloat: fix float{32,64}_maybe_silence_nan() for MIPS

On targets that define sNaN with the sNaN bit as one, simply clearing
this bit may correspond to an infinite value.

Convert it to a default NaN if SNAN_BIT_IS_ONE, as it corresponds to
the MIPS implementation, the only emulated CPU with SNAN_BIT_IS_ONE....

d735d695 01/06/2011 05:29 pm Aurelien Jarno

softfloat: rename *IsNaN variables to *IsQuietNaN

Similarly to what has been done in commit
185698715dfb18c82ad2a5dbc169908602d43e81 rename the misnamed *IsNaN
variables into *IsQuietNaN.

Reviewed-by: Peter Maydell <>
Signed-off-by: Aurelien Jarno <>

34d23861 01/06/2011 05:29 pm Aurelien Jarno

softfloat: remove HPPA specific code

We don't have any HPPA target, so let's remove HPPA specific code. It
can be re-added when someone adds an HPPA target.

This has been blessed by Stuart Brady <>, author of the
target-hppa fork.

Reviewed-by: Peter Maydell <>...

011da610 01/03/2011 12:59 am Peter Maydell

target-arm: Implement correct NaN propagation rules

Implement the correct NaN propagation rules for ARM targets by
providing an appropriate pickNaN function.

Signed-off-by: Peter Maydell <>
Signed-off-by: Aurelien Jarno <>

354f211b 01/03/2011 12:58 am Peter Maydell

softfloat: abstract out target-specific NaN propagation rules

IEEE754 doesn't specify precisely what NaN should be returned as
the result of an operation on two input NaNs. This is therefore
target-specific. Abstract out the code in propagateFloat*NaN()
which was implementing the x87 propagation rules, so that it...

18569871 01/02/2011 12:15 pm Peter Maydell

softfloat: Rename float*_is_nan() functions to float*_is_quiet_nan()

The softfloat functions float*_is_nan() were badly misnamed,
because they return true only for quiet NaNs, not for all NaNs.
Rename them to float*_is_quiet_nan() to more accurately reflect...

21d6ebde 12/07/2010 05:37 pm Peter Maydell

softfloat: Add float*_is_any_nan() functions

Add float*_is_any_nan() functions which return true if the argument
is a NaN of any kind (quiet or signalling).

Signed-off-by: Peter Maydell <>
Reviewed-by: Nathan Froyd <>

b408dbde 12/07/2010 05:37 pm Peter Maydell

softfloat: Add float*_maybe_silence_nan() functions

Add functions float*_maybe_silence_nan() which ensure that a
value is not a signaling NaN by turning it into a quiet NaN.

Signed-off-by: Peter Maydell <>
Reviewed-by: Nathan Froyd <>

cbcef455 12/07/2010 05:37 pm Peter Maydell

softfloat: Add float/double to 16 bit integer conversion functions

The ARM architecture needs float/double to 16 bit integer conversions.
(The 32 bit versions aren't sufficient because of the requirement
to saturate at 16 bit MAXINT/MININT and to get the exception bits right.)...

8229c991 07/13/2010 07:18 pm Aurelien Jarno

softfloat: add float32_exp2()

Signed-off-by: Aurelien Jarno <>

ed086f3d 03/07/2010 03:49 pm Blue Swirl

softfloat: remove dead assignments, spotted by clang

Value stored to 'bSign' is never read.

Signed-off-by: Blue Swirl <>

8443effb 02/24/2010 12:36 am Richard Henderson

target-alpha: Split up FPCR value into separate fields.

The fpcr_exc_status, fpcr_exc_mask, and fpcr_dyn_round fields
are stored in <softfloat.h> format for convenience during
regular execution.

Revert the addition of float_exception_mask to float_status,...

bc4347b8 02/07/2010 12:16 am Stefan Weil

arm host: fix compiler warning

Compilation for arm (native or cross) results in this
warning:

fpu/softfloat-native.c: In function ‘float64_round_to_int’:
fpu/softfloat-native.c:387: error: control reaches end of non-void function

float64_round_to_int uses special assembler code for arm...

ba0e276d 12/13/2009 09:32 pm Richard Henderson

target-alpha: Fixes for alpha-linux syscalls.

1. Add correct definitions of error numbers.
2. Implement SYS_osf_sigprocmask
3. Implement SYS_osf_get/setsysinfo for IEEE_FP_CONTROL.

This last requires exposing the FPCR value to do_syscall.
Since this value is actually split up into the float_status,...