public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: kvm@vger.kernel.org
Cc: mtosatti@redhat.com, pbonzini@redhat.com
Subject: [PATCH unit test] add test for "mov[zs]x %ah, ..." instruction
Date: Wed, 24 Apr 2013 13:50:40 +0300	[thread overview]
Message-ID: <20130424105040.GM12401@redhat.com> (raw)


Signed-off-by: Gleb Natapov <gleb@redhat.com>
diff --git a/x86/realmode.c b/x86/realmode.c
index f5426e0..91c93a9 100644
--- a/x86/realmode.c
+++ b/x86/realmode.c
@@ -1358,12 +1358,19 @@ static void test_movzx_movsx(void)
 {
     MK_INSN(movsx, "movsx %al, %ebx");
     MK_INSN(movzx, "movzx %al, %ebx");
+    MK_INSN(movzsah, "movsx %ah, %ebx");
+    MK_INSN(movzxah, "movzx %ah, %ebx");
 
     inregs.eax = 0x1234569c;
+    inregs.esp = 0xffff;
     exec_in_big_real_mode(&insn_movsx);
     report("movsx", R_BX, outregs.ebx == (signed char)inregs.eax);
     exec_in_big_real_mode(&insn_movzx);
     report("movzx", R_BX, outregs.ebx == (unsigned char)inregs.eax);
+    exec_in_big_real_mode(&insn_movzsah);
+    report("movsx ah", R_BX, outregs.ebx == (signed char)(inregs.eax>>8));
+    exec_in_big_real_mode(&insn_movzxah);
+    report("movzx ah", R_BX, outregs.ebx == (unsigned char)(inregs.eax >> 8));
 }
 
 static void test_bswap(void)
--
			Gleb.

             reply	other threads:[~2013-04-24 10:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-24 10:50 Gleb Natapov [this message]
2013-04-30  2:23 ` [PATCH unit test] add test for "mov[zs]x %ah, ..." instruction Marcelo Tosatti

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=20130424105040.GM12401@redhat.com \
    --to=gleb@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    /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