From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Cc: qemu-stable@nongnu.org, Aurelien Jarno <aurelien@aurel32.net>
Subject: [Qemu-devel] [PATCH 2/4] target-i386: fix round{pd, ps, sd, ss} SSE2 instructions
Date: Sat, 7 Jan 2012 21:09:36 +0100 [thread overview]
Message-ID: <1325966978-940-3-git-send-email-aurelien@aurel32.net> (raw)
In-Reply-To: <1325966978-940-1-git-send-email-aurelien@aurel32.net>
roundps and roundss SSE2 instructions have been broken when switching
target-i386 to softfloat. They use float64_round_to_int to convert a
float32, and while the implicit conversion from float32 to float64 was
correct for softfloat-native, it is not for pure softfloat. Fix that by
using the correct registers and correct functions.
Also fix roundpd and roundsd implementation at the same time, even if
these functions are behaving correctly.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
target-i386/ops_sse.h | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/target-i386/ops_sse.h b/target-i386/ops_sse.h
index a743c85..a185bfb 100644
--- a/target-i386/ops_sse.h
+++ b/target-i386/ops_sse.h
@@ -1648,10 +1648,10 @@ void glue(helper_roundps, SUFFIX) (Reg *d, Reg *s, uint32_t mode)
break;
}
- d->L(0) = float64_round_to_int(s->L(0), &env->sse_status);
- d->L(1) = float64_round_to_int(s->L(1), &env->sse_status);
- d->L(2) = float64_round_to_int(s->L(2), &env->sse_status);
- d->L(3) = float64_round_to_int(s->L(3), &env->sse_status);
+ d->XMM_S(0) = float32_round_to_int(s->XMM_S(0), &env->sse_status);
+ d->XMM_S(1) = float32_round_to_int(s->XMM_S(1), &env->sse_status);
+ d->XMM_S(2) = float32_round_to_int(s->XMM_S(2), &env->sse_status);
+ d->XMM_S(3) = float32_round_to_int(s->XMM_S(3), &env->sse_status);
#if 0 /* TODO */
if (mode & (1 << 3))
@@ -1684,8 +1684,8 @@ void glue(helper_roundpd, SUFFIX) (Reg *d, Reg *s, uint32_t mode)
break;
}
- d->Q(0) = float64_round_to_int(s->Q(0), &env->sse_status);
- d->Q(1) = float64_round_to_int(s->Q(1), &env->sse_status);
+ d->XMM_D(0) = float64_round_to_int(s->XMM_D(0), &env->sse_status);
+ d->XMM_D(1) = float64_round_to_int(s->XMM_D(1), &env->sse_status);
#if 0 /* TODO */
if (mode & (1 << 3))
@@ -1718,7 +1718,7 @@ void glue(helper_roundss, SUFFIX) (Reg *d, Reg *s, uint32_t mode)
break;
}
- d->L(0) = float64_round_to_int(s->L(0), &env->sse_status);
+ d->XMM_S(0) = float32_round_to_int(s->XMM_S(0), &env->sse_status);
#if 0 /* TODO */
if (mode & (1 << 3))
@@ -1751,7 +1751,7 @@ void glue(helper_roundsd, SUFFIX) (Reg *d, Reg *s, uint32_t mode)
break;
}
- d->Q(0) = float64_round_to_int(s->Q(0), &env->sse_status);
+ d->XMM_D(0) = float64_round_to_int(s->XMM_D(0), &env->sse_status);
#if 0 /* TODO */
if (mode & (1 << 3))
--
1.7.7.3
next prev parent reply other threads:[~2012-01-07 20:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-07 20:09 [Qemu-devel] [PATCH 0/4] target-i386: Fix regressions introduced by the switch to softfloat Aurelien Jarno
2012-01-07 20:09 ` [Qemu-devel] [PATCH 1/4] target-i386: fix {min, max}{pd, ps, sd, ss} SSE2 instructions Aurelien Jarno
2012-01-07 20:22 ` Peter Maydell
2012-01-07 21:24 ` [Qemu-devel] [PATCH 1/4 v2] " Aurelien Jarno
2012-01-07 20:09 ` Aurelien Jarno [this message]
2012-01-07 20:09 ` [Qemu-devel] [PATCH 3/4] target-i386: fix dpps and dppd " Aurelien Jarno
2012-01-07 20:09 ` [Qemu-devel] [PATCH 4/4] target-i386: fix SSE rounding and flush to zero Aurelien Jarno
2012-01-12 5:37 ` Dong Xu Wang
2012-01-13 9:40 ` Markus Armbruster
2012-01-13 15:14 ` [Qemu-devel] [Qemu-stable] " Justin M. Forbes
2012-01-13 16:07 ` [Qemu-devel] " Aurelien Jarno
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1325966978-940-3-git-send-email-aurelien@aurel32.net \
--to=aurelien@aurel32.net \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).