Commit Graph

271 Commits

Author SHA1 Message Date
Peter Maydell 185698715d 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
what they do.

This change was produced by:
 perl -p -i -e 's/_is_nan/_is_quiet_nan/g' $(git grep -l is_nan)
(with the results manually checked.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Nathan Froyd <froydnj@codesourcery.com>
Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-02 11:15:25 +01:00
Peter Maydell cbcef455a2 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.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Nathan Froyd <froydnj@codesourcery.com>
2010-12-07 15:37:34 +00:00
Peter Maydell b408dbdec3 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 <peter.maydell@linaro.org>
Reviewed-by: Nathan Froyd <froydnj@codesourcery.com>
2010-12-07 15:37:34 +00:00
Peter Maydell 21d6ebde76 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 <peter.maydell@linaro.org>
Reviewed-by: Nathan Froyd <froydnj@codesourcery.com>
2010-12-07 15:37:34 +00:00
Aurelien Jarno 8229c9913a softfloat: add float32_exp2()
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-07-13 18:18:23 +02:00
Blue Swirl ed086f3dde softfloat: remove dead assignments, spotted by clang
Value stored to 'bSign' is never read.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-07 13:49:58 +00:00
Richard Henderson 8443effb50 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,
added in ba0e276db4.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-02-23 23:36:22 +01:00
Stefan Weil bc4347b883 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
and has no explicit return value.

As there is no obvious reason why arm should need special
code, all fpu related conditionals were removed.
The remaining code is standard (C99) and compiles for arm,
too.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Acked-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-02-06 23:16:05 +01:00
Richard Henderson ba0e276db4 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,
expose routines from helper.c to access it.

Finally, also add a float_exception_mask field to float_status.
We don't actually use it to control delivery of exceptions to
the emulator yet, but simply hold the value that we placed there
when loading/storing the FPCR.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-13 20:32:36 +01:00
Richard Henderson 990b3e1901 target-alpha: Enable softfloat.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-13 20:32:36 +01:00
Andreas Färber be45f06826 Silence softfloat warnings on OpenSolaris
Don't define C99 math functions on OpenSolaris (Solaris 11),
which still ships GCC 3.4.3. This fixes redefinition warnings.

Spotted by Palle Lyckegaard.

Signed-off-by: Andreas Färber <afaerber@opensolaris.org>
Cc: Palle Lyckegaard <palle@lyckegaard.dk>
Cc: Ben Taylor <bentaylor.solx86@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-12-13 14:28:17 +00:00
Aurelien Jarno a167ba5085 Add support for GNU/kFreeBSD
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-11-29 18:00:41 +01:00
Paul Brook 600114988c ARM FP16 support
Implement the ARM VFP half precision floating point extensions.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-11-19 16:45:20 +00:00
Juan Quintela 75b5a697ed rename NEEDS_LIBSUNMATH to CONFIG_NEEDS_LIBSUNMATH
Once there fix a place where it was misspelled

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27 14:10:55 -05:00
Juan Quintela e2542fe2bc rename WORDS_BIGENDIAN to HOST_WORDS_BIGENDIAN
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27 14:09:21 -05:00
Juan Quintela 71e72a19ba rename HOST_BSD to CONFIG_BSD
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27 14:09:20 -05:00
Juan Quintela dfe5fff3ea change HOST_SOLARIS to CONFIG_SOLARIS{_VERSION}
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27 14:09:16 -05:00
blueswir1 3f4cb3d37f Fix OpenSolaris gcc4 warnings: iovec type mismatches, missing 'static'
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7103 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-13 16:31:01 +00:00
blueswir1 14d483eca0 Fix OpenSolaris softfloat warnings
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7102 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-13 16:27:08 +00:00
blueswir1 2734c7037e Rename one more _BSD to HOST_BSD (spotted by Hasso Tepper)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6782 c046a42c-6fe2-441c-8c8c-71466251a162
2009-03-08 15:58:00 +00:00
blueswir1 179a2c1971 Rename _BSD to HOST_BSD so that it's more obvious that it's defined by configure
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6775 c046a42c-6fe2-441c-8c8c-71466251a162
2009-03-08 08:23:32 +00:00
blueswir1 70c14705c3 Sparse fixes: dubious mixing of bitwise and logical operations
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6741 c046a42c-6fe2-441c-8c8c-71466251a162
2009-03-07 16:03:05 +00:00
aurel32 374dfc33e2 soft-float: add float32_log2() and float64_log2()
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6518 c046a42c-6fe2-441c-8c8c-71466251a162
2009-02-05 13:42:47 +00:00
aurel32 196cfc89e8 softfloat: add a 1.0 constant for float32 and float64
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6514 c046a42c-6fe2-441c-8c8c-71466251a162
2009-02-04 13:52:27 +00:00
malc 947f5fcbde Add static qualifier to local functions
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6436 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-25 10:56:51 +00:00
malc e58ffeb322 Remove all traces of __powerpc__
According to $GCC/gcc/config/rs6000/rs6000-c.c _ARCH_PPC is the
ubiquitous define which should be used to test whether gcc targets
PowerPC, on 64bit platforms _ARCH_PPC64 will be also defined.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6301 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-14 18:39:49 +00:00
aurel32 e872aa811a softfloat-native: fix type of float_rounding_mode
fegetround() and fesetround() are using an int type. Change the type of
float_rounding_mode and floatx80_rounding_precision in the float_status
structure for consistency.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6115 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-20 23:41:32 +00:00
pbrook fe76d97653 Implement flush-to-zero mode (denormal results are replaced with zero).
Signed-off-by: Paul Brook <paul@codesourcery.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6107 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-19 14:33:59 +00:00
pbrook 5c7908ed23 Implement default-NaN mode.
Signed-off-by: Paul Brook <paul@codesourcery.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6106 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-19 13:53:37 +00:00
pbrook 69397542d6 Correctly normalize values and handle zero inputs to scalbn functions.
Signed-off-by: Paul Brook <paul@codesourcery.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6102 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-19 12:59:28 +00:00
aurel32 dadd71a777 fp: fix float32_is_infinity()
Thanks to Laurent Desnogues for the hint.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6089 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-18 22:43:16 +00:00
aurel32 8d6c92b6b1 softfloat-native: improve correctness of floatXX_is_neg()
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6059 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-15 22:07:50 +00:00
aurel32 c52ab6f585 fp: add floatXX_is_infinity(), floatXX_is_neg(), floatXX_is_zero()
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6050 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-15 17:14:20 +00:00
aurel32 1b2ad2ec7a softfloat-native: fix *nan()
Fix float64_is_nan()
Fix floatx80_is_signaling_nan()
Add floatx80_is_nan()

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6049 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-15 17:14:12 +00:00
aurel32 30e7a22eba Use float_relation_* constants
Use float_relation_* constants rather than magic numbers in
softfloat-native comparison routines.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6025 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-14 11:12:02 +00:00
aurel32 629bd74a4f softfloat-native: add float32_is_nan()
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6002 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-13 11:46:15 +00:00
blueswir1 1d6198c3b0 Remove unnecessary trailing newlines
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6000 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-13 09:32:43 +00:00
blueswir1 d07cca02aa Add native softfloat fpu functions (Christoph Egger)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5775 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-22 20:17:37 +00:00
malc b29fe3ed48 Preliminary AIX support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5732 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-18 01:42:22 +00:00
pbrook 9027db892a Fix ARM default NaN.
Signed-off-by: Paul Brook <paul@codesourcery.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5618 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-04 12:33:21 +00:00
blueswir1 b1d8e52e63 Fix undeclared symbol warnings from sparse
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5539 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-26 13:43:07 +00:00
blueswir1 b55266b5a2 Suppress gcc 4.x -Wpointer-sign (included in -Wall) warnings
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5275 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-20 08:07:15 +00:00
blueswir1 7c2a9d0997 Fix math warnings on OpenBSD -current
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5077 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-24 10:29:29 +00:00
blueswir1 128ab2ff50 Preliminary OpenBSD host support (based on OpenBSD patches by Todd T. Fries)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5012 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-15 18:33:42 +00:00
ths 85016c983c Assortment of soft-float fixes, by Aurelien Jarno.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3860 c046a42c-6fe2-441c-8c8c-71466251a162
2007-12-25 23:59:51 +00:00
blueswir1 1f58732916 128-bit float support for user mode
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3740 c046a42c-6fe2-441c-8c8c-71466251a162
2007-11-25 18:40:20 +00:00
blueswir1 cd8a25337e Fix more typos in softloat code (Eduardo Felipe)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3716 c046a42c-6fe2-441c-8c8c-71466251a162
2007-11-21 18:57:44 +00:00
pbrook a1b91bb406 Fix typo in softfloat code.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3714 c046a42c-6fe2-441c-8c8c-71466251a162
2007-11-21 15:32:12 +00:00
pbrook f090c9d4ad Add strict checking mode for softfp code.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3688 c046a42c-6fe2-441c-8c8c-71466251a162
2007-11-18 14:33:24 +00:00
ths 5a6932d51d Fix NaN handling for MIPS and HPPA.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3655 c046a42c-6fe2-441c-8c8c-71466251a162
2007-11-16 14:57:36 +00:00
pbrook 9ee6e8bb85 ARMv7 support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3572 c046a42c-6fe2-441c-8c8c-71466251a162
2007-11-11 00:04:49 +00:00
ths 5fafdf24ef find -type f | xargs sed -i 's/[\t ]$//g' # on most files
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3173 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-16 21:08:06 +00:00
ths 924b2c07cd Add proper float*_is_nan prototypes.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2902 c046a42c-6fe2-441c-8c8c-71466251a162
2007-05-31 16:17:52 +00:00
ths b645bb4885 Fix softfloat NaN handling.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2805 c046a42c-6fe2-441c-8c8c-71466251a162
2007-05-11 17:10:14 +00:00
ths fc81ba536b Check that HOST_SOLARIS is defined before relying on its value.
Spotted by Joachim Henke.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2712 c046a42c-6fe2-441c-8c8c-71466251a162
2007-04-22 17:16:54 +00:00
ths c94655b0b5 Updated Solaris isinf support, by Juergen Keil and Ben Taylor.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2696 c046a42c-6fe2-441c-8c8c-71466251a162
2007-04-17 21:57:02 +00:00
ths 0475a5ca54 Solaris 9/x86 support, by Ben Taylor.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2577 c046a42c-6fe2-441c-8c8c-71466251a162
2007-04-01 18:54:44 +00:00
j_mayer 3430b0be36 Ooops... Typo.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2520 c046a42c-6fe2-441c-8c8c-71466251a162
2007-03-20 22:25:37 +00:00
j_mayer 75d62a5856 Add missing softfloat helpers.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2518 c046a42c-6fe2-441c-8c8c-71466251a162
2007-03-20 22:10:42 +00:00
ths 63a654bb39 trunc() for Solaris 9 / SPARC, by Juergen Keil.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2508 c046a42c-6fe2-441c-8c8c-71466251a162
2007-03-19 16:46:07 +00:00
bellard 750afe93fd avoid using char when it is not necessary
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2204 c046a42c-6fe2-441c-8c8c-71466251a162
2006-10-28 19:27:11 +00:00
pbrook e6e5906b6e ColdFire target.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2196 c046a42c-6fe2-441c-8c8c-71466251a162
2006-10-22 00:18:54 +00:00
bellard fdbb46910a Solaris/SPARC host port (Ben Taylor)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1979 c046a42c-6fe2-441c-8c8c-71466251a162
2006-06-14 17:32:25 +00:00
bellard 38cfa06cbd Solaris port (Ben Taylor)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1888 c046a42c-6fe2-441c-8c8c-71466251a162
2006-05-01 13:58:07 +00:00
pbrook 7918bf476b Fix typo in BSD FP rounding mode names.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1865 c046a42c-6fe2-441c-8c8c-71466251a162
2006-04-28 15:26:51 +00:00
pbrook 3598ecb620 Remove missing include.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1857 c046a42c-6fe2-441c-8c8c-71466251a162
2006-04-26 15:55:55 +00:00
bellard ec530c81ef Solaris port (Ben Taylor)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1855 c046a42c-6fe2-441c-8c8c-71466251a162
2006-04-25 22:36:06 +00:00
bellard 1b2b0af50d 64 bit fix
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1842 c046a42c-6fe2-441c-8c8c-71466251a162
2006-04-23 22:59:41 +00:00
bellard b109f9f867 more native FPU comparison functions - native FPU remainder
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1339 c046a42c-6fe2-441c-8c8c-71466251a162
2005-03-20 10:33:58 +00:00
bellard 1d6bda3561 added abs, chs and compare functions
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1338 c046a42c-6fe2-441c-8c8c-71466251a162
2005-03-13 18:52:29 +00:00
bellard 158142c2c2 soft float support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1332 c046a42c-6fe2-441c-8c8c-71466251a162
2005-03-13 16:54:06 +00:00