qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] x86: fix daa opcode for al register values higher than 0xf9
@ 2011-08-30  7:00 Boris Figovsky
  2011-08-30 11:18 ` Peter Maydell
  2011-09-02 10:09 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
  0 siblings, 2 replies; 3+ messages in thread
From: Boris Figovsky @ 2011-08-30  7:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial

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>
---
 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.0.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] x86: fix daa opcode for al register values higher than 0xf9
  2011-08-30  7:00 [Qemu-devel] [PATCH] x86: fix daa opcode for al register values higher than 0xf9 Boris Figovsky
@ 2011-08-30 11:18 ` Peter Maydell
  2011-09-02 10:09 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2011-08-30 11:18 UTC (permalink / raw)
  To: Boris Figovsky; +Cc: qemu-trivial, qemu-devel

On 30 August 2011 08:00, Boris Figovsky
<boris.figovsky@ravellosystems.com> wrote:
> The second if statement should consider the original al register value,
> and not the new one.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

(It took me some time to convince myself that the line
   CF <- old_CF or (Carry from AL <- AL + 6)
in the Intel architecture manual is actually redundant; the
AMD docs are much clearer here...)

-- PMM

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [Qemu-trivial] [PATCH] x86: fix daa opcode for al register values higher than 0xf9
  2011-08-30  7:00 [Qemu-devel] [PATCH] x86: fix daa opcode for al register values higher than 0xf9 Boris Figovsky
  2011-08-30 11:18 ` Peter Maydell
@ 2011-09-02 10:09 ` Stefan Hajnoczi
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2011-09-02 10:09 UTC (permalink / raw)
  To: Boris Figovsky; +Cc: qemu-trivial, qemu-devel

On Tue, Aug 30, 2011 at 10:00:55AM +0300, Boris Figovsky wrote:
> 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>
> ---
>  target-i386/op_helper.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)

Thanks, applied to the trivial patches tree:
http://repo.or.cz/w/qemu/stefanha.git/shortlog/refs/heads/trivial-patches

Stefan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-09-02 10:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-30  7:00 [Qemu-devel] [PATCH] x86: fix daa opcode for al register values higher than 0xf9 Boris Figovsky
2011-08-30 11:18 ` Peter Maydell
2011-09-02 10:09 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi

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).