[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 1/4] target-i386: fix {min, max}{pd, ps, sd, ss} SS
From: |
Aurelien Jarno |
Subject: |
[Qemu-stable] [PATCH 1/4] target-i386: fix {min, max}{pd, ps, sd, ss} SSE2 instructions |
Date: |
Sat, 7 Jan 2012 21:09:35 +0100 |
minpd, minps, minsd, minss and maxpd, maxps, maxsd, maxss SSE2
instructions have been broken when switching target-i386 to softfloat.
It's not possible to use comparison instructions on float types anymore
to softfloat, so use the floatXX_min anf floatXX_max functions instead.
As a bonus it implements the correct NaNs behaviour, so let's remove
this from the TODO.
It fixes GDM screen display on Debian Lenny.
Signed-off-by: Aurelien Jarno <address@hidden>
---
target-i386/TODO | 1 -
target-i386/ops_sse.h | 4 ++--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/target-i386/TODO b/target-i386/TODO
index c8ada07..a8d69cf 100644
--- a/target-i386/TODO
+++ b/target-i386/TODO
@@ -15,7 +15,6 @@ Correctness issues:
- DRx register support
- CR0.AC emulation
- SSE alignment checks
-- fix SSE min/max with nans
Optimizations/Features:
diff --git a/target-i386/ops_sse.h b/target-i386/ops_sse.h
index 47dde78..a743c85 100644
--- a/target-i386/ops_sse.h
+++ b/target-i386/ops_sse.h
@@ -584,8 +584,8 @@ void helper_ ## name ## sd (Reg *d, Reg *s)\
#define FPU_SUB(size, a, b) float ## size ## _sub(a, b, &env->sse_status)
#define FPU_MUL(size, a, b) float ## size ## _mul(a, b, &env->sse_status)
#define FPU_DIV(size, a, b) float ## size ## _div(a, b, &env->sse_status)
-#define FPU_MIN(size, a, b) (a) < (b) ? (a) : (b)
-#define FPU_MAX(size, a, b) (a) > (b) ? (a) : (b)
+#define FPU_MIN(size, a, b) float ## size ## _min(a, b, &env->sse_status)
+#define FPU_MAX(size, a, b) float ## size ## _max(a, b, &env->sse_status)
#define FPU_SQRT(size, a, b) float ## size ## _sqrt(b, &env->sse_status)
SSE_HELPER_S(add, FPU_ADD)
--
1.7.7.3