[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 08/11] target-i386: cleanup helper_fxam_ST0()
From: |
Aurelien Jarno |
Subject: |
[Qemu-devel] [PATCH 08/11] target-i386: cleanup helper_fxam_ST0() |
Date: |
Sun, 15 May 2011 16:13:18 +0200 |
Rewrite helper_fxam_ST0() using only softfloat functions.
Signed-off-by: Aurelien Jarno <address@hidden>
---
target-i386/op_helper.c | 30 ++++++++++++------------------
1 files changed, 12 insertions(+), 18 deletions(-)
diff --git a/target-i386/op_helper.c b/target-i386/op_helper.c
index cec0c76..8ba2b5f 100644
--- a/target-i386/op_helper.c
+++ b/target-i386/op_helper.c
@@ -4241,29 +4241,23 @@ void helper_fcos(void)
void helper_fxam_ST0(void)
{
- CPU_LDoubleU temp;
- int expdif;
-
- temp.d = ST0;
-
env->fpus &= (~0x4700); /* (C3,C2,C1,C0) <-- 0000 */
- if (SIGND(temp))
+
+ if (floatx80_is_neg(ST0)) {
env->fpus |= 0x200; /* C1 <-- 1 */
+ }
/* XXX: test fptags too */
- expdif = EXPD(temp);
- if (expdif == MAXEXPD) {
- if (MANTD(temp) == 0x8000000000000000ULL)
- env->fpus |= 0x500 /*Infinity*/;
- else
- env->fpus |= 0x100 /*NaN*/;
- } else if (expdif == 0) {
- if (MANTD(temp) == 0)
- env->fpus |= 0x4000 /*Zero*/;
- else
- env->fpus |= 0x4400 /*Denormal*/;
+ if (floatx80_is_infinity(ST0)) {
+ env->fpus |= 0x500; /* (C3,C2,C0) <-- 011 */
+ } else if (floatx80_is_any_nan(ST0)) {
+ env->fpus |= 0x100; /* (C3,C2,C0) <-- 001 */
+ } else if (floatx80_is_zero(ST0)) {
+ env->fpus |= 0x4000; /* (C3,C2,C0) <-- 100 */
+ } else if (floatx80_is_zero_or_denormal(ST0)) {
+ env->fpus |= 0x4400; /* (C3,C2,C0) <-- 110 */
} else {
- env->fpus |= 0x400;
+ env->fpus |= 0x400; /* (C3,C2,C0) <-- 010 */
}
}
--
1.7.2.3
- [Qemu-devel] [PATCH 00/11] softfloat-native removal and i386 improvements, Aurelien Jarno, 2011/05/15
- [Qemu-devel] [PATCH 11/11] target-i386: use floatx80_log2() to implement helper_fyl2x*(), Aurelien Jarno, 2011/05/15
- [Qemu-devel] [PATCH 01/11] target-ppc: remove old CONFIG_SOFTFLOAT #ifdef, Aurelien Jarno, 2011/05/15
- [Qemu-devel] [PATCH 07/11] softfloat: add float*_is_zero_or_denormal(), Aurelien Jarno, 2011/05/15
- [Qemu-devel] [PATCH 04/11] softfloat: always enable floatx80 and float128 support, Aurelien Jarno, 2011/05/15
- [Qemu-devel] [PATCH 08/11] target-i386: cleanup helper_fxam_ST0(),
Aurelien Jarno <=
- [Qemu-devel] [PATCH 06/11] target-i386: use floatx80 constants in helper_fld*_ST0(), Aurelien Jarno, 2011/05/15
- [Qemu-devel] [PATCH 02/11] target-mips/gdbstub: remove old CONFIG_SOFTFLOAT #ifdef, Aurelien Jarno, 2011/05/15
- [Qemu-devel] [PATCH 10/11] softfloat: add floatx80_log2() function, Aurelien Jarno, 2011/05/15
- [Qemu-devel] [PATCH 05/11] target-i386: remove old code handling float64, Aurelien Jarno, 2011/05/15