From: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: Boris Figovsky <boris.figovksy@ravellosystems.com>,
Anthony Liguori <aliguori@us.ibm.com>,
Boris Figovsky <boris.figovsky@ravellosystems.com>,
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH 2/3] x86: fix daa opcode for al register values higher than 0xf9
Date: Fri, 2 Sep 2011 11:12:51 +0100 [thread overview]
Message-ID: <1314958372-23513-3-git-send-email-stefanha@linux.vnet.ibm.com> (raw)
In-Reply-To: <1314958372-23513-1-git-send-email-stefanha@linux.vnet.ibm.com>
From: Boris Figovsky <boris.figovsky@ravellosystems.com>
The second if statement should consider the original al register value,
and not the new one.
Signed-off-by: Boris Figovsky <boris.figovksy@ravellosystems.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
target-i386/op_helper.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/target-i386/op_helper.c b/target-i386/op_helper.c
index 1bbc3b5..1fc248f 100644
--- a/target-i386/op_helper.c
+++ b/target-i386/op_helper.c
@@ -1970,20 +1970,20 @@ void helper_aas(void)
void helper_daa(void)
{
- int al, af, cf;
+ int old_al, al, af, cf;
int eflags;
eflags = helper_cc_compute_all(CC_OP);
cf = eflags & CC_C;
af = eflags & CC_A;
- al = EAX & 0xff;
+ old_al = al = EAX & 0xff;
eflags = 0;
if (((al & 0x0f) > 9 ) || af) {
al = (al + 6) & 0xff;
eflags |= CC_A;
}
- if ((al > 0x9f) || cf) {
+ if ((old_al > 0x99) || cf) {
al = (al + 0x60) & 0xff;
eflags |= CC_C;
}
--
1.7.5.4
next prev parent reply other threads:[~2011-09-02 10:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-02 10:12 [Qemu-devel] [PULL 0/3] Trivial patches for Auguest 25 to September 2 2011 Stefan Hajnoczi
2011-09-02 10:12 ` [Qemu-devel] [PATCH 1/3] sh4: Fix potential crash in debug code Stefan Hajnoczi
2011-09-02 10:12 ` Stefan Hajnoczi [this message]
2011-09-02 10:12 ` [Qemu-devel] [PATCH 3/3] libcacard: use INSTALL_DATA for data Stefan Hajnoczi
2011-09-08 13:14 ` [Qemu-devel] [PULL 0/3] Trivial patches for Auguest 25 to September 2 2011 Stefan Hajnoczi
2011-09-08 14:26 ` Anthony Liguori
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=1314958372-23513-3-git-send-email-stefanha@linux.vnet.ibm.com \
--to=stefanha@linux.vnet.ibm.com \
--cc=aliguori@us.ibm.com \
--cc=boris.figovksy@ravellosystems.com \
--cc=boris.figovsky@ravellosystems.com \
--cc=qemu-devel@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).