Statistics
| Branch: | Revision:

root / fpu @ fd728f2f

Name Size
softfloat-macros.h 24.9 kB
softfloat-specialize.h 38.3 kB
softfloat.c 253.8 kB

Latest revisions

# Date Author Comment
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...

View revisions

Also available in: Atom