[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 05/19] target-i386: add floatx_{add, mul, sub} an
From: |
Aurelien Jarno |
Subject: |
[Qemu-devel] [PATCH v2 05/19] target-i386: add floatx_{add, mul, sub} and use them |
Date: |
Thu, 14 Apr 2011 01:11:00 +0200 |
Add floatx_{add,mul,sub} defines, and use them instead of using direct
C operations.
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Aurelien Jarno <address@hidden>
---
target-i386/exec.h | 6 ++++++
target-i386/op_helper.c | 18 ++++++++----------
2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/target-i386/exec.h b/target-i386/exec.h
index 63a23cd..ae6b947 100644
--- a/target-i386/exec.h
+++ b/target-i386/exec.h
@@ -110,6 +110,9 @@ static inline void svm_check_intercept(uint32_t type)
#define float64_to_floatx float64_to_floatx80
#define floatx_to_float32 floatx80_to_float32
#define floatx_to_float64 floatx80_to_float64
+#define floatx_add floatx80_add
+#define floatx_mul floatx80_mul
+#define floatx_sub floatx80_sub
#define floatx_abs floatx80_abs
#define floatx_chs floatx80_chs
#define floatx_round_to_int floatx80_round_to_int
@@ -126,6 +129,9 @@ static inline void svm_check_intercept(uint32_t type)
#define float64_to_floatx(x, e) (x)
#define floatx_to_float32 float64_to_float32
#define floatx_to_float64(x, e) (x)
+#define floatx_add float64_add
+#define floatx_mul float64_mul
+#define floatx_sub float64_sub
#define floatx_abs float64_abs
#define floatx_chs float64_chs
#define floatx_round_to_int float64_round_to_int
diff --git a/target-i386/op_helper.c b/target-i386/op_helper.c
index 43fbd0c..a73427f 100644
--- a/target-i386/op_helper.c
+++ b/target-i386/op_helper.c
@@ -3711,22 +3711,22 @@ void helper_fucomi_ST0_FT0(void)
void helper_fadd_ST0_FT0(void)
{
- ST0 += FT0;
+ ST0 = floatx_add(ST0, FT0, &env->fp_status);
}
void helper_fmul_ST0_FT0(void)
{
- ST0 *= FT0;
+ ST0 = floatx_mul(ST0, FT0, &env->fp_status);
}
void helper_fsub_ST0_FT0(void)
{
- ST0 -= FT0;
+ ST0 = floatx_sub(ST0, FT0, &env->fp_status);
}
void helper_fsubr_ST0_FT0(void)
{
- ST0 = FT0 - ST0;
+ ST0 = floatx_sub(FT0, ST0, &env->fp_status);
}
void helper_fdiv_ST0_FT0(void)
@@ -3743,24 +3743,22 @@ void helper_fdivr_ST0_FT0(void)
void helper_fadd_STN_ST0(int st_index)
{
- ST(st_index) += ST0;
+ ST(st_index) = floatx_add(ST(st_index), ST0, &env->fp_status);
}
void helper_fmul_STN_ST0(int st_index)
{
- ST(st_index) *= ST0;
+ ST(st_index) = floatx_mul(ST(st_index), ST0, &env->fp_status);
}
void helper_fsub_STN_ST0(int st_index)
{
- ST(st_index) -= ST0;
+ ST(st_index) = floatx_sub(ST(st_index), ST0, &env->fp_status);
}
void helper_fsubr_STN_ST0(int st_index)
{
- CPU86_LDouble *p;
- p = &ST(st_index);
- *p = ST0 - *p;
+ ST(st_index) = floatx_sub(ST0, ST(st_index), &env->fp_status);
}
void helper_fdiv_STN_ST0(int st_index)
--
1.7.2.3
- [Qemu-devel] [PATCH v2 00/19] softfloat and FPU fixes/improvements, Aurelien Jarno, 2011/04/13
- [Qemu-devel] [PATCH v2 04/19] target-i386: use float unions from cpu-all.h, Aurelien Jarno, 2011/04/13
- [Qemu-devel] [PATCH v2 05/19] target-i386: add floatx_{add, mul, sub} and use them,
Aurelien Jarno <=
- [Qemu-devel] [PATCH v2 07/19] softfloat-native: add float*_unordered_quiet() functions, Aurelien Jarno, 2011/04/13
- [Qemu-devel] [PATCH v2 13/19] softfloat: move float*_eq and float*_eq_quiet, Aurelien Jarno, 2011/04/13
- [Qemu-devel] [PATCH v2 08/19] target-alpha: use new float64_unordered_quiet() function, Aurelien Jarno, 2011/04/13
- [Qemu-devel] [PATCH v2 01/19] softfloat: use GCC builtins to count the leading zeros, Aurelien Jarno, 2011/04/13
- [Qemu-devel] [PATCH v2 03/19] target-i386: use CPU_LDoubleU instead of a private union, Aurelien Jarno, 2011/04/13
- [Qemu-devel] [PATCH v2 10/19] target-i386: fix CMPUNORDPS/D and CMPORDPS/D instructions, Aurelien Jarno, 2011/04/13
- [Qemu-devel] [PATCH v2 19/19] target-mips: clear softfpu exception state for comparison instructions, Aurelien Jarno, 2011/04/13
- [Qemu-devel] [PATCH v2 17/19] target-mips: don't hardcode softfloat exception bits, Aurelien Jarno, 2011/04/13
- [Qemu-devel] [PATCH v2 14/19] softfloat: improve description of comparison functions, Aurelien Jarno, 2011/04/13