summaryrefslogtreecommitdiffstats
path: root/target-i386/exec.h
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-03-13 17:01:47 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-03-13 17:01:47 +0000
commit7a0e1f41ceeb658791a1456ffc7f8f9edca7da19 (patch)
treeeab50fb37085ad2dc6e8aa283f334defd538fa8c /target-i386/exec.h
parent4ecc31906d7535c4ad88fcc63968bef412dd67ba (diff)
downloadhqemu-7a0e1f41ceeb658791a1456ffc7f8f9edca7da19.zip
hqemu-7a0e1f41ceeb658791a1456ffc7f8f9edca7da19.tar.gz
soft float support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1336 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-i386/exec.h')
-rw-r--r--target-i386/exec.h70
1 files changed, 12 insertions, 58 deletions
diff --git a/target-i386/exec.h b/target-i386/exec.h
index c4e59c4..137774f 100644
--- a/target-i386/exec.h
+++ b/target-i386/exec.h
@@ -139,44 +139,6 @@ extern int loglevel;
#include "cpu.h"
#include "exec-all.h"
-/* XXX: add a generic FPU library */
-
-static inline double float32_to_float64(float a)
-{
- return a;
-}
-
-static inline float float64_to_float32(double a)
-{
- return a;
-}
-
-#if defined(__powerpc__)
-/* better to call an helper on ppc */
-float int32_to_float32(int32_t a);
-double int32_to_float64(int32_t a);
-#else
-static inline float int32_to_float32(int32_t a)
-{
- return (float)a;
-}
-
-static inline double int32_to_float64(int32_t a)
-{
- return (double)a;
-}
-#endif
-
-static inline float int64_to_float32(int64_t a)
-{
- return (float)a;
-}
-
-static inline double int64_to_float64(int64_t a)
-{
- return (double)a;
-}
-
typedef struct CCTable {
int (*compute_all)(void); /* return all the flags */
int (*compute_c)(void); /* return the C flag */
@@ -358,9 +320,11 @@ static inline void stfl(target_ulong ptr, float v)
#ifdef USE_X86LDOUBLE
/* use long double functions */
-#define lrint lrintl
-#define llrint llrintl
-#define fabs fabsl
+#define floatx_to_int32 floatx80_to_int32
+#define floatx_to_int64 floatx80_to_int64
+#define floatx_abs floatx80_abs
+#define floatx_chs floatx80_chs
+#define floatx_round_to_int floatx80_round_to_int
#define sin sinl
#define cos cosl
#define sqrt sqrtl
@@ -370,17 +334,14 @@ static inline void stfl(target_ulong ptr, float v)
#define atan2 atan2l
#define floor floorl
#define ceil ceill
-#define rint rintl
-#endif
-
-#if !defined(_BSD)
-extern int lrint(CPU86_LDouble x);
-extern int64_t llrint(CPU86_LDouble x);
#else
-#define lrint(d) ((int)rint(d))
-#define llrint(d) ((int)rint(d))
+#define floatx_to_int32 float64_to_int32
+#define floatx_to_int64 float64_to_int64
+#define floatx_abs float64_abs
+#define floatx_chs float64_chs
+#define floatx_round_to_int float64_round_to_int
#endif
-extern CPU86_LDouble fabs(CPU86_LDouble x);
+
extern CPU86_LDouble sin(CPU86_LDouble x);
extern CPU86_LDouble cos(CPU86_LDouble x);
extern CPU86_LDouble sqrt(CPU86_LDouble x);
@@ -390,7 +351,6 @@ extern CPU86_LDouble tan(CPU86_LDouble x);
extern CPU86_LDouble atan2(CPU86_LDouble, CPU86_LDouble);
extern CPU86_LDouble floor(CPU86_LDouble x);
extern CPU86_LDouble ceil(CPU86_LDouble x);
-extern CPU86_LDouble rint(CPU86_LDouble x);
#define RC_MASK 0xc00
#define RC_NEAR 0x000
@@ -400,13 +360,6 @@ extern CPU86_LDouble rint(CPU86_LDouble x);
#define MAXTAN 9223372036854775808.0
-#ifdef __arm__
-/* we have no way to do correct rounding - a FPU emulator is needed */
-#define FE_DOWNWARD FE_TONEAREST
-#define FE_UPWARD FE_TONEAREST
-#define FE_TOWARDZERO FE_TONEAREST
-#endif
-
#ifdef USE_X86LDOUBLE
/* only for x86 */
@@ -596,6 +549,7 @@ float approx_rsqrt(float a);
float approx_rcp(float a);
double helper_sqrt(double a);
int fpu_isnan(double a);
+void update_fp_status(void);
extern const uint8_t parity_table[256];
extern const uint8_t rclw_table[32];
OpenPOWER on IntegriCloud