public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH unit test] add test for "mov[zs]x %ah, ..." instruction
@ 2013-04-24 10:50 Gleb Natapov
  2013-04-30  2:23 ` Marcelo Tosatti
  0 siblings, 1 reply; 2+ messages in thread
From: Gleb Natapov @ 2013-04-24 10:50 UTC (permalink / raw)
  To: kvm; +Cc: mtosatti, pbonzini


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.

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

end of thread, other threads:[~2013-04-30  2:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-24 10:50 [PATCH unit test] add test for "mov[zs]x %ah, ..." instruction Gleb Natapov
2013-04-30  2:23 ` Marcelo Tosatti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox